diff --git a/3rdParty/com.google.guava/.classpath b/3rdParty/com.google.guava/.classpath new file mode 100644 index 00000000..8195af2b --- /dev/null +++ b/3rdParty/com.google.guava/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/3rdParty/com.google.guava/.project b/3rdParty/com.google.guava/.project new file mode 100644 index 00000000..1c8c4e3e --- /dev/null +++ b/3rdParty/com.google.guava/.project @@ -0,0 +1,28 @@ + + + com.google.guava + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + + org.eclipse.pde.PluginNature + org.eclipse.jdt.core.javanature + + diff --git a/3rdParty/com.google.guava/.settings/org.eclipse.jdt.core.prefs b/3rdParty/com.google.guava/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 00000000..f42de363 --- /dev/null +++ b/3rdParty/com.google.guava/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,7 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 +org.eclipse.jdt.core.compiler.compliance=1.7 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.7 diff --git a/3rdParty/com.google.guava/META-INF/MANIFEST.MF b/3rdParty/com.google.guava/META-INF/MANIFEST.MF new file mode 100644 index 00000000..670284bf --- /dev/null +++ b/3rdParty/com.google.guava/META-INF/MANIFEST.MF @@ -0,0 +1,60 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: Guava: Google Core Libraries for Java +Bundle-SymbolicName: com.google.guava +Bundle-Version: 14.0.1 +Bundle-ClassPath: guava-14.0.1.jar +Bundle-Vendor: KDM Analytics Inc. +Export-Package: com.google.common.annotations;version="14.0.1", + com.google.common.base;version="14.0.1";uses:="javax.annotation", + com.google.common.cache;version="14.0.1"; + uses:="com.google.common.collect, + com.google.common.util.concurrent, + javax.annotation, + com.google.common.base, + com.google.common.primitives, + sun.misc", + com.google.common.collect;version="14.0.1"; + uses:="com.google.common.base, + javax.annotation, + com.google.common.primitives, + com.google.common.math", + com.google.common.eventbus;version="14.0.1"; + uses:="com.google.common.collect, + com.google.common.cache, + com.google.common.util.concurrent, + com.google.common.base, + com.google.common.reflect, + javax.annotation", + com.google.common.hash;version="14.0.1"; + uses:="com.google.common.primitives, + com.google.common.base, + javax.annotation, + com.google.common.math", + com.google.common.io;version="14.0.1"; + uses:="javax.annotation, + com.google.common.base, + com.google.common.math, + com.google.common.hash, + com.google.common.collect, + com.google.common.primitives", + com.google.common.math;version="14.0.1";uses:="com.google.common.base,com.google.common.primitives,javax.annotation", + com.google.common.net;version="14.0.1"; + uses:="javax.annotation, + com.google.common.base, + com.google.common.hash, + com.google.common.io, + com.google.common.primitives, + com.google.common.collect", + com.google.common.primitives;version="14.0.1";uses:="javax.annotation,com.google.common.base,sun.misc", + com.google.common.reflect;version="14.0.1";uses:="javax.annotation,com.google.common.base,com.google.common.collect", + com.google.common.util.concurrent;version="14.0.1"; + uses:="com.google.common.base, + javax.annotation, + com.google.common.collect, + javax.inject, + com.google.common.primitives, + com.google.common.math" +Bundle-RequiredExecutionEnvironment: JavaSE-1.7 +Import-Package: javax.annotation;resolution:=optional, + javax.inject;resolution:=optional diff --git a/3rdParty/com.google.guava/build.properties b/3rdParty/com.google.guava/build.properties new file mode 100644 index 00000000..d1496600 --- /dev/null +++ b/3rdParty/com.google.guava/build.properties @@ -0,0 +1,2 @@ +bin.includes = META-INF/,\ + guava-14.0.1.jar diff --git a/3rdParty/com.google.guava/guava-14.0.1.jar b/3rdParty/com.google.guava/guava-14.0.1.jar new file mode 100644 index 00000000..3a3d9258 Binary files /dev/null and b/3rdParty/com.google.guava/guava-14.0.1.jar differ diff --git a/3rdParty/com.google.guava/pom.xml b/3rdParty/com.google.guava/pom.xml new file mode 100644 index 00000000..c75dc6c9 --- /dev/null +++ b/3rdParty/com.google.guava/pom.xml @@ -0,0 +1,21 @@ + + + 4.0.0 + + + com.kdmanalytics.libs.libsjava + plugins + 2.4.0-SNAPSHOT + + + com.kdmanalytics.libs.libsjava.plugins + com.google.guava + 14.0.1 + + Google Guava Library + + eclipse-plugin + + diff --git a/3rdParty/com.kdmanalytics.kdm.repositoryMerger/.classpath b/3rdParty/com.kdmanalytics.kdm.repositoryMerger/.classpath new file mode 100644 index 00000000..ad32c83a --- /dev/null +++ b/3rdParty/com.kdmanalytics.kdm.repositoryMerger/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/3rdParty/com.kdmanalytics.kdm.repositoryMerger/.project b/3rdParty/com.kdmanalytics.kdm.repositoryMerger/.project new file mode 100644 index 00000000..b9e908c6 --- /dev/null +++ b/3rdParty/com.kdmanalytics.kdm.repositoryMerger/.project @@ -0,0 +1,28 @@ + + + com.kdmanalytics.kdm.repositoryMerger + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + + org.eclipse.pde.PluginNature + org.eclipse.jdt.core.javanature + + diff --git a/3rdParty/com.kdmanalytics.kdm.repositoryMerger/.settings/org.eclipse.jdt.core.prefs b/3rdParty/com.kdmanalytics.kdm.repositoryMerger/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 00000000..dc5af0dc --- /dev/null +++ b/3rdParty/com.kdmanalytics.kdm.repositoryMerger/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,8 @@ +#Wed Aug 31 09:56:20 EDT 2011 +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 +org.eclipse.jdt.core.compiler.compliance=1.6 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.6 diff --git a/3rdParty/com.kdmanalytics.kdm.repositoryMerger/META-INF/MANIFEST.MF b/3rdParty/com.kdmanalytics.kdm.repositoryMerger/META-INF/MANIFEST.MF new file mode 100644 index 00000000..ab1aaee3 --- /dev/null +++ b/3rdParty/com.kdmanalytics.kdm.repositoryMerger/META-INF/MANIFEST.MF @@ -0,0 +1,21 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: Repository Merger +Bundle-SymbolicName: com.kdmanalytics.kdm.repositoryMerger +Bundle-Version: 1.16.0.qualifier +Bundle-Activator: com.kdmanalytics.kdm.repositoryMerger.Activator +Bundle-Vendor: KDM Analytics Inc. +Require-Bundle: org.apache.commons.lang3;bundle-version="[3.0.0,4.0.0)", + net.sf.trove4j;bundle-version="3.0.3", + org.openrdf.sesame;bundle-version="[2.4.0,2.5.0)", + com.google.guava;bundle-version="[14.0.1,15.0.0)", + org.apache.log4j;bundle-version="[1.2.13,2.0.0)", + com.lexicalscope.jewelcli;bundle-version="[0.8.5,1.0.0)", + org.eclipse.ui, + org.eclipse.core.runtime +Bundle-RequiredExecutionEnvironment: JavaSE-1.6 +Eclipse-RegisterBuddy: com.lexicalscope.jewelcli +Bundle-ActivationPolicy: lazy +Export-Package: com.kdmanalytics.kdm.repositoryMerger,com.kdmanalytics + .kdm.repositoryMerger.Utilities,com.kdmanalytics.kdm.repositoryMerger + .linkconfig,com.kdmanalytics.kdm.repositoryMerger.ranges diff --git a/3rdParty/com.kdmanalytics.kdm.repositoryMerger/bin/com/kdmanalytics/kdm/repositoryMerger/Activator.class b/3rdParty/com.kdmanalytics.kdm.repositoryMerger/bin/com/kdmanalytics/kdm/repositoryMerger/Activator.class new file mode 100644 index 00000000..87e42a19 Binary files /dev/null and b/3rdParty/com.kdmanalytics.kdm.repositoryMerger/bin/com/kdmanalytics/kdm/repositoryMerger/Activator.class differ diff --git a/3rdParty/com.kdmanalytics.kdm.repositoryMerger/bin/com/kdmanalytics/kdm/repositoryMerger/GlobalMap.class b/3rdParty/com.kdmanalytics.kdm.repositoryMerger/bin/com/kdmanalytics/kdm/repositoryMerger/GlobalMap.class new file mode 100644 index 00000000..c9f55764 Binary files /dev/null and b/3rdParty/com.kdmanalytics.kdm.repositoryMerger/bin/com/kdmanalytics/kdm/repositoryMerger/GlobalMap.class differ diff --git a/3rdParty/com.kdmanalytics.kdm.repositoryMerger/bin/com/kdmanalytics/kdm/repositoryMerger/MethodOverrides.class b/3rdParty/com.kdmanalytics.kdm.repositoryMerger/bin/com/kdmanalytics/kdm/repositoryMerger/MethodOverrides.class new file mode 100644 index 00000000..0ad686d6 Binary files /dev/null and b/3rdParty/com.kdmanalytics.kdm.repositoryMerger/bin/com/kdmanalytics/kdm/repositoryMerger/MethodOverrides.class differ diff --git a/3rdParty/com.kdmanalytics.kdm.repositoryMerger/bin/com/kdmanalytics/kdm/repositoryMerger/MethodState.class b/3rdParty/com.kdmanalytics.kdm.repositoryMerger/bin/com/kdmanalytics/kdm/repositoryMerger/MethodState.class new file mode 100644 index 00000000..51c221fd Binary files /dev/null and b/3rdParty/com.kdmanalytics.kdm.repositoryMerger/bin/com/kdmanalytics/kdm/repositoryMerger/MethodState.class differ diff --git a/3rdParty/com.kdmanalytics.kdm.repositoryMerger/bin/com/kdmanalytics/kdm/repositoryMerger/RepositoryMerger.class b/3rdParty/com.kdmanalytics.kdm.repositoryMerger/bin/com/kdmanalytics/kdm/repositoryMerger/RepositoryMerger.class new file mode 100644 index 00000000..704a49c8 Binary files /dev/null and b/3rdParty/com.kdmanalytics.kdm.repositoryMerger/bin/com/kdmanalytics/kdm/repositoryMerger/RepositoryMerger.class differ diff --git a/3rdParty/com.kdmanalytics.kdm.repositoryMerger/bin/com/kdmanalytics/kdm/repositoryMerger/StatementWriter.class b/3rdParty/com.kdmanalytics.kdm.repositoryMerger/bin/com/kdmanalytics/kdm/repositoryMerger/StatementWriter.class new file mode 100644 index 00000000..a4c17e58 Binary files /dev/null and b/3rdParty/com.kdmanalytics.kdm.repositoryMerger/bin/com/kdmanalytics/kdm/repositoryMerger/StatementWriter.class differ diff --git a/3rdParty/com.kdmanalytics.kdm.repositoryMerger/bin/com/kdmanalytics/kdm/repositoryMerger/Utilities/IntUtils.class b/3rdParty/com.kdmanalytics.kdm.repositoryMerger/bin/com/kdmanalytics/kdm/repositoryMerger/Utilities/IntUtils.class new file mode 100644 index 00000000..23f9aa3d Binary files /dev/null and b/3rdParty/com.kdmanalytics.kdm.repositoryMerger/bin/com/kdmanalytics/kdm/repositoryMerger/Utilities/IntUtils.class differ diff --git a/3rdParty/com.kdmanalytics.kdm.repositoryMerger/bin/com/kdmanalytics/kdm/repositoryMerger/Utilities/KdmConstants$KdmPredicate.class b/3rdParty/com.kdmanalytics.kdm.repositoryMerger/bin/com/kdmanalytics/kdm/repositoryMerger/Utilities/KdmConstants$KdmPredicate.class new file mode 100644 index 00000000..f689d914 Binary files /dev/null and b/3rdParty/com.kdmanalytics.kdm.repositoryMerger/bin/com/kdmanalytics/kdm/repositoryMerger/Utilities/KdmConstants$KdmPredicate.class differ diff --git a/3rdParty/com.kdmanalytics.kdm.repositoryMerger/bin/com/kdmanalytics/kdm/repositoryMerger/Utilities/KdmConstants$KdmType.class b/3rdParty/com.kdmanalytics.kdm.repositoryMerger/bin/com/kdmanalytics/kdm/repositoryMerger/Utilities/KdmConstants$KdmType.class new file mode 100644 index 00000000..34fe65e2 Binary files /dev/null and b/3rdParty/com.kdmanalytics.kdm.repositoryMerger/bin/com/kdmanalytics/kdm/repositoryMerger/Utilities/KdmConstants$KdmType.class differ diff --git a/3rdParty/com.kdmanalytics.kdm.repositoryMerger/bin/com/kdmanalytics/kdm/repositoryMerger/Utilities/KdmConstants$WorkbenchPredicate.class b/3rdParty/com.kdmanalytics.kdm.repositoryMerger/bin/com/kdmanalytics/kdm/repositoryMerger/Utilities/KdmConstants$WorkbenchPredicate.class new file mode 100644 index 00000000..8ef8db04 Binary files /dev/null and b/3rdParty/com.kdmanalytics.kdm.repositoryMerger/bin/com/kdmanalytics/kdm/repositoryMerger/Utilities/KdmConstants$WorkbenchPredicate.class differ diff --git a/3rdParty/com.kdmanalytics.kdm.repositoryMerger/bin/com/kdmanalytics/kdm/repositoryMerger/Utilities/KdmConstants$WorkbenchStereotype.class b/3rdParty/com.kdmanalytics.kdm.repositoryMerger/bin/com/kdmanalytics/kdm/repositoryMerger/Utilities/KdmConstants$WorkbenchStereotype.class new file mode 100644 index 00000000..f3d002f7 Binary files /dev/null and b/3rdParty/com.kdmanalytics.kdm.repositoryMerger/bin/com/kdmanalytics/kdm/repositoryMerger/Utilities/KdmConstants$WorkbenchStereotype.class differ diff --git a/3rdParty/com.kdmanalytics.kdm.repositoryMerger/bin/com/kdmanalytics/kdm/repositoryMerger/Utilities/KdmConstants.class b/3rdParty/com.kdmanalytics.kdm.repositoryMerger/bin/com/kdmanalytics/kdm/repositoryMerger/Utilities/KdmConstants.class new file mode 100644 index 00000000..39daed60 Binary files /dev/null and b/3rdParty/com.kdmanalytics.kdm.repositoryMerger/bin/com/kdmanalytics/kdm/repositoryMerger/Utilities/KdmConstants.class differ diff --git a/3rdParty/com.kdmanalytics.kdm.repositoryMerger/bin/com/kdmanalytics/kdm/repositoryMerger/Utilities/KdmLiteral.class b/3rdParty/com.kdmanalytics.kdm.repositoryMerger/bin/com/kdmanalytics/kdm/repositoryMerger/Utilities/KdmLiteral.class new file mode 100644 index 00000000..d02b9306 Binary files /dev/null and b/3rdParty/com.kdmanalytics.kdm.repositoryMerger/bin/com/kdmanalytics/kdm/repositoryMerger/Utilities/KdmLiteral.class differ diff --git a/3rdParty/com.kdmanalytics.kdm.repositoryMerger/bin/com/kdmanalytics/kdm/repositoryMerger/Utilities/MergerURI.class b/3rdParty/com.kdmanalytics.kdm.repositoryMerger/bin/com/kdmanalytics/kdm/repositoryMerger/Utilities/MergerURI.class new file mode 100644 index 00000000..6c6578fa Binary files /dev/null and b/3rdParty/com.kdmanalytics.kdm.repositoryMerger/bin/com/kdmanalytics/kdm/repositoryMerger/Utilities/MergerURI.class differ diff --git a/3rdParty/com.kdmanalytics.kdm.repositoryMerger/bin/com/kdmanalytics/kdm/repositoryMerger/Utilities/MergerUtilities.class b/3rdParty/com.kdmanalytics.kdm.repositoryMerger/bin/com/kdmanalytics/kdm/repositoryMerger/Utilities/MergerUtilities.class new file mode 100644 index 00000000..273e5bac Binary files /dev/null and b/3rdParty/com.kdmanalytics.kdm.repositoryMerger/bin/com/kdmanalytics/kdm/repositoryMerger/Utilities/MergerUtilities.class differ diff --git a/3rdParty/com.kdmanalytics.kdm.repositoryMerger/bin/com/kdmanalytics/kdm/repositoryMerger/Utilities/NullArgumentException.class b/3rdParty/com.kdmanalytics.kdm.repositoryMerger/bin/com/kdmanalytics/kdm/repositoryMerger/Utilities/NullArgumentException.class new file mode 100644 index 00000000..e188dca5 Binary files /dev/null and b/3rdParty/com.kdmanalytics.kdm.repositoryMerger/bin/com/kdmanalytics/kdm/repositoryMerger/Utilities/NullArgumentException.class differ diff --git a/3rdParty/com.kdmanalytics.kdm.repositoryMerger/bin/com/kdmanalytics/kdm/repositoryMerger/Utilities/StringTokenIterator.class b/3rdParty/com.kdmanalytics.kdm.repositoryMerger/bin/com/kdmanalytics/kdm/repositoryMerger/Utilities/StringTokenIterator.class new file mode 100644 index 00000000..3cb662c8 Binary files /dev/null and b/3rdParty/com.kdmanalytics.kdm.repositoryMerger/bin/com/kdmanalytics/kdm/repositoryMerger/Utilities/StringTokenIterator.class differ diff --git a/3rdParty/com.kdmanalytics.kdm.repositoryMerger/bin/com/kdmanalytics/kdm/repositoryMerger/ValidationData.class b/3rdParty/com.kdmanalytics.kdm.repositoryMerger/bin/com/kdmanalytics/kdm/repositoryMerger/ValidationData.class new file mode 100644 index 00000000..244cc6db Binary files /dev/null and b/3rdParty/com.kdmanalytics.kdm.repositoryMerger/bin/com/kdmanalytics/kdm/repositoryMerger/ValidationData.class differ diff --git a/3rdParty/com.kdmanalytics.kdm.repositoryMerger/bin/com/kdmanalytics/kdm/repositoryMerger/linkconfig/FileMergeConfig.class b/3rdParty/com.kdmanalytics.kdm.repositoryMerger/bin/com/kdmanalytics/kdm/repositoryMerger/linkconfig/FileMergeConfig.class new file mode 100644 index 00000000..47449dc8 Binary files /dev/null and b/3rdParty/com.kdmanalytics.kdm.repositoryMerger/bin/com/kdmanalytics/kdm/repositoryMerger/linkconfig/FileMergeConfig.class differ diff --git a/3rdParty/com.kdmanalytics.kdm.repositoryMerger/bin/com/kdmanalytics/kdm/repositoryMerger/linkconfig/LinkConfig.class b/3rdParty/com.kdmanalytics.kdm.repositoryMerger/bin/com/kdmanalytics/kdm/repositoryMerger/linkconfig/LinkConfig.class new file mode 100644 index 00000000..e0c82678 Binary files /dev/null and b/3rdParty/com.kdmanalytics.kdm.repositoryMerger/bin/com/kdmanalytics/kdm/repositoryMerger/linkconfig/LinkConfig.class differ diff --git a/3rdParty/com.kdmanalytics.kdm.repositoryMerger/bin/com/kdmanalytics/kdm/repositoryMerger/linkconfig/MergeConfig.class b/3rdParty/com.kdmanalytics.kdm.repositoryMerger/bin/com/kdmanalytics/kdm/repositoryMerger/linkconfig/MergeConfig.class new file mode 100644 index 00000000..1250c763 Binary files /dev/null and b/3rdParty/com.kdmanalytics.kdm.repositoryMerger/bin/com/kdmanalytics/kdm/repositoryMerger/linkconfig/MergeConfig.class differ diff --git a/3rdParty/com.kdmanalytics.kdm.repositoryMerger/bin/com/kdmanalytics/kdm/repositoryMerger/ranges/Range.class b/3rdParty/com.kdmanalytics.kdm.repositoryMerger/bin/com/kdmanalytics/kdm/repositoryMerger/ranges/Range.class new file mode 100644 index 00000000..c0ae8557 Binary files /dev/null and b/3rdParty/com.kdmanalytics.kdm.repositoryMerger/bin/com/kdmanalytics/kdm/repositoryMerger/ranges/Range.class differ diff --git a/3rdParty/com.kdmanalytics.kdm.repositoryMerger/bin/com/kdmanalytics/kdm/repositoryMerger/ranges/RangeSet$1.class b/3rdParty/com.kdmanalytics.kdm.repositoryMerger/bin/com/kdmanalytics/kdm/repositoryMerger/ranges/RangeSet$1.class new file mode 100644 index 00000000..c68ff564 Binary files /dev/null and b/3rdParty/com.kdmanalytics.kdm.repositoryMerger/bin/com/kdmanalytics/kdm/repositoryMerger/ranges/RangeSet$1.class differ diff --git a/3rdParty/com.kdmanalytics.kdm.repositoryMerger/bin/com/kdmanalytics/kdm/repositoryMerger/ranges/RangeSet.class b/3rdParty/com.kdmanalytics.kdm.repositoryMerger/bin/com/kdmanalytics/kdm/repositoryMerger/ranges/RangeSet.class new file mode 100644 index 00000000..d3b8e200 Binary files /dev/null and b/3rdParty/com.kdmanalytics.kdm.repositoryMerger/bin/com/kdmanalytics/kdm/repositoryMerger/ranges/RangeSet.class differ diff --git a/3rdParty/com.kdmanalytics.kdm.repositoryMerger/bin/config/cxx.cfg b/3rdParty/com.kdmanalytics.kdm.repositoryMerger/bin/config/cxx.cfg new file mode 100644 index 00000000..01fd647d --- /dev/null +++ b/3rdParty/com.kdmanalytics.kdm.repositoryMerger/bin/config/cxx.cfg @@ -0,0 +1,39 @@ +# Actions define the merge behaviour for various element KDM types. This specifies +# how two files are merged together. +# +# MERGE Merges the contents of like IDed nodes together +# COPY Copies the information in the node even if the ID is already represented +# IGNORE Does not specifically merge or copy data, but recurses down the tree and +# let the children specify for themselves. +# +# To match multiple elements you may use regular expressions. +# +# The default behaviour is specified by using catch all regex ".*". Ensure that this +# is the LAST element or it will mask any other regex entries. +# +# When identifying a merge type for an element, first an exact match is attempted, +# then regular expressions are evaluated in the order in which they appear in the +# file. +# +action,code/Package,MERGE +action,code/LanguageUnit,MERGE +action,code/SharedUnit,MERGE +action,code/CodeAssembly,MERGE +action,code/CompilationUnit,MERGE +action,code/CompilationUnit,MERGE +action,source/StorableUnit,MERGE +action,source/Directory,MERGE +action,code/MethodUnit,SINGLETON +action,code/CallableUnit,SINGLETON +action,action/BlockUnit,SINGLETON +action,.*Model,MERGE +action,kdm/ExtensionFamily,MERGE +action,data/DataContainer,MERGE + +# This regex matches everything else. Note that the default behaviour in the linker +# is currently to ignore, but since this could change it is probably a good idea to +# actively code this behaviour. +action,.*,IGNORE + +# When elements have no IDs, how should they be handled? +noid,COPY \ No newline at end of file diff --git a/3rdParty/com.kdmanalytics.kdm.repositoryMerger/build.properties b/3rdParty/com.kdmanalytics.kdm.repositoryMerger/build.properties new file mode 100644 index 00000000..34d2e4d2 --- /dev/null +++ b/3rdParty/com.kdmanalytics.kdm.repositoryMerger/build.properties @@ -0,0 +1,4 @@ +source.. = src/ +output.. = bin/ +bin.includes = META-INF/,\ + . diff --git a/3rdParty/com.kdmanalytics.kdm.repositoryMerger/pom.xml b/3rdParty/com.kdmanalytics.kdm.repositoryMerger/pom.xml new file mode 100644 index 00000000..5c859533 --- /dev/null +++ b/3rdParty/com.kdmanalytics.kdm.repositoryMerger/pom.xml @@ -0,0 +1,19 @@ + + + 4.0.0 + + + com.kdmanalytics.toif + plugins + 1.16.0-SNAPSHOT + + + com.kdmanalytics.toif.compile + com.kdmanalytics.kdm.repositoryMerger + + eclipse-plugin + + Repository Merger + + diff --git a/3rdParty/com.kdmanalytics.kdm.repositoryMerger/src/com/kdmanalytics/kdm/repositoryMerger/Activator.java b/3rdParty/com.kdmanalytics.kdm.repositoryMerger/src/com/kdmanalytics/kdm/repositoryMerger/Activator.java new file mode 100644 index 00000000..3884d727 --- /dev/null +++ b/3rdParty/com.kdmanalytics.kdm.repositoryMerger/src/com/kdmanalytics/kdm/repositoryMerger/Activator.java @@ -0,0 +1,50 @@ +package com.kdmanalytics.kdm.repositoryMerger; + +import org.eclipse.ui.plugin.AbstractUIPlugin; +import org.osgi.framework.BundleContext; + +/** + * The activator class controls the plug-in life cycle + */ +public class Activator extends AbstractUIPlugin { + + // The plug-in ID + public static final String PLUGIN_ID = "com.kdmanalytics.kdm.repositoryMerger"; //$NON-NLS-1$ + + // The shared instance + private static Activator plugin; + + /** + * The constructor + */ + public Activator() { + } + + /* + * (non-Javadoc) + * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) + */ + public void start(BundleContext context) throws Exception { + super.start(context); + plugin = this; + } + + /* + * (non-Javadoc) + * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) + */ + public void stop(BundleContext context) throws Exception { + plugin = null; + super.stop(context); + } + + /** + * Returns the shared instance + * + * @return the shared instance + */ + public static Activator getDefault() { + return plugin; + } + +} diff --git a/3rdParty/com.kdmanalytics.kdm.repositoryMerger/src/com/kdmanalytics/kdm/repositoryMerger/GlobalMap.java b/3rdParty/com.kdmanalytics.kdm.repositoryMerger/src/com/kdmanalytics/kdm/repositoryMerger/GlobalMap.java new file mode 100644 index 00000000..24c7a372 --- /dev/null +++ b/3rdParty/com.kdmanalytics.kdm.repositoryMerger/src/com/kdmanalytics/kdm/repositoryMerger/GlobalMap.java @@ -0,0 +1,95 @@ +package com.kdmanalytics.kdm.repositoryMerger; + +import gnu.trove.map.hash.THashMap; + +import java.util.Map; + +import org.openrdf.model.URI; +import org.openrdf.model.Value; + +import com.kdmanalytics.kdm.repositoryMerger.Utilities.MergerURI; + + +/** The GlobalMap is used to store global information for the link/merge + * It is not complete KDM, but just a subset of data needed for the merge. + * + */ +public class GlobalMap +{ + /** + * + */ + public static final int ROOTID = 0; + + /** + * + */ + private URI root = null; + + private Map> map = null; + + /** + * + */ + public GlobalMap() + { + map = new THashMap>(); + root = new MergerURI(MergerURI.KdmModelNS, ""+ROOTID); + //root = SimpleValueFactory.getSimpleValueFactory().createURI(RDFInterface.modelNS, ""+ROOTID); + Map values = new THashMap(); + map.put(root, values); + } + + /** + * + * @return + */ + public URI getRoot() + { + return root; + } + + /** + * + * @param globalNode + * @param id + * @return + */ + public boolean containsId(URI parentURI, Value id) + { + if(!map.containsKey(parentURI)) return false; + Map values = map.get(parentURI); + if(values.containsKey(id)) return true; + return false; + } + + /** Add the child with the given id and globalID to the tree + * + * @param parentURI + * @param childID + * @param childURI + */ + public void add(URI parentURI, Value childID, URI childURI) + { + Map values = map.get(parentURI); + if(values == null) + { + values = new THashMap(); + map.put(parentURI, values); + } + values.put(childID, childURI); + } + + /** + * + * @param parentURI + * @param id + * @return + */ + public URI get(URI parentURI, Value id) + { + if(!map.containsKey(parentURI)) return null; + Map values = map.get(parentURI); + return values.get(id); + } +} diff --git a/3rdParty/com.kdmanalytics.kdm.repositoryMerger/src/com/kdmanalytics/kdm/repositoryMerger/RepositoryMerger.java b/3rdParty/com.kdmanalytics.kdm.repositoryMerger/src/com/kdmanalytics/kdm/repositoryMerger/RepositoryMerger.java new file mode 100644 index 00000000..822bdfce --- /dev/null +++ b/3rdParty/com.kdmanalytics.kdm.repositoryMerger/src/com/kdmanalytics/kdm/repositoryMerger/RepositoryMerger.java @@ -0,0 +1,1958 @@ + +package com.kdmanalytics.kdm.repositoryMerger; + +import gnu.trove.map.hash.THashMap; +import gnu.trove.set.hash.THashSet; +import info.aduna.iteration.CloseableIteration; + +import java.io.PrintWriter; +import java.util.ArrayList; +import java.util.EnumSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; +import java.util.Stack; +import java.util.regex.Pattern; + +import org.apache.commons.lang3.SystemUtils; +import org.apache.log4j.Logger; +import org.openrdf.model.Literal; +import org.openrdf.model.Statement; +import org.openrdf.model.URI; +import org.openrdf.model.Value; +import org.openrdf.model.ValueFactory; +import org.openrdf.model.impl.StatementImpl; +import org.openrdf.repository.Repository; +import org.openrdf.repository.RepositoryConnection; +import org.openrdf.repository.RepositoryException; + +import com.kdmanalytics.kdm.repositoryMerger.Utilities.IntUtils; +import com.kdmanalytics.kdm.repositoryMerger.Utilities.KdmConstants; +import com.kdmanalytics.kdm.repositoryMerger.Utilities.KdmConstants.KdmPredicate; +import com.kdmanalytics.kdm.repositoryMerger.Utilities.KdmConstants.KdmType; +import com.kdmanalytics.kdm.repositoryMerger.Utilities.KdmConstants.WorkbenchPredicate; +import com.kdmanalytics.kdm.repositoryMerger.Utilities.KdmConstants.WorkbenchStereotype; +import com.kdmanalytics.kdm.repositoryMerger.Utilities.KdmLiteral; +import com.kdmanalytics.kdm.repositoryMerger.Utilities.MergerURI; +import com.kdmanalytics.kdm.repositoryMerger.Utilities.MergerUtilities; +import com.kdmanalytics.kdm.repositoryMerger.linkconfig.MergeConfig; +import com.kdmanalytics.kdm.repositoryMerger.ranges.Range; +import com.kdmanalytics.kdm.repositoryMerger.ranges.RangeSet; + +/** + * + * @author Ken Duck + * + */ +class MethodOverrides +{ + + private final String link; + + private MethodState state; + + public MethodOverrides(String link) + { + this.link = link; + state = MethodState.DECLARATION; + } + + /** + * + * @return + */ + public final String getLink() + { + return link; + } + + /** + * + * @return + */ + public final MethodState getState() + { + return state; + } + + /** + * + * @param state + */ + public final void setState(MethodState state) + { + this.state = state; + } + +} + +/** + * Used to indicate whether the IMPLEMENTATION of a method has been committed + * yet + * + * @author Ken Duck + * + */ +enum MethodState +{ + DECLARATION, IMPLEMENTATION +}; + +/** + * Merge multiple repositories into a common repository. The destination + * repository is actually a file target, not a memory or disk repository, which + * means all merging needs to be done on the fly, with a minimum of data kept in + * memory. + * + * The individual repositories being loaded are provided as KdmRepository + * instances. + * + * Output may be performed in two ways: * NTRIPLES format * MODIFIED_NTRIPLES + * which is a more compressed representation + * + */ +public class RepositoryMerger +{ + + public static final int ACTION_ELEMENT_NAMES = 0x10; + + private static final String LINK_ID = "link:id"; + + /** + * log4j logger. + */ + private static final Logger LOG = Logger.getLogger(RepositoryMerger.class); + + public static final int LOWMEM = 0x0C; + + public static final int MODIFIED_NTRIPLES = 0x02; + + public static final int NO_FLOWS = 0x04; + + public static final int NO_LOCALS = 0x08; + + // 0x20 + // 0x40 + // 0x80 + + public static final int NTRIPLES = 0x01; + + /** + * A switch for testing purposes. Should be false for non test runs. + */ + private static final boolean preserveIDs = false; + + /** + * This switch is used to ensure an error message is written only once. + */ + private static boolean preservingURIs = true; + + public static final String UID_RANGES_ATTRIBUTE = "__KNT_UIDs"; + + /** + * The codeAssembly that all codeModel elements from the source repository + * will be written into. + */ + private final URI assembly; + + /** + * Case Sensitive KdmTypes + */ + final EnumSet caseSensitive = EnumSet.of(KdmType.PACKAGE, KdmType.SHARED_UNIT, KdmType.BINARY_FILE, KdmType.CONFIGURATION, + KdmType.DEPENDS_ON, KdmType.DIRECTORY, KdmType.EXECUTABLE_FILE, KdmType.IMAGE, KdmType.INVENTORY_CONTAINER, KdmType.INVENTORY_ELEMENT, + KdmType.INVENTORY_ITEM, KdmType.PROJECT, KdmType.RESOURCE_DESCRIPTION, KdmType.SOURCE_FILE); + + /** + * The codeModel that is created. + */ + private final URI codeModel; + + private final Pattern commaSplitter; + + // // Disabled for C. May re-enable for C++ + // private static final String CLASS_MODEL_NAME = "Class Structure"; + + /** + * Configuration file that defines how various elements are merged together. + */ + private final MergeConfig config; + + /** + * Reusable URI for the "contains" relationship + */ + private final URI contains = new MergerURI(MergerURI.KdmNS, "contains"); + + /** + * Map of new ranges by URI + */ + private final Map deferredRanges; + + /** + * List of statements whose output is deferred until the URI "object" of the + * statement can be resolved to the "newURI" that will be assigned to it. + * This list is reset every .kdmo object file that is processed. + */ + private List deferredStatements; + + /** + * Factory with which to generate URIs + */ + private ValueFactory factory; + + private int format = 1; + + /** + * This is a double key map, where the first key is the destination URI, and + * the second is a unique link:id within that destination. It is used in the + * merging process to locate existing elements in the target repository with + * which to merge. An example would be finding a SharedUnit that is already + * within the repository which we are merging the same SharedUnit from + * another object with. + * + */ + private final GlobalMap globals; + + /** + * Use this to mark elements that should remain hidden. This includes at + * least: + * + * * LanguageUnit * InventoryModel + * + */ + private URI hiddenStereotype; + + /** + * The new ID numbers are assigned from here. Start counting at 1 (one) + * because the root is id 0. + * + */ + private long id = GlobalMap.ROOTID; + + /** + * The localIdMap is a map of the URI contained within the kdmo file to the + * URI that it is translated to in the new linked file. + * + * The map is refreshed for every kdmo file being loaded. + */ + private Map localIdMap; + + /** + * Use this to mark the StructureModel as being updateable by Workbench + * probes. + * + */ + private URI managedStereotype; + + /** + * On a per-merge basis, what is the maximum UID found. + */ + private long maxUID = 0; + + /** + * Utilities for the repository (per .kdmo object) + */ + private MergerUtilities mergerUtils; + + /** + * A map of models by their type names to allow us to identify the models + * that need to be merged together. + * + */ + private final Map modelByType; + + /** + * Set of nodes that did not get link IDs (used for error messaging) + */ + private Set noLinkId; + + /** + * The StructureAssembly is a class which gathers the information required + * for generating a StructureModel for the binary. It then dumps the new + * Structure on shutdown. + */ + // // Disabled for C. May re-enable for C++ + // private StructureAssembly structure; + + /** + */ + private final StatementWriter output; + + /** + * Path of the file being analysed + */ + private String path; + + /** + * Repository being merged FROM + */ + private Repository repository; + + // // Disabled for C. May re-enable for C++ + // /** Set to true to generate an object oriented model + // */ + // private boolean ooModel = true; + // + // /** Set to true to generate a file based model + // */ + // private boolean fileModel = false; + + private Map reverseLocalIdMap; + + private URI segmentURI; + + private final Pattern semiColonSplitter; + + /** + * Indicate how much to offset UID values during integration. + */ + private long uidOffset = 0; + + /** + * Set to true to do extra data validation. + */ + private boolean validate = false; + + /** + * Store data used in validation stages + */ + private ValidationData validationData; + + /** + * Instantiate the merger. This causes some basic top level elements to be + * created, including the Segment, a CodeModel, and the CodeAssembly for the + * linked code (binary/library/etc.) + * + * Various lists and maps are instantiated that are to contain the minimal + * amount of data required to ensure linking is successful. + * + * @param mergeConfig + * @param out + * @param assemblyName + * The name of the CodeAssembly to "link" everything into + */ + public RepositoryMerger(MergeConfig mergeConfig, PrintWriter out, int format, String assemblyName) + { + commaSplitter = Pattern.compile(","); + semiColonSplitter = Pattern.compile(";"); + + config = mergeConfig; + + globals = new GlobalMap(); + modelByType = new THashMap(); + deferredRanges = new THashMap(); + output = new StatementWriter(out, format); + this.format = format; + + segmentURI = new MergerURI(MergerURI.KdmModelNS, 0 + ""); + // Write the segment + ++id; + output.print(segmentURI, KdmPredicate.KDM_TYPE.toURI(), KdmType.SEGMENT.toLiteral()); + output.print(segmentURI, KdmPredicate.NAME.toURI(), new KdmLiteral("root")); + // Set the UID for the node + output.print(segmentURI, WorkbenchPredicate.UID.toURI(), new KdmLiteral("" + uidOffset)); + deferredRanges.put(segmentURI, new RangeSet((int) uidOffset)); + ++uidOffset; + + codeModel = getDestinationModel("code/CodeModel"); + + // Initialize the stereotypes required by the workbench + initializeWorkbenchStereotypes(segmentURI); + + // Write the CodeAssembly + assembly = new MergerURI(MergerURI.KdmModelNS, "" + id); + ++id; + output.print(assembly, KdmPredicate.KDM_TYPE.toURI(), KdmType.CODE_ASSEMBLY.toLiteral()); + output.print(assembly, KdmPredicate.NAME.toURI(), new KdmLiteral(assemblyName)); + output.print(codeModel, KdmPredicate.CONTAINS.toURI(), assembly); + // Set the UID for the node + output.print(assembly, WorkbenchPredicate.UID.toURI(), new KdmLiteral("" + uidOffset)); + deferredRanges.put(assembly, new RangeSet((int) uidOffset)); + ++uidOffset; + + // Substitute the CodeAssembly for the CodeModel + modelByType.put("code/CodeModel", assembly); + } + + /** + * Add the specified range to all of the ancestors in the current ancestor + * path, which should go straight up to the segment. + * + * @param ancestors + * @param range + */ + private void addDeferredRanges(Stack ancestors, Range range) + { + for (int i = ancestors.size() - 1; i >= 0; --i) + { + final URI parent = ancestors.get(i); + RangeSet ranges = null; + if (deferredRanges.containsKey(parent)) + { + ranges = deferredRanges.get(parent); + } + else + { + ranges = new RangeSet(); + deferredRanges.put(parent, ranges); + } + ranges.add(range); + } + } + + /** + * Close the merge session. This will output some key information that was + * built from information from all merged objects, including: + * + * 1. Segment and CodeModel ranges. 2. Class model for c++ // Currently + * disabled 2. Link information + * + * This MUST be called to complete the output + */ + public void close() + { + // Update the CodeModel ranges + final RangeSet cmRanges = deferredRanges.get(codeModel); + final RangeSet assRanges = deferredRanges.get(assembly); + cmRanges.addAll(assRanges); + + // Update segment ranges + final RangeSet sRanges = deferredRanges.get(segmentURI); + sRanges.add(new Range(0, uidOffset)); + + // Write the deferred ranges + for (final Entry entry : deferredRanges.entrySet()) + { + final URI element = entry.getKey(); + final RangeSet ranges = entry.getValue(); + // // Disabled for C. May re-enable for C++ + // structure.addRanges(element, ranges); + output.print(element, WorkbenchPredicate.WORKBENCH_RANGES.toURI(), new KdmLiteral(ranges.toString())); + } + // // Disabled for C. May re-enable for C++ + // // Write the structure + // // FIXME: Can only currently create one type of model. This should be + // updated + // // to allow generation of multiple model types. + // URI structureModel = null; + // + // // Override the default name for the structure model if it is object + // oriented + // if(ooModel) structureModel = + // getDestinationModel(KdmType.STRUCTURE_MODEL.toString(), + // CLASS_MODEL_NAME); + // else structureModel = + // getDestinationModel(KdmType.STRUCTURE_MODEL.toString()); + // + // id = structure.generateStructure(structureModel, id); + output.close(); + } + + /** + * Copy the specified node and its children. Any non-containment implicit + * "relation" (where the object is a URI) should be deferred till all nodes + * have been transfered. + * + * Part of the copy method is assigning a new id to the node and note the + * translation so that "relations" may be redirected at the end of the + * merge. + * + * Also involved is applying the UID offset to all contained UIDs to ensure + * there is no collision with the UIDs of other elements. + * + * @param dst + * @param node + * @param remember + * is set to true if these nodes should be added to the globals + * (copy as a result of a merge). Remember is not set to true if + * we are writing a CompilationUnit, for example, but will be for + * a SharedUnit. + * @throws RepositoryException + */ + private void copy(URI dst, URI node, boolean remember) throws RepositoryException + { + // If the element is already in the local map, then we have + // already handled the node. This will only happen if there + // is a problem with the input data. + if (localIdMap.containsKey(node)) + { + LOG.error("Attempting to re-copy element " + node + " into parent " + dst); + debugPathToRoot(node); + throw new UnsupportedOperationException("Attempting to re-copy element " + node + " into parent " + dst); + } + + // In order to successfully merge methods/functions, we need to track + // some particular + // information about the method. + final KdmType type = KdmType.valueOfKdmString(mergerUtils.getRDFAttribute(node, KdmPredicate.KDM_TYPE.toString())); + + try + { + // Generate a new URI for the element. All elements get new URIs + // to ensure there is no overlap with existing URIs. + final URI newURI = generateLinkerURI(node); + + // Add the mapping to the localIdMap. This data is only required + // in the local map, since different objects CANNOT directly + // reference each other. References between objects are resolved + // by the RelationshipLinker. + localIdMap.put(node, newURI); + reverseLocalIdMap.put(newURI, node); + + // Record a set of all contained children. + final Set children = new THashSet(); + + // Remember the kdmType of this node. It will help determine how + // the data is handled. + String kdmType = null; + + // Keep a list of statements found. + final List stmts = new ArrayList(); + + // // Disabled for C. May re-enable for C++ + // // By default we hide a class in the StructureModel. If it has a + // UID then we know it + // // is not hidden for the purposes of the structure model. + // boolean hiddenClass = true; + + // Get all triples with the node as the subject + final RepositoryConnection con = repository.getConnection(); + final CloseableIteration statements = con.getStatements(node, null, null, true); + try + { + long validateOriginalUid = 0; + long validateOriginalLastUid = 0; + long validateUid = 0; + long validateLastUid = 0; + + // Get all statements and handle them in the appropriate manner + while (statements.hasNext()) + { + final Statement st = statements.next(); + final URI predicate = st.getPredicate(); + final Value object = st.getObject(); + + // If the KDMType is not expected to be linked, then + // return from here. + if (skip(predicate, object)) + { + return; + } + + final String predicateName = predicate.getLocalName(); + // If the object is a URI and is not a contains then we + // want to defer the writing until we know what the + // object ID is being rewritten to. + // + // Contains are written at the beginning of "copy" + if (object instanceof URI) + { + // Several predicates actually indicate a contains. + if ("contains".equals(predicateName)) + { + if (!skipChild((URI) object)) + { + children.add((URI) object); + } + } + else if ("__item".equals(predicateName)) + { + children.add((URI) object); + } + else if ("__index".equals(predicateName)) + { + children.add((URI) object); + } + else + { + // LOG.debug("Defer " + node + "(" + newURI + ") " + + // predicate + " " + object); + deferredStatements.add(new StatementImpl(newURI, predicate, object)); + + // Run this code for advanced data validation + if (validate) + { + if (KdmPredicate.FROM.toString().equals(predicateName)) + { + validationData.setRelationshipFrom(node, (URI) object); + } + else if (KdmPredicate.TO.toString().equals(predicateName)) + { + validationData.setRelationshipTo(node, (URI) object); + } + } + + } + continue; + } + + // Handle compressed representation data + if ("SourceRef".equals(predicateName)) + { + deferredStatements.add(new StatementImpl(newURI, predicate, object)); + continue; + } + + // Only print ActionElement names if required + if (((format & ACTION_ELEMENT_NAMES) == 0) && KdmPredicate.NAME.toString().equals(predicateName) + && KdmConstants.KdmType.ACTION_ELEMENT.toString().equals(type)) + { + continue; + } + + // When merging, in most cases we are merely visiting + // children + // to see if they match up or new ones need copying. + + // If there is a link:id try to add this to the global map. + // Don't write it to the file, though. This link:id + // will be used for future merges, so only needs to be + // done if we are going to merge with this node (check the + // remember boolean). + if (remember && LINK_ID.equals(predicateName)) + { + globals.add(dst, getLinkId(node), newURI); + continue; + } + + // Some element outputs depend on KDM type. Remember the + // type. + if (KdmPredicate.KDM_TYPE.toString().equals(predicateName)) + { + kdmType = object.stringValue(); + } + + // If this is a UID related triple, add the offset + if (WorkbenchPredicate.UID.toString().equals(predicateName) + || WorkbenchPredicate.LAST_UID.toString().equals(predicateName)) + { + // If this is the lastUID and it is redundant, then skip + // it + if (WorkbenchPredicate.LAST_UID.toString().equals(predicateName)) + { + final long myLastUid = Long.parseLong(object.stringValue()); + final long myUid = Long.parseLong(mergerUtils.getRDFAttribute((URI) st.getSubject(), WorkbenchPredicate.UID.toString())); + if (myUid == myLastUid) + { + continue; + } + if (myLastUid < myUid) + { + LOG.error("Invalid range for " + node + " (" + myUid + "-" + myLastUid + ")"); + } + } + + // // Disabled for C. May re-enable for C++ + // hiddenClass = false; // There us a UID. If this is a + // class do not hide it. + + // Get the uid/lastUid + long uid = Long.parseLong(object.stringValue()); + + // Remember the original values for validation + if (WorkbenchPredicate.UID.toString().equals(predicateName)) + validateOriginalUid = uid; + else validateOriginalLastUid = uid; + + // otherwise get the appropriate UID + if (uid <= 0) + { + LOG.error("Linked object contains node with an invalid UID <= 0"); + } + uid += uidOffset; + if (uid > maxUID) + { + maxUID = uid; + } + + // Remember the converted UIDs for validation purposes + if (WorkbenchPredicate.UID.toString().equals(predicateName)) + validateUid = uid; + else validateLastUid = uid; + + final Literal newUid = new KdmLiteral(Long.toString(uid)); + + stmts.add(new StatementImpl(newURI, predicate, newUid)); + + // If we are performing validation, we want to remember + // UIDs + if (validate) + { + validationData.setUid(node, object); + } + continue; + } + + // Buffer the remaining statements for printing + stmts.add(new StatementImpl(newURI, predicate, object)); + } + + // Validate the UID, since they appear to be having troubles + if (validate) + { + if (validateLastUid > 0 && validateLastUid < validateUid) + { + if (validateOriginalLastUid < validateOriginalUid) + { + LOG.error("Invalid original range for " + node + " (" + validateOriginalUid + "-" + validateOriginalLastUid + ")"); + } + else + { + LOG.error("Invalid converted range for " + node + " (" + validateUid + "-" + validateLastUid + ")"); + } + } + } + + } + finally + { + statements.close(); // make sure the result object is closed + // properly + con.close(); + } + + // At this point all statements have been loaded. We know the + // element type. Some triples are being deferred (implicit + // relationships). + + // Set to hidden if required + if ("code/LanguageUnit".equals(kdmType)) + { + output.print(newURI, KdmPredicate.STEREOTYPE.toURI(), hiddenStereotype); + } + + // // Disabled for C. May re-enable for C++ + // // Some elements need to be passed to the StructureAssembly + // // for successful generation of the StructureModel. + // + // // FIXME: Can only currently create one type of model. This + // should be updated + // // to allow generation of multiple model types. + // + // // OO models are based on classes + // if(ooModel) + // { + // if("code/ClassUnit".equals(kdmType)) + // { + // if(!hiddenClass) + // { + // structure.add(newURI, stmts); + // } + // } + // } + // + // // File models are based on SharedUnits and CompilationUnits + // else if(fileModel) + // { + // if("code/CompilationUnit".equals(kdmType)) + // structure.add(newURI, stmts); + // if("code/SharedUnit".equals(kdmType)) + // structure.add(newURI, stmts); + // } + // + // // Both model types require the source path + // if("source/SourceFile".equals(kdmType)) + // structure.add(newURI, stmts); + + // Write the stored statements. + for (final Statement stmt : stmts) + { + output.print((URI) stmt.getSubject(), stmt.getPredicate(), stmt.getObject()); + } + + // Setup the contains. This call is here because we may have + // bailed out earlier if this is a node that is not being + // added to the linked repository. + // + // Also, we want the contains to be after anything else about + // the node. + output.print(dst, contains, newURI); + + // Recursively copy the child nodes. + for (final URI child : children) + { + copy(newURI, child, remember); + } + } + finally + { + } + } + + /** + * Copy the specified child into the target node, and merge the UID ranges. + * This is only done for the top level of a copy, since the range spread for + * these elements are already known absolutely. + * + * @param dst + * Destination URI the element is being added to + * @param node + * Source URI being added + * @param remember + * is set to true if these nodes should be added to the globals + * (copy as a result of a merge). Remember is not set to true if + * we are writing a CompilationUnit, for example, but will be for + * a SharedUnit. + * + * @throws RepositoryException + */ + private void copyAndMergeRange(URI dst, URI node, boolean remember) throws RepositoryException + { + // First copy all of the elements. All of the ranges in a copy + // are offset by the same amount, which preserves the containment + // information provided by the ranges. + copy(dst, node, remember); + + // Now get the ranges for the top element copied. Offset the ranges + // and add them to the destination (parent) ranges. This is a + // simple translation process, since the previous copy offset the + // copied ranges by the same amount. + try + { + final RangeSet childRanges = new RangeSet(repository, node); + childRanges.offsetAll(uidOffset); + if (validate) + { + if (!childRanges.isValid()) + { + LOG.error("Invalid range for " + node + " (" + childRanges + ")"); + } + } + final RangeSet parentRanges = deferredRanges.get(dst); + parentRanges.addAll(childRanges); + if (!parentRanges.isValid()) + { + LOG.error("Invalid range for " + node + " (" + parentRanges + ")"); + } + } + // If there is an exception, there are no ranges to merge. This may + // happen in the case of InventoryModel elements, at the very + // least. + catch (final RepositoryException e) + { + } + } + + /** + * This code is only invoked on an error, and is used to provide a path to + * the root from a given URI. + * + * @param node + * @throws RepositoryException + */ + private String debugPathToRoot(URI node) throws RepositoryException + { + final URI parent = mergerUtils.getOwner(node); + String indent = ""; + if (parent != null) + { + indent = debugPathToRoot(parent); + } + final String linkId = mergerUtils.getRDFAttribute(node, LINK_ID); + LOG.warn(indent + node + " " + linkId); + return indent + " "; + } + + /** + * Dump context information for the specified element id. This information + * is pulled from the *.kdmo repository, so the ID must be valid for there. + * + * If the element is a relationship, also dump information about the "from" + * side of the relationship. + * + * @param id + */ + private void dumpContextLocation(String indent, URI id) + { + RepositoryConnection con = null; + CloseableIteration statements = null; + try + { + LOG.error(indent + "Subject: " + id); + if (id != null) + { + boolean found = false; + con = repository.getConnection(); + statements = con.getStatements(id, null, null, true); + // Get all statements and handle them in the appropriate manner + while (statements.hasNext()) + { + Statement stmt = statements.next(); + if (stmt != null) + { + Value object = stmt.getObject(); + URI predicate = stmt.getPredicate(); + + LOG.error(indent + " " + predicate + " " + object); + found = true; + + // If this is a relationship, then get the "from" side + // for great justice. + if (object != null && predicate != null) + { + String pstring = predicate.getLocalName(); + if (KdmPredicate.FROM.toString().equals(pstring) && (object instanceof URI)) + { + dumpContextLocation(indent + " ", (URI) stmt.getObject()); + } + if (KdmPredicate.SOURCEREF.toString().equals(pstring)) + { + String ref = object.stringValue(); + if (ref != null) + { + String[] tokens = ref.split(";"); + final URI fid = new MergerURI(MergerURI.KdmModelNS, tokens[0]); + dumpContextLocation(indent + " ", fid); + } + } + } + } + } + // If we found no good statements, then this is a "dangling to" + // type problem+ + + if (!found) + { + LOG.error(indent + " No statements found"); + } + } + } + catch (RepositoryException e) + { + LOG.error("Exception gathering context information for " + id, e); + } + finally + { + if (statements != null) + { + try + { + statements.close(); + } + catch (RepositoryException e) + { + LOG.error("Exception closing statement", e); + } + } + if (con != null) + { + try + { + con.close(); + } + catch (RepositoryException e) + { + LOG.error("Exception closing connection", e); + } + } + } + } + + /** + * Dump as an error contextual location useful for debugging purposes. + * + * @param src + * @param dst + */ + private void dumpContextLocation(URI src, URI dst) + { + LOG.error(" Path: " + path); + // Need to use a reverse map to get the source ID for the kdmo + // repository + URI srcId = reverseLocalIdMap.get(src); + // LOG.error(" Source context (" + getSourceRef(src) + ")"); + dumpContextLocation(" ", srcId); + + // Dump information for the target if it exists + LOG.error(" Target context"); + dumpContextLocation(" ", dst); + } + + /** + * Generate a new URI for the linker. In production use this ID should be + * generated to ensure there is no overlap, but for testing purposes I may + * preserve existing values. + * + */ + private URI generateLinkerURI(URI node) + { + // This should only run in debug situations + if (preserveIDs) + { + if (preservingURIs) + { + LOG.error("Preserving compiled URIs -- use only for debug purposes"); + preservingURIs = false; + } + return node; + } + else + { + final URI newURI = factory.createURI(MergerURI.KdmModelNS + id); + ++id; + return newURI; + } + } + + /** + * Get the destination model with the specified type. If it does not yet + * exist, then create it. + * + * @param type + * @return + */ + private URI getDestinationModel(String type) + { + // Get the name. Fancy it up a little by adding spaces before capitol + // letters + final int start = type.indexOf('/') + 1; + final StringBuilder name = new StringBuilder(); + for (int i = start; i < type.length(); i++) + { + final char c = type.charAt(i); + if ((c >= 'A') && (c <= 'Z') && (i > start)) + { + name.append(' '); + } + name.append(c); + } + + return getDestinationModel(type, name.toString()); + } + + /** + * + * @param type + * @param name + * @return + */ + private URI getDestinationModel(String type, String name) + { + if (modelByType.containsKey(type)) + { + return modelByType.get(type); + } + + final URI model = new MergerURI(MergerURI.KdmModelNS, "" + id); + ++id; + + // Write the Model + output.print(model, KdmPredicate.KDM_TYPE.toURI(), new KdmLiteral(type)); + + output.print(model, KdmPredicate.NAME.toURI(), new KdmLiteral(name)); + + output.print(segmentURI, KdmPredicate.CONTAINS.toURI(), model); + + // Set to hidden if required + if (KdmConstants.KdmType.INVENTORY_MODEL.toString().equals(type)) + { + output.print(model, KdmPredicate.STEREOTYPE.toURI(), hiddenStereotype); + } + + // The StructureModel may be managed by Workbench probes + if (KdmType.STRUCTURE_MODEL.toString().equals(type)) + { + output.print(model, KdmPredicate.STEREOTYPE.toURI(), managedStereotype); + } + + // Set the UID for the node + output.print(model, WorkbenchPredicate.UID.toURI(), new KdmLiteral("" + uidOffset)); + deferredRanges.put(model, new RangeSet((int) uidOffset)); + ++uidOffset; + + // Reuse other models + modelByType.put(type, model); + return model; + } + + /** + * + * @param node + * @return + * @throws RepositoryException + */ + private Value getLinkId(URI node) throws RepositoryException + { + Value id = mergerUtils.getRDFAttributeValue(node, LINK_ID); + if (id != null) + { + if (SystemUtils.IS_OS_WINDOWS) + { + KdmType kdmType = KdmType.valueOfKdmString(mergerUtils.getRDFAttribute(node, KdmPredicate.KDM_TYPE.toString())); + if (caseSensitive.contains(kdmType)) + { + id = factory.createLiteral(id.stringValue().toLowerCase()); + } + } + // if(id.stringValue().trim().isEmpty()) + // { + // LOG.error("Invalid link:id " + id + " for element " + node); + // } + } + return id; + } + + /** + * Return the maximum assigned subject ID at this point. + * + * @return + */ + public long getMaxId() + { + return id; + } + + /** + * Return the number of statements processed by the merger. + * + * @return + */ + public long getStatementCount() + { + return output.getCount(); + } + + /** + * Used to determine whether the code has a UID or not. + * + * @param element + * element to check + * @return true if the element has a UID defined + * @throws RepositoryException + */ + private boolean hasUID(URI element) throws RepositoryException + { + String result = mergerUtils.getRDFAttribute(element, "UID"); + if (result == null || result.trim().isEmpty()) + return false; + return true; + } + + /** + * Initialize the stereotypes expected by workbench + * + * @param segment + * The segment to which this data is being written. + */ + private void initializeWorkbenchStereotypes(URI segment) + { + final URI extensionFamily = new MergerURI(MergerURI.KdmModelNS, "" + id); + ++id; + output.print(extensionFamily, KdmPredicate.KDM_TYPE.toURI(), new KdmLiteral("kdm/ExtensionFamily")); + output.print(extensionFamily, KdmPredicate.NAME.toURI(), MergerURI.WORKBENCH_EXTENSION_LITERAL); + output.print(segment, KdmPredicate.CONTAINS.toURI(), extensionFamily); + + hiddenStereotype = new MergerURI(MergerURI.KdmModelNS, "" + id); + ++id; + output.print(hiddenStereotype, KdmPredicate.KDM_TYPE.toURI(), new KdmLiteral("kdm/Stereotype")); + output.print(hiddenStereotype, KdmPredicate.NAME.toURI(), WorkbenchStereotype.HIDDEN.toLiteral()); + output.print(extensionFamily, KdmPredicate.CONTAINS.toURI(), hiddenStereotype); + + managedStereotype = new MergerURI(MergerURI.KdmModelNS, "" + id); + ++id; + output.print(managedStereotype, KdmPredicate.KDM_TYPE.toURI(), new KdmLiteral("kdm/Stereotype")); + output.print(managedStereotype, KdmPredicate.NAME.toURI(), WorkbenchStereotype.MANAGED_STRUCTURE_MODEL.toLiteral()); + output.print(extensionFamily, KdmPredicate.CONTAINS.toURI(), managedStereotype); + } + + /** + * Returns true if the subject is a local variable + * + * @param subject + * @return + * @throws RepositoryException + */ + private boolean isLocalVariable(URI subject) throws RepositoryException + { + final String type = mergerUtils.getRDFAttribute(subject, KdmPredicate.KDM_TYPE.toString()); + if (type == null) + { + return false; + } + if (type.equals(KdmType.STORABLE_UNIT.toString())) + { + final String kind = mergerUtils.getRDFAttribute(subject, KdmPredicate.KIND.toString()); + if ("local".equals(kind) || "register".equals(kind)) + { + return true; + } + } + return false; + } + + /** + * Top level merge of the repository. This instantiates some utilities so + * that they know of the KdmRepository for the object being merged. It kicks + * off the model merge and performs final closing operations (writing + * deferred values and clearing utilities). + * + * @deprecated Use merge(String path, KdmRepository repository) + * + * @param repository + * @throws RepositoryException + */ + @Deprecated + public void merge(Repository repository) throws RepositoryException + { + try + { + factory = repository.getValueFactory(); + mergerUtils = new MergerUtilities(repository); + this.repository = repository; + deferredStatements = new ArrayList(); + localIdMap = new THashMap(); + reverseLocalIdMap = new THashMap(); + noLinkId = new THashSet(); + + // Initialise the maximum uid + maxUID = uidOffset; + + // This data is only initialised if we are performing advanced data + // validation + if (validate) + { + validationData = new ValidationData(); + } + + mergeModels(); + + // Identify and merge "bad" data with the invalid UID "-1". This is + // only + // intended + // as a temporary handling of some bad data. + if (validate) + { + mergeInvalid(); + } + + // Perform the merge/copy + // recursiveMerge(globals.getRoot(), segment, "kdm/Segment"); + + // Write any deferred data + writeDeferredStatements(); + + // Perform validation + if (validate) + { + validationData.validate(noLinkId); + } + + // Clear some variables to help ensure the code is running correctly + factory = null; + mergerUtils = null; + this.repository = null; + deferredStatements = null; + localIdMap = null; + reverseLocalIdMap = null; + noLinkId = null; + + // Set the new UID offset for next linked node. + uidOffset = maxUID; + } + finally + { + // Ensure we have cleared the file name + this.path = null; + } + } + + /** + * + * @param file + * @param repository + * @throws RepositoryException + */ + public void merge(String filePath, Repository repository) throws RepositoryException + { + this.path = filePath; + merge(repository); + this.path = null; // ensure the path is reset. + } + + /** + * Identify and merge "bad" data with the invalid UID "-1". This is only + * intended as a temporary handling of some bad data. + * + * @throws RepositoryException + */ + private void mergeInvalid() throws RepositoryException + { + final URI invalid = new MergerURI(MergerURI.KdmNS, "-1"); + // Get the invalid children. + final List children = mergerUtils.getRelated(invalid, "contains"); + for (final URI child : children) + { + final String typeString = mergerUtils.getRDFAttribute(child, KdmConstants.KdmPredicate.KDM_TYPE.toString()); + final KdmType type = KdmType.valueOfKdmString(typeString); + switch (type) + { + case COMPILATION_UNIT: + case SHARED_UNIT: + LOG.error("Element has invalid parent " + child + " (" + type + ")"); + LOG.error(" - Added to CodeAssembly"); + // output.print(assembly, KdmPredicate.CONTAINS.toURI(), + // child); + mergeInvalid(assembly, child, config.getMergeType(type.toString())); + break; + case SOURCE_FILE: + LOG.error("Element has invalid parent " + child + " (" + type + ")"); + final URI dstModel = getDestinationModel("source/InventoryModel"); + // output.print(dstModel, KdmPredicate.CONTAINS.toURI(), + // child); + mergeInvalid(dstModel, child, config.getMergeType(type.toString())); + LOG.error(" - Added to InventoryModel"); + break; + case CODE_MODEL: + case EXTENSION_FAMILY: + case INVENTORY_MODEL: + LOG.warn("Element has invalid parent " + child + " (" + type + ")"); + break; + default: + LOG.error("Element has invalid parent " + child + " (" + type + ")"); + break; + } + } + } + + private void mergeInvalid(URI dst, URI child, int defaultMergeType) throws RepositoryException + { + final String type = mergerUtils.getRDFAttribute(child, "kdmType"); + // String name = rdfUtils.getRDFAttribute(child, "name"); + + // If we are explicitly trying to copy, then copy + if ((defaultMergeType == MergeConfig.COPY) || (config.getMergeType(type) == MergeConfig.COPY)) + { + // Copy, but do not "remember" the node IDs in the globals + // map, since we will not be merging with this data. + copyAndMergeRange(dst, child, false); + } + // Fallback is to merge if possible + else + { + // If the node exists in the target, then merge, otherwise + // copy it. This is done so we can error out on a merge + // that does not match. + // final Value linkID = rdfUtils.getRDFAttributeValue(child, + // "link:id"); + final Value linkID = getLinkId(child); + if (linkID == null) + { + return; + } + + // Is this id already within the global map? + // If it is then attempt to merge with it. + if (globals.containsId(dst, linkID)) + { + final Stack ancestors = new Stack(); + ancestors.push(dst); + mergeNode(ancestors, child); + } + // Otherwise just copy it in, updating the UID ranges of the + // destination. + else + { + // Copy, and "remember" the node IDs in the globals + // map since we may be merging with this data later. + copyAndMergeRange(dst, child, true); + } + } + } + + /** + * We are provided the destination URI (dst), the source model URI (src), + * and a default merge type. For each of the children in the source, + * determine if the desired operation is to COPY the data in, or to attempt + * to MERGE it with some existing data. + * + * Some things we might want to always copy are CompilationUnits. There + * should be no overlap between these in objects. SharedUnits are likely + * overlapping between files. + * + * In the case of elements that are intended to be merged. If the element + * has NOT been added yet (first time the SharedUnit is encountered, for + * example) then it will be copied. + * + * The identity of mergable elements is determined by the "link:id" + * attribute, which needs to be added by this point in the operations. The + * "link:id" is unique within a particular parent, but should always be the + * same across different objects. An example might be a file name within a + * particular directory. + * + * When either merging or copying, the UID range of the target may need to + * be updated (a certainty in copying). + * + * @param dst + * @param child + * @param i + * @throws RepositoryException + */ + private void mergeModelContents(URI dst, URI src, int defaultMergeType) throws RepositoryException + { + // Get the contained nodes + final List children = mergerUtils.getRelated(src, "contains"); + for (final URI child : children) + { + final String type = mergerUtils.getRDFAttribute(child, "kdmType"); + // String name = rdfUtils.getRDFAttribute(child, "name"); + + // If we are explicitly trying to copy, then copy + if ((defaultMergeType == MergeConfig.COPY) || (config.getMergeType(type) == MergeConfig.COPY)) + { + // Copy, but do not "remember" the node IDs in the globals + // map, since we will not be merging with this data. + copyAndMergeRange(dst, child, false); + } + // Fallback is to merge if possible + else + { + // If the node exists in the target, then merge, otherwise + // copy it. This is done so we can error out on a merge + // that does not match. + // final Value linkID = rdfUtils.getRDFAttributeValue(child, + // "link:id"); + final Value linkID = getLinkId(child); + + if (linkID == null) + { + continue; + } + + // Is this id already within the global map? + // If it is then attempt to merge with it. + if (globals.containsId(dst, linkID)) + { + final Stack ancestors = new Stack(); + ancestors.push(dst); + mergeNode(ancestors, child); + } + // Otherwise just copy it in, updating the UID ranges of the + // destination. + else + { + // Copy, and "remember" the node IDs in the globals + // map since we may be merging with this data later. + copyAndMergeRange(dst, child, true); + } + } + } + } + + /** + * Merge the models from the working repository into correct location in the + * new repository. Depending on the model type we operate in different ways. + * + * o InventoryModel: All inventory models are merged into one inventory + * model. There are NO UIDs to offset, however. o CodeModel: The same model + * is used in each case, but instead of merging into the CodeModel itself, + * we merge into its contained CodeAssembly + * + * o ...? + * + * @param segment + * @throws RepositoryException + */ + private void mergeModels() throws RepositoryException + { + // First get the top node. + final URI segment = (URI) mergerUtils.getRootId(); + + // Get the models + final List children = mergerUtils.getRelated(segment, "contains"); + for (final URI child : children) + { + final String type = mergerUtils.getRDFAttribute(child, "kdmType"); + if (type == null) + { + LOG.error("Corrupt KDM file. No KDM Type for element " + child + ". Skipping."); + continue; + } + LOG.debug("Merging " + type); + + // Get the destination model (or CodeAssembly) + final URI dstModel = getDestinationModel(type); + mergeModelContents(dstModel, child, config.getMergeType(type)); + } + } + + /** + * Currently I have altered the compile phase to the "file oriented" view of + * the code, but as soon as the "object oriented" view is enabled this data + * will be lost. + * + * The complexity is that by merging new data, the UID offsets for elements + * will change. Since the offsets for nodes are currently written on the fly + * and there is no method for updating this data, we are left with a + * situation where the UID ranges are incorrect. + * + * @param node + * @return + * @throws RepositoryException + */ + private void mergeNode(Stack ancestors, URI node) throws RepositoryException + { + final URI globalParent = ancestors.peek(); + if (localIdMap.containsKey(node)) + { + throw new UnsupportedOperationException("Attempting to re-merge element " + node + " into parent " + globalParent); + } + + // Get the link:id + final Value id = getLinkId(node); + // final Value id = rdfUtils.getRDFAttributeValue(node, "link:id"); + + // final String type = rdfUtils.getRDFAttribute(node, + // KdmConstants.KdmPredicate.KDM_TYPE.toString()); + // if (type) + // + // + // factory.createLiteral(arg0) + + // If there is no ID, then no merging should take place. A special case + // is ActionElements + // in methods which DO have an id, which is handled below. + if (id == null) + { + noLinkId.add(node); + switch (config.getNoIdMergeType()) + { + case MergeConfig.COPY: + copy(globalParent, node, false); + return; + case MergeConfig.IGNORE: + return; + case MergeConfig.SINGLETON: + return; + case MergeConfig.MERGE: + LOG.error("Element missing link:id, cannot merge " + node); + return; + } + } + + // Is this id already within the global map? If it is not then + // it should be copied there. + if (!globals.containsId(globalParent, id)) + { + copy(globalParent, node, true); + + // Since we are merging with a parent which has already set a + // UID/lastUID combo, we need to record the new ranges + // for this element. Add the range to the deferred ranges. + if (hasUID(node)) + { + // int uid = Integer.parseInt(rdfUtils.getRDFAttribute(node, + // "UID")); + int uid = IntUtils.parseInt(mergerUtils.getRDFAttribute(node, "UID")); + final String luid = mergerUtils.getRDFAttribute(node, "lastUID"); + int lastUID = uid; + if (luid != null) + { + // lastUID = Integer.parseInt(luid); + lastUID = IntUtils.parseInt(luid); + } + uid += uidOffset; + lastUID += uidOffset; + if (uid > lastUID) + LOG.error("Invalid UID range found for " + node + " into parent " + globalParent); + if (lastUID < uid) + { + LOG.error("Invalid range for " + node + " (" + uid + "-" + lastUID + ")"); + } + + addDeferredRanges(ancestors, new Range(uid, lastUID)); + } + } + // Otherwise proceed with the merge + else + { + final KdmType type = KdmType.valueOfKdmString(mergerUtils.getRDFAttribute(node, KdmConstants.KdmPredicate.KDM_TYPE.toString())); + + // Record the global node ID in the localMap for lookups + // Required in both merge and singletons. + final URI globalNode = globals.get(globalParent, id); + localIdMap.put(node, globalNode); + reverseLocalIdMap.put(globalNode, node); + + // If this is a singleton type then it should only exist ONCE in the + // system. + // Singletons are used when the contents cannot merge normally, for + // example + // with ActionElements. + if (config.getMergeType(type.toString()) == MergeConfig.SINGLETON) + { + // If we are performing validation, we want to remember UIDs + if (validate) + { + final Value uid = mergerUtils.getRDFAttributeValue(node, "UID"); + if (uid != null) + { + validationData.setUid(node, uid); + } + } + return; + } + + // Default case, not a method. + { + // When merging, in most cases we are merely visiting children + // to see if they match up or new ones need copying. There are + // some cases where the data for an element needs updating, + // however. In these cases we need to record the statements + // somewhere that allows them to me merged together. + // Add them to said lists here... + // FIXME: I said add them + + // If we are performing validation, we want to remember UIDs + if (validate) + { + final Value uid = mergerUtils.getRDFAttributeValue(node, "UID"); + if (uid != null) + { + validationData.setUid(node, uid); + } + } + + // Get the children. Merge the child nodes with the global map. + final List children = mergerUtils.getRelated(node, "contains"); + for (final URI child : children) + { + ancestors.push(globalNode); + // If we are explicitly trying to copy, then copy + if (config.getMergeType(type.toString()) == MergeConfig.COPY) + { + // Copy, but do not "remember" the node IDs in the + // globals + // map, since we will not be merging with this data. + copy(globalNode, child, false); + } + // Fallback is to merge if possible + else + { + mergeNode(ancestors, child); + } + ancestors.pop(); + } + } + } + } + + /** + * + * @param roots + */ + public void setRoots(List roots) + { + // // Disabled for C. May re-enable for C++ + // structure.setRoots(roots); + } + + /** + * Enable enhanced data validation. This can be used to ensure that the + * input KDM is well formed. + * + * @param b + */ + public void setValidation(boolean b) + { + validate = b; + } + + /** + * Return true if this predicate/object indicates that it should not be + * added to the link file. This is done to reduce the size of the link file + * to something more manageable. + * + * @param predicate + * @return + */ + private boolean skip(URI predicate, Value object) + { + // If we are not writing the lightweight link file, then + // write everything. + if ((format & NO_FLOWS) == 0) + { + return false; + } + if (object instanceof URI) + { + return false; + } + final String pname = predicate.getLocalName(); + if ("kdmType".equals(pname)) + { + if (object.stringValue().contains("Flow")) + { + return true; + } + } + return false; + } + + /** + * Are we running in a modified mode where we should skip this child? + * + * @param object + * @return + * @throws RepositoryException + */ + private boolean skipChild(URI subject) throws RepositoryException + { + final String type = mergerUtils.getRDFAttribute(subject, KdmPredicate.KDM_TYPE.toString()); + if (type == null) + { + // This is actually bad, but I make too much noise on old KDM at the + // moment. This is also + // likely fixed, so consider making it an error later. + LOG.debug("Contained element missing type " + subject); + return false; + } + // Skip flows? + if (((format & NO_FLOWS) != 0) && type.endsWith("Flow")) + { + return true; + } + // Skip local variables? + if ((format & NO_LOCALS) != 0) + { + // Is this a local variable? + if (isLocalVariable(subject)) + { + return true; + } + // Is this a relationship to a local variable? + else + { + final URI to = mergerUtils.getRelatedValue(subject, KdmPredicate.TO.toString()); + if (to != null) + { + if (isLocalVariable(to)) + { + return true; + } + + } + } + } + + // System.err.println("Check: " + type + " " + subject); + return false; + } + /** + * Write the deferred SourceRef information. + * + * @param subject + * @param predicate + * @param object + */ + private void writeDeferredSourceRef(URI subject, URI predicate, Value object) + { + final StringBuilder newref = new StringBuilder(100); + String ref = object.stringValue(); + if (ref.trim().isEmpty()) + { + return; // Don't write empty SourceRefs + } + final String[] elements = commaSplitter.split(ref); + // For each SourceRef element + for (int i = 0; i < elements.length; i++) + { + // Translate the file reference. Copy the rest + final String[] components = semiColonSplitter.split(elements[i]); + if (components[0].trim().isEmpty()) + { + // Don't bother outputting source refs if there is no file + // reference AND no snippet + if ((components.length < 2) || !components[1].trim().isEmpty()) + { + continue; + } + + newref.append(elements[i]); + } + else + { + final URI o = new MergerURI(MergerURI.KdmModelNS, components[0]); + if (!localIdMap.containsKey(o)) + { + LOG.error("Missing translation object for URI " + o); + dumpContextLocation(subject, (URI) object); + } + else + { + newref.append(localIdMap.get(o).getLocalName()); + // Add the connection between the CompilationUnit/ClassUnit + // and the SourceFile + // // Disabled for C. May re-enable for C++ + // if(structure.contains(subject)) + // structure.addReference(subject, localIdMap.get(o)); + } + for (int j = 1; j < components.length; ++j) + { + newref.append(";").append(components[j]); + } + } + if (i < elements.length - 1) + { + newref.append(","); + } + } + ref = newref.toString(); + if (!ref.isEmpty()) + { + output.print(subject, predicate, new KdmLiteral(ref)); + } + } + + /** + * Write statements that were deferred until the new "object" URI could be + * identified. + * + * If we deferred a SourceRef it needs to be decomposed, redirected, then + * written. + * + * Other cases are more simple where the object just needs to be redirected. + * + */ + private void writeDeferredStatements() + { + for (final Statement stmt : deferredStatements) + { + final URI subject = (URI) stmt.getSubject(); + final URI predicate = stmt.getPredicate(); + final Value object = stmt.getObject(); + + final String pname = predicate.getLocalName(); + // Translate the compressed SourceRef. + if (KdmPredicate.SOURCEREF.toString().equals(pname)) + { + writeDeferredSourceRef(subject, predicate, object); + } + // Default handling, object should be translated + else + { + // Error out if the object cannot be translated + if (!localIdMap.containsKey(object)) + { + LOG.error("Missing translation object " + stmt.getObject() + " [has link:id - " + !noLinkId.contains(object) + "]"); + dumpContextLocation(subject, (URI) object); + } + else + { + output.print(subject, predicate, localIdMap.get(object)); + } + } + } + } + + public long getId() { + return id; + } +} + +/** + * Perform some advanced validation of merged data. + * + * @author Ken Duck + * + */ +class ValidationData +{ + + private static final Logger LOG = Logger.getLogger(RepositoryMerger.class); + + private final Map validation_relationshipFrom; + + /** + * + */ + private final Set validation_relationships; + + private final Map validation_relationshipTo; + + /** + * + */ + private final Map validation_uidMap; + + public ValidationData() + { + validation_uidMap = new THashMap(); + validation_relationships = new THashSet(); + validation_relationshipFrom = new THashMap(); + validation_relationshipTo = new THashMap(); + } + + private void addRelationship(URI rel) + { + validation_relationships.add(rel); + } + + public void addRelationshipType(URI rel, KdmType type) + { + throw new UnsupportedOperationException(); + } + + public void setRelationshipFrom(URI rel, URI from) + { + addRelationship(rel); + validation_relationshipFrom.put(rel, from); + } + + public void setRelationshipTo(URI rel, URI from) + { + addRelationship(rel); + validation_relationshipTo.put(rel, from); + } + + public void setUid(URI uri, Value uid) + { + validation_uidMap.put(uri, uid); + } + + /** + * Run tests to ensure validate the results of the merge to ensure that + * there are no anomalies. + */ + public void validate(Set noLinkId) + { + int relCount = 0; + // For each found relationship, ensure there are from and to sides, and + // that there are + // UIDs for each of these. + for (final URI rel : validation_relationships) + { + ++relCount; + if (validation_relationshipFrom.containsKey(rel)) + { + final URI endpoint = validation_relationshipFrom.get(rel); + if (!validation_uidMap.containsKey(endpoint)) + { + LOG.error("Missing UID for 'from' element " + endpoint + " [has link:id - " + !noLinkId.contains(endpoint) + "]"); + LOG.error(" Relationship: " + rel); + } + } + else + { + LOG.error("Missing from element for relationship " + rel); + } + if (validation_relationshipTo.containsKey(rel)) + { + final URI endpoint = validation_relationshipTo.get(rel); + if (!validation_uidMap.containsKey(endpoint)) + { + LOG.error("Missing UID for 'to' element " + endpoint + " [has link:id - " + !noLinkId.contains(endpoint) + "]"); + LOG.error(" Relationship: " + rel); + } + } + else + { + LOG.error("Missing to element for relationship " + rel); + } + } + + if (LOG.isDebugEnabled()) + { + LOG.debug("Relationships found: " + relCount); + } + } +} diff --git a/3rdParty/com.kdmanalytics.kdm.repositoryMerger/src/com/kdmanalytics/kdm/repositoryMerger/StatementWriter.java b/3rdParty/com.kdmanalytics.kdm.repositoryMerger/src/com/kdmanalytics/kdm/repositoryMerger/StatementWriter.java new file mode 100644 index 00000000..0ba111c1 --- /dev/null +++ b/3rdParty/com.kdmanalytics.kdm.repositoryMerger/src/com/kdmanalytics/kdm/repositoryMerger/StatementWriter.java @@ -0,0 +1,214 @@ + +package com.kdmanalytics.kdm.repositoryMerger; + +import java.io.PrintWriter; + +import org.apache.log4j.Logger; +import org.openrdf.model.URI; +import org.openrdf.model.Value; +import org.openrdf.repository.Repository; +import org.openrdf.repository.RepositoryConnection; +import org.openrdf.repository.RepositoryException; +import org.openrdf.rio.ntriples.NTriplesUtil; + +/** + * This is a utility class used to provide output assistance for various KDM + * output formats. + * + * Supported formats includes: + * + * o NTRIPLES o MODIFIED_NTRIPLES o Direct to a repository + * + */ +public class StatementWriter +{ + + private static final Logger LOG = Logger.getLogger(StatementWriter.class); + + /** + * In the repository output solution, repository connection is stored here + */ + private RepositoryConnection con; + + /** + * In the file output solution, output stream is here + */ + private PrintWriter output; + + /** + * The format we are storing in + */ + private int format; + + /** + * Number of statements written. + */ + long count = 0; + + /** + * + * @param out + * @param format + */ + public StatementWriter(PrintWriter out, int format) + { + this.output = out; + this.format = format; + } + + /** + * Make a statement writer that writes directly to a repository. + * + * @param repository + */ + public StatementWriter(Repository repository) + { + try + { + con = repository.getConnection(); + } + catch (RepositoryException e) + { + LOG.error("Exception writing repository", e); + } + } + + /** + * Call to dispose of any resources that were created for the writer + * purposes. Does not close or shutdown underlying streams or repositories. + */ + public void dispose() + { + if (con != null) + { + try + { + con.close(); + } + catch (RepositoryException e) + { + LOG.error("Exception disposing StatementWriter", e); + } + } + + con = null; + output = null; + } + + /** + * + * @param subject + * @param predicate + * @param object + */ + public void print(URI subject, URI predicate, Value object) + { + ++count; + // DIRECT to repository + if (con != null) + { + try + { + con.add(subject, predicate, object); + } + catch (RepositoryException e) + { + LOG.error("Exception writing repository", e); + } + } + else + { + if (output == null) + { + LOG.error("Attempting to write to disposed StatementWriter"); + return; + } + // NTRIPLES format + if ((format & RepositoryMerger.NTRIPLES) > 0) + { + StringBuilder sb = new StringBuilder(); + sb.append("<"); + sb.append(subject); + sb.append("> "); + sb.append("<"); + sb.append(predicate); + sb.append("> "); + if (object instanceof URI) + { + sb.append("<"); + sb.append(object); + sb.append("> ."); + } + else + { + sb.append("\""); + String str = object.stringValue(); + + // change all windows backslashes to forward slashes. + if ("path".equals(predicate.getLocalName())) + { + str = str.replace("\\", "/"); + } + + + str = NTriplesUtil.escapeString(str); + + sb.append(str); + sb.append("\" ."); + } + output.println(sb.toString()); + } + // COMPRESSED NTRIPLES format + else + { + StringBuilder sb = new StringBuilder(); + sb.append("<"); + sb.append(subject.getLocalName()); + sb.append("> "); + sb.append("<"); + sb.append(predicate.getLocalName()); + sb.append("> "); + if (object instanceof URI) + { + sb.append("<"); + sb.append(((URI) object).getLocalName()); + sb.append("> ."); + } + else + { + sb.append("\""); + String str = object.stringValue(); + + // change all windows backslashes to forward slashes. + if ("path".equals(predicate.getLocalName())) + { + str = str.replace("\\", "/"); + } + + str = NTriplesUtil.escapeString(str); + + sb.append(str); + sb.append("\" ."); + } + output.println(sb.toString()); + } + } + } + + /** + * Return the number of statements output at this point. + * + * @return + */ + public long getCount() + { + return count; + } + + public void close() + { + output.flush(); + output.close(); + } + +} diff --git a/3rdParty/com.kdmanalytics.kdm.repositoryMerger/src/com/kdmanalytics/kdm/repositoryMerger/Utilities/IntUtils.java b/3rdParty/com.kdmanalytics.kdm.repositoryMerger/src/com/kdmanalytics/kdm/repositoryMerger/Utilities/IntUtils.java new file mode 100644 index 00000000..305573cc --- /dev/null +++ b/3rdParty/com.kdmanalytics.kdm.repositoryMerger/src/com/kdmanalytics/kdm/repositoryMerger/Utilities/IntUtils.java @@ -0,0 +1,115 @@ +/** + * + */ + + + +package com.kdmanalytics.kdm.repositoryMerger.Utilities; + +import static com.google.common.base.Preconditions.checkNotNull; + +/** + * @author Kyle Girard + * + */ +public class IntUtils +{ + + /** + * Parses the string argument as a signed decimal integer. Faster than + * Integer.parseInt since it assumes radix 10 + * + * @param intString a String containing the int representation to be parsed + * + * @return the integer value represented by the argument in decimal. + */ + public static int parseIntChecked(final String intString) + { + //Ensure that we have + checkNotNull(intString, "A null string cannot be parsed"); + + // Check for a sign. + int num = 0; + int sign = -1; + final int len = intString.length(); + final char ch = intString.charAt(0); + if (ch == '-') + { + if (len == 1) + { + throw new NumberFormatException("Missing digits: " + intString); + } + sign = 1; + } + else + { + final int d = ch - '0'; + if ((d < 0) || (d > 9)) + { + throw new NumberFormatException("Malformed: " + intString); + } + num = -d; + } + + // Build the number. + final int max = (sign == -1) ? -Integer.MAX_VALUE : Integer.MIN_VALUE; + final int multmax = max / 10; + int i = 1; + while (i < len) + { + final int d = intString.charAt(i++) - '0'; + if ((d < 0) || (d > 9)) + { + throw new NumberFormatException("Malformed: " + intString); + } + if (num < multmax) + { + throw new NumberFormatException("Over/underflow: " + intString); + } + num *= 10; + if (num < (max + d)) + { + throw new NumberFormatException("Over/underflow: " + intString); + } + num -= d; + } + + return sign * num; + } + + /** + * Quick and dirt integer parsing. Faster than + * Integer.parseInt since it assumes radix 10. Use this function only when + * you know that your String really is an integer. + * + * @param intString a String containing the int representation to be parsed + * + * @return the integer value represented by the argument in decimal. + */ + public static int parseInt(final String intString) + { + // Check for a sign. + int num = 0; + int sign = -1; + final int len = intString.length(); + final char ch = intString.charAt(0); + if (ch == '-') + { + sign = 1; + } + else + { + num = '0' - ch; + } + + // Build the number. + int i = 1; + while (i < len) + { + num = num * 10 + '0' - intString.charAt(i++); + } + + return sign * num; + } + +} diff --git a/3rdParty/com.kdmanalytics.kdm.repositoryMerger/src/com/kdmanalytics/kdm/repositoryMerger/Utilities/KdmConstants.java b/3rdParty/com.kdmanalytics.kdm.repositoryMerger/src/com/kdmanalytics/kdm/repositoryMerger/Utilities/KdmConstants.java new file mode 100644 index 00000000..2be0901f --- /dev/null +++ b/3rdParty/com.kdmanalytics.kdm.repositoryMerger/src/com/kdmanalytics/kdm/repositoryMerger/Utilities/KdmConstants.java @@ -0,0 +1,579 @@ +/** + * + */ +package com.kdmanalytics.kdm.repositoryMerger.Utilities; + +import java.util.HashMap; +import java.util.Map; + +import org.openrdf.model.Literal; +import org.openrdf.model.URI; + + +/** + * @author adam + * + */ +public class KdmConstants +{ + + public enum KdmPredicate + { + STEREOTYPE("stereotype"), //$NON-NLS-1$ + CONTAINS("contains"), //$NON-NLS-1$ + KDM_TYPE("kdmType"), //$NON-NLS-1$ + NAME("name"), //$NON-NLS-1$ + TYPE("type"), //$NON-NLS-1$ + PATH("path"), //$NON-NLS-1$ + GROUP("__group"), //$NON-NLS-1$ + SOURCEREF("SourceRef"), //$NON-NLS-1$ + FROM("from"), //$NON-NLS-1$ + TO("to"), //$NON-NLS-1$ + FILE("file"), //$NON-NLS-1$ + ITEM("__item"), //$NON-NLS-1$ + INDEX("__index"), //$NON-NLS-1$ + SNIPPET("snippet"), //$NON-NLS-1$ + KIND("kind"), //$NON-NLS-1$ + EXPORT("export"), UUID("UUID"); //$NON-NLS-1$ + + private final String predicateString; + + private final URI predicateUri; + + KdmPredicate(String predicateName) + { + predicateString = predicateName; + + predicateUri = new MergerURI(MergerURI.KdmNS, predicateName); + } + + @Override + public String toString() + { + return predicateString; + } + + public URI toURI() + { + return predicateUri; + } + } + + public enum KdmType + { + // Models + BUILD_MODEL("build/BuildModel"), //$NON-NLS-1$ + CODE_MODEL("code/CodeModel"), //$NON-NLS-1$ + DATA_MODEL("data/DataModel"), //$NON-NLS-1$ + INVENTORY_MODEL("source/InventoryModel"), //$NON-NLS-1$ + PLATFORM_MODEL("platform/PlatformModel"), //$NON-NLS-1$ + STRUCTURE_MODEL("structure/StructureModel"), //$NON-NLS-1$ + CONCEPTUAL_MODEL("conceptual/ConceptualModel"), //$NON-NLS-1$ + EVENT_MODEL("event/EventModel"), //$NON-NLS-1$ + UI_MODEL("ui/UIModel"), //$NON-NLS-1$ + + // Core + ELEMENT("core/Element"), //$NON-NLS-1$ + KDM_ENTITY("core/KDMEntity"), //$NON-NLS-1$ + KDM_RELATIONSHIP("core/KDMRelationship"), //$NON-NLS-1$ + MODEL_ELEMENT("core/ModelElement"), //$NON-NLS-1$ + + // Kdm + ANNOTATION("kdm/Annotation"), //$NON-NLS-1$ + ATTRIBUTE("kdm/Attribute"), //$NON-NLS-1$ + AUDIT("kdm/Audit"), //$NON-NLS-1$ + EXTENDED_VALUE("kdm/ExtendedValue"), //$NON-NLS-1$ + EXTENSION_FAMILY("kdm/ExtensionFamily"), //$NON-NLS-1$ + SEGMENT("kdm/Segment"), //$NON-NLS-1$ + STEREOTYPE("kdm/Stereotype"), //$NON-NLS-1$ + TAG_DEFINITION("kdm/TagDefinition"), //$NON-NLS-1$ + TAGGED_REF("kdm/TaggedRef"), //$NON-NLS-1$ + TAGGED_VALUE("kdm/TaggedValue"), //$NON-NLS-1$ + + // Action + ACTION_ELEMENT("action/ActionElement"), //$NON-NLS-1$ + ACTION_RELATIONSHIP("action/ActionRelationship"), //$NON-NLS-1$ + ADDRESSES("action/Addresses"), //$NON-NLS-1$ + BLOCK_UNIT("action/BlockUnit"), //$NON-NLS-1$ + CALLS("action/Calls"), //$NON-NLS-1$ + CATCH_UNIT("action/CatchUnit"), //$NON-NLS-1$ + COMPLIES_TO("action/CompliesTo"), //$NON-NLS-1$ + CONTROL_FLOW("action/ControlFlow"), //$NON-NLS-1$ + CREATES("action/Creates"), //$NON-NLS-1$ + DISPATCHES("action/Dispatches"), //$NON-NLS-1$ + ENTRY_FLOW("action/EntryFlow"), //$NON-NLS-1$ + EXCEPTION_FLOW("action/ExceptionFlow"), //$NON-NLS-1$ + EXIT_FLOW("action/ExitFlow"), //$NON-NLS-1$ + FALSE_FLOW("action/FalseFlow"), //$NON-NLS-1$ + FINALLY_FLOW("action/FinallyFlow"), //$NON-NLS-1$ + FLOW("action/Flow"), //$NON-NLS-1$ + GUARDED_FLOW("action/GuardedFlow"), //$NON-NLS-1$ + READS("action/Reads"), //$NON-NLS-1$ + THROWS("action/Throws"), //$NON-NLS-1$ + TRUE_FLOW("action/TrueFlow"), //$NON-NLS-1$ + TRY_UNIT("action/TryUnit"), //$NON-NLS-1$ + USES_TYPE("action/UsesType"), //$NON-NLS-1$ + WRITES("action/Writes"), //$NON-NLS-1$ + + // Code + ARRAY_TYPE("code/ArrayType"), //$NON-NLS-1$ + BAG_TYPE("code/BagType"), //$NON-NLS-1$ + BITSTRING_TYPE("code/BitstringType"), //$NON-NLS-1$ + BIT_TYPE("code/BitType"), //$NON-NLS-1$ + BOOLEAN_TYPE("code/BooleanType"), //$NON-NLS-1$ + CALLABLE_KIND("code/CallableKind"), //$NON-NLS-1$ + CALLABLE_UNIT("code/CallableUnit"), //$NON-NLS-1$ + CHAR_TYPE("code/CharType"), //$NON-NLS-1$ + CHOICE_TYPE("code/ChoiceType"), //$NON-NLS-1$ + CLASS_UNIT("code/ClassUnit"), //$NON-NLS-1$ + CODE_ASSEMBLY("code/CodeAssembly"), //$NON-NLS-1$ + CODE_ELEMENT("code/CodeElement"), //$NON-NLS-1$ + CODE_ITEM("code/CodeItem"), //$NON-NLS-1$ + CODE_RELATIONSHIP("code/CodeRelationship"), //$NON-NLS-1$ + COMMENT_UNIT("code/CommentUnit"), //$NON-NLS-1$ + COMPILATION_UNIT("code/CompilationUnit"), //$NON-NLS-1$ + COMPOSITE_TYPE("code/CompositeType"), //$NON-NLS-1$ + COMPUTATIONAL_OBJECT("code/ComputationalObject"), //$NON-NLS-1$ + CONDITIONAL_DIRECTIVE("code/ConditionalDirective"), //$NON-NLS-1$ + CONTROL_ELEMENT("code/ControlElement"), //$NON-NLS-1$ + DATA_ELEMENT("code/DataElement"), //$NON-NLS-1$ + DATATYPE("code/Datatype"), //$NON-NLS-1$ + DATE_TYPE("code/DateType"), //$NON-NLS-1$ + DECIMAL_TYPE("code/DecimalType"), //$NON-NLS-1$ + DEFINED_TYPE("code/DefinedType"), //$NON-NLS-1$ + DERIVED_TYPE("code/DerivedType"), //$NON-NLS-1$ + ENUMERATED_TYPE("code/EnumeratedType"), //$NON-NLS-1$ + EXPANDS("code/Expands"), //$NON-NLS-1$ + EXPORT_KIND("code/ExportKind"), //$NON-NLS-1$ + EXTENDS("code/Extends"), //$NON-NLS-1$ + FLOAT_TYPE("code/FloatType"), //$NON-NLS-1$ + GENERATED_FROM("code/GeneratedFrom"), //$NON-NLS-1$ + HAS_TYPE("code/HasType"), //$NON-NLS-1$ + HAS_VALUE("code/HasValue"), //$NON-NLS-1$ + IMPLEMENTATION_OF("code/ImplementationOf"), //$NON-NLS-1$ + IMPLEMENTS("code/Implements"), //$NON-NLS-1$ + IMPORTS("code/Imports"), //$NON-NLS-1$ + INCLUDE_DIRECTIVE("code/IncludeDirective"), //$NON-NLS-1$ + INCLUDES("code/Includes"), //$NON-NLS-1$ + INDEX_UNIT("code/IndexUnit"), //$NON-NLS-1$ + INSTANCE_OF("code/InstanceOf"), //$NON-NLS-1$ + INTEGER_TYPE("code/IntegerType"), //$NON-NLS-1$ + INTERFACE_UNIT("code/InterfaceUnit"), //$NON-NLS-1$ + ITEM_UNIT("code/ItemUnit"), //$NON-NLS-1$ + LANGUAGE_UNIT("code/LanguageUnit"), //$NON-NLS-1$ + MACRO_DIRECTIVE("code/MacroDirective"), //$NON-NLS-1$ + MACRO_KIND("code/MacroKind"), //$NON-NLS-1$ + MACRO_UNIT("code/MacroUnit"), //$NON-NLS-1$ + MEMBER_UNIT("code/MemberUnit"), //$NON-NLS-1$ + METHOD_KIND("code/MethodKind"), //$NON-NLS-1$ + METHOD_UNIT("code/MethodUnit"), //$NON-NLS-1$ + MODULE("code/Module"), //$NON-NLS-1$ + NAMESPACE_UNIT("code/NamespaceUnit"), //$NON-NLS-1$ + OCTETSTRING_TYPE("code/OctetstringType"), //$NON-NLS-1$ + OCTET_TYPE("code/OctetType"), //$NON-NLS-1$ + ORDINAL_TYPE("code/OrdinalType"), //$NON-NLS-1$ + PACKAGE("code/Package"), //$NON-NLS-1$ + PARAMETER_KIND("code/ParameterKind"), //$NON-NLS-1$ + PARAMETER_TO("code/ParameterTo"), //$NON-NLS-1$ + PARAMETER_UNIT("code/ParameterUnit"), //$NON-NLS-1$ + POINTER_TYPE("code/PointerType"), //$NON-NLS-1$ + PREPROCESSOR_DIRECTIVE("code/PreprocessorDirective"), //$NON-NLS-1$ + PRIMITIVE_TYPE("code/PrimitiveType"), //$NON-NLS-1$ + RANGE_TYPE("code/RangeType"), //$NON-NLS-1$ + RECORD_TYPE("code/RecordType"), //$NON-NLS-1$ + REDEFINES("code/Redefines"), //$NON-NLS-1$ + SCALED_TYPE("code/ScaledType"), //$NON-NLS-1$ + SEQUENCE_TYPE("code/SequenceType"), //$NON-NLS-1$ + SET_TYPE("code/SetType"), //$NON-NLS-1$ + SHARED_UNIT("code/SharedUnit"), //$NON-NLS-1$ + SIGNATURE("code/Signature"), //$NON-NLS-1$ + STORABLE_KIND("code/StorableKind"), //$NON-NLS-1$ + STORABLE_UNIT("code/StorableUnit"), //$NON-NLS-1$ + STRING_TYPE("code/StringType"), //$NON-NLS-1$ + SYNONYM_TYPE("code/SynonymType"), //$NON-NLS-1$ + TEMPLATE_PARAMETER("code/TemplateParameter"), //$NON-NLS-1$ + TEMPLATE_TYPE("code/TemplateType"), //$NON-NLS-1$ + TEMPLATE_UNIT("code/TemplateUnit"), //$NON-NLS-1$ + TIME_TYPE("code/TimeType"), //$NON-NLS-1$ + TYPE_UNIT("code/TypeUnit"), //$NON-NLS-1$ + VALUE("code/Value"), //$NON-NLS-1$ + VALUE_ELEMENT("code/ValueElement"), //$NON-NLS-1$ + VALUE_LIST("code/ValueList"), //$NON-NLS-1$ + VARIANT_TO("code/VariantTo"), //$NON-NLS-1$ + VISIBLE_IN("code/VisibleIn"), //$NON-NLS-1$ + VOID_TYPE("code/VoidType"), //$NON-NLS-1$ + + // Source + BINARY_FILE("source/BinaryFile"), //$NON-NLS-1$ + CONFIGURATION("source/Configuration"), //$NON-NLS-1$ + DEPENDS_ON("source/DependsOn"), //$NON-NLS-1$ + DIRECTORY("source/Directory"), //$NON-NLS-1$ + EXECUTABLE_FILE("source/ExecutableFile"), //$NON-NLS-1$ + IMAGE("source/Image"), //$NON-NLS-1$ + INVENTORY_CONTAINER("source/InventoryContainer"), //$NON-NLS-1$ + INVENTORY_ELEMENT("source/InventoryElement"), //$NON-NLS-1$ + INVENTORY_ITEM("source/InventoryItem"), //$NON-NLS-1$ + INVENTORY_RELATIONSHIP("source/InventoryRelationship"), //$NON-NLS-1$ + PROJECT("source/Project"), //$NON-NLS-1$ + RESOURCE_DESCRIPTION("source/ResourceDescription"), //$NON-NLS-1$ + SOURCE_FILE("source/SourceFile"), //$NON-NLS-1$ + SOURCE_REF("source/SourceRef"), //$NON-NLS-1$ + SOURCE_REGION("source/SourceRegion"), //$NON-NLS-1$ + + // Data + ALL_CONTENT("data/AllContent"), //$NON-NLS-1$ + ANY_CONTENT("data/AnyContent"), //$NON-NLS-1$ + CATALOG("data/Catalog"), //$NON-NLS-1$ + CHOICE_CONTENT("data/ChoiceContent"), //$NON-NLS-1$ + COLUMN_SET("data/ColumnSet"), //$NON-NLS-1$ + COMPLEX_CONTENT_TYPE("data/ComplexContentType"), //$NON-NLS-1$ + CONTENT_ATTRIBUTE("data/ContentAttribute"), //$NON-NLS-1$ + CONTENT_ELEMENT("data/ContentElement"), //$NON-NLS-1$ + CONTENT_ITEM("data/ContentItem"), //$NON-NLS-1$ + CONTENT_REFERENCE("data/ContentReference"), //$NON-NLS-1$ + CONTENT_RESTRICTION("data/ContentRestriction"), //$NON-NLS-1$ + DATA_ACTION("data/DataAction"), //$NON-NLS-1$ + DATA_CONTAINER("data/DataContainer"), //$NON-NLS-1$ + DATA_EVENT("data/DataEvent"), //$NON-NLS-1$ + DATA_RELATIONSHIP("data/DataRelationship"), //$NON-NLS-1$ + DATA_RESOURCE("data/DataResource"), //$NON-NLS-1$ + DATA_SEGMENT("data/DataSegment"), //$NON-NLS-1$ + DATATYPE_OF("data/DatatypeOf"), //$NON-NLS-1$ + EXTENDED_DATA_ELEMENT("data/ExtendedDataElement"), //$NON-NLS-1$ + EXTENSION_TO("data/ExtensionTo"), //$NON-NLS-1$ + GROUP_CONTENT("data/GroupContent"), //$NON-NLS-1$ + HAS_CONTENT("data/HasContent"), //$NON-NLS-1$ + INDEX("data/Index"), //$NON-NLS-1$ + INDEX_ELEMENT("data/IndexElement"), //$NON-NLS-1$ + KEY_RELATION("data/KeyRelation"), //$NON-NLS-1$ + MANAGES_DATA("data/ManagesData"), //$NON-NLS-1$ + MIXED_CONTENT("data/MixedContent"), //$NON-NLS-1$ + PRODUCES_DATA_ELEMENT("data/ProducesDataElement"), //$NON-NLS-1$ + READS_COLUMN_SET("data/ReadsColumnSet"), //$NON-NLS-1$ + RECORD_FILE("data/RecordFile"), //$NON-NLS-1$ + REFERENCE_KEY("data/ReferenceKey"), //$NON-NLS-1$ + REFERENCE_TO("data/ReferenceTo"), //$NON-NLS-1$ + RELATIONAL_SCHEMA("data/RelationalSchema"), //$NON-NLS-1$ + RELATIONAL_TABLE("data/RelationalTable"), //$NON-NLS-1$ + RELATIONAL_VIEW("data/RelationalView"), //$NON-NLS-1$ + RESTRICTION_OF("data/RestrictionOf"), //$NON-NLS-1$ + SEQ_CONTENT("data/SeqContent"), //$NON-NLS-1$ + SIMPLE_CONTENT_TYPE("data/SimpleContentType"), //$NON-NLS-1$ + TRIGGER("data/Trigger"), //$NON-NLS-1$ + TYPED_BY("data/TypedBy"), //$NON-NLS-1$ + UNIQUE_KEY("data/UniqueKey"), //$NON-NLS-1$ + WRITES_COLUMN_SET("data/WritesColumnSet"), //$NON-NLS-1$ + XML_SCHEMA("data/XMLSchema"), //$NON-NLS-1$ + + // Structure + ARCHITECTURE_VIEW("structure/ArchitectureView"), //$NON-NLS-1$ + COMPONENT("structure/Component"), //$NON-NLS-1$ + LAYER("structure/Layer"), //$NON-NLS-1$ + SOFTWARE_SYSTEM("structure/SoftwareSystem"), //$NON-NLS-1$ + STRUCTURE_ELEMENT("structure/StructureElement"), //$NON-NLS-1$ + STRUCTURE_RELATIONSHIP("structure/StructureRelationship"), //$NON-NLS-1$ + SUBSYSTEM("structure/Subsystem"), //$NON-NLS-1$ + + // Build + BUILD_COMPONENT("build/BuildComponent"), //$NON-NLS-1$ + BUILD_DESCRIPTION("build/BuildDescription"), //$NON-NLS-1$ + BUILD_ELEMENT("build/BuildElement"), //$NON-NLS-1$ + BUILD_PRODUCT("build/BuildProduct"), //$NON-NLS-1$ + BUILD_RELATIONSHIP("build/BuildRelationship"), //$NON-NLS-1$ + BUILD_RESOURCE("build/BuildResource"), //$NON-NLS-1$ + BUILD_STEP("build/BuildStep"), //$NON-NLS-1$ + CONSUMES("build/Consumes"), //$NON-NLS-1$ + DESCRIBED_BY("build/DescribedBy"), //$NON-NLS-1$ + LIBRARY("build/Library"), //$NON-NLS-1$ + LINKS_TO("build/LinksTo"), //$NON-NLS-1$ + PRODUCES("build/Produces"), //$NON-NLS-1$ + SUPPLIED_BY("build/SuppliedBy"), //$NON-NLS-1$ + SUPPLIER("build/Supplier"), //$NON-NLS-1$ + SUPPORTED_BY("build/SupportedBy"), //$NON-NLS-1$ + SYMBOLIC_LINK("build/SymbolicLink"), //$NON-NLS-1$ + TOOL("build/Tool"), //$NON-NLS-1$ + + // Conceptual + BEHAVIOR_UNIT("conceptual/BehaviorUnit"), //$NON-NLS-1$ + CONCEPTUAL_CONTAINER("conceptual/ConceptualContainer"), //$NON-NLS-1$ + CONCEPTUAL_ELEMENT("conceptual/ConceptualElement"), //$NON-NLS-1$ + CONCEPTUAL_FLOW("conceptual/ConceptualFlow"), //$NON-NLS-1$ + CONCEPTUAL_RELATIONSHIP("conceptual/ConceptualRelationship"), //$NON-NLS-1$ + CONCEPTUAL_ROLE("conceptual/ConceptualRole"), //$NON-NLS-1$ + FACT_UNIT("conceptual/FactUnit"), //$NON-NLS-1$ + RULE_UNIT("conceptual/RuleUnit"), //$NON-NLS-1$ + SCENARIO_UNIT("conceptual/ScenarioUnit"), //$NON-NLS-1$ + TERM_UNIT("conceptual/TermUnit"), //$NON-NLS-1$ + + // Event + CONSUMES_EVENT("event/ConsumesEvent"), //$NON-NLS-1$ + EVENT("event/Event"), //$NON-NLS-1$ + EVENT_ACTION("event/EventAction"), //$NON-NLS-1$ + EVENT_ELEMENT("event/EventElement"), //$NON-NLS-1$ + EVENT_RELATIONSHIP("event/EventRelationship"), //$NON-NLS-1$ + EVENT_RESOURCE("event/EventResource"), //$NON-NLS-1$ + HAS_STATE("event/HasState"), //$NON-NLS-1$ + INITIAL_STATE("event/InitialState"), //$NON-NLS-1$ + NEXT_STATE("event/NextState"), //$NON-NLS-1$ + ON_ENTRY("event/OnEntry"), //$NON-NLS-1$ + ON_EXIT("event/OnExit"), //$NON-NLS-1$ + PRODUCES_EVENT("event/ProducesEvent"), //$NON-NLS-1$ + READS_STATE("event/ReadsState"), //$NON-NLS-1$ + STATE("event/State"), //$NON-NLS-1$ + TRANSITION("event/Transition"), //$NON-NLS-1$ + + // Platform + BINDS_TO("platform/BindsTo"), //$NON-NLS-1$ + DATA_MANAGER("platform/DataManager"), //$NON-NLS-1$ + DEFINED_BY("platform/DefinedBy"), //$NON-NLS-1$ + DEPLOYED_COMPONENT("platform/DeployedComponent"), //$NON-NLS-1$ + DEPLOYED_RESOURCE("platform/DeployedResource"), //$NON-NLS-1$ + DEPLOYED_SOFTWARE_SYSTEM("platform/DeployedSoftwareSystem"), //$NON-NLS-1$ + EXECUTION_RESOURCE("platform/ExecutionResource"), //$NON-NLS-1$ + EXTERNAL_ACTOR("platform/ExternalActor"), //$NON-NLS-1$ + FILE_RESOURCE("platform/FileResource"), //$NON-NLS-1$ + LOADS("platform/Loads"), //$NON-NLS-1$ + LOCK_RESOURCE("platform/LockResource"), //$NON-NLS-1$ + MACHINE("platform/Machine"), //$NON-NLS-1$ + MANAGES_RESOURCE("platform/ManagesResource"), //$NON-NLS-1$ + MARSHALLED_RESOURCE("platform/MarshalledResource"), //$NON-NLS-1$ + MESSAGING_RESOURCE("platform/MessagingResource"), //$NON-NLS-1$ + NAMING_RESOURCE("platform/NamingResource"), //$NON-NLS-1$ + PLATFORM_ACTION("platform/PlatformAction"), //$NON-NLS-1$ + PLATFORM_ELEMENT("platform/PlatformElement"), //$NON-NLS-1$ + PLATFORM_EVENT("platform/PlatformEvent"), //$NON-NLS-1$ + PLATFORM_RELATIONSHIP("platform/PlatformRelationship"), //$NON-NLS-1$ + PROCESS("platform/Process"), //$NON-NLS-1$ + READS_RESOURCE("platform/ReadsResource"), //$NON-NLS-1$ + REQUIRES("platform/Requires"), //$NON-NLS-1$ + RESOURCE_TYPE("platform/ResourceType"), //$NON-NLS-1$ + RUNTIME_RESOURCE("platform/RuntimeResource"), //$NON-NLS-1$ + SPAWNS("platform/Spawns"), //$NON-NLS-1$ + STREAM_RESOURCE("platform/StreamResource"), //$NON-NLS-1$ + THREAD("platform/Thread"), //$NON-NLS-1$ + WRITES_RESOURCE("platform/WritesResource"), //$NON-NLS-1$ + + // UI + DISPLAYS("ui/Displays"), //$NON-NLS-1$ + DISPLAYS_IMAGE("ui/DisplaysImage"), //$NON-NLS-1$ + MANAGES_UI("ui/ManagesUI"), //$NON-NLS-1$ + READS_UI("ui/ReadsUI"), //$NON-NLS-1$ + REPORT("ui/Report"), //$NON-NLS-1$ + SCREEN("ui/Screen"), //$NON-NLS-1$ + UI_ACTION("ui/UIAction"), //$NON-NLS-1$ + UI_DISPLAY("ui/UIDisplay"), //$NON-NLS-1$ + UI_ELEMENT("ui/UIElement"), //$NON-NLS-1$ + UI_EVENT("ui/UIEvent"), //$NON-NLS-1$ + UI_FIELD("ui/UIField"), //$NON-NLS-1$ + UI_FLOW("ui/UIFlow"), //$NON-NLS-1$ + UI_LAYOUT("ui/UILayout"), //$NON-NLS-1$ + UI_RELATIONSHIP("ui/UIRelationship"), //$NON-NLS-1$ + UI_RESOURCE("ui/UIResource"), //$NON-NLS-1$ + WRITES_UI("ui/WritesUI"); //$NON-NLS-1$ + + private static final Map defaultTypeMap = new HashMap(); + + static + { + for (KdmType t : KdmType.values()) + { + defaultTypeMap.put(t.toString(), t); + } + } + + private final String typeString; + + private Literal typeLiteral; + + KdmType(String aTypename) + { + typeString = aTypename; + typeLiteral = new KdmLiteral(aTypename); + } + + public static KdmType valueOfKdmString(String kdmTypeString) + { + return defaultTypeMap.get(kdmTypeString); + } + + public Literal toLiteral() + { + return typeLiteral; + + } + + @Override + public String toString() + { + return typeString; + } + } + + public enum WorkbenchPredicate + { + UID("UID"), LAST_UID("lastUID"), WORKBENCH_RANGES("__KNT_UIDs"), LINK_ID("link:id"), LINK_SRC("link:src"), LINK_SNK("link:snk"); + + private final String predicateString; + + private final URI predicateUri; + + WorkbenchPredicate(String predicateName) + { + predicateString = predicateName; + predicateUri = new MergerURI(MergerURI.KdmNS, predicateName); + // predicateUri = + // SimpleValueFactory.getSimpleValueFactory().createURI(SimpleURI.kdmNS, + // predicateName); + } + + @Override + public String toString() + { + return predicateString; + } + + public URI toURI() + { + return predicateUri; + } + + } + + public enum WorkbenchStereotype + { + /** + * Elements that the Workbench should not display are stereotyped as + * hidden. + */ + HIDDEN("__HIDDEN__"), + /** + * KDM's specially managed Structure Models should be stereotyped in a + * special way. This allows us to know which models we should do + * additional processing for inside the various probes. + */ + MANAGED_STRUCTURE_MODEL("__MANAGED__"), + + /** + * Elements that the Workbench should not delete are stereotyped as + * undeletable + */ + CANNOT_DELETE_MODEL("__UNDELETABLE__"), + /** + * User created models are marked because they have some special + * functionality, such as special persistence into future builds. + */ + USER_MODEL("__USER_MODEL__"), + /** + * Mark a node as containing user data. This is required for proper + * persistence between builds. + */ + USER_DATA("__USER_DATA__"), + /** + * Indicate the model was created by the API agent + */ + API_AGENT_MODEL("__API_AGENT_MODEL__"), + /** + * Set to indicate we are overriding the UID. On load of such a model, + * the target UID is discovered through various heuristics. + */ + UID_OVERRIDE("__UID_OVERRIDE__"), + /** + * Indicate the model was created by the Overview agent + */ + OVERVIEW_AGENT_MODEL("__OVERVIEW_AGENT_MODEL__"), + + /** + * Indicates that the aggregated relationships have been pre-calculated + * for this diagram + */ + CACHED_AGGREGATES("__CACHED_AGGREGATED_RELATIONSHIPS__"), + + /** + * Indicates that this is a generated model such as an Overview or API + * model. + */ + GENERATED_MODEL("__GENERATED_MODEL__"), + + /** + * + */ + REFERS_TO("__REFERS_TO__"), + + COMPILE("COMPILE"), ARCHIVE("ARCHIVE"), LINK("LINK"), + + /** + * Indicates that the UIDs have been refined (specified) below this + * level, where normally they would not. + */ + REFINED("__REFINED__"), + + /** + * Indicates that the specified platform resource has content defined by + * the specified data resource. + */ + HAS_CONTENT("__HAS_CONTENT__"), + + /** + * The default context indicates to workbench which model is the + * preferred owner model for elements that do not have a prescribed + * context. + */ + DEFAULT_CONTEXT("__DEFAULT_CONTEXT__"); + + private String stereoTypeName; + + private Literal stereoTypeLiteral; + + /** + * A map with which we can get matching Stereotypes for strings. + */ + private static final Map defaultTypeMap = new HashMap(); + + /** + * Initialise the lookup table. + */ + static + { + for (WorkbenchStereotype t : WorkbenchStereotype.values()) + { + defaultTypeMap.put(t.toString(), t); + } + } + + /** + * + * @param name + */ + WorkbenchStereotype(String name) + { + stereoTypeName = name; + stereoTypeLiteral = new KdmLiteral(name); + } + + /** + * Get the stereotype that matches the string + * + * @param kdmTypeString + * @return + */ + public static WorkbenchStereotype valueOfKdmString(String kdmTypeString) + { + return defaultTypeMap.get(kdmTypeString); + } + + public Literal toLiteral() + { + return stereoTypeLiteral; + } + + /** + * + */ + @Override + public String toString() + { + return stereoTypeName; + } + + } +} diff --git a/3rdParty/com.kdmanalytics.kdm.repositoryMerger/src/com/kdmanalytics/kdm/repositoryMerger/Utilities/KdmLiteral.java b/3rdParty/com.kdmanalytics.kdm.repositoryMerger/src/com/kdmanalytics/kdm/repositoryMerger/Utilities/KdmLiteral.java new file mode 100644 index 00000000..87ef9aa8 --- /dev/null +++ b/3rdParty/com.kdmanalytics.kdm.repositoryMerger/src/com/kdmanalytics/kdm/repositoryMerger/Utilities/KdmLiteral.java @@ -0,0 +1,164 @@ +/** + * + */ + +package com.kdmanalytics.kdm.repositoryMerger.Utilities; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.math.BigInteger; + +import javax.xml.datatype.XMLGregorianCalendar; + +import org.openrdf.model.Literal; +import org.openrdf.model.URI; +import org.openrdf.model.Value; + +/** + * @author adam + * + */ +public class KdmLiteral implements Literal, Value, Comparable, Serializable +{ + + /** + * + */ + private static final long serialVersionUID = 1L; + + protected String buf = null; + + /** + * + * @param value + */ + public KdmLiteral(String value) + { + // Use the canonical version to save space -- but costs time + // this.buf = value.intern(); + this.buf = value; + } + + @Override + public boolean booleanValue() + { + return Boolean.parseBoolean(buf); + } + + @Override + public byte byteValue() + { + return Byte.parseByte(buf); + } + + @Override + public XMLGregorianCalendar calendarValue() + { + throw new UnsupportedOperationException(); + } + + @Override + public BigDecimal decimalValue() + { + return new BigDecimal(buf); + } + + @Override + public double doubleValue() + { + return Double.parseDouble(buf); + } + + @Override + public float floatValue() + { + return Float.parseFloat(buf); + } + + @Override + public URI getDatatype() + { + return null; + } + + @Override + public String getLabel() + { + return buf; + } + + @Override + public String getLanguage() + { + return null; + } + + @Override + public int intValue() + { + // return Integer.parseInt(buf); + return IntUtils.parseInt(buf); + } + + @Override + public BigInteger integerValue() + { + return new BigInteger(buf); + } + + @Override + public long longValue() + { + return Long.parseLong(buf); + } + + @Override + public short shortValue() + { + return Short.parseShort(buf); + } + + @Override + public String stringValue() + { + return buf; + } + + @Override + public int hashCode() + { + return buf.hashCode(); + } + + /** + * Assume we are sent a value to compare with. If not then this will fail + * most grievously. + * + */ + @Override + public boolean equals(Object o) + { + Value val = (Value) o; + return buf.equals(val.stringValue()); + } + + /** + * Assume we are sent a value to compare with. If not then this will fail + * most grievously. + * + */ + @Override + public int compareTo(Value val) + { + return buf.compareTo(val.stringValue()); + } + + /** + * + */ + @Override + public String toString() + { + return "\"" + buf + "\""; + } +} diff --git a/3rdParty/com.kdmanalytics.kdm.repositoryMerger/src/com/kdmanalytics/kdm/repositoryMerger/Utilities/MergerURI.java b/3rdParty/com.kdmanalytics.kdm.repositoryMerger/src/com/kdmanalytics/kdm/repositoryMerger/Utilities/MergerURI.java new file mode 100644 index 00000000..4ffba5f1 --- /dev/null +++ b/3rdParty/com.kdmanalytics.kdm.repositoryMerger/src/com/kdmanalytics/kdm/repositoryMerger/Utilities/MergerURI.java @@ -0,0 +1,126 @@ +/** + * + */ + +package com.kdmanalytics.kdm.repositoryMerger.Utilities; + +import org.openrdf.model.Literal; +import org.openrdf.model.URI; + +/** + * @author adam + * + */ +public class MergerURI implements URI +{ + + private static final long serialVersionUID = 350068407482600064L; + + public static String KdmNS = "http://org.omg.kdm/"; + + public static String KdmModelNS = "http://kdmanalytics.com/"; + + public static final String WORKBENCH_EXTENSION = "__WORKBENCH__"; + + public static final Literal WORKBENCH_EXTENSION_LITERAL = getLiteral(WORKBENCH_EXTENSION); + + private String name; + + private String nameSpace; + + /** + * + * @param ns + * @param name + */ + public MergerURI(String ns, String name) + { + this.name = name; + this.nameSpace = ns; + + } + + /** + * Generate a URI for the specified name + * + * @param name + * @return + */ + private static Literal getLiteral(String name) + { + return new KdmLiteral(name); + } + + /** + * Big assumption: In KDM, currently, the namespace is not important so I am + * not using it in my comparisons. + * + */ + @Override + public boolean equals(Object o) + { + if (o instanceof MergerURI) + { + final MergerURI other = (MergerURI) o; + return other.getLocalName().equals(name); + } + + if (o instanceof URI) + { + return ((URI) o).getLocalName().equals(name); + } + + return false; + } + + /** + * (non-Javadoc) + * + * @see org.openrdf.model.URI#getLocalName() + */ + @Override + public String getLocalName() + { + return name; + } + + /** + * (non-Javadoc) + * + * @see org.openrdf.model.URI#getNamespace() + */ + @Override + public String getNamespace() + { + return nameSpace; + } + + /** + * + */ + @Override + public final int hashCode() + { + return toString().hashCode(); + } + + /** + * (non-Javadoc) + * + * @see org.openrdf.model.Value#stringValue() + */ + @Override + public String stringValue() + { + return nameSpace + name; + } + + /** + * + */ + @Override + public String toString() + { + return stringValue(); + } +} diff --git a/3rdParty/com.kdmanalytics.kdm.repositoryMerger/src/com/kdmanalytics/kdm/repositoryMerger/Utilities/MergerUtilities.java b/3rdParty/com.kdmanalytics.kdm.repositoryMerger/src/com/kdmanalytics/kdm/repositoryMerger/Utilities/MergerUtilities.java new file mode 100644 index 00000000..3d023b4a --- /dev/null +++ b/3rdParty/com.kdmanalytics.kdm.repositoryMerger/src/com/kdmanalytics/kdm/repositoryMerger/Utilities/MergerUtilities.java @@ -0,0 +1,320 @@ + +package com.kdmanalytics.kdm.repositoryMerger.Utilities; + +import info.aduna.iteration.CloseableIteration; + +import java.util.ArrayList; +import java.util.List; + +import org.openrdf.model.Resource; +import org.openrdf.model.Statement; +import org.openrdf.model.URI; +import org.openrdf.model.Value; +import org.openrdf.model.ValueFactory; +import org.openrdf.repository.Repository; +import org.openrdf.repository.RepositoryConnection; +import org.openrdf.repository.RepositoryException; + +public class MergerUtilities +{ + + private Repository repository; + + /** + * + * @param repository + */ + public MergerUtilities(Repository repository) + { + this.repository = repository; + + } + + /** + * + * @param + * @param + * @param iter + */ + private void closeQuietly(CloseableIteration iter) + { + try + { + if (iter != null) + { + iter.close(); + } + } + catch (final Exception e) + { + // TODO: Log + } + + } + + /** + * + * @param con + */ + private void closeQuietly(RepositoryConnection con) + { + try + { + if (con != null) + { + con.close(); + } + } + catch (final RepositoryException e) + { + // TODO:Log + } + } + + /** + * + * @param + * @param + * @param con + * @param statements + */ + private void closeQuietly(RepositoryConnection con, CloseableIteration statements) + { + closeQuietly(statements); + closeQuietly(con); + } + + /** + * Return the URI for the owner of the specified element. + * + * @param uri + * @return First found parent URI, or null if no parent found. An error is + * written to stderr if there is more then one parent found. + * @throws RepositoryException + */ + public URI getOwner(URI uri) throws RepositoryException + { + final ValueFactory f = repository.getValueFactory(); + final URI predicate = f.createURI(MergerURI.KdmNS + "contains"); + + CloseableIteration statements = null; + RepositoryConnection con = null; + + try + { + con = repository.getConnection(); + statements = con.getStatements(null, predicate, uri, false); + + URI result = null; + while (statements.hasNext()) + { + final Statement st = statements.next(); + if (result == null) + { + result = (URI) st.getSubject(); + } + else + { + // TODO:LOG.error("Element has more then one parent (" + uri + // + ", " + result + "," + st.getSubject() + ")"); + } + return (URI) st.getSubject(); + + } + return result; + } + finally + { + closeQuietly(con, statements); + } + } + + /** + * Simple function that creates a predicate based on the provided string + * predicate name. + * + * @param pred + * @return + */ + protected URI getPredicate(String pred) + { + final ValueFactory f = repository.getValueFactory(); + return f.createURI(MergerURI.KdmNS, pred); + } + + /** + * Returns the requested RDF Attribute as a string value. + * + * @param id + * @param name + * @return + * @throws RepositoryException + */ + public String getRDFAttribute(URI id, String name) throws RepositoryException + { + return getRDFAttribute(id, name, null); + } + + /** + * Returns the requested RDF Attribute as a string value. This version is + * used for the rare cases when a context is used. + * + * @param id + * @param name + * @param context + * @return + * @throws RepositoryException + */ + public String getRDFAttribute(URI id, String name, Value context) throws RepositoryException + { + final Value value = getRDFAttributeValue(id, name); + if (value == null) + { + return null; + } + return value.stringValue(); + } + + /** + * Same as getRDFAttribute, but returns the result as a "Value" as opposed + * to a "String". + * + * @param name + * @param name + * @return + * @throws RepositoryException + */ + public Value getRDFAttributeValue(URI source, String name) throws RepositoryException + { + if (source == null) + { + // TODO: log + return null; + } + final ValueFactory f = repository.getValueFactory(); + final URI predicate = f.createURI(MergerURI.KdmNS, name); + RepositoryConnection con = null; + CloseableIteration statements = null; + + try + { + con = repository.getConnection(); + statements = con.getStatements(source, predicate, null, false); + + if (statements.hasNext()) + { + final Statement st = statements.next(); + return st.getObject(); + } + } + finally + { + closeQuietly(con, statements); + } + return null; + } + + /** + * Return the entities that are related in any way + * + * @param id + * @param predicate + * @return + */ + public CloseableIteration getRelated(Value id) throws RepositoryException + { + + RepositoryConnection con = null; + try + { + con = repository.getConnection(); + return con.getStatements((Resource) id, null, null, false); + } + finally + { + closeQuietly(con); + } + } + + /** + * Return the entities that are related in the specified manner + * + * @param id + * @param predicate + * @return + */ + public List getRelated(Value id, String predicate) throws RepositoryException + { + final ArrayList results = new ArrayList(); + CloseableIteration statements = null; + + RepositoryConnection con = null; + try + { + con = repository.getConnection(); + + URI predicate2 = getPredicate(predicate); + statements = con.getStatements((Resource) id, predicate2, null, true, (Resource) null); + while (statements.hasNext()) + { + final Statement st = statements.next(); + final URI result = (URI) st.getObject(); + results.add(result); + } + } + finally + { + closeQuietly(con, statements); + } + + return results; + } + + /** + * Return the entities that are related in the specified manner + * + * @param id + * @param predicate + * @return + */ + public URI getRelatedValue(Value id, String predicate) throws RepositoryException + { + CloseableIteration statements = null; + RepositoryConnection con = null; + try + { + con = repository.getConnection(); + statements = con.getStatements((Resource) id, getPredicate(predicate), null, false); + if (statements.hasNext()) + { + final Statement st = statements.next(); + final Value val = st.getObject(); + if (val instanceof URI) + { + return (URI) st.getObject(); + } + // TODO: Log + } + } + finally + { + closeQuietly(con, statements); + } + return null; + } + + /** + * Get the root element for the specified context + * + * @param context + * @return + * @throws RepositoryException + */ + public Value getRootId() throws RepositoryException + { + ValueFactory f = repository.getValueFactory(); + Value segmentURI = f.createURI("http://kdmanalytics.com/", Long.toString(0)); + return segmentURI; + } + +} diff --git a/3rdParty/com.kdmanalytics.kdm.repositoryMerger/src/com/kdmanalytics/kdm/repositoryMerger/Utilities/NullArgumentException.java b/3rdParty/com.kdmanalytics.kdm.repositoryMerger/src/com/kdmanalytics/kdm/repositoryMerger/Utilities/NullArgumentException.java new file mode 100644 index 00000000..6c310283 --- /dev/null +++ b/3rdParty/com.kdmanalytics.kdm.repositoryMerger/src/com/kdmanalytics/kdm/repositoryMerger/Utilities/NullArgumentException.java @@ -0,0 +1,26 @@ +package com.kdmanalytics.kdm.repositoryMerger.Utilities; + +/** + * Simple subclass of IllegalArguemntException + * + * Gives a little more info than the standards IllegalArgumentException + * + * @author Kyle Girard + * + */ +public class NullArgumentException extends IllegalArgumentException +{ + /** + * Required for serialization support. + * + * @see java.io.Serializable + */ + private static final long serialVersionUID = 1174360235354917591L; + + + public NullArgumentException(String argName) + { + super((argName == null ? "Argument" : argName) + " must not be null."); + } + +} diff --git a/3rdParty/com.kdmanalytics.kdm.repositoryMerger/src/com/kdmanalytics/kdm/repositoryMerger/Utilities/StringTokenIterator.java b/3rdParty/com.kdmanalytics.kdm.repositoryMerger/src/com/kdmanalytics/kdm/repositoryMerger/Utilities/StringTokenIterator.java new file mode 100644 index 00000000..2babfd53 --- /dev/null +++ b/3rdParty/com.kdmanalytics.kdm.repositoryMerger/src/com/kdmanalytics/kdm/repositoryMerger/Utilities/StringTokenIterator.java @@ -0,0 +1,110 @@ +package com.kdmanalytics.kdm.repositoryMerger.Utilities; +import java.util.Iterator; +/** + * Extremely simple StringTokenizer. Tokenizes a string on a single character. + * + * You can set a boolean to true preserve all tokens or false to skip empty + * tokens + * + * @author Kyle Girard + * + */ +public class StringTokenIterator implements Iterable, Iterator +{ + private char delim; + + private String srcString; + + int srcStringLength; + + int startIndex; + + int endIndex; + + boolean match; + + boolean lastMatch; + + boolean preserveTokens; + + /** Create a StringTokenIterator + * + * @param sourceString String to be tokenized + * @param delimiter + * @param preserveAllTokens Should the delimeter be preserved + */ + public StringTokenIterator(String sourceString, char delimiter, boolean preserveAllTokens) + { + if (sourceString == null) + { + throw new NullArgumentException("aString"); + } + + if (sourceString.isEmpty()) + { + throw new IllegalArgumentException("'sourceString' cannot be an empty String"); + } + + lastMatch = false; + match = false; + startIndex = 0; + endIndex = 0; + srcString = sourceString; + srcStringLength = srcString.length(); + delim = delimiter; + preserveTokens = preserveAllTokens; + } + + @Override + public Iterator iterator() + { + return this; + } + + @Override + public boolean hasNext() + { + if (endIndex > srcStringLength) + { + return false; + } + + while (endIndex < srcStringLength) + { + if (srcString.charAt(endIndex) == delim) + { + if (match || preserveTokens) + { + return true; + } + startIndex = ++endIndex; + continue; + } + match = true; + lastMatch = false; + ++endIndex; + } + return (match || (preserveTokens && lastMatch)); + } + + @Override + public String next() + { + String retStr; + if (startIndex == 0 && endIndex == 0) + { + hasNext(); + } + retStr = srcString.substring(startIndex, endIndex); + match = false; + lastMatch = true; + startIndex = ++endIndex; + return retStr; + } + + @Override + public void remove() + { + throw new UnsupportedOperationException("Remove not supported"); + } +} diff --git a/3rdParty/com.kdmanalytics.kdm.repositoryMerger/src/com/kdmanalytics/kdm/repositoryMerger/linkconfig/FileMergeConfig.java b/3rdParty/com.kdmanalytics.kdm.repositoryMerger/src/com/kdmanalytics/kdm/repositoryMerger/linkconfig/FileMergeConfig.java new file mode 100644 index 00000000..e96e238c --- /dev/null +++ b/3rdParty/com.kdmanalytics.kdm.repositoryMerger/src/com/kdmanalytics/kdm/repositoryMerger/linkconfig/FileMergeConfig.java @@ -0,0 +1,44 @@ +package com.kdmanalytics.kdm.repositoryMerger.linkconfig; + + + +/** + * This class refers back to the LinkConfig class which handles both the Merge + * and Link configuration files in one. + * + */ +public class FileMergeConfig extends MergeConfig +{ + + private LinkConfig linkConfig; + + /** + * Load configuration information from the file. + * + * @param in + */ + public FileMergeConfig(LinkConfig linkConfig) + { + this.linkConfig = linkConfig; + } + + /** + * Return the merge type based on the KDM type. + * + */ + @Override + public int getMergeType(String kdmType) + { + return linkConfig.getMergeType(kdmType); + } + + /* + * (non-Javadoc) + * @see com.kdmanalytics.kdm.link.linker.MergeConfig#getNoIdMergeType() + */ + @Override + public int getNoIdMergeType() + { + return linkConfig.getNoIdMergeType(); + } +} diff --git a/3rdParty/com.kdmanalytics.kdm.repositoryMerger/src/com/kdmanalytics/kdm/repositoryMerger/linkconfig/LinkConfig.java b/3rdParty/com.kdmanalytics.kdm.repositoryMerger/src/com/kdmanalytics/kdm/repositoryMerger/linkconfig/LinkConfig.java new file mode 100644 index 00000000..6395e8f2 --- /dev/null +++ b/3rdParty/com.kdmanalytics.kdm.repositoryMerger/src/com/kdmanalytics/kdm/repositoryMerger/linkconfig/LinkConfig.java @@ -0,0 +1,326 @@ + +package com.kdmanalytics.kdm.repositoryMerger.linkconfig; + +import java.io.BufferedReader; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.lang.reflect.Field; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.StringTokenizer; + +/** + * Load the configuration file and provide access to the contents through the + * specified interfaces. + * + */ +public class LinkConfig +{ + + // private static final Logger LOG = + // Logger.getLogger(LinkConfig.class);//getLogger(LinkConfig.class); + + /** + * This class provides access to the merge specific components of the file + * + */ + private FileMergeConfig mergeConfig = null; + + /** + * + */ + private Map mergeMap = null; + + /** + * By default, what is done when an element has no id + */ + private int noIdMergeType = MergeConfig.IGNORE; + + /** + * + */ + private List mergeRegex = null; + +// /** +// * +// */ +// private Map types = null; + + /** + * + */ + public LinkConfig() + { + init(); + } + + /** + * Parse the configuration file and setup the required data structures. + * Instantiate the interface classes that will be requested. + * + * @param file + */ + public LinkConfig(File file) + { + init(); + load(file); + } + + /** + * Parse the configuration stream and setup the required data structures. + * Instantiate the interface classes that will be requested. + * + * @param is + */ + public LinkConfig(InputStream is) + { + init(); + load(is); + } + + /** + * Load the specified config file into the linker configuration. + * + * @param file + */ + public void load(File file) + { + try + { + InputStream is = new FileInputStream(file); + load(is); + is.close(); + } + catch (FileNotFoundException e) + { + // LOG.error("Exception loading config file", e); + } + catch (IOException e) + { + // LOG.error("Exception loading config file", e); + } + } + + /** + * Load configuration information from the specified stream into the linker + * configuration. + * + * @param is + */ + public void load(InputStream is) + { + try + { + BufferedReader in = new BufferedReader(new InputStreamReader(is)); + String line = in.readLine(); + int lineCount = 0; + while (line != null) + { + lineCount++; + line = line.trim(); + if (line.isEmpty()) + { + line = in.readLine(); + continue; + } + if (line.startsWith("#")) + { + line = in.readLine(); + continue; + } + if (line.startsWith("action,")) + loadMergeDefinition(line.substring(7)); + else if (line.startsWith("noid,")) + loadNoIdDefinition(line.substring(5)); + else System.err.println("Parse error on line " + lineCount);// LOG.error("Parse error on line " + // + + // lineCount); + line = in.readLine(); + } + } + catch (IOException e) + { + // LOG.error("Exception loading config file", e); + } + } + + /** + * + * @param is + */ + private void init() + { + mergeConfig = new FileMergeConfig(this); + + mergeMap = new HashMap(); + mergeRegex = new ArrayList(); + +// types = new HashMap(); + } + + /** + * + * @param substring + */ + private void loadNoIdDefinition(String def) + { + StringTokenizer st = new StringTokenizer(def, ","); + if (!st.hasMoreElements()) + { + // LOG.error("Bad noid definition"); + return; + } + String type = st.nextToken(); + if ("COPY".equals(type)) + { + noIdMergeType = MergeConfig.COPY; + } + else if ("MERGE".equals(type)) + { + noIdMergeType = MergeConfig.MERGE; + } + else if ("IGNORE".equals(type)) + { + noIdMergeType = MergeConfig.IGNORE; + } + else if ("SINGLETON".equals(type)) + { + noIdMergeType = MergeConfig.SINGLETON; + } + else + { + // LOG.error("Invalid link type " + type); + return; + } + } + + /** + * Load the merge definition map + * + * @param substring + */ + private void loadMergeDefinition(String def) + { + StringTokenizer st = new StringTokenizer(def, ","); + if (!st.hasMoreElements()) + { + // LOG.error("Bad action definition"); + return; + } + String kdmType = st.nextToken(); + if (!st.hasMoreElements()) + { + // LOG.error("Bad action definition"); + return; + } + String actionType = st.nextToken(); + try + { + Field field = MergeConfig.class.getField(actionType); + int value = field.getInt(null); + if (isRegex(kdmType)) + mergeRegex.add(kdmType); + + // Even regexes are placed here, since they will never match + // without coercion. + mergeMap.put(kdmType, value); + } + catch (SecurityException e) + { + // LOG.error("Exception loading definitions", e); + } + catch (NoSuchFieldException e) + { + // LOG.error("Exception loading definitions", e); + } + catch (IllegalArgumentException e) + { + // LOG.error("Exception loading definitions", e); + } + catch (IllegalAccessException e) + { + // LOG.error("Exception loading definitions", e); + } + } + + /** + * Ugly hack to identify regular expressions. This only works since we know + * the limitations of the string names we are expecting. + * + * @param kdmType + * @return + */ + private boolean isRegex(String s) + { + if (s.contains(".")) + return true; + if (s.contains("?")) + return true; + if (s.contains("*")) + return true; + if (s.contains("[")) + return true; + if (s.contains("(")) + return true; + if (s.contains("^")) + return true; + if (s.contains("$")) + return true; + return false; + } + + /** + * Get the interface used to retrieve merge specific data + * + * @return + */ + public MergeConfig getMergeConfig() + { + return mergeConfig; + } + + /** + * Return the merge type based on the KDM type. + * + */ + public int getMergeType(String kdmType) + { + Integer result = mergeMap.get(kdmType); + if (result == null) + { + for (Iterator it = mergeRegex.iterator(); it.hasNext();) + { + String regex = it.next(); + if (kdmType.matches(regex)) + { + result = mergeMap.get(regex); + break; + } + } + + // FALLBACK, anything else is ignored. + if (result == null) + result = MergeConfig.IGNORE; + } + return result.intValue(); + } + + /** + * Where there are no link:ids, how should the elements be handled + * + * @return + */ + public int getNoIdMergeType() + { + return noIdMergeType; + } + + +} diff --git a/3rdParty/com.kdmanalytics.kdm.repositoryMerger/src/com/kdmanalytics/kdm/repositoryMerger/linkconfig/MergeConfig.java b/3rdParty/com.kdmanalytics.kdm.repositoryMerger/src/com/kdmanalytics/kdm/repositoryMerger/linkconfig/MergeConfig.java new file mode 100644 index 00000000..35656230 --- /dev/null +++ b/3rdParty/com.kdmanalytics.kdm.repositoryMerger/src/com/kdmanalytics/kdm/repositoryMerger/linkconfig/MergeConfig.java @@ -0,0 +1,52 @@ +package com.kdmanalytics.kdm.repositoryMerger.linkconfig; + +/** + * Merge configuration interface. Provides an API through which the merge tool + * can determine how to handle various situations. Also tells the Linker proper + * what id generators to use. + * + * Subclass this to provide the data required to work. + * + */ +public abstract class MergeConfig +{ + + public static final int IGNORE = 0; + + public static final int MERGE = 1; + + public static final int COPY = 2; + + public static final int SINGLETON = 3; + + public static final int DEFAULT = IGNORE; + + public MergeConfig() + { + } + +// /** +// * Get the merge type for the provided element +// * +// * @param element +// * @return +// */ +// public int getMergeType(Element element) +// { +// return getMergeType(element.getClass().getSimpleName()); +// } + + /** + * Given the string type name, return the type of merge to engage in. + * + * @param simpleName + * @return + */ + public abstract int getMergeType(String kdmType); + + /** + * If there is no link ID, how should the elements be handled? + * @return + */ + public abstract int getNoIdMergeType(); +} diff --git a/3rdParty/com.kdmanalytics.kdm.repositoryMerger/src/com/kdmanalytics/kdm/repositoryMerger/ranges/Range.java b/3rdParty/com.kdmanalytics.kdm.repositoryMerger/src/com/kdmanalytics/kdm/repositoryMerger/ranges/Range.java new file mode 100644 index 00000000..04c365c6 --- /dev/null +++ b/3rdParty/com.kdmanalytics.kdm.repositoryMerger/src/com/kdmanalytics/kdm/repositoryMerger/ranges/Range.java @@ -0,0 +1,187 @@ +/** + * + * @author Ken Duck + * + */ +package com.kdmanalytics.kdm.repositoryMerger.ranges; + +import java.util.ArrayList; +import java.util.List; + +public class Range implements Cloneable +{ + protected int from; + protected int to; + + public Range(int from, int to) + { + this.from = from; + this.to = to; + } + + public Range(long uidBefore, long uidAfter) + { + from = (int) uidBefore; + to = (int) uidAfter; + } + + public int getFrom() {return from;} + public int getTo() {return to;} + + public void setFrom(int from) {this.from = from;} + public void setTo(int to) {this.to = to;} + + /** + * + */ + @Override + public final int hashCode() + { + return (from + "," + to).hashCode(); + } + + /** Returns true if the ranges are equal + * + */ + @Override + public final boolean equals(Object o) + { + if(!(o instanceof Range)) + return false; + + Range r = (Range)o; + return (r.from == from && r.to == to); + } + + /** Returns true if the specified range is contained within this + * range. + * + * @param r + * @return + */ + public final boolean contains(Range r) + { + if(r.from >= from && r.to <= to) return true; + return false; + } + + /** Returns true if the specified range is contained within this + * range. + * + * @param r + * @return + */ + public final boolean contains(long id) + { + if(id < from) return false; + if(id > to) return false; + return true; + } + + /** + * + * @param r + * @return + */ + public boolean intersects(Range r) + { + if(r.from >= from && r.from <= to) return true; + if(r.to >= from && r.to <= to) return true; + + if(from >= r.from && from <= r.to) return true; + if(to >= r.from && to <= r.to) return true; + return false; + } + + /** Return the intersection between two ranges + * + * @param testRange + * @return + */ + public Range getIntersection(Range r) + { + if(!intersects(r)) return null; + + int f = r.from; + int t = r.to; + if(from > f) f = from; + if(to < t) t = to; + + return new Range(f, t); + } + + /** Return a list of ranges that indicates the difference between this + * range and the specified range + * + * Consider the situation where we have a range from 1 to 6 (inclusive) + * 1 2 3 4 5 6 + * + * There are 4 situations of overlapping ranges. One where the range is + * completely contained, one where it overlaps the beginning of the + * range, one where it overlaps the end, and one where the range is + * completely covered. + * + * a. 1 2 - - 5 6 + * b. - - 3 4 5 6 + * c. 1 2 3 4 - - + * d. - - - - - - + * + * @param r + * @return + */ + public final List minus(Range r) + { + List results = new ArrayList(); + if(r.from <= from) // case b or case d + { + if(r.to >= to) // case d -- all deleted + { + return results; + } + else // case b -- beginning removed + { + results.add(new Range(r.to + 1, to)); + } + } + else if(r.to >= to) // case c + { + results.add(new Range(from, r.from - 1)); + } + else // case a + { + results.add(new Range(from, r.from - 1)); + results.add(new Range(r.to + 1, to)); + } + + return results; + } + + /* + * (non-Javadoc) + * @see java.lang.Object#toString() + */ + @Override + public final String toString() + { + return "Range: " + from + "-" + to; + } + + /* + * (non-Javadoc) + * @see java.lang.Object#clone() + */ + @Override + public final Range clone() + { + return new Range(from, to); + } + + /** Get the size of the range. + * + * @return + */ + public int getSize() + { + return to - from + 1; + } +} \ No newline at end of file diff --git a/3rdParty/com.kdmanalytics.kdm.repositoryMerger/src/com/kdmanalytics/kdm/repositoryMerger/ranges/RangeSet.java b/3rdParty/com.kdmanalytics.kdm.repositoryMerger/src/com/kdmanalytics/kdm/repositoryMerger/ranges/RangeSet.java new file mode 100644 index 00000000..1c2285d4 --- /dev/null +++ b/3rdParty/com.kdmanalytics.kdm.repositoryMerger/src/com/kdmanalytics/kdm/repositoryMerger/ranges/RangeSet.java @@ -0,0 +1,1249 @@ + +package com.kdmanalytics.kdm.repositoryMerger.ranges; + +import info.aduna.iteration.CloseableIteration; + +import java.awt.Point; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.Comparator; +import java.util.Iterator; +import java.util.List; +import java.util.ListIterator; + +import org.apache.log4j.Logger; +import org.openrdf.model.Statement; +import org.openrdf.model.URI; +import org.openrdf.model.Value; +import org.openrdf.repository.Repository; +import org.openrdf.repository.RepositoryConnection; +import org.openrdf.repository.RepositoryException; + +import com.kdmanalytics.kdm.repositoryMerger.Utilities.IntUtils; +import com.kdmanalytics.kdm.repositoryMerger.Utilities.KdmConstants.WorkbenchPredicate; +import com.kdmanalytics.kdm.repositoryMerger.Utilities.MergerURI; +import com.kdmanalytics.kdm.repositoryMerger.Utilities.StringTokenIterator; + + +/** + * Class that tracks a list of ranges, providing operations to add and remove + * ranges from the contained list. + * + * The operations of this list are a little different from a standard list. + * Since it is working with ranges, a range can be "contained" in this list by + * being "contained" in any of the stored ranges. For example if the list + * consists of a single element (1-5) it can be said to contain the element + * (2-3) + * + * This list *may* be backed by a repository specified by a particular URI + * (subject). In this case the initial list should be initialised from the + * repository and any edits should be written to the repository. + * + */ +public class RangeSet implements List +{ + + private static final Logger LOG = Logger.getLogger(RangeSet.class); + + /** + * + */ + private static URI UID; + + private static URI lastUID; + + private static final int INFINITY = Integer.MAX_VALUE; + + /** + * + */ + private final List ranges = new ArrayList(); + + /** + * If the list is backed by a repository, store that information here. + * + */ + private Repository repository; + + private URI subject; + + /** + * Indicates whether edits should be committed or not + */ + private boolean commit = true; + + /** + * Cache the result of the test for a particular ID. I do this since tests + * are in partial order it is quite possible the same test will occur + * multiple times in a row. + */ + private long cacheContainsId = -1; + + private boolean cacheContainsResult; + + /** + * More advanced caching. IDs near each other (an in order search) are more + * likely to be in the same range. + * + * FIXME: Currently I do not use this value for extra sophistimicated + * performance improvements, since it appears the simpler caching and binary + * search are currently sufficient. There is no reason currently to mess + * with the code to remove this yet, though, and it is always possible I + * will want to add additional caching. + */ + // private Range cacheContainsRange; + + /** + * Instantiate a new set of ranges, initially containing only a single range + * containing a single value. + * + * @param uid + */ + public RangeSet(int uid) + { + addImpl(new Range(uid, uid)); + } + + /** + * I want to remove all references to Point, which is why this constructor + * is deprecated. + * + * + * @param containedRanges + * @deprecated No longer for public use, The Point class is not to be used + */ + @Deprecated + public RangeSet(List containedRanges) + { + for (final Point p : containedRanges) + { + addImpl(new Range(p.x, p.y)); + } + } + + /** + * + * @param range + */ + public RangeSet(Range range) + { + add(range); + } + + /** + * Instantiate a new ranges set based on the information found in the + * specified repository. + * + * @param element + * @throws RepositoryException + */ + public RangeSet(Repository repository, URI subject) throws RepositoryException + { + this.repository = repository; + this.subject = subject; + + commit = false; + + final RepositoryConnection con = repository.getConnection(); + + try + { + // Add any other ranges found listed in the repository + initRanges(con, subject); + + // Get the natural range + final int uid = getUID(con, subject); + // In some cases an element does not have ranges. + if (uid < 0) + { + return; + } + + final int lastUID = getLastUID(con, subject); + + // Always ensure the natural range is included + addImpl(new Range(uid, lastUID)); + } + finally + { + commit = true; + if (con != null) + { + con.close(); + } + } + } + + public RangeSet() + { + } + + /** + * Generate a range given the text range description. + * + * @param txt + * @return + */ + public static RangeSet parse(String txt) + { + final RangeSet ranges = new RangeSet(); + ranges.parseString(txt); + return ranges; + } + + /** + * Initialize more ranges from the __KNT_UIDs attribute. + * + * @param con + * @param subject + * @throws RepositoryException + */ + private final void initRanges(RepositoryConnection con, URI subject) throws RepositoryException + { + final CloseableIteration results = con.getStatements(subject, WorkbenchPredicate.WORKBENCH_RANGES.toURI(), null, false); + while (results.hasNext()) + { + final Statement stmt = results.next(); + final Value object = stmt.getObject(); + final String rangesString = object.stringValue(); + if ((rangesString != null) && !rangesString.isEmpty()) + { + parseString(rangesString); + } + } + } + + /** + * This method makes the assumption that the rangeString is produced by a + * clean RangeSet which is minimal and in order. If it detects that this is + * not the case, it calls a much less efficient version. + * + * @param rangesString + */ + private final void parseString(String rangesString) + { + int max = 0; + if ((rangesString == null) || rangesString.isEmpty()) + { + return; + } + for (final String token : new StringTokenIterator(rangesString, ',', false)) + { + final int index = token.indexOf("-"); + if (index <= 0) + { + LOG.error("Bad ranges found in " + rangesString + " (" + token + ")"); + continue; + } + final String x = token.substring(0, index); + final String y = token.substring(index + 1); + try + { +// final int from = Integer.parseInt(x); + final int from = IntUtils.parseIntChecked(x); +// final int to = Integer.parseInt(y); + final int to = IntUtils.parseIntChecked(y); + + // If an error is detected, use the slow method. + if (from < max) + { + LOG.error("Range string not in order or overlapping"); + ranges.clear(); + correctingParseString(rangesString); + return; + } + final Range range = new Range(from, to); + // addImpl(range); + ranges.add(range); + max = to; + } + catch (final NumberFormatException ex) + { + LOG.error("Invalid ranges found in " + rangesString + " (" + token + ")"); + continue; + } + } + } + + /** + * This parses the string and corrects any errors along the way (overlapping + * ranges, out of order, etc.) + * + * @param rangesString + */ + private final void correctingParseString(String rangesString) + { + if ((rangesString == null) || rangesString.isEmpty()) + { + return; + } + for (final String token : new StringTokenIterator(rangesString, ',', false)) + { + final int index = token.indexOf("-"); + if (index <= 0) + { + LOG.error("Bad ranges found in " + rangesString + " (" + token + ")"); + continue; + } + final String x = token.substring(0, index); + final String y = token.substring(index + 1); + try + { +// final Range range = new Range(Integer.parseInt(x), Integer.parseInt(y)); + final Range range = new Range(IntUtils.parseIntChecked(x), IntUtils.parseIntChecked(y)); + addImpl(range); + } + catch (final NumberFormatException ex) + { + LOG.error("Invalid ranges found in " + rangesString + " (" + token + ")"); + continue; + } + } + } + + /** + * Get the UID for the specified node. + * + * @param con + * @param subject + * @return + * @throws RepositoryException + */ + private final int getUID(RepositoryConnection con, URI subject) throws RepositoryException + { + if (UID == null) + { + UID = con.getValueFactory().createURI(MergerURI.KdmNS, "UID"); + } + final CloseableIteration results = con.getStatements(subject, UID, null, false); + if (!results.hasNext()) + { + // There are some cases where we are happy to not have a UID. + // In these cases we will just have empty ranges. + + // I used to error out in cases where I didn't expect this, + // but this is tough to keep up to date (no one will + // remember). Therefore assume it is correct that there + // is no UID in this situation. + return -1; + } + + final Statement stmt = results.next(); + final Value object = stmt.getObject(); +// final int uid = Integer.parseInt(object.stringValue()); + final int uid = IntUtils.parseInt(object.stringValue()); + return uid; + } + + /** + * + * @param con + * @param subject + * @return + * @throws RepositoryException + */ + private final int getLastUID(RepositoryConnection con, URI subject) throws RepositoryException + { + if (lastUID == null) + { + lastUID = con.getValueFactory().createURI(MergerURI.KdmNS, "lastUID"); + } + final CloseableIteration results = con.getStatements(subject, lastUID, null, false); + if (!results.hasNext()) + { + return getUID(con, subject); + } + + final Statement stmt = results.next(); + final Value object = stmt.getObject(); +// final int uid = Integer.parseInt(object.stringValue()); + final int uid = IntUtils.parseInt(object.stringValue()); + return uid; + } + + /* + * The public add method ensures that the Range does not belong to another + * RangeSet by cloning the passed in range. This MAY add some extra time to + * the process since it takes time to construct and de-construct the + * objects, but is the only way we can be sure the data is consistent. + * + * (non-Javadoc) + * + * @see java.util.List#add(java.lang.Object) + */ + @Override + public final boolean add(Range e) + { + if(e == null) return true; + // To ensure we are not sharing ranges with other RangeSets only + // add clones. + return addImpl(e.clone()); + } + + /** + * + * @param newRange + * @return + */ + private final boolean addImpl(Range newRange) + { + return addImpl(0, newRange) >= 0; + } + + /** + * FIXME: This is not efficient + * + * This version of the "add" method DOES NOT clone the range, so we must be + * sure that this is the only RangeSet that contains the specified range. + * + */ + private final int addImpl(int start, Range newRange) + { + boolean result = false; + int i; + // Add the new range, merging if applicable + for (i = start; i < ranges.size(); ++i) + { + final Range range = ranges.get(i); + // If the range is contained, then bail out + if (range.contains(newRange)) + { + result = true; + break; + } + + // pre + if (newRange.from < range.from) + { + // join + if (newRange.to >= range.from - 1) + { + range.from = newRange.from; + // Does the new range completely overlap the current range? + if (newRange.to > range.to) + { + range.to = newRange.to; + // It is possible we overlap further ranges. Merge any + // overlapped ranges. + final int j = i + 1; + while (j < ranges.size()) // The size gets smaller with + // each iteration due to the + // merge + { + final Range nextRange = ranges.get(j); + // Overlap! + if (newRange.intersects(nextRange)) + { + if (nextRange.to > newRange.to) + { + newRange.to = nextRange.to; // Merge + } + ranges.remove(j); // Remove the merged next + } + // No more overlaps + else + { + break; + } + } + } + result = true; + break; + } + + // insert + ranges.add(i, newRange.clone()); + result = true; + break; + } + + // post + // merge + if (range.to >= newRange.from - 1) + { + range.to = newRange.to; + result = true; + // Can we join with the next? + if (i < ranges.size() - 1) + { + mergeRanges(range, i); + } + break; + } + } + + // If we couldn't add in by now, just append to the list + if (!result) + { + result = ranges.add(newRange.clone()); + } + + if (commit && (repository != null)) + { + try + { + updateRanges(); + } + catch (final RepositoryException e1) + { + e1.printStackTrace(); + return -1; + } + } + if (result) + { + return i; + } + else + { + return -1; + } + + } + + /** + * The specified range may span multiple subsequent ranges. + * + * @param range + * The range to keep + * @param index + * The index of the range to keep, possibly merge subsequent + * ranges + */ + private void mergeRanges(Range range, int index) + { + final int i = index + 1; + + // Keep going until we run out of ranges. We will break + // the loop if merges are no longer possible (before we run out + // of ranges in the set). + while (i < ranges.size()) + { + final Range next = ranges.get(i); + + // If the next "from" is equal to or less than the previous "to" + // then the + // ranges should be merged. + if (next.from <= range.to + 1) + { + range.to = next.to; + + // Now that the merge is done, remove the next. + ranges.remove(i); + } + // If there is no intersection between the nodes, then there are no + // merges + // remaining. + else + { + break; + } + + // Don't increment i, since the size is getting smaller due to + // removing elements from the list. + } + } + + /* + * (non-Javadoc) + * + * @see java.util.List#add(int, java.lang.Object) + */ + @Override + public final void add(int index, Range element) + { + throw new UnsupportedOperationException(); + } + + /* + * (non-Javadoc) + * + * @see java.util.List#addAll(java.util.Collection) + */ + @Override + public final boolean addAll(Collection c) + { + if (c == null) + { + return true; // We can successfully add nothing + } + int start = 0; + boolean result = true; + commit = false; // Hold off commit until all adds are complete + + try + { + if (c instanceof RangeSet) + { + for (final Range range : c) + { + start = addImpl(start, range); + if (start < 0) + { + result = false; + break; + } + } + } + else + { + for (final Range range : c) + { + result &= add(range); + } + } + if (repository != null) + { + try + { + updateRanges(); + } + catch (final RepositoryException e1) + { + e1.printStackTrace(); + return false; + } + } + return result; + } + finally + { + commit = true; + } + } + + /* + * (non-Javadoc) + * + * @see java.util.List#addAll(int, java.util.Collection) + */ + @Override + public final boolean addAll(int index, Collection c) + { + throw new UnsupportedOperationException(); + } + + /* + * (non-Javadoc) + * + * @see java.util.List#clear() + */ + @Override + public final void clear() + { + ranges.clear(); + } + + /** + * Do any of the component ranges contain the passed in range? + * + * WARNING: There are some conditions on the use of this method to compare + * two RangeSets. This test is a quick and dirty check to see what the + * chances are that one range contains the other. Only the first element of + * the "child" is checked. If it is contained we will assume (for now) that + * the rest are too. This may have to be revisited if we want to use this + * method in a more generally applicable way. + */ + @Override + public final boolean contains(Object o) + { + if (o instanceof Range) + { + for (final Range range : ranges) + { + if (range.contains((Range) o)) + { + return true; + } + } + } + + // This test is a quick and dirty check to see what the chances + // are that one range contains the other. Only the first + // element of the "child" is checked. If it is contained we + // will assume (for now) that the rest are too. This may have + // to be revisited if we want to use this method in a more + // generally applicable way. + if (o instanceof RangeSet) + { + final RangeSet child = (RangeSet) o; + if (child.size() > 0) + { + return contains(child.get(0)) && !equals(child); + } + } + return false; + } + + /** + * + * @param id + * @return + */ + public final boolean contains(long id) + { + // If the id is cached, then return the cached result + if (id == cacheContainsId) + { + return cacheContainsResult; + } + + // Make the new cached id the specified id + cacheContainsId = id; + + final int val = Collections.binarySearch(ranges, new Range(id, id), new Comparator() { + + @Override + public final int compare(Range arg0, Range arg1) + { + int result = 0; + if (arg1.from < arg0.from) + { + result = 1; + } + if (arg1.from > arg0.to) + { + result = -1; + } + return result; + } + + }); + + cacheContainsResult = val >= 0; + + return cacheContainsResult; + } + + /* + * (non-Javadoc) + * + * @see java.util.List#containsAll(java.util.Collection) + */ + @Override + public final boolean containsAll(Collection c) + { + throw new UnsupportedOperationException(); + } + + /* + * (non-Javadoc) + * + * @see java.util.List#get(int) + */ + @Override + public final Range get(int index) + { + return ranges.get(index); + } + + /* + * (non-Javadoc) + * + * @see java.util.List#indexOf(java.lang.Object) + */ + @Override + public final int indexOf(Object o) + { + throw new UnsupportedOperationException(); + } + + /* + * (non-Javadoc) + * + * @see java.util.List#isEmpty() + */ + @Override + public final boolean isEmpty() + { + return ranges.isEmpty(); + } + + /* + * (non-Javadoc) + * + * @see java.util.List#iterator() + */ + @Override + public final Iterator iterator() + { + return ranges.iterator(); + } + + /* + * (non-Javadoc) + * + * @see java.util.List#lastIndexOf(java.lang.Object) + */ + @Override + public final int lastIndexOf(Object o) + { + throw new UnsupportedOperationException(); + } + + /* + * (non-Javadoc) + * + * @see java.util.List#listIterator() + */ + @Override + public final ListIterator listIterator() + { + throw new UnsupportedOperationException(); + } + + /* + * (non-Javadoc) + * + * @see java.util.List#listIterator(int) + */ + @Override + public final ListIterator listIterator(int index) + { + throw new UnsupportedOperationException(); + } + + /** + * Remove the specified range from the contained set of ranges. + * + */ + @Override + public final boolean remove(Object o) + { + return remove(0, o) >= 0; + } + + /** + * Optimized range for use when removing many ranges (from a range set). + * This allows us to perform the remove operation for multiple ranges in one + * pass through this RangeSet + * + * @param index + * @param o + * @return + */ + private final int remove(int index, Object o) + { + if (!(o instanceof Range)) + { + throw new UnsupportedOperationException("Cannot remove class " + o.getClass() + " from ranges"); + } + + final Range r = (Range) o; + + final List buf = new ArrayList(); + + final int size = ranges.size(); + for (int i = index; i < size; i++) + { + final Range range = ranges.get(i); + if (range.intersects(r)) + { + final List tmp = range.minus(r); + buf.addAll(tmp); + if (tmp.size() == 0) // completely remove a range + { + ranges.remove(i); + return i; + } + if (tmp.size() == 1) // Removed one side or the other + { + final Range newRange = tmp.get(0); + range.from = newRange.from; + range.to = newRange.to; + return i; + } + if (tmp.size() == 2) // Split range + { + Range newRange = tmp.get(0); + range.from = newRange.from; + range.to = newRange.to; + newRange = tmp.get(1); + ++i; + ranges.add(i, newRange); + return i; + } + LOG.error("Range 'minus' results in 3 ranges"); + } + } + + // Write changes to the repository + if (commit && (repository != null)) + { + try + { + updateRanges(); + } + catch (final RepositoryException e) + { + LOG.error(e.getLocalizedMessage(), e); + return -1; + } + } + + return index; + } + + @Override + public final Range remove(int index) + { + throw new UnsupportedOperationException(); + } + + /** + * FIXME: Only apply changes after ALL removes + * + */ + @Override + public final boolean removeAll(Collection c) + { + boolean result = true; + commit = false; // Don't commit removes till all complete + try + { + if (c instanceof RangeSet) + { + // Special optimized remove + int index = 0; + for (final Range range : (RangeSet) c) + { + index = remove(index, range); + } + } + else + { + for (final Object o : c) + { + result &= remove(o); + } + } + if (repository != null) + { + try + { + updateRanges(); + } + catch (final RepositoryException e1) + { + e1.printStackTrace(); + return false; + } + } + return result; + } + finally + { + commit = true; + } + } + + /* + * (non-Javadoc) + * + * @see java.util.List#retainAll(java.util.Collection) + */ + @Override + public final boolean retainAll(Collection c) + { + throw new UnsupportedOperationException(); + } + + /* + * (non-Javadoc) + * + * @see java.util.List#set(int, java.lang.Object) + */ + @Override + public final Range set(int index, Range element) + { + throw new UnsupportedOperationException(); + } + + /* + * (non-Javadoc) + * + * @see java.util.List#size() + */ + @Override + public final int size() + { + return ranges.size(); + } + + /* + * (non-Javadoc) + * + * @see java.util.List#subList(int, int) + */ + @Override + public final List subList(int fromIndex, int toIndex) + { + return ranges.subList(fromIndex, toIndex); + } + + /* + * (non-Javadoc) + * + * @see java.util.List#toArray() + */ + @Override + public final Object[] toArray() + { + return ranges.toArray(); + } + + /* + * (non-Javadoc) + * + * @see java.util.List#toArray(T[]) + */ + @Override + public final T[] toArray(T[] a) + { + return ranges.toArray(a); + } + + /** + * Write any changes to the list to the repository. + * + * @throws RepositoryException + * + */ + private final void updateRanges() throws RepositoryException + { + if (repository == null) + { + return; + } + + final RepositoryConnection con = repository.getConnection(); + + // Keep in mind the RangeSet includes the range between UID and lastUID. + // Keep the stored data minimal by not reproducing that data if not + // required. + // Get the natural range + if (ranges.size() == 1) + { + final int uid = getUID(con, subject); + // In some cases an element does not have ranges. + if (uid >= 0) + { + final int lastUID = getLastUID(con, subject); + final Range range = new Range(uid, lastUID); + // If these ranges are equal, then remove the range from the + // repository, + // or just don't write it. + if (range.equals(ranges.get(0))) + { + if (con.hasStatement(subject, WorkbenchPredicate.WORKBENCH_RANGES.toURI(), null, false)) + { + con.remove(subject, WorkbenchPredicate.WORKBENCH_RANGES.toURI(), null); + } + return; + } + } + } + + try + { + con.add(subject, WorkbenchPredicate.WORKBENCH_RANGES.toURI(), con.getValueFactory().createLiteral(toString())); + } + finally + { + if (con != null) + { + con.close(); + } + } + } + + /** + * Return the string in a format suitable for writing to the repository. + * + */ + @Override + public final String toString() + { + // Update the ranges in the repository + final Iterator it = ranges.iterator(); + // Record the rest + final StringBuilder sb = new StringBuilder(); + while (it.hasNext()) + { + final Range range = it.next(); + sb.append(range.from + "-" + range.to); + if (it.hasNext()) + { + sb.append(","); + } + } + return sb.toString(); + } + + /** + * Return the inverted range. Do not edit this range set. + * + * @return + */ + public final RangeSet getInvertedRange() + { + final Range range = new Range(0, INFINITY); + final RangeSet results = new RangeSet(range); + results.removeAll(this); + return results; + } + + /** + * + * @param offset + */ + public final void offsetAll(long offset) + { + for (final Range r : ranges) + { + r.to += offset; + r.from += offset; + } + } + + /** + * Determine if the two ranges intersect + * + * @param test + * @return + */ + public boolean intersects(RangeSet test) + { + for (final Range range : ranges) + { + for (final Range testRange : test) + { + if (range.intersects(testRange)) + { + return true; + } + } + } + return false; + } + + /** Return the full intersection between the two ranges + * + * FIXME: Not efficient. + * + * @param elementRanges + * @return + */ + public RangeSet getIntersection(RangeSet test) + { + RangeSet results = new RangeSet(); + + for (final Range range : ranges) + { + for (final Range testRange : test) + { + if (range.intersects(testRange)) + { + results.add(range.getIntersection(testRange)); + } + } + } + return results; + } + + /** + * Validate the contained ranges to ensure this RangeSet is correct. This is + * only used for testing purposes. + * + * Ensure none of the internal ranges overlap + * + */ + public boolean isValid() + { + for (final Range range : ranges) + { + for (final Range testRange : ranges) + { + // Of course ranges overlap themselves + if (range == testRange) + { + continue; + } + + // But they should not overlap others + if (range.intersects(testRange)) + { + return false; + } + } + } + return true; + } + + /* + * (non-Javadoc) + * + * @see java.lang.Object#equals(java.lang.Object) + */ + @Override + public boolean equals(Object o) + { + if (!(o instanceof RangeSet)) + { + return false; + } + + final RangeSet oSet = (RangeSet) o; + if (oSet.size() != size()) + { + return false; + } + + for (int i = size() - 1; i >= 0; --i) + { + if (!get(i).equals(oSet.get(i))) + { + return false; + } + } + + return true; + } + + /** + * Range X completely contains range Y if and only if: * X intersects with Y + * AND * The inverse of X does not intersect with Y + * + * @param linkRange + * @return + */ + public boolean containsRanges(RangeSet ranges) + { + if (!intersects(ranges)) + { + return false; + } + final RangeSet inv = getInvertedRange(); + if (inv.intersects(ranges)) + { + return false; + } + return true; + } + + /** + * Get the sum of the contained ranges sizes + * + * @return + */ + public int getCoverageSize() + { + int size = 0; + for (final Range range : ranges) + { + size += range.getSize(); + } + return size; + } +} diff --git a/3rdParty/com.kdmanalytics.kdm.repositoryMerger/src/config/cxx.cfg b/3rdParty/com.kdmanalytics.kdm.repositoryMerger/src/config/cxx.cfg new file mode 100644 index 00000000..01fd647d --- /dev/null +++ b/3rdParty/com.kdmanalytics.kdm.repositoryMerger/src/config/cxx.cfg @@ -0,0 +1,39 @@ +# Actions define the merge behaviour for various element KDM types. This specifies +# how two files are merged together. +# +# MERGE Merges the contents of like IDed nodes together +# COPY Copies the information in the node even if the ID is already represented +# IGNORE Does not specifically merge or copy data, but recurses down the tree and +# let the children specify for themselves. +# +# To match multiple elements you may use regular expressions. +# +# The default behaviour is specified by using catch all regex ".*". Ensure that this +# is the LAST element or it will mask any other regex entries. +# +# When identifying a merge type for an element, first an exact match is attempted, +# then regular expressions are evaluated in the order in which they appear in the +# file. +# +action,code/Package,MERGE +action,code/LanguageUnit,MERGE +action,code/SharedUnit,MERGE +action,code/CodeAssembly,MERGE +action,code/CompilationUnit,MERGE +action,code/CompilationUnit,MERGE +action,source/StorableUnit,MERGE +action,source/Directory,MERGE +action,code/MethodUnit,SINGLETON +action,code/CallableUnit,SINGLETON +action,action/BlockUnit,SINGLETON +action,.*Model,MERGE +action,kdm/ExtensionFamily,MERGE +action,data/DataContainer,MERGE + +# This regex matches everything else. Note that the default behaviour in the linker +# is currently to ignore, but since this could change it is probably a good idea to +# actively code this behaviour. +action,.*,IGNORE + +# When elements have no IDs, how should they be handled? +noid,COPY \ No newline at end of file diff --git a/3rdParty/com.kdmanalytics.kdm.repositoryMerger/target/MANIFEST.MF b/3rdParty/com.kdmanalytics.kdm.repositoryMerger/target/MANIFEST.MF new file mode 100644 index 00000000..51201dd6 --- /dev/null +++ b/3rdParty/com.kdmanalytics.kdm.repositoryMerger/target/MANIFEST.MF @@ -0,0 +1,20 @@ +Manifest-Version: 1.0 +Export-Package: com.kdmanalytics.kdm.repositoryMerger,com.kdmanalytics + .kdm.repositoryMerger.Utilities,com.kdmanalytics.kdm.repositoryMerger + .linkconfig,com.kdmanalytics.kdm.repositoryMerger.ranges +Require-Bundle: org.apache.commons.lang3;bundle-version="[3.0.0,4.0.0) + ",net.sf.trove4j;bundle-version="3.0.3",org.openrdf.sesame;bundle-ver + sion="[2.4.0,2.5.0)",com.google.guava;bundle-version="[14.0.1,15.0.0) + ",org.apache.log4j;bundle-version="[1.2.13,2.0.0)",com.lexicalscope.j + ewelcli;bundle-version="[0.8.5,1.0.0)",org.eclipse.ui,org.eclipse.cor + e.runtime +Bundle-Vendor: KDM Analytics Inc. +Bundle-ActivationPolicy: lazy +Bundle-Version: 1.15.5 +Bundle-Name: Repository Merger +Bundle-Activator: com.kdmanalytics.kdm.repositoryMerger.Activator +Bundle-ManifestVersion: 2 +Bundle-SymbolicName: com.kdmanalytics.kdm.repositoryMerger +Eclipse-RegisterBuddy: com.lexicalscope.jewelcli +Bundle-RequiredExecutionEnvironment: JavaSE-1.6 + diff --git a/3rdParty/com.kdmanalytics.kdm.repositoryMerger/target/classes/com/kdmanalytics/kdm/repositoryMerger/Activator.class b/3rdParty/com.kdmanalytics.kdm.repositoryMerger/target/classes/com/kdmanalytics/kdm/repositoryMerger/Activator.class new file mode 100644 index 00000000..87e42a19 Binary files /dev/null and b/3rdParty/com.kdmanalytics.kdm.repositoryMerger/target/classes/com/kdmanalytics/kdm/repositoryMerger/Activator.class differ diff --git a/3rdParty/com.kdmanalytics.kdm.repositoryMerger/target/classes/com/kdmanalytics/kdm/repositoryMerger/GlobalMap.class b/3rdParty/com.kdmanalytics.kdm.repositoryMerger/target/classes/com/kdmanalytics/kdm/repositoryMerger/GlobalMap.class new file mode 100644 index 00000000..c9f55764 Binary files /dev/null and b/3rdParty/com.kdmanalytics.kdm.repositoryMerger/target/classes/com/kdmanalytics/kdm/repositoryMerger/GlobalMap.class differ diff --git a/3rdParty/com.kdmanalytics.kdm.repositoryMerger/target/classes/com/kdmanalytics/kdm/repositoryMerger/MethodOverrides.class b/3rdParty/com.kdmanalytics.kdm.repositoryMerger/target/classes/com/kdmanalytics/kdm/repositoryMerger/MethodOverrides.class new file mode 100644 index 00000000..0ad686d6 Binary files /dev/null and b/3rdParty/com.kdmanalytics.kdm.repositoryMerger/target/classes/com/kdmanalytics/kdm/repositoryMerger/MethodOverrides.class differ diff --git a/3rdParty/com.kdmanalytics.kdm.repositoryMerger/target/classes/com/kdmanalytics/kdm/repositoryMerger/MethodState.class b/3rdParty/com.kdmanalytics.kdm.repositoryMerger/target/classes/com/kdmanalytics/kdm/repositoryMerger/MethodState.class new file mode 100644 index 00000000..51c221fd Binary files /dev/null and b/3rdParty/com.kdmanalytics.kdm.repositoryMerger/target/classes/com/kdmanalytics/kdm/repositoryMerger/MethodState.class differ diff --git a/3rdParty/com.kdmanalytics.kdm.repositoryMerger/target/classes/com/kdmanalytics/kdm/repositoryMerger/RepositoryMerger.class b/3rdParty/com.kdmanalytics.kdm.repositoryMerger/target/classes/com/kdmanalytics/kdm/repositoryMerger/RepositoryMerger.class new file mode 100644 index 00000000..0213a807 Binary files /dev/null and b/3rdParty/com.kdmanalytics.kdm.repositoryMerger/target/classes/com/kdmanalytics/kdm/repositoryMerger/RepositoryMerger.class differ diff --git a/3rdParty/com.kdmanalytics.kdm.repositoryMerger/target/classes/com/kdmanalytics/kdm/repositoryMerger/StatementWriter.class b/3rdParty/com.kdmanalytics.kdm.repositoryMerger/target/classes/com/kdmanalytics/kdm/repositoryMerger/StatementWriter.class new file mode 100644 index 00000000..a114954e Binary files /dev/null and b/3rdParty/com.kdmanalytics.kdm.repositoryMerger/target/classes/com/kdmanalytics/kdm/repositoryMerger/StatementWriter.class differ diff --git a/3rdParty/com.kdmanalytics.kdm.repositoryMerger/target/classes/com/kdmanalytics/kdm/repositoryMerger/Utilities/IntUtils.class b/3rdParty/com.kdmanalytics.kdm.repositoryMerger/target/classes/com/kdmanalytics/kdm/repositoryMerger/Utilities/IntUtils.class new file mode 100644 index 00000000..23f9aa3d Binary files /dev/null and b/3rdParty/com.kdmanalytics.kdm.repositoryMerger/target/classes/com/kdmanalytics/kdm/repositoryMerger/Utilities/IntUtils.class differ diff --git a/3rdParty/com.kdmanalytics.kdm.repositoryMerger/target/classes/com/kdmanalytics/kdm/repositoryMerger/Utilities/KdmConstants$KdmPredicate.class b/3rdParty/com.kdmanalytics.kdm.repositoryMerger/target/classes/com/kdmanalytics/kdm/repositoryMerger/Utilities/KdmConstants$KdmPredicate.class new file mode 100644 index 00000000..f689d914 Binary files /dev/null and b/3rdParty/com.kdmanalytics.kdm.repositoryMerger/target/classes/com/kdmanalytics/kdm/repositoryMerger/Utilities/KdmConstants$KdmPredicate.class differ diff --git a/3rdParty/com.kdmanalytics.kdm.repositoryMerger/target/classes/com/kdmanalytics/kdm/repositoryMerger/Utilities/KdmConstants$KdmType.class b/3rdParty/com.kdmanalytics.kdm.repositoryMerger/target/classes/com/kdmanalytics/kdm/repositoryMerger/Utilities/KdmConstants$KdmType.class new file mode 100644 index 00000000..34fe65e2 Binary files /dev/null and b/3rdParty/com.kdmanalytics.kdm.repositoryMerger/target/classes/com/kdmanalytics/kdm/repositoryMerger/Utilities/KdmConstants$KdmType.class differ diff --git a/3rdParty/com.kdmanalytics.kdm.repositoryMerger/target/classes/com/kdmanalytics/kdm/repositoryMerger/Utilities/KdmConstants$WorkbenchPredicate.class b/3rdParty/com.kdmanalytics.kdm.repositoryMerger/target/classes/com/kdmanalytics/kdm/repositoryMerger/Utilities/KdmConstants$WorkbenchPredicate.class new file mode 100644 index 00000000..8ef8db04 Binary files /dev/null and b/3rdParty/com.kdmanalytics.kdm.repositoryMerger/target/classes/com/kdmanalytics/kdm/repositoryMerger/Utilities/KdmConstants$WorkbenchPredicate.class differ diff --git a/3rdParty/com.kdmanalytics.kdm.repositoryMerger/target/classes/com/kdmanalytics/kdm/repositoryMerger/Utilities/KdmConstants$WorkbenchStereotype.class b/3rdParty/com.kdmanalytics.kdm.repositoryMerger/target/classes/com/kdmanalytics/kdm/repositoryMerger/Utilities/KdmConstants$WorkbenchStereotype.class new file mode 100644 index 00000000..f3d002f7 Binary files /dev/null and b/3rdParty/com.kdmanalytics.kdm.repositoryMerger/target/classes/com/kdmanalytics/kdm/repositoryMerger/Utilities/KdmConstants$WorkbenchStereotype.class differ diff --git a/3rdParty/com.kdmanalytics.kdm.repositoryMerger/target/classes/com/kdmanalytics/kdm/repositoryMerger/Utilities/KdmConstants.class b/3rdParty/com.kdmanalytics.kdm.repositoryMerger/target/classes/com/kdmanalytics/kdm/repositoryMerger/Utilities/KdmConstants.class new file mode 100644 index 00000000..39daed60 Binary files /dev/null and b/3rdParty/com.kdmanalytics.kdm.repositoryMerger/target/classes/com/kdmanalytics/kdm/repositoryMerger/Utilities/KdmConstants.class differ diff --git a/3rdParty/com.kdmanalytics.kdm.repositoryMerger/target/classes/com/kdmanalytics/kdm/repositoryMerger/Utilities/KdmLiteral.class b/3rdParty/com.kdmanalytics.kdm.repositoryMerger/target/classes/com/kdmanalytics/kdm/repositoryMerger/Utilities/KdmLiteral.class new file mode 100644 index 00000000..d02b9306 Binary files /dev/null and b/3rdParty/com.kdmanalytics.kdm.repositoryMerger/target/classes/com/kdmanalytics/kdm/repositoryMerger/Utilities/KdmLiteral.class differ diff --git a/3rdParty/com.kdmanalytics.kdm.repositoryMerger/target/classes/com/kdmanalytics/kdm/repositoryMerger/Utilities/MergerURI.class b/3rdParty/com.kdmanalytics.kdm.repositoryMerger/target/classes/com/kdmanalytics/kdm/repositoryMerger/Utilities/MergerURI.class new file mode 100644 index 00000000..6c6578fa Binary files /dev/null and b/3rdParty/com.kdmanalytics.kdm.repositoryMerger/target/classes/com/kdmanalytics/kdm/repositoryMerger/Utilities/MergerURI.class differ diff --git a/3rdParty/com.kdmanalytics.kdm.repositoryMerger/target/classes/com/kdmanalytics/kdm/repositoryMerger/Utilities/MergerUtilities.class b/3rdParty/com.kdmanalytics.kdm.repositoryMerger/target/classes/com/kdmanalytics/kdm/repositoryMerger/Utilities/MergerUtilities.class new file mode 100644 index 00000000..9929e494 Binary files /dev/null and b/3rdParty/com.kdmanalytics.kdm.repositoryMerger/target/classes/com/kdmanalytics/kdm/repositoryMerger/Utilities/MergerUtilities.class differ diff --git a/3rdParty/com.kdmanalytics.kdm.repositoryMerger/target/classes/com/kdmanalytics/kdm/repositoryMerger/Utilities/NullArgumentException.class b/3rdParty/com.kdmanalytics.kdm.repositoryMerger/target/classes/com/kdmanalytics/kdm/repositoryMerger/Utilities/NullArgumentException.class new file mode 100644 index 00000000..e188dca5 Binary files /dev/null and b/3rdParty/com.kdmanalytics.kdm.repositoryMerger/target/classes/com/kdmanalytics/kdm/repositoryMerger/Utilities/NullArgumentException.class differ diff --git a/3rdParty/com.kdmanalytics.kdm.repositoryMerger/target/classes/com/kdmanalytics/kdm/repositoryMerger/Utilities/StringTokenIterator.class b/3rdParty/com.kdmanalytics.kdm.repositoryMerger/target/classes/com/kdmanalytics/kdm/repositoryMerger/Utilities/StringTokenIterator.class new file mode 100644 index 00000000..3cb662c8 Binary files /dev/null and b/3rdParty/com.kdmanalytics.kdm.repositoryMerger/target/classes/com/kdmanalytics/kdm/repositoryMerger/Utilities/StringTokenIterator.class differ diff --git a/3rdParty/com.kdmanalytics.kdm.repositoryMerger/target/classes/com/kdmanalytics/kdm/repositoryMerger/ValidationData.class b/3rdParty/com.kdmanalytics.kdm.repositoryMerger/target/classes/com/kdmanalytics/kdm/repositoryMerger/ValidationData.class new file mode 100644 index 00000000..6812efe6 Binary files /dev/null and b/3rdParty/com.kdmanalytics.kdm.repositoryMerger/target/classes/com/kdmanalytics/kdm/repositoryMerger/ValidationData.class differ diff --git a/3rdParty/com.kdmanalytics.kdm.repositoryMerger/target/classes/com/kdmanalytics/kdm/repositoryMerger/linkconfig/FileMergeConfig.class b/3rdParty/com.kdmanalytics.kdm.repositoryMerger/target/classes/com/kdmanalytics/kdm/repositoryMerger/linkconfig/FileMergeConfig.class new file mode 100644 index 00000000..47449dc8 Binary files /dev/null and b/3rdParty/com.kdmanalytics.kdm.repositoryMerger/target/classes/com/kdmanalytics/kdm/repositoryMerger/linkconfig/FileMergeConfig.class differ diff --git a/3rdParty/com.kdmanalytics.kdm.repositoryMerger/target/classes/com/kdmanalytics/kdm/repositoryMerger/linkconfig/LinkConfig.class b/3rdParty/com.kdmanalytics.kdm.repositoryMerger/target/classes/com/kdmanalytics/kdm/repositoryMerger/linkconfig/LinkConfig.class new file mode 100644 index 00000000..5d1fd56b Binary files /dev/null and b/3rdParty/com.kdmanalytics.kdm.repositoryMerger/target/classes/com/kdmanalytics/kdm/repositoryMerger/linkconfig/LinkConfig.class differ diff --git a/3rdParty/com.kdmanalytics.kdm.repositoryMerger/target/classes/com/kdmanalytics/kdm/repositoryMerger/linkconfig/MergeConfig.class b/3rdParty/com.kdmanalytics.kdm.repositoryMerger/target/classes/com/kdmanalytics/kdm/repositoryMerger/linkconfig/MergeConfig.class new file mode 100644 index 00000000..1250c763 Binary files /dev/null and b/3rdParty/com.kdmanalytics.kdm.repositoryMerger/target/classes/com/kdmanalytics/kdm/repositoryMerger/linkconfig/MergeConfig.class differ diff --git a/3rdParty/com.kdmanalytics.kdm.repositoryMerger/target/classes/com/kdmanalytics/kdm/repositoryMerger/ranges/Range.class b/3rdParty/com.kdmanalytics.kdm.repositoryMerger/target/classes/com/kdmanalytics/kdm/repositoryMerger/ranges/Range.class new file mode 100644 index 00000000..c0ae8557 Binary files /dev/null and b/3rdParty/com.kdmanalytics.kdm.repositoryMerger/target/classes/com/kdmanalytics/kdm/repositoryMerger/ranges/Range.class differ diff --git a/3rdParty/com.kdmanalytics.kdm.repositoryMerger/target/classes/com/kdmanalytics/kdm/repositoryMerger/ranges/RangeSet$1.class b/3rdParty/com.kdmanalytics.kdm.repositoryMerger/target/classes/com/kdmanalytics/kdm/repositoryMerger/ranges/RangeSet$1.class new file mode 100644 index 00000000..c68ff564 Binary files /dev/null and b/3rdParty/com.kdmanalytics.kdm.repositoryMerger/target/classes/com/kdmanalytics/kdm/repositoryMerger/ranges/RangeSet$1.class differ diff --git a/3rdParty/com.kdmanalytics.kdm.repositoryMerger/target/classes/com/kdmanalytics/kdm/repositoryMerger/ranges/RangeSet.class b/3rdParty/com.kdmanalytics.kdm.repositoryMerger/target/classes/com/kdmanalytics/kdm/repositoryMerger/ranges/RangeSet.class new file mode 100644 index 00000000..f8b08f22 Binary files /dev/null and b/3rdParty/com.kdmanalytics.kdm.repositoryMerger/target/classes/com/kdmanalytics/kdm/repositoryMerger/ranges/RangeSet.class differ diff --git a/3rdParty/com.kdmanalytics.kdm.repositoryMerger/target/classes/config/cxx.cfg b/3rdParty/com.kdmanalytics.kdm.repositoryMerger/target/classes/config/cxx.cfg new file mode 100644 index 00000000..01fd647d --- /dev/null +++ b/3rdParty/com.kdmanalytics.kdm.repositoryMerger/target/classes/config/cxx.cfg @@ -0,0 +1,39 @@ +# Actions define the merge behaviour for various element KDM types. This specifies +# how two files are merged together. +# +# MERGE Merges the contents of like IDed nodes together +# COPY Copies the information in the node even if the ID is already represented +# IGNORE Does not specifically merge or copy data, but recurses down the tree and +# let the children specify for themselves. +# +# To match multiple elements you may use regular expressions. +# +# The default behaviour is specified by using catch all regex ".*". Ensure that this +# is the LAST element or it will mask any other regex entries. +# +# When identifying a merge type for an element, first an exact match is attempted, +# then regular expressions are evaluated in the order in which they appear in the +# file. +# +action,code/Package,MERGE +action,code/LanguageUnit,MERGE +action,code/SharedUnit,MERGE +action,code/CodeAssembly,MERGE +action,code/CompilationUnit,MERGE +action,code/CompilationUnit,MERGE +action,source/StorableUnit,MERGE +action,source/Directory,MERGE +action,code/MethodUnit,SINGLETON +action,code/CallableUnit,SINGLETON +action,action/BlockUnit,SINGLETON +action,.*Model,MERGE +action,kdm/ExtensionFamily,MERGE +action,data/DataContainer,MERGE + +# This regex matches everything else. Note that the default behaviour in the linker +# is currently to ignore, but since this could change it is probably a good idea to +# actively code this behaviour. +action,.*,IGNORE + +# When elements have no IDs, how should they be handled? +noid,COPY \ No newline at end of file diff --git a/3rdParty/com.kdmanalytics.kdm.repositoryMerger/target/com.kdmanalytics.kdm.repositoryMerger-1.15.5.jar b/3rdParty/com.kdmanalytics.kdm.repositoryMerger/target/com.kdmanalytics.kdm.repositoryMerger-1.15.5.jar new file mode 100644 index 00000000..e23b7b4c Binary files /dev/null and b/3rdParty/com.kdmanalytics.kdm.repositoryMerger/target/com.kdmanalytics.kdm.repositoryMerger-1.15.5.jar differ diff --git a/3rdParty/com.kdmanalytics.kdm.repositoryMerger/target/local-artifacts.properties b/3rdParty/com.kdmanalytics.kdm.repositoryMerger/target/local-artifacts.properties new file mode 100644 index 00000000..265c8bc6 --- /dev/null +++ b/3rdParty/com.kdmanalytics.kdm.repositoryMerger/target/local-artifacts.properties @@ -0,0 +1,4 @@ +#Thu May 29 09:56:04 EDT 2014 +artifact.attached.p2metadata=/home/adam/git/toif/plugins/com.kdmanalytics.kdm.repositoryMerger/target/p2content.xml +artifact.main=/home/adam/git/toif/plugins/com.kdmanalytics.kdm.repositoryMerger/target/com.kdmanalytics.kdm.repositoryMerger-1.15.5.jar +artifact.attached.p2artifacts=/home/adam/git/toif/plugins/com.kdmanalytics.kdm.repositoryMerger/target/p2artifacts.xml diff --git a/3rdParty/com.kdmanalytics.kdm.repositoryMerger/target/maven-archiver/pom.properties b/3rdParty/com.kdmanalytics.kdm.repositoryMerger/target/maven-archiver/pom.properties new file mode 100644 index 00000000..8e4bdb5e --- /dev/null +++ b/3rdParty/com.kdmanalytics.kdm.repositoryMerger/target/maven-archiver/pom.properties @@ -0,0 +1,5 @@ +#Generated by Maven +#Thu May 29 09:56:04 EDT 2014 +version=1.15.5 +groupId=com.kdmanalytics.toif.compile +artifactId=com.kdmanalytics.kdm.repositoryMerger diff --git a/3rdParty/com.kdmanalytics.kdm.repositoryMerger/target/p2artifacts.xml b/3rdParty/com.kdmanalytics.kdm.repositoryMerger/target/p2artifacts.xml new file mode 100644 index 00000000..6e4621f2 --- /dev/null +++ b/3rdParty/com.kdmanalytics.kdm.repositoryMerger/target/p2artifacts.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/3rdParty/com.kdmanalytics.kdm.repositoryMerger/target/p2content.xml b/3rdParty/com.kdmanalytics.kdm.repositoryMerger/target/p2content.xml new file mode 100644 index 00000000..78f60ec7 --- /dev/null +++ b/3rdParty/com.kdmanalytics.kdm.repositoryMerger/target/p2content.xml @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Bundle-SymbolicName: com.kdmanalytics.kdm.repositoryMerger Bundle-Version: 1.15.5 + + + + + diff --git a/3rdParty/com.lexicalscope.jewelcli/.classpath b/3rdParty/com.lexicalscope.jewelcli/.classpath new file mode 100644 index 00000000..16278668 --- /dev/null +++ b/3rdParty/com.lexicalscope.jewelcli/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/3rdParty/com.lexicalscope.jewelcli/.project b/3rdParty/com.lexicalscope.jewelcli/.project new file mode 100644 index 00000000..60b6d3c1 --- /dev/null +++ b/3rdParty/com.lexicalscope.jewelcli/.project @@ -0,0 +1,28 @@ + + + com.lexicalscope.jewelcli + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + + org.eclipse.pde.PluginNature + org.eclipse.jdt.core.javanature + + diff --git a/3rdParty/com.lexicalscope.jewelcli/.settings/org.eclipse.jdt.core.prefs b/3rdParty/com.lexicalscope.jewelcli/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 00000000..11f6e462 --- /dev/null +++ b/3rdParty/com.lexicalscope.jewelcli/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,7 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 +org.eclipse.jdt.core.compiler.compliance=1.7 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.7 diff --git a/3rdParty/com.lexicalscope.jewelcli/LICENSE b/3rdParty/com.lexicalscope.jewelcli/LICENSE new file mode 100644 index 00000000..261eeb9e --- /dev/null +++ b/3rdParty/com.lexicalscope.jewelcli/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/3rdParty/com.lexicalscope.jewelcli/LICENSE.txt b/3rdParty/com.lexicalscope.jewelcli/LICENSE.txt new file mode 100644 index 00000000..5ebe92c5 --- /dev/null +++ b/3rdParty/com.lexicalscope.jewelcli/LICENSE.txt @@ -0,0 +1,27 @@ +BSD License + +Copyright (c) 2000-2006, www.hamcrest.org +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +Redistributions of source code must retain the above copyright notice, this list of +conditions and the following disclaimer. Redistributions in binary form must reproduce +the above copyright notice, this list of conditions and the following disclaimer in +the documentation and/or other materials provided with the distribution. + +Neither the name of Hamcrest nor the names of its contributors may be used to endorse +or promote products derived from this software without specific prior written +permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY +EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT +SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED +TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR +BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY +WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. diff --git a/3rdParty/com.lexicalscope.jewelcli/META-INF/DEPENDENCIES b/3rdParty/com.lexicalscope.jewelcli/META-INF/DEPENDENCIES new file mode 100644 index 00000000..70d6e798 --- /dev/null +++ b/3rdParty/com.lexicalscope.jewelcli/META-INF/DEPENDENCIES @@ -0,0 +1,23 @@ +// ------------------------------------------------------------------ +// Transitive dependencies of this project determined from the +// maven pom organized by organization. +// ------------------------------------------------------------------ + +Google Guice - Core Library + + +From: 'an unknown organization' + - AOP alliance (http://aopalliance.sourceforge.net) aopalliance:aopalliance:jar:1.0 + License: Public Domain + - javax.inject (http://code.google.com/p/atinject/) javax.inject:javax.inject:jar:1 + License: The Apache Software License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0.txt) + - CGLIB (http://sourceforge.net/projects/cglib/) org.sonatype.sisu.inject:cglib:jar:2.2.1-v20090111 + License: The Apache Software License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0.txt) + +From: 'ObjectWeb' (http://www.objectweb.org/) + - ASM Core (http://asm.objectweb.org/asm/) asm:asm:jar:3.1 + + + + + diff --git a/3rdParty/com.lexicalscope.jewelcli/META-INF/MANIFEST.MF b/3rdParty/com.lexicalscope.jewelcli/META-INF/MANIFEST.MF new file mode 100644 index 00000000..b171f49c --- /dev/null +++ b/3rdParty/com.lexicalscope.jewelcli/META-INF/MANIFEST.MF @@ -0,0 +1,50 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: JewelCLI +Bundle-SymbolicName: com.lexicalscope.jewelcli +Bundle-Version: 0.8.5 +Bundle-ClassPath: com.lexicalscope.jewelcli_0.8.5.jar +Bundle-Vendor: KDM Analytics Inc +Export-Package: com.lexicalscope.jewel, + com.lexicalscope.jewel.cli, + com.lexicalscope.jewel.cli.parser, + com.lexicalscope.jewel.cli.specification, + com.lexicalscope.jewel.cli.validation, + com.lexicalscope.jewelcli.internal.cglib.asm, + com.lexicalscope.jewelcli.internal.cglib.core, + com.lexicalscope.jewelcli.internal.cglib.proxy, + com.lexicalscope.jewelcli.internal.fluentcollections, + com.lexicalscope.jewelcli.internal.fluentcollectionsadapters, + com.lexicalscope.jewelcli.internal.fluentcollectionsfunctions, + com.lexicalscope.jewelcli.internal.fluentcollectionsiterator, + com.lexicalscope.jewelcli.internal.fluentcollectionslist, + com.lexicalscope.jewelcli.internal.fluentcollectionsmap, + com.lexicalscope.jewelcli.internal.fluentcollectionsmap.transforms, + com.lexicalscope.jewelcli.internal.fluentreflection, + com.lexicalscope.jewelcli.internal.fluentreflection.bean, + com.lexicalscope.jewelcli.internal.fluentreflection.dynamicproxy, + com.lexicalscope.jewelcli.internal.guava.base, + com.lexicalscope.jewelcli.internal.guava.collect, + com.lexicalscope.jewelcli.internal.guava.primitives, + com.lexicalscope.jewelcli.internal.guice, + com.lexicalscope.jewelcli.internal.guice.internal, + com.lexicalscope.jewelcli.internal.guice.internal.util, + com.lexicalscope.jewelcli.internal.guice.util, + com.lexicalscope.jewelcli.internal.hamcrest, + com.lexicalscope.jewelcli.internal.hamcrest.collection, + com.lexicalscope.jewelcli.internal.hamcrest.core, + com.lexicalscope.jewelcli.internal.hamcrest.internal, + com.lexicalscope.jewelcli.internal.lamdaj, + com.lexicalscope.jewelcli.internal.lamdaj.collection, + com.lexicalscope.jewelcli.internal.lamdaj.function.aggregate, + com.lexicalscope.jewelcli.internal.lamdaj.function.convert, + com.lexicalscope.jewelcli.internal.lamdaj.proxy, + com.lexicalscope.jewelcli.internal.lamdaj.util, + com.lexicalscope.jewelcli.internal.lamdaj.util.iterator, + com.lexicalscope.jewelcli.internal.lang3.builder +Created-By: Apache Maven +Archiver-Version: Plexus Archiver +Eclipse-BuddyPolicy: registered +Built-By: jenkins +Build-Jdk: 1.7.0_25 +Bundle-RequiredExecutionEnvironment: JavaSE-1.7 diff --git a/3rdParty/com.lexicalscope.jewelcli/META-INF/maven/com.kdmanalytics.libs.libsjava.plugins/com.lexicalscope.jewelcli/pom.properties b/3rdParty/com.lexicalscope.jewelcli/META-INF/maven/com.kdmanalytics.libs.libsjava.plugins/com.lexicalscope.jewelcli/pom.properties new file mode 100644 index 00000000..0df42ca8 --- /dev/null +++ b/3rdParty/com.lexicalscope.jewelcli/META-INF/maven/com.kdmanalytics.libs.libsjava.plugins/com.lexicalscope.jewelcli/pom.properties @@ -0,0 +1,5 @@ +#Generated by Maven +#Thu Sep 12 11:08:54 EDT 2013 +version=0.8.5 +groupId=com.kdmanalytics.libs.libsjava.plugins +artifactId=com.lexicalscope.jewelcli diff --git a/3rdParty/com.lexicalscope.jewelcli/META-INF/maven/com.kdmanalytics.libs.libsjava.plugins/com.lexicalscope.jewelcli/pom.xml b/3rdParty/com.lexicalscope.jewelcli/META-INF/maven/com.kdmanalytics.libs.libsjava.plugins/com.lexicalscope.jewelcli/pom.xml new file mode 100644 index 00000000..70833b1a --- /dev/null +++ b/3rdParty/com.lexicalscope.jewelcli/META-INF/maven/com.kdmanalytics.libs.libsjava.plugins/com.lexicalscope.jewelcli/pom.xml @@ -0,0 +1,21 @@ + + + 4.0.0 + + + com.kdmanalytics.libs.libsjava + plugins + 2.3.1 + + + com.kdmanalytics.libs.libsjava.plugins + com.lexicalscope.jewelcli + 0.8.5 + + Lexical Scope JewelCLI Library + + eclipse-plugin + + diff --git a/3rdParty/com.lexicalscope.jewelcli/NOTICE b/3rdParty/com.lexicalscope.jewelcli/NOTICE new file mode 100644 index 00000000..3f59805c --- /dev/null +++ b/3rdParty/com.lexicalscope.jewelcli/NOTICE @@ -0,0 +1,2 @@ +This product includes software developed by +The Apache Software Foundation (http://www.apache.org/). diff --git a/3rdParty/com.lexicalscope.jewelcli/asm-license.txt b/3rdParty/com.lexicalscope.jewelcli/asm-license.txt new file mode 100644 index 00000000..bfc17890 --- /dev/null +++ b/3rdParty/com.lexicalscope.jewelcli/asm-license.txt @@ -0,0 +1,27 @@ +ASM: a very small and fast Java bytecode manipulation framework +Copyright (c) 2000,2002,2003 INRIA, France Telecom +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. +3. Neither the name of the copyright holders nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF +THE POSSIBILITY OF SUCH DAMAGE. diff --git a/3rdParty/com.lexicalscope.jewelcli/com.lexicalscope.jewelcli_0.8.5.jar b/3rdParty/com.lexicalscope.jewelcli/com.lexicalscope.jewelcli_0.8.5.jar new file mode 100644 index 00000000..caf84f04 Binary files /dev/null and b/3rdParty/com.lexicalscope.jewelcli/com.lexicalscope.jewelcli_0.8.5.jar differ diff --git a/3rdParty/javax.xml/.classpath b/3rdParty/javax.xml/.classpath new file mode 100644 index 00000000..259e6d13 --- /dev/null +++ b/3rdParty/javax.xml/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/3rdParty/javax.xml/.project b/3rdParty/javax.xml/.project new file mode 100644 index 00000000..191237fd --- /dev/null +++ b/3rdParty/javax.xml/.project @@ -0,0 +1,28 @@ + + + javax.xml + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + + org.eclipse.pde.PluginNature + org.eclipse.jdt.core.javanature + + diff --git a/3rdParty/javax.xml/.settings/org.eclipse.jdt.core.prefs b/3rdParty/javax.xml/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 00000000..f42de363 --- /dev/null +++ b/3rdParty/javax.xml/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,7 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 +org.eclipse.jdt.core.compiler.compliance=1.7 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.7 diff --git a/3rdParty/javax.xml/META-INF/MANIFEST.MF b/3rdParty/javax.xml/META-INF/MANIFEST.MF new file mode 100644 index 00000000..af29d54e --- /dev/null +++ b/3rdParty/javax.xml/META-INF/MANIFEST.MF @@ -0,0 +1,33 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: Apache Xerces-J +Bundle-SymbolicName: javax.xml +Require-Bundle: system.bundle +Bundle-Version: 1.4.0.qualifier +Bundle-Vendor: KDM Analytics Inc. +Export-Package: javax.xml;version="1.4", + javax.xml.datatype;version="1.4", + javax.xml.namespace;version="1.4", + javax.xml.parsers;version="1.4", + javax.xml.transform;version="1.4", + javax.xml.transform.dom;version="1.4", + javax.xml.transform.sax;version="1.4", + javax.xml.transform.stream;version="1.4", + javax.xml.validation;version="1.4", + javax.xml.xpath;version="1.4", + org.apache.xmlcommons;version="1.4.1", + org.w3c.dom;version="3.0", + org.w3c.dom.bootstrap;version="3.0", + org.w3c.dom.css;version="2.0", + org.w3c.dom.events;version="2.0", + org.w3c.dom.html;version="2.0", + org.w3c.dom.ls;version="2.0", + org.w3c.dom.ranges;version="2.0", + org.w3c.dom.stylesheets;version="2.0", + org.w3c.dom.traversal;version="2.0", + org.w3c.dom.views;version="2.0", + org.w3c.dom.xpath;version="3.0", + org.xml.sax;version="2.0.2", + org.xml.sax.ext;version="2.0.2", + org.xml.sax.helpers;version="2.0.2" +Bundle-RequiredExecutionEnvironment: JavaSE-1.7 diff --git a/3rdParty/javax.xml/build.properties b/3rdParty/javax.xml/build.properties new file mode 100644 index 00000000..b7d67620 --- /dev/null +++ b/3rdParty/javax.xml/build.properties @@ -0,0 +1,5 @@ +output.. = . +bin.includes = META-INF/,\ + javax/,\ + license/,\ + org/ diff --git a/3rdParty/javax.xml/javax/xml/XMLConstants.class b/3rdParty/javax.xml/javax/xml/XMLConstants.class new file mode 100644 index 00000000..58b4a065 Binary files /dev/null and b/3rdParty/javax.xml/javax/xml/XMLConstants.class differ diff --git a/3rdParty/javax.xml/javax/xml/datatype/DatatypeConfigurationException.class b/3rdParty/javax.xml/javax/xml/datatype/DatatypeConfigurationException.class new file mode 100644 index 00000000..b829e4da Binary files /dev/null and b/3rdParty/javax.xml/javax/xml/datatype/DatatypeConfigurationException.class differ diff --git a/3rdParty/javax.xml/javax/xml/datatype/DatatypeConstants$1.class b/3rdParty/javax.xml/javax/xml/datatype/DatatypeConstants$1.class new file mode 100644 index 00000000..a599ff1c Binary files /dev/null and b/3rdParty/javax.xml/javax/xml/datatype/DatatypeConstants$1.class differ diff --git a/3rdParty/javax.xml/javax/xml/datatype/DatatypeConstants$Field.class b/3rdParty/javax.xml/javax/xml/datatype/DatatypeConstants$Field.class new file mode 100644 index 00000000..4ce08bb4 Binary files /dev/null and b/3rdParty/javax.xml/javax/xml/datatype/DatatypeConstants$Field.class differ diff --git a/3rdParty/javax.xml/javax/xml/datatype/DatatypeConstants.class b/3rdParty/javax.xml/javax/xml/datatype/DatatypeConstants.class new file mode 100644 index 00000000..f4e8e349 Binary files /dev/null and b/3rdParty/javax.xml/javax/xml/datatype/DatatypeConstants.class differ diff --git a/3rdParty/javax.xml/javax/xml/datatype/DatatypeFactory.class b/3rdParty/javax.xml/javax/xml/datatype/DatatypeFactory.class new file mode 100644 index 00000000..bd77cf02 Binary files /dev/null and b/3rdParty/javax.xml/javax/xml/datatype/DatatypeFactory.class differ diff --git a/3rdParty/javax.xml/javax/xml/datatype/Duration.class b/3rdParty/javax.xml/javax/xml/datatype/Duration.class new file mode 100644 index 00000000..7a80f455 Binary files /dev/null and b/3rdParty/javax.xml/javax/xml/datatype/Duration.class differ diff --git a/3rdParty/javax.xml/javax/xml/datatype/FactoryFinder$ConfigurationError.class b/3rdParty/javax.xml/javax/xml/datatype/FactoryFinder$ConfigurationError.class new file mode 100644 index 00000000..c73052cc Binary files /dev/null and b/3rdParty/javax.xml/javax/xml/datatype/FactoryFinder$ConfigurationError.class differ diff --git a/3rdParty/javax.xml/javax/xml/datatype/FactoryFinder.class b/3rdParty/javax.xml/javax/xml/datatype/FactoryFinder.class new file mode 100644 index 00000000..949052a5 Binary files /dev/null and b/3rdParty/javax.xml/javax/xml/datatype/FactoryFinder.class differ diff --git a/3rdParty/javax.xml/javax/xml/datatype/SecuritySupport$1.class b/3rdParty/javax.xml/javax/xml/datatype/SecuritySupport$1.class new file mode 100644 index 00000000..2268124d Binary files /dev/null and b/3rdParty/javax.xml/javax/xml/datatype/SecuritySupport$1.class differ diff --git a/3rdParty/javax.xml/javax/xml/datatype/SecuritySupport$2.class b/3rdParty/javax.xml/javax/xml/datatype/SecuritySupport$2.class new file mode 100644 index 00000000..ce62ba97 Binary files /dev/null and b/3rdParty/javax.xml/javax/xml/datatype/SecuritySupport$2.class differ diff --git a/3rdParty/javax.xml/javax/xml/datatype/SecuritySupport$3.class b/3rdParty/javax.xml/javax/xml/datatype/SecuritySupport$3.class new file mode 100644 index 00000000..080ed79a Binary files /dev/null and b/3rdParty/javax.xml/javax/xml/datatype/SecuritySupport$3.class differ diff --git a/3rdParty/javax.xml/javax/xml/datatype/SecuritySupport$4.class b/3rdParty/javax.xml/javax/xml/datatype/SecuritySupport$4.class new file mode 100644 index 00000000..a1cb2608 Binary files /dev/null and b/3rdParty/javax.xml/javax/xml/datatype/SecuritySupport$4.class differ diff --git a/3rdParty/javax.xml/javax/xml/datatype/SecuritySupport$5.class b/3rdParty/javax.xml/javax/xml/datatype/SecuritySupport$5.class new file mode 100644 index 00000000..d739df9d Binary files /dev/null and b/3rdParty/javax.xml/javax/xml/datatype/SecuritySupport$5.class differ diff --git a/3rdParty/javax.xml/javax/xml/datatype/SecuritySupport.class b/3rdParty/javax.xml/javax/xml/datatype/SecuritySupport.class new file mode 100644 index 00000000..75b59cc3 Binary files /dev/null and b/3rdParty/javax.xml/javax/xml/datatype/SecuritySupport.class differ diff --git a/3rdParty/javax.xml/javax/xml/datatype/XMLGregorianCalendar.class b/3rdParty/javax.xml/javax/xml/datatype/XMLGregorianCalendar.class new file mode 100644 index 00000000..e16c2fa5 Binary files /dev/null and b/3rdParty/javax.xml/javax/xml/datatype/XMLGregorianCalendar.class differ diff --git a/3rdParty/javax.xml/javax/xml/namespace/NamespaceContext.class b/3rdParty/javax.xml/javax/xml/namespace/NamespaceContext.class new file mode 100644 index 00000000..db2ef45b Binary files /dev/null and b/3rdParty/javax.xml/javax/xml/namespace/NamespaceContext.class differ diff --git a/3rdParty/javax.xml/javax/xml/namespace/QName$1.class b/3rdParty/javax.xml/javax/xml/namespace/QName$1.class new file mode 100644 index 00000000..fefdd9ed Binary files /dev/null and b/3rdParty/javax.xml/javax/xml/namespace/QName$1.class differ diff --git a/3rdParty/javax.xml/javax/xml/namespace/QName.class b/3rdParty/javax.xml/javax/xml/namespace/QName.class new file mode 100644 index 00000000..5f5feb64 Binary files /dev/null and b/3rdParty/javax.xml/javax/xml/namespace/QName.class differ diff --git a/3rdParty/javax.xml/javax/xml/parsers/DocumentBuilder.class b/3rdParty/javax.xml/javax/xml/parsers/DocumentBuilder.class new file mode 100644 index 00000000..b799a7db Binary files /dev/null and b/3rdParty/javax.xml/javax/xml/parsers/DocumentBuilder.class differ diff --git a/3rdParty/javax.xml/javax/xml/parsers/DocumentBuilderFactory.class b/3rdParty/javax.xml/javax/xml/parsers/DocumentBuilderFactory.class new file mode 100644 index 00000000..6a8d6eff Binary files /dev/null and b/3rdParty/javax.xml/javax/xml/parsers/DocumentBuilderFactory.class differ diff --git a/3rdParty/javax.xml/javax/xml/parsers/FactoryConfigurationError.class b/3rdParty/javax.xml/javax/xml/parsers/FactoryConfigurationError.class new file mode 100644 index 00000000..cb0254b0 Binary files /dev/null and b/3rdParty/javax.xml/javax/xml/parsers/FactoryConfigurationError.class differ diff --git a/3rdParty/javax.xml/javax/xml/parsers/FactoryFinder$ConfigurationError.class b/3rdParty/javax.xml/javax/xml/parsers/FactoryFinder$ConfigurationError.class new file mode 100644 index 00000000..ff408d42 Binary files /dev/null and b/3rdParty/javax.xml/javax/xml/parsers/FactoryFinder$ConfigurationError.class differ diff --git a/3rdParty/javax.xml/javax/xml/parsers/FactoryFinder.class b/3rdParty/javax.xml/javax/xml/parsers/FactoryFinder.class new file mode 100644 index 00000000..16205cd8 Binary files /dev/null and b/3rdParty/javax.xml/javax/xml/parsers/FactoryFinder.class differ diff --git a/3rdParty/javax.xml/javax/xml/parsers/FilePathToURI.class b/3rdParty/javax.xml/javax/xml/parsers/FilePathToURI.class new file mode 100644 index 00000000..89cf2c8d Binary files /dev/null and b/3rdParty/javax.xml/javax/xml/parsers/FilePathToURI.class differ diff --git a/3rdParty/javax.xml/javax/xml/parsers/ParserConfigurationException.class b/3rdParty/javax.xml/javax/xml/parsers/ParserConfigurationException.class new file mode 100644 index 00000000..97756711 Binary files /dev/null and b/3rdParty/javax.xml/javax/xml/parsers/ParserConfigurationException.class differ diff --git a/3rdParty/javax.xml/javax/xml/parsers/SAXParser.class b/3rdParty/javax.xml/javax/xml/parsers/SAXParser.class new file mode 100644 index 00000000..0519009a Binary files /dev/null and b/3rdParty/javax.xml/javax/xml/parsers/SAXParser.class differ diff --git a/3rdParty/javax.xml/javax/xml/parsers/SAXParserFactory.class b/3rdParty/javax.xml/javax/xml/parsers/SAXParserFactory.class new file mode 100644 index 00000000..f8bceb8d Binary files /dev/null and b/3rdParty/javax.xml/javax/xml/parsers/SAXParserFactory.class differ diff --git a/3rdParty/javax.xml/javax/xml/parsers/SecuritySupport$1.class b/3rdParty/javax.xml/javax/xml/parsers/SecuritySupport$1.class new file mode 100644 index 00000000..982b261d Binary files /dev/null and b/3rdParty/javax.xml/javax/xml/parsers/SecuritySupport$1.class differ diff --git a/3rdParty/javax.xml/javax/xml/parsers/SecuritySupport$2.class b/3rdParty/javax.xml/javax/xml/parsers/SecuritySupport$2.class new file mode 100644 index 00000000..983ce016 Binary files /dev/null and b/3rdParty/javax.xml/javax/xml/parsers/SecuritySupport$2.class differ diff --git a/3rdParty/javax.xml/javax/xml/parsers/SecuritySupport$3.class b/3rdParty/javax.xml/javax/xml/parsers/SecuritySupport$3.class new file mode 100644 index 00000000..002736e0 Binary files /dev/null and b/3rdParty/javax.xml/javax/xml/parsers/SecuritySupport$3.class differ diff --git a/3rdParty/javax.xml/javax/xml/parsers/SecuritySupport$4.class b/3rdParty/javax.xml/javax/xml/parsers/SecuritySupport$4.class new file mode 100644 index 00000000..0343e377 Binary files /dev/null and b/3rdParty/javax.xml/javax/xml/parsers/SecuritySupport$4.class differ diff --git a/3rdParty/javax.xml/javax/xml/parsers/SecuritySupport$5.class b/3rdParty/javax.xml/javax/xml/parsers/SecuritySupport$5.class new file mode 100644 index 00000000..2b5d3dee Binary files /dev/null and b/3rdParty/javax.xml/javax/xml/parsers/SecuritySupport$5.class differ diff --git a/3rdParty/javax.xml/javax/xml/parsers/SecuritySupport.class b/3rdParty/javax.xml/javax/xml/parsers/SecuritySupport.class new file mode 100644 index 00000000..79799c3c Binary files /dev/null and b/3rdParty/javax.xml/javax/xml/parsers/SecuritySupport.class differ diff --git a/3rdParty/javax.xml/javax/xml/stream/EventFilter.class b/3rdParty/javax.xml/javax/xml/stream/EventFilter.class new file mode 100644 index 00000000..7620f7b4 Binary files /dev/null and b/3rdParty/javax.xml/javax/xml/stream/EventFilter.class differ diff --git a/3rdParty/javax.xml/javax/xml/stream/FactoryConfigurationError.class b/3rdParty/javax.xml/javax/xml/stream/FactoryConfigurationError.class new file mode 100644 index 00000000..68707658 Binary files /dev/null and b/3rdParty/javax.xml/javax/xml/stream/FactoryConfigurationError.class differ diff --git a/3rdParty/javax.xml/javax/xml/stream/FactoryFinder$ConfigurationError.class b/3rdParty/javax.xml/javax/xml/stream/FactoryFinder$ConfigurationError.class new file mode 100644 index 00000000..2ad8d0b9 Binary files /dev/null and b/3rdParty/javax.xml/javax/xml/stream/FactoryFinder$ConfigurationError.class differ diff --git a/3rdParty/javax.xml/javax/xml/stream/FactoryFinder.class b/3rdParty/javax.xml/javax/xml/stream/FactoryFinder.class new file mode 100644 index 00000000..bae33c01 Binary files /dev/null and b/3rdParty/javax.xml/javax/xml/stream/FactoryFinder.class differ diff --git a/3rdParty/javax.xml/javax/xml/stream/Location.class b/3rdParty/javax.xml/javax/xml/stream/Location.class new file mode 100644 index 00000000..d0b3a2a4 Binary files /dev/null and b/3rdParty/javax.xml/javax/xml/stream/Location.class differ diff --git a/3rdParty/javax.xml/javax/xml/stream/SecuritySupport$1.class b/3rdParty/javax.xml/javax/xml/stream/SecuritySupport$1.class new file mode 100644 index 00000000..2e02f087 Binary files /dev/null and b/3rdParty/javax.xml/javax/xml/stream/SecuritySupport$1.class differ diff --git a/3rdParty/javax.xml/javax/xml/stream/SecuritySupport$2.class b/3rdParty/javax.xml/javax/xml/stream/SecuritySupport$2.class new file mode 100644 index 00000000..bb20bb7f Binary files /dev/null and b/3rdParty/javax.xml/javax/xml/stream/SecuritySupport$2.class differ diff --git a/3rdParty/javax.xml/javax/xml/stream/SecuritySupport$3.class b/3rdParty/javax.xml/javax/xml/stream/SecuritySupport$3.class new file mode 100644 index 00000000..7c6fdbe7 Binary files /dev/null and b/3rdParty/javax.xml/javax/xml/stream/SecuritySupport$3.class differ diff --git a/3rdParty/javax.xml/javax/xml/stream/SecuritySupport$4.class b/3rdParty/javax.xml/javax/xml/stream/SecuritySupport$4.class new file mode 100644 index 00000000..b4f70f64 Binary files /dev/null and b/3rdParty/javax.xml/javax/xml/stream/SecuritySupport$4.class differ diff --git a/3rdParty/javax.xml/javax/xml/stream/SecuritySupport$5.class b/3rdParty/javax.xml/javax/xml/stream/SecuritySupport$5.class new file mode 100644 index 00000000..f21d97ff Binary files /dev/null and b/3rdParty/javax.xml/javax/xml/stream/SecuritySupport$5.class differ diff --git a/3rdParty/javax.xml/javax/xml/stream/SecuritySupport.class b/3rdParty/javax.xml/javax/xml/stream/SecuritySupport.class new file mode 100644 index 00000000..3722cd16 Binary files /dev/null and b/3rdParty/javax.xml/javax/xml/stream/SecuritySupport.class differ diff --git a/3rdParty/javax.xml/javax/xml/stream/StreamFilter.class b/3rdParty/javax.xml/javax/xml/stream/StreamFilter.class new file mode 100644 index 00000000..8cbad666 Binary files /dev/null and b/3rdParty/javax.xml/javax/xml/stream/StreamFilter.class differ diff --git a/3rdParty/javax.xml/javax/xml/stream/XMLEventFactory.class b/3rdParty/javax.xml/javax/xml/stream/XMLEventFactory.class new file mode 100644 index 00000000..6a050e23 Binary files /dev/null and b/3rdParty/javax.xml/javax/xml/stream/XMLEventFactory.class differ diff --git a/3rdParty/javax.xml/javax/xml/stream/XMLEventReader.class b/3rdParty/javax.xml/javax/xml/stream/XMLEventReader.class new file mode 100644 index 00000000..50999ca8 Binary files /dev/null and b/3rdParty/javax.xml/javax/xml/stream/XMLEventReader.class differ diff --git a/3rdParty/javax.xml/javax/xml/stream/XMLEventWriter.class b/3rdParty/javax.xml/javax/xml/stream/XMLEventWriter.class new file mode 100644 index 00000000..c1262ebc Binary files /dev/null and b/3rdParty/javax.xml/javax/xml/stream/XMLEventWriter.class differ diff --git a/3rdParty/javax.xml/javax/xml/stream/XMLInputFactory.class b/3rdParty/javax.xml/javax/xml/stream/XMLInputFactory.class new file mode 100644 index 00000000..978c78f9 Binary files /dev/null and b/3rdParty/javax.xml/javax/xml/stream/XMLInputFactory.class differ diff --git a/3rdParty/javax.xml/javax/xml/stream/XMLOutputFactory.class b/3rdParty/javax.xml/javax/xml/stream/XMLOutputFactory.class new file mode 100644 index 00000000..181590f6 Binary files /dev/null and b/3rdParty/javax.xml/javax/xml/stream/XMLOutputFactory.class differ diff --git a/3rdParty/javax.xml/javax/xml/stream/XMLReporter.class b/3rdParty/javax.xml/javax/xml/stream/XMLReporter.class new file mode 100644 index 00000000..491e8f55 Binary files /dev/null and b/3rdParty/javax.xml/javax/xml/stream/XMLReporter.class differ diff --git a/3rdParty/javax.xml/javax/xml/stream/XMLResolver.class b/3rdParty/javax.xml/javax/xml/stream/XMLResolver.class new file mode 100644 index 00000000..607315ee Binary files /dev/null and b/3rdParty/javax.xml/javax/xml/stream/XMLResolver.class differ diff --git a/3rdParty/javax.xml/javax/xml/stream/XMLStreamConstants.class b/3rdParty/javax.xml/javax/xml/stream/XMLStreamConstants.class new file mode 100644 index 00000000..3aadadc0 Binary files /dev/null and b/3rdParty/javax.xml/javax/xml/stream/XMLStreamConstants.class differ diff --git a/3rdParty/javax.xml/javax/xml/stream/XMLStreamException.class b/3rdParty/javax.xml/javax/xml/stream/XMLStreamException.class new file mode 100644 index 00000000..695d9ad3 Binary files /dev/null and b/3rdParty/javax.xml/javax/xml/stream/XMLStreamException.class differ diff --git a/3rdParty/javax.xml/javax/xml/stream/XMLStreamReader.class b/3rdParty/javax.xml/javax/xml/stream/XMLStreamReader.class new file mode 100644 index 00000000..ae63e4e6 Binary files /dev/null and b/3rdParty/javax.xml/javax/xml/stream/XMLStreamReader.class differ diff --git a/3rdParty/javax.xml/javax/xml/stream/XMLStreamWriter.class b/3rdParty/javax.xml/javax/xml/stream/XMLStreamWriter.class new file mode 100644 index 00000000..ea9cf49b Binary files /dev/null and b/3rdParty/javax.xml/javax/xml/stream/XMLStreamWriter.class differ diff --git a/3rdParty/javax.xml/javax/xml/stream/events/Attribute.class b/3rdParty/javax.xml/javax/xml/stream/events/Attribute.class new file mode 100644 index 00000000..32bd467f Binary files /dev/null and b/3rdParty/javax.xml/javax/xml/stream/events/Attribute.class differ diff --git a/3rdParty/javax.xml/javax/xml/stream/events/Characters.class b/3rdParty/javax.xml/javax/xml/stream/events/Characters.class new file mode 100644 index 00000000..10a31a8c Binary files /dev/null and b/3rdParty/javax.xml/javax/xml/stream/events/Characters.class differ diff --git a/3rdParty/javax.xml/javax/xml/stream/events/Comment.class b/3rdParty/javax.xml/javax/xml/stream/events/Comment.class new file mode 100644 index 00000000..bd8b31da Binary files /dev/null and b/3rdParty/javax.xml/javax/xml/stream/events/Comment.class differ diff --git a/3rdParty/javax.xml/javax/xml/stream/events/DTD.class b/3rdParty/javax.xml/javax/xml/stream/events/DTD.class new file mode 100644 index 00000000..85b4c1a1 Binary files /dev/null and b/3rdParty/javax.xml/javax/xml/stream/events/DTD.class differ diff --git a/3rdParty/javax.xml/javax/xml/stream/events/EndDocument.class b/3rdParty/javax.xml/javax/xml/stream/events/EndDocument.class new file mode 100644 index 00000000..a34251fd Binary files /dev/null and b/3rdParty/javax.xml/javax/xml/stream/events/EndDocument.class differ diff --git a/3rdParty/javax.xml/javax/xml/stream/events/EndElement.class b/3rdParty/javax.xml/javax/xml/stream/events/EndElement.class new file mode 100644 index 00000000..7896b741 Binary files /dev/null and b/3rdParty/javax.xml/javax/xml/stream/events/EndElement.class differ diff --git a/3rdParty/javax.xml/javax/xml/stream/events/EntityDeclaration.class b/3rdParty/javax.xml/javax/xml/stream/events/EntityDeclaration.class new file mode 100644 index 00000000..ea183b09 Binary files /dev/null and b/3rdParty/javax.xml/javax/xml/stream/events/EntityDeclaration.class differ diff --git a/3rdParty/javax.xml/javax/xml/stream/events/EntityReference.class b/3rdParty/javax.xml/javax/xml/stream/events/EntityReference.class new file mode 100644 index 00000000..1b08a98e Binary files /dev/null and b/3rdParty/javax.xml/javax/xml/stream/events/EntityReference.class differ diff --git a/3rdParty/javax.xml/javax/xml/stream/events/Namespace.class b/3rdParty/javax.xml/javax/xml/stream/events/Namespace.class new file mode 100644 index 00000000..a407484a Binary files /dev/null and b/3rdParty/javax.xml/javax/xml/stream/events/Namespace.class differ diff --git a/3rdParty/javax.xml/javax/xml/stream/events/NotationDeclaration.class b/3rdParty/javax.xml/javax/xml/stream/events/NotationDeclaration.class new file mode 100644 index 00000000..9c96769c Binary files /dev/null and b/3rdParty/javax.xml/javax/xml/stream/events/NotationDeclaration.class differ diff --git a/3rdParty/javax.xml/javax/xml/stream/events/ProcessingInstruction.class b/3rdParty/javax.xml/javax/xml/stream/events/ProcessingInstruction.class new file mode 100644 index 00000000..be3051b2 Binary files /dev/null and b/3rdParty/javax.xml/javax/xml/stream/events/ProcessingInstruction.class differ diff --git a/3rdParty/javax.xml/javax/xml/stream/events/StartDocument.class b/3rdParty/javax.xml/javax/xml/stream/events/StartDocument.class new file mode 100644 index 00000000..bbc961e6 Binary files /dev/null and b/3rdParty/javax.xml/javax/xml/stream/events/StartDocument.class differ diff --git a/3rdParty/javax.xml/javax/xml/stream/events/StartElement.class b/3rdParty/javax.xml/javax/xml/stream/events/StartElement.class new file mode 100644 index 00000000..32612ad5 Binary files /dev/null and b/3rdParty/javax.xml/javax/xml/stream/events/StartElement.class differ diff --git a/3rdParty/javax.xml/javax/xml/stream/events/XMLEvent.class b/3rdParty/javax.xml/javax/xml/stream/events/XMLEvent.class new file mode 100644 index 00000000..5e149b0c Binary files /dev/null and b/3rdParty/javax.xml/javax/xml/stream/events/XMLEvent.class differ diff --git a/3rdParty/javax.xml/javax/xml/stream/util/EventReaderDelegate.class b/3rdParty/javax.xml/javax/xml/stream/util/EventReaderDelegate.class new file mode 100644 index 00000000..b7a577d2 Binary files /dev/null and b/3rdParty/javax.xml/javax/xml/stream/util/EventReaderDelegate.class differ diff --git a/3rdParty/javax.xml/javax/xml/stream/util/StreamReaderDelegate.class b/3rdParty/javax.xml/javax/xml/stream/util/StreamReaderDelegate.class new file mode 100644 index 00000000..c6173414 Binary files /dev/null and b/3rdParty/javax.xml/javax/xml/stream/util/StreamReaderDelegate.class differ diff --git a/3rdParty/javax.xml/javax/xml/stream/util/XMLEventAllocator.class b/3rdParty/javax.xml/javax/xml/stream/util/XMLEventAllocator.class new file mode 100644 index 00000000..ffe11698 Binary files /dev/null and b/3rdParty/javax.xml/javax/xml/stream/util/XMLEventAllocator.class differ diff --git a/3rdParty/javax.xml/javax/xml/stream/util/XMLEventConsumer.class b/3rdParty/javax.xml/javax/xml/stream/util/XMLEventConsumer.class new file mode 100644 index 00000000..5c52b401 Binary files /dev/null and b/3rdParty/javax.xml/javax/xml/stream/util/XMLEventConsumer.class differ diff --git a/3rdParty/javax.xml/javax/xml/transform/ErrorListener.class b/3rdParty/javax.xml/javax/xml/transform/ErrorListener.class new file mode 100644 index 00000000..a6f9a1a0 Binary files /dev/null and b/3rdParty/javax.xml/javax/xml/transform/ErrorListener.class differ diff --git a/3rdParty/javax.xml/javax/xml/transform/FactoryFinder$ConfigurationError.class b/3rdParty/javax.xml/javax/xml/transform/FactoryFinder$ConfigurationError.class new file mode 100644 index 00000000..4bd0c841 Binary files /dev/null and b/3rdParty/javax.xml/javax/xml/transform/FactoryFinder$ConfigurationError.class differ diff --git a/3rdParty/javax.xml/javax/xml/transform/FactoryFinder.class b/3rdParty/javax.xml/javax/xml/transform/FactoryFinder.class new file mode 100644 index 00000000..2c8e4494 Binary files /dev/null and b/3rdParty/javax.xml/javax/xml/transform/FactoryFinder.class differ diff --git a/3rdParty/javax.xml/javax/xml/transform/OutputKeys.class b/3rdParty/javax.xml/javax/xml/transform/OutputKeys.class new file mode 100644 index 00000000..def821de Binary files /dev/null and b/3rdParty/javax.xml/javax/xml/transform/OutputKeys.class differ diff --git a/3rdParty/javax.xml/javax/xml/transform/Result.class b/3rdParty/javax.xml/javax/xml/transform/Result.class new file mode 100644 index 00000000..7a946701 Binary files /dev/null and b/3rdParty/javax.xml/javax/xml/transform/Result.class differ diff --git a/3rdParty/javax.xml/javax/xml/transform/SecuritySupport$1.class b/3rdParty/javax.xml/javax/xml/transform/SecuritySupport$1.class new file mode 100644 index 00000000..b774a66d Binary files /dev/null and b/3rdParty/javax.xml/javax/xml/transform/SecuritySupport$1.class differ diff --git a/3rdParty/javax.xml/javax/xml/transform/SecuritySupport$2.class b/3rdParty/javax.xml/javax/xml/transform/SecuritySupport$2.class new file mode 100644 index 00000000..952ea57b Binary files /dev/null and b/3rdParty/javax.xml/javax/xml/transform/SecuritySupport$2.class differ diff --git a/3rdParty/javax.xml/javax/xml/transform/SecuritySupport$3.class b/3rdParty/javax.xml/javax/xml/transform/SecuritySupport$3.class new file mode 100644 index 00000000..cda77761 Binary files /dev/null and b/3rdParty/javax.xml/javax/xml/transform/SecuritySupport$3.class differ diff --git a/3rdParty/javax.xml/javax/xml/transform/SecuritySupport$4.class b/3rdParty/javax.xml/javax/xml/transform/SecuritySupport$4.class new file mode 100644 index 00000000..febce4eb Binary files /dev/null and b/3rdParty/javax.xml/javax/xml/transform/SecuritySupport$4.class differ diff --git a/3rdParty/javax.xml/javax/xml/transform/SecuritySupport$5.class b/3rdParty/javax.xml/javax/xml/transform/SecuritySupport$5.class new file mode 100644 index 00000000..344b4427 Binary files /dev/null and b/3rdParty/javax.xml/javax/xml/transform/SecuritySupport$5.class differ diff --git a/3rdParty/javax.xml/javax/xml/transform/SecuritySupport.class b/3rdParty/javax.xml/javax/xml/transform/SecuritySupport.class new file mode 100644 index 00000000..4e5acc7c Binary files /dev/null and b/3rdParty/javax.xml/javax/xml/transform/SecuritySupport.class differ diff --git a/3rdParty/javax.xml/javax/xml/transform/Source.class b/3rdParty/javax.xml/javax/xml/transform/Source.class new file mode 100644 index 00000000..41186323 Binary files /dev/null and b/3rdParty/javax.xml/javax/xml/transform/Source.class differ diff --git a/3rdParty/javax.xml/javax/xml/transform/SourceLocator.class b/3rdParty/javax.xml/javax/xml/transform/SourceLocator.class new file mode 100644 index 00000000..acc1b676 Binary files /dev/null and b/3rdParty/javax.xml/javax/xml/transform/SourceLocator.class differ diff --git a/3rdParty/javax.xml/javax/xml/transform/Templates.class b/3rdParty/javax.xml/javax/xml/transform/Templates.class new file mode 100644 index 00000000..aefba9dc Binary files /dev/null and b/3rdParty/javax.xml/javax/xml/transform/Templates.class differ diff --git a/3rdParty/javax.xml/javax/xml/transform/Transformer.class b/3rdParty/javax.xml/javax/xml/transform/Transformer.class new file mode 100644 index 00000000..a32a69a3 Binary files /dev/null and b/3rdParty/javax.xml/javax/xml/transform/Transformer.class differ diff --git a/3rdParty/javax.xml/javax/xml/transform/TransformerConfigurationException.class b/3rdParty/javax.xml/javax/xml/transform/TransformerConfigurationException.class new file mode 100644 index 00000000..eaf05c8a Binary files /dev/null and b/3rdParty/javax.xml/javax/xml/transform/TransformerConfigurationException.class differ diff --git a/3rdParty/javax.xml/javax/xml/transform/TransformerException.class b/3rdParty/javax.xml/javax/xml/transform/TransformerException.class new file mode 100644 index 00000000..2c8228cb Binary files /dev/null and b/3rdParty/javax.xml/javax/xml/transform/TransformerException.class differ diff --git a/3rdParty/javax.xml/javax/xml/transform/TransformerFactory.class b/3rdParty/javax.xml/javax/xml/transform/TransformerFactory.class new file mode 100644 index 00000000..2f88fba2 Binary files /dev/null and b/3rdParty/javax.xml/javax/xml/transform/TransformerFactory.class differ diff --git a/3rdParty/javax.xml/javax/xml/transform/TransformerFactoryConfigurationError.class b/3rdParty/javax.xml/javax/xml/transform/TransformerFactoryConfigurationError.class new file mode 100644 index 00000000..70770a08 Binary files /dev/null and b/3rdParty/javax.xml/javax/xml/transform/TransformerFactoryConfigurationError.class differ diff --git a/3rdParty/javax.xml/javax/xml/transform/URIResolver.class b/3rdParty/javax.xml/javax/xml/transform/URIResolver.class new file mode 100644 index 00000000..98d21d42 Binary files /dev/null and b/3rdParty/javax.xml/javax/xml/transform/URIResolver.class differ diff --git a/3rdParty/javax.xml/javax/xml/transform/dom/DOMLocator.class b/3rdParty/javax.xml/javax/xml/transform/dom/DOMLocator.class new file mode 100644 index 00000000..852a7eba Binary files /dev/null and b/3rdParty/javax.xml/javax/xml/transform/dom/DOMLocator.class differ diff --git a/3rdParty/javax.xml/javax/xml/transform/dom/DOMResult.class b/3rdParty/javax.xml/javax/xml/transform/dom/DOMResult.class new file mode 100644 index 00000000..93fa4ff7 Binary files /dev/null and b/3rdParty/javax.xml/javax/xml/transform/dom/DOMResult.class differ diff --git a/3rdParty/javax.xml/javax/xml/transform/dom/DOMSource.class b/3rdParty/javax.xml/javax/xml/transform/dom/DOMSource.class new file mode 100644 index 00000000..b064dc6d Binary files /dev/null and b/3rdParty/javax.xml/javax/xml/transform/dom/DOMSource.class differ diff --git a/3rdParty/javax.xml/javax/xml/transform/sax/SAXResult.class b/3rdParty/javax.xml/javax/xml/transform/sax/SAXResult.class new file mode 100644 index 00000000..680d02bc Binary files /dev/null and b/3rdParty/javax.xml/javax/xml/transform/sax/SAXResult.class differ diff --git a/3rdParty/javax.xml/javax/xml/transform/sax/SAXSource.class b/3rdParty/javax.xml/javax/xml/transform/sax/SAXSource.class new file mode 100644 index 00000000..6bfa8c72 Binary files /dev/null and b/3rdParty/javax.xml/javax/xml/transform/sax/SAXSource.class differ diff --git a/3rdParty/javax.xml/javax/xml/transform/sax/SAXTransformerFactory.class b/3rdParty/javax.xml/javax/xml/transform/sax/SAXTransformerFactory.class new file mode 100644 index 00000000..57819c20 Binary files /dev/null and b/3rdParty/javax.xml/javax/xml/transform/sax/SAXTransformerFactory.class differ diff --git a/3rdParty/javax.xml/javax/xml/transform/sax/TemplatesHandler.class b/3rdParty/javax.xml/javax/xml/transform/sax/TemplatesHandler.class new file mode 100644 index 00000000..dc8143be Binary files /dev/null and b/3rdParty/javax.xml/javax/xml/transform/sax/TemplatesHandler.class differ diff --git a/3rdParty/javax.xml/javax/xml/transform/sax/TransformerHandler.class b/3rdParty/javax.xml/javax/xml/transform/sax/TransformerHandler.class new file mode 100644 index 00000000..1d3139e4 Binary files /dev/null and b/3rdParty/javax.xml/javax/xml/transform/sax/TransformerHandler.class differ diff --git a/3rdParty/javax.xml/javax/xml/transform/stax/StAXResult.class b/3rdParty/javax.xml/javax/xml/transform/stax/StAXResult.class new file mode 100644 index 00000000..9b780718 Binary files /dev/null and b/3rdParty/javax.xml/javax/xml/transform/stax/StAXResult.class differ diff --git a/3rdParty/javax.xml/javax/xml/transform/stax/StAXSource.class b/3rdParty/javax.xml/javax/xml/transform/stax/StAXSource.class new file mode 100644 index 00000000..367463f6 Binary files /dev/null and b/3rdParty/javax.xml/javax/xml/transform/stax/StAXSource.class differ diff --git a/3rdParty/javax.xml/javax/xml/transform/stream/FilePathToURI.class b/3rdParty/javax.xml/javax/xml/transform/stream/FilePathToURI.class new file mode 100644 index 00000000..4a53d242 Binary files /dev/null and b/3rdParty/javax.xml/javax/xml/transform/stream/FilePathToURI.class differ diff --git a/3rdParty/javax.xml/javax/xml/transform/stream/StreamResult.class b/3rdParty/javax.xml/javax/xml/transform/stream/StreamResult.class new file mode 100644 index 00000000..cace6617 Binary files /dev/null and b/3rdParty/javax.xml/javax/xml/transform/stream/StreamResult.class differ diff --git a/3rdParty/javax.xml/javax/xml/transform/stream/StreamSource.class b/3rdParty/javax.xml/javax/xml/transform/stream/StreamSource.class new file mode 100644 index 00000000..f0ef82e3 Binary files /dev/null and b/3rdParty/javax.xml/javax/xml/transform/stream/StreamSource.class differ diff --git a/3rdParty/javax.xml/javax/xml/validation/Schema.class b/3rdParty/javax.xml/javax/xml/validation/Schema.class new file mode 100644 index 00000000..1dd7429f Binary files /dev/null and b/3rdParty/javax.xml/javax/xml/validation/Schema.class differ diff --git a/3rdParty/javax.xml/javax/xml/validation/SchemaFactory.class b/3rdParty/javax.xml/javax/xml/validation/SchemaFactory.class new file mode 100644 index 00000000..e124f20c Binary files /dev/null and b/3rdParty/javax.xml/javax/xml/validation/SchemaFactory.class differ diff --git a/3rdParty/javax.xml/javax/xml/validation/SchemaFactoryFinder$1.class b/3rdParty/javax.xml/javax/xml/validation/SchemaFactoryFinder$1.class new file mode 100644 index 00000000..108f59b4 Binary files /dev/null and b/3rdParty/javax.xml/javax/xml/validation/SchemaFactoryFinder$1.class differ diff --git a/3rdParty/javax.xml/javax/xml/validation/SchemaFactoryFinder$2.class b/3rdParty/javax.xml/javax/xml/validation/SchemaFactoryFinder$2.class new file mode 100644 index 00000000..89fc025a Binary files /dev/null and b/3rdParty/javax.xml/javax/xml/validation/SchemaFactoryFinder$2.class differ diff --git a/3rdParty/javax.xml/javax/xml/validation/SchemaFactoryFinder$SingleIterator.class b/3rdParty/javax.xml/javax/xml/validation/SchemaFactoryFinder$SingleIterator.class new file mode 100644 index 00000000..0f447742 Binary files /dev/null and b/3rdParty/javax.xml/javax/xml/validation/SchemaFactoryFinder$SingleIterator.class differ diff --git a/3rdParty/javax.xml/javax/xml/validation/SchemaFactoryFinder.class b/3rdParty/javax.xml/javax/xml/validation/SchemaFactoryFinder.class new file mode 100644 index 00000000..7145ed05 Binary files /dev/null and b/3rdParty/javax.xml/javax/xml/validation/SchemaFactoryFinder.class differ diff --git a/3rdParty/javax.xml/javax/xml/validation/SchemaFactoryLoader.class b/3rdParty/javax.xml/javax/xml/validation/SchemaFactoryLoader.class new file mode 100644 index 00000000..13e0c0ba Binary files /dev/null and b/3rdParty/javax.xml/javax/xml/validation/SchemaFactoryLoader.class differ diff --git a/3rdParty/javax.xml/javax/xml/validation/SecuritySupport$1.class b/3rdParty/javax.xml/javax/xml/validation/SecuritySupport$1.class new file mode 100644 index 00000000..1f623b46 Binary files /dev/null and b/3rdParty/javax.xml/javax/xml/validation/SecuritySupport$1.class differ diff --git a/3rdParty/javax.xml/javax/xml/validation/SecuritySupport$2.class b/3rdParty/javax.xml/javax/xml/validation/SecuritySupport$2.class new file mode 100644 index 00000000..d1cc4531 Binary files /dev/null and b/3rdParty/javax.xml/javax/xml/validation/SecuritySupport$2.class differ diff --git a/3rdParty/javax.xml/javax/xml/validation/SecuritySupport$3.class b/3rdParty/javax.xml/javax/xml/validation/SecuritySupport$3.class new file mode 100644 index 00000000..9e47714a Binary files /dev/null and b/3rdParty/javax.xml/javax/xml/validation/SecuritySupport$3.class differ diff --git a/3rdParty/javax.xml/javax/xml/validation/SecuritySupport$4.class b/3rdParty/javax.xml/javax/xml/validation/SecuritySupport$4.class new file mode 100644 index 00000000..9463ae42 Binary files /dev/null and b/3rdParty/javax.xml/javax/xml/validation/SecuritySupport$4.class differ diff --git a/3rdParty/javax.xml/javax/xml/validation/SecuritySupport$5.class b/3rdParty/javax.xml/javax/xml/validation/SecuritySupport$5.class new file mode 100644 index 00000000..82807641 Binary files /dev/null and b/3rdParty/javax.xml/javax/xml/validation/SecuritySupport$5.class differ diff --git a/3rdParty/javax.xml/javax/xml/validation/SecuritySupport$6.class b/3rdParty/javax.xml/javax/xml/validation/SecuritySupport$6.class new file mode 100644 index 00000000..7ee69277 Binary files /dev/null and b/3rdParty/javax.xml/javax/xml/validation/SecuritySupport$6.class differ diff --git a/3rdParty/javax.xml/javax/xml/validation/SecuritySupport$7.class b/3rdParty/javax.xml/javax/xml/validation/SecuritySupport$7.class new file mode 100644 index 00000000..d0f7eff6 Binary files /dev/null and b/3rdParty/javax.xml/javax/xml/validation/SecuritySupport$7.class differ diff --git a/3rdParty/javax.xml/javax/xml/validation/SecuritySupport$8.class b/3rdParty/javax.xml/javax/xml/validation/SecuritySupport$8.class new file mode 100644 index 00000000..7ab4df9f Binary files /dev/null and b/3rdParty/javax.xml/javax/xml/validation/SecuritySupport$8.class differ diff --git a/3rdParty/javax.xml/javax/xml/validation/SecuritySupport.class b/3rdParty/javax.xml/javax/xml/validation/SecuritySupport.class new file mode 100644 index 00000000..72b5c41a Binary files /dev/null and b/3rdParty/javax.xml/javax/xml/validation/SecuritySupport.class differ diff --git a/3rdParty/javax.xml/javax/xml/validation/TypeInfoProvider.class b/3rdParty/javax.xml/javax/xml/validation/TypeInfoProvider.class new file mode 100644 index 00000000..fcea0a55 Binary files /dev/null and b/3rdParty/javax.xml/javax/xml/validation/TypeInfoProvider.class differ diff --git a/3rdParty/javax.xml/javax/xml/validation/Validator.class b/3rdParty/javax.xml/javax/xml/validation/Validator.class new file mode 100644 index 00000000..a0b20ec5 Binary files /dev/null and b/3rdParty/javax.xml/javax/xml/validation/Validator.class differ diff --git a/3rdParty/javax.xml/javax/xml/validation/ValidatorHandler.class b/3rdParty/javax.xml/javax/xml/validation/ValidatorHandler.class new file mode 100644 index 00000000..e36cc939 Binary files /dev/null and b/3rdParty/javax.xml/javax/xml/validation/ValidatorHandler.class differ diff --git a/3rdParty/javax.xml/javax/xml/xpath/SecuritySupport$1.class b/3rdParty/javax.xml/javax/xml/xpath/SecuritySupport$1.class new file mode 100644 index 00000000..954bb297 Binary files /dev/null and b/3rdParty/javax.xml/javax/xml/xpath/SecuritySupport$1.class differ diff --git a/3rdParty/javax.xml/javax/xml/xpath/SecuritySupport$2.class b/3rdParty/javax.xml/javax/xml/xpath/SecuritySupport$2.class new file mode 100644 index 00000000..58ced7e7 Binary files /dev/null and b/3rdParty/javax.xml/javax/xml/xpath/SecuritySupport$2.class differ diff --git a/3rdParty/javax.xml/javax/xml/xpath/SecuritySupport$3.class b/3rdParty/javax.xml/javax/xml/xpath/SecuritySupport$3.class new file mode 100644 index 00000000..3cbf66b2 Binary files /dev/null and b/3rdParty/javax.xml/javax/xml/xpath/SecuritySupport$3.class differ diff --git a/3rdParty/javax.xml/javax/xml/xpath/SecuritySupport$4.class b/3rdParty/javax.xml/javax/xml/xpath/SecuritySupport$4.class new file mode 100644 index 00000000..8297f851 Binary files /dev/null and b/3rdParty/javax.xml/javax/xml/xpath/SecuritySupport$4.class differ diff --git a/3rdParty/javax.xml/javax/xml/xpath/SecuritySupport$5.class b/3rdParty/javax.xml/javax/xml/xpath/SecuritySupport$5.class new file mode 100644 index 00000000..187af257 Binary files /dev/null and b/3rdParty/javax.xml/javax/xml/xpath/SecuritySupport$5.class differ diff --git a/3rdParty/javax.xml/javax/xml/xpath/SecuritySupport$6.class b/3rdParty/javax.xml/javax/xml/xpath/SecuritySupport$6.class new file mode 100644 index 00000000..0d4befdb Binary files /dev/null and b/3rdParty/javax.xml/javax/xml/xpath/SecuritySupport$6.class differ diff --git a/3rdParty/javax.xml/javax/xml/xpath/SecuritySupport$7.class b/3rdParty/javax.xml/javax/xml/xpath/SecuritySupport$7.class new file mode 100644 index 00000000..ae665a46 Binary files /dev/null and b/3rdParty/javax.xml/javax/xml/xpath/SecuritySupport$7.class differ diff --git a/3rdParty/javax.xml/javax/xml/xpath/SecuritySupport$8.class b/3rdParty/javax.xml/javax/xml/xpath/SecuritySupport$8.class new file mode 100644 index 00000000..af71dfcc Binary files /dev/null and b/3rdParty/javax.xml/javax/xml/xpath/SecuritySupport$8.class differ diff --git a/3rdParty/javax.xml/javax/xml/xpath/SecuritySupport.class b/3rdParty/javax.xml/javax/xml/xpath/SecuritySupport.class new file mode 100644 index 00000000..02f35fc8 Binary files /dev/null and b/3rdParty/javax.xml/javax/xml/xpath/SecuritySupport.class differ diff --git a/3rdParty/javax.xml/javax/xml/xpath/XPath.class b/3rdParty/javax.xml/javax/xml/xpath/XPath.class new file mode 100644 index 00000000..16593402 Binary files /dev/null and b/3rdParty/javax.xml/javax/xml/xpath/XPath.class differ diff --git a/3rdParty/javax.xml/javax/xml/xpath/XPathConstants.class b/3rdParty/javax.xml/javax/xml/xpath/XPathConstants.class new file mode 100644 index 00000000..1adaf154 Binary files /dev/null and b/3rdParty/javax.xml/javax/xml/xpath/XPathConstants.class differ diff --git a/3rdParty/javax.xml/javax/xml/xpath/XPathException.class b/3rdParty/javax.xml/javax/xml/xpath/XPathException.class new file mode 100644 index 00000000..06c79480 Binary files /dev/null and b/3rdParty/javax.xml/javax/xml/xpath/XPathException.class differ diff --git a/3rdParty/javax.xml/javax/xml/xpath/XPathExpression.class b/3rdParty/javax.xml/javax/xml/xpath/XPathExpression.class new file mode 100644 index 00000000..2887b00e Binary files /dev/null and b/3rdParty/javax.xml/javax/xml/xpath/XPathExpression.class differ diff --git a/3rdParty/javax.xml/javax/xml/xpath/XPathExpressionException.class b/3rdParty/javax.xml/javax/xml/xpath/XPathExpressionException.class new file mode 100644 index 00000000..d42de23c Binary files /dev/null and b/3rdParty/javax.xml/javax/xml/xpath/XPathExpressionException.class differ diff --git a/3rdParty/javax.xml/javax/xml/xpath/XPathFactory.class b/3rdParty/javax.xml/javax/xml/xpath/XPathFactory.class new file mode 100644 index 00000000..752e6c77 Binary files /dev/null and b/3rdParty/javax.xml/javax/xml/xpath/XPathFactory.class differ diff --git a/3rdParty/javax.xml/javax/xml/xpath/XPathFactoryConfigurationException.class b/3rdParty/javax.xml/javax/xml/xpath/XPathFactoryConfigurationException.class new file mode 100644 index 00000000..b732fcce Binary files /dev/null and b/3rdParty/javax.xml/javax/xml/xpath/XPathFactoryConfigurationException.class differ diff --git a/3rdParty/javax.xml/javax/xml/xpath/XPathFactoryFinder$1.class b/3rdParty/javax.xml/javax/xml/xpath/XPathFactoryFinder$1.class new file mode 100644 index 00000000..d5cb107d Binary files /dev/null and b/3rdParty/javax.xml/javax/xml/xpath/XPathFactoryFinder$1.class differ diff --git a/3rdParty/javax.xml/javax/xml/xpath/XPathFactoryFinder$2.class b/3rdParty/javax.xml/javax/xml/xpath/XPathFactoryFinder$2.class new file mode 100644 index 00000000..c1f131e2 Binary files /dev/null and b/3rdParty/javax.xml/javax/xml/xpath/XPathFactoryFinder$2.class differ diff --git a/3rdParty/javax.xml/javax/xml/xpath/XPathFactoryFinder$SingleIterator.class b/3rdParty/javax.xml/javax/xml/xpath/XPathFactoryFinder$SingleIterator.class new file mode 100644 index 00000000..d708360b Binary files /dev/null and b/3rdParty/javax.xml/javax/xml/xpath/XPathFactoryFinder$SingleIterator.class differ diff --git a/3rdParty/javax.xml/javax/xml/xpath/XPathFactoryFinder.class b/3rdParty/javax.xml/javax/xml/xpath/XPathFactoryFinder.class new file mode 100644 index 00000000..d58ccbf4 Binary files /dev/null and b/3rdParty/javax.xml/javax/xml/xpath/XPathFactoryFinder.class differ diff --git a/3rdParty/javax.xml/javax/xml/xpath/XPathFunction.class b/3rdParty/javax.xml/javax/xml/xpath/XPathFunction.class new file mode 100644 index 00000000..861c4f9e Binary files /dev/null and b/3rdParty/javax.xml/javax/xml/xpath/XPathFunction.class differ diff --git a/3rdParty/javax.xml/javax/xml/xpath/XPathFunctionException.class b/3rdParty/javax.xml/javax/xml/xpath/XPathFunctionException.class new file mode 100644 index 00000000..da96ad0a Binary files /dev/null and b/3rdParty/javax.xml/javax/xml/xpath/XPathFunctionException.class differ diff --git a/3rdParty/javax.xml/javax/xml/xpath/XPathFunctionResolver.class b/3rdParty/javax.xml/javax/xml/xpath/XPathFunctionResolver.class new file mode 100644 index 00000000..4f445a58 Binary files /dev/null and b/3rdParty/javax.xml/javax/xml/xpath/XPathFunctionResolver.class differ diff --git a/3rdParty/javax.xml/javax/xml/xpath/XPathVariableResolver.class b/3rdParty/javax.xml/javax/xml/xpath/XPathVariableResolver.class new file mode 100644 index 00000000..3a16628f Binary files /dev/null and b/3rdParty/javax.xml/javax/xml/xpath/XPathVariableResolver.class differ diff --git a/3rdParty/javax.xml/license/LICENSE b/3rdParty/javax.xml/license/LICENSE new file mode 100644 index 00000000..75b52484 --- /dev/null +++ b/3rdParty/javax.xml/license/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/3rdParty/javax.xml/license/LICENSE.dom-documentation.txt b/3rdParty/javax.xml/license/LICENSE.dom-documentation.txt new file mode 100644 index 00000000..e4226c71 --- /dev/null +++ b/3rdParty/javax.xml/license/LICENSE.dom-documentation.txt @@ -0,0 +1,73 @@ +xml-commons/java/external/LICENSE.dom-documentation.txt $Id: LICENSE.dom-documentation.txt 226215 2005-06-03 22:49:13Z mrglavas $ + + +This license came from: http://www.w3.org/Consortium/Legal/copyright-documents-20021231 + + +W3C® DOCUMENT LICENSE +http://www.w3.org/Consortium/Legal/2002/copyright-documents-20021231 + +Public documents on the W3C site are provided by the copyright holders under +the following license. By using and/or copying this document, or the W3C +document from which this statement is linked, you (the licensee) agree that +you have read, understood, and will comply with the following terms and +conditions: + +Permission to copy, and distribute the contents of this document, or the W3C +document from which this statement is linked, in any medium for any purpose +and without fee or royalty is hereby granted, provided that you include the +following on ALL copies of the document, or portions thereof, that you use: + + 1. A link or URL to the original W3C document. + 2. The pre-existing copyright notice of the original author, or if it + doesn't exist, a notice (hypertext is preferred, but a textual + representation is permitted) of the form: "Copyright © [$date-of-document] + World Wide Web Consortium, (Massachusetts Institute of Technology, + European Research Consortium for Informatics and Mathematics, Keio + University). All Rights Reserved. + http://www.w3.org/Consortium/Legal/2002/copyright-documents-20021231" + 3. If it exists, the STATUS of the W3C document. + +When space permits, inclusion of the full text of this NOTICE should be +provided. We request that authorship attribution be provided in any software, +documents, or other items or products that you create pursuant to the +implementation of the contents of this document, or any portion thereof. + +No right to create modifications or derivatives of W3C documents is granted +pursuant to this license. However, if additional requirements (documented in +the Copyright FAQ) are satisfied, the right to create modifications or +derivatives is sometimes granted by the W3C to individuals complying with +those requirements. + +THIS DOCUMENT IS PROVIDED "AS IS," AND COPYRIGHT HOLDERS MAKE NO +REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, INCLUDING, BUT NOT +LIMITED TO, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, +NON-INFRINGEMENT, OR TITLE; THAT THE CONTENTS OF THE DOCUMENT ARE SUITABLE +FOR ANY PURPOSE; NOR THAT THE IMPLEMENTATION OF SUCH CONTENTS WILL NOT +INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS. + +COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE DOCUMENT OR THE +PERFORMANCE OR IMPLEMENTATION OF THE CONTENTS THEREOF. + +The name and trademarks of copyright holders may NOT be used in advertising +or publicity pertaining to this document or its contents without specific, +written prior permission. Title to copyright in this document will at all +times remain with copyright holders. + +---------------------------------------------------------------------------- + +This formulation of W3C's notice and license became active on December 31 2002. +This version removes the copyright ownership notice such that this license can +be used with materials other than those owned by the W3C, moves information on +style sheets, DTDs, and schemas to the Copyright FAQ, reflects that ERCIM is +now a host of the W3C, includes references to this specific dated version of +the license, and removes the ambiguous grant of "use". See the older +formulation for the policy prior to this date. Please see our Copyright FAQ for +common questions about using materials from our site, such as the translating +or annotating specifications. Other questions about this notice can be directed +to site-policy@w3.org. + +Joseph Reagle + +Last revised by Reagle $Date: 2005-06-03 18:49:13 -0400 (Fri, 03 Jun 2005) $ diff --git a/3rdParty/javax.xml/license/LICENSE.dom-software.txt b/3rdParty/javax.xml/license/LICENSE.dom-software.txt new file mode 100644 index 00000000..81125fe5 --- /dev/null +++ b/3rdParty/javax.xml/license/LICENSE.dom-software.txt @@ -0,0 +1,54 @@ +xml-commons/java/external/LICENSE.dom-software.txt $Id: LICENSE.dom-software.txt 734314 2009-01-14 03:33:27Z mrglavas $ + +This license came from: http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/java-binding.zip (COPYRIGHT.html) + +W3C® SOFTWARE NOTICE AND LICENSE +Copyright © 2004 World Wide Web Consortium, (Massachusetts Institute of Technology, +European Research Consortium for Informatics and Mathematics, Keio University). +All Rights Reserved. + +The DOM bindings are published under the W3C Software Copyright Notice and +License. The software license requires "Notice of any changes or modifications +to the W3C files, including the date changes were made." Consequently, modified +versions of the DOM bindings must document that they do not conform to the W3C +standard; in the case of the IDL definitions, the pragma prefix can no longer +be 'w3c.org'; in the case of the Java language binding, the package names can no +longer be in the 'org.w3c' package. + +Note: The original version of the W3C Software Copyright Notice and License could +be found at http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 + +This work (and included software, documentation such as READMEs, or other +related items) is being provided by the copyright holders under the following +license. By obtaining, using and/or copying this work, you (the licensee) agree +that you have read, understood, and will comply with the following terms and +conditions. + +Permission to copy, modify, and distribute this software and its documentation, +with or without modification, for any purpose and without fee or royalty is +hereby granted, provided that you include the following on ALL copies of the +software and documentation or portions thereof, including modifications: + + 1. The full text of this NOTICE in a location viewable to users of the + redistributed or derivative work. + 2. Any pre-existing intellectual property disclaimers, notices, or terms + and conditions. If none exist, the W3C Software Short Notice should be + included (hypertext is preferred, text is permitted) within the body + of any redistributed or derivative code. + 3. Notice of any changes or modifications to the files, including the date + changes were made. (We recommend you provide URIs to the location from + which the code is derived.) + +THIS SOFTWARE AND DOCUMENTATION IS PROVIDED "AS IS," AND COPYRIGHT HOLDERS MAKE +NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO, WARRANTIES OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT +THE USE OF THE SOFTWARE OR DOCUMENTATION WILL NOT INFRINGE ANY THIRD PARTY +PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS. + +COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE SOFTWARE OR DOCUMENTATION. + +The name and trademarks of copyright holders may NOT be used in advertising or +publicity pertaining to the software without specific, written prior permission. +Title to copyright in this software and any associated documentation will at +all times remain with copyright holders. \ No newline at end of file diff --git a/3rdParty/javax.xml/license/LICENSE.sax.txt b/3rdParty/javax.xml/license/LICENSE.sax.txt new file mode 100644 index 00000000..0738c247 --- /dev/null +++ b/3rdParty/javax.xml/license/LICENSE.sax.txt @@ -0,0 +1,23 @@ +xml-commons/java/external/LICENSE.sax.txt $Id: LICENSE.sax.txt 225954 2002-01-31 23:26:48Z curcuru $ + + +This license came from: http://www.megginson.com/SAX/copying.html + However please note future versions of SAX may be covered + under http://saxproject.org/?selected=pd + + +This page is now out of date -- see the new SAX site at +http://www.saxproject.org/ for more up-to-date +releases and other information. Please change your bookmarks. + + +SAX2 is Free! + +I hereby abandon any property rights to SAX 2.0 (the Simple API for +XML), and release all of the SAX 2.0 source code, compiled code, and +documentation contained in this distribution into the Public Domain. +SAX comes with NO WARRANTY or guarantee of fitness for any +purpose. + +David Megginson, david@megginson.com +2000-05-05 \ No newline at end of file diff --git a/3rdParty/javax.xml/license/NOTICE b/3rdParty/javax.xml/license/NOTICE new file mode 100644 index 00000000..9a05f3cb --- /dev/null +++ b/3rdParty/javax.xml/license/NOTICE @@ -0,0 +1,16 @@ + ========================================================================= + == NOTICE file corresponding to section 4(d) of the Apache License, == + == Version 2.0, in this case for the Apache xml-commons xml-apis == + == distribution. == + ========================================================================= + + Apache XML Commons XML APIs + Copyright 1999-2009 The Apache Software Foundation. + + This product includes software developed at + The Apache Software Foundation (http://www.apache.org/). + + Portions of this software were originally based on the following: + - software copyright (c) 1999, IBM Corporation., http://www.ibm.com. + - software copyright (c) 1999, Sun Microsystems., http://www.sun.com. + - software copyright (c) 2000 World Wide Web Consortium, http://www.w3.org diff --git a/3rdParty/javax.xml/license/README.dom.txt b/3rdParty/javax.xml/license/README.dom.txt new file mode 100644 index 00000000..4f6fb31d --- /dev/null +++ b/3rdParty/javax.xml/license/README.dom.txt @@ -0,0 +1,56 @@ +xml-commons/java/external/README.dom.txt $Id: README.dom.txt 477038 2006-11-20 04:40:36Z mrglavas $ + + +HEAR YE, HEAR YE! + + +All of the .java software and associated documentation about +the DOM in this repository are distributed under the license +from the W3C, which is provided herein. + + +LICENSE.dom-software.txt covers all software from the W3C +including the following items in the xml-commons project: + + xml-commons/java/external/src/org/w3c + and all subdirectories + +(Note: SAC (The Simple API for CSS) has been published under an older +version of the W3C license. The original license file is LICENSE.sac.html.) + +LICENSE.dom-documentation.txt covers all documentation from the W3C +including the following items in the xml-commons project: + + xml-commons/java/external/xdocs/dom + and all subdirectories + +The actual DOM Java Language Binding classes in xml-commons came from: + http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/java-binding.html + +The specification of DOM Level 3's various parts is at: + http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/ + http://www.w3.org/TR/2004/REC-DOM-Level-3-LS-20040407/ + http://www.w3.org/TR/2004/NOTE-DOM-Level-3-XPath-20040226/ + +The specification of DOM Level 2's various parts is at: + http://www.w3.org/TR/2000/REC-DOM-Level-2-Events-20001113/ + http://www.w3.org/TR/2000/REC-DOM-Level-2-Style-20001113/ + http://www.w3.org/TR/2000/REC-DOM-Level-2-Traversal-Range-20001113/ + http://www.w3.org/TR/2000/REC-DOM-Level-2-Views-20001113/ + +The specification of DOM Level 1's various parts is at: + http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-html.html + +Links to all available W3C DOM Java Bindings can be found at: + http://www.w3.org/DOM/DOMTR + +The actual classes of The Simple API for CSS (SAC) came from: + http://www.w3.org/Style/CSS/SAC/ + http://www.w3.org/2002/06/sacjava-1.3.zip + +The actual DOM Java Language Binding classes for SMIL came from: + http://dev.w3.org/cvsweb/java/classes/org/w3c/dom/smil/ + (both ElementTimeControl.java and TimeEvent.java were taken at revision 1.1) + +The actual DOM Java Language Binding classes for SVG 1.1 came from: + http://www.w3.org/TR/SVG11/java.html \ No newline at end of file diff --git a/3rdParty/javax.xml/license/README.sax.txt b/3rdParty/javax.xml/license/README.sax.txt new file mode 100644 index 00000000..fd878768 --- /dev/null +++ b/3rdParty/javax.xml/license/README.sax.txt @@ -0,0 +1,24 @@ +xml-commons/java/external/README.sax.txt $Id: README.sax.txt 225954 2002-01-31 23:26:48Z curcuru $ + + +HEAR YE, HEAR YE! + + +All of the .java software and associated documentation about +SAX in this repository are distributed freely in the +public domain. + + +LICENSE.sax.txt covers all software and documentation from the +megginson.com including the following in the xml-commons project: + + xml-commons/java/external/src/org/xml/sax + and all subdirectories + xml-commons/java/external/xdocs/sax + and all subdirectories + + +The actual SAX classes in xml-commons came from: + http://www.megginson.com/Software/index.html + The original versions are tagged 'SAX-2_0-r2-prerelease' + diff --git a/3rdParty/javax.xml/org/apache/xmlcommons/Version.class b/3rdParty/javax.xml/org/apache/xmlcommons/Version.class new file mode 100644 index 00000000..5f48c66e Binary files /dev/null and b/3rdParty/javax.xml/org/apache/xmlcommons/Version.class differ diff --git a/3rdParty/javax.xml/org/w3c/dom/Attr.class b/3rdParty/javax.xml/org/w3c/dom/Attr.class new file mode 100644 index 00000000..d04a837c Binary files /dev/null and b/3rdParty/javax.xml/org/w3c/dom/Attr.class differ diff --git a/3rdParty/javax.xml/org/w3c/dom/CDATASection.class b/3rdParty/javax.xml/org/w3c/dom/CDATASection.class new file mode 100644 index 00000000..34fa50b5 Binary files /dev/null and b/3rdParty/javax.xml/org/w3c/dom/CDATASection.class differ diff --git a/3rdParty/javax.xml/org/w3c/dom/CharacterData.class b/3rdParty/javax.xml/org/w3c/dom/CharacterData.class new file mode 100644 index 00000000..22e545d9 Binary files /dev/null and b/3rdParty/javax.xml/org/w3c/dom/CharacterData.class differ diff --git a/3rdParty/javax.xml/org/w3c/dom/Comment.class b/3rdParty/javax.xml/org/w3c/dom/Comment.class new file mode 100644 index 00000000..5184dbdb Binary files /dev/null and b/3rdParty/javax.xml/org/w3c/dom/Comment.class differ diff --git a/3rdParty/javax.xml/org/w3c/dom/DOMConfiguration.class b/3rdParty/javax.xml/org/w3c/dom/DOMConfiguration.class new file mode 100644 index 00000000..563a5910 Binary files /dev/null and b/3rdParty/javax.xml/org/w3c/dom/DOMConfiguration.class differ diff --git a/3rdParty/javax.xml/org/w3c/dom/DOMError.class b/3rdParty/javax.xml/org/w3c/dom/DOMError.class new file mode 100644 index 00000000..8ac444ad Binary files /dev/null and b/3rdParty/javax.xml/org/w3c/dom/DOMError.class differ diff --git a/3rdParty/javax.xml/org/w3c/dom/DOMErrorHandler.class b/3rdParty/javax.xml/org/w3c/dom/DOMErrorHandler.class new file mode 100644 index 00000000..f6d28a93 Binary files /dev/null and b/3rdParty/javax.xml/org/w3c/dom/DOMErrorHandler.class differ diff --git a/3rdParty/javax.xml/org/w3c/dom/DOMException.class b/3rdParty/javax.xml/org/w3c/dom/DOMException.class new file mode 100644 index 00000000..d6ebb30a Binary files /dev/null and b/3rdParty/javax.xml/org/w3c/dom/DOMException.class differ diff --git a/3rdParty/javax.xml/org/w3c/dom/DOMImplementation.class b/3rdParty/javax.xml/org/w3c/dom/DOMImplementation.class new file mode 100644 index 00000000..5eb341cf Binary files /dev/null and b/3rdParty/javax.xml/org/w3c/dom/DOMImplementation.class differ diff --git a/3rdParty/javax.xml/org/w3c/dom/DOMImplementationList.class b/3rdParty/javax.xml/org/w3c/dom/DOMImplementationList.class new file mode 100644 index 00000000..d23edc01 Binary files /dev/null and b/3rdParty/javax.xml/org/w3c/dom/DOMImplementationList.class differ diff --git a/3rdParty/javax.xml/org/w3c/dom/DOMImplementationSource.class b/3rdParty/javax.xml/org/w3c/dom/DOMImplementationSource.class new file mode 100644 index 00000000..2b6778a9 Binary files /dev/null and b/3rdParty/javax.xml/org/w3c/dom/DOMImplementationSource.class differ diff --git a/3rdParty/javax.xml/org/w3c/dom/DOMLocator.class b/3rdParty/javax.xml/org/w3c/dom/DOMLocator.class new file mode 100644 index 00000000..78ad20d3 Binary files /dev/null and b/3rdParty/javax.xml/org/w3c/dom/DOMLocator.class differ diff --git a/3rdParty/javax.xml/org/w3c/dom/DOMStringList.class b/3rdParty/javax.xml/org/w3c/dom/DOMStringList.class new file mode 100644 index 00000000..eea5f8be Binary files /dev/null and b/3rdParty/javax.xml/org/w3c/dom/DOMStringList.class differ diff --git a/3rdParty/javax.xml/org/w3c/dom/Document.class b/3rdParty/javax.xml/org/w3c/dom/Document.class new file mode 100644 index 00000000..b18c59db Binary files /dev/null and b/3rdParty/javax.xml/org/w3c/dom/Document.class differ diff --git a/3rdParty/javax.xml/org/w3c/dom/DocumentFragment.class b/3rdParty/javax.xml/org/w3c/dom/DocumentFragment.class new file mode 100644 index 00000000..ec431dd7 Binary files /dev/null and b/3rdParty/javax.xml/org/w3c/dom/DocumentFragment.class differ diff --git a/3rdParty/javax.xml/org/w3c/dom/DocumentType.class b/3rdParty/javax.xml/org/w3c/dom/DocumentType.class new file mode 100644 index 00000000..cbf1e1d5 Binary files /dev/null and b/3rdParty/javax.xml/org/w3c/dom/DocumentType.class differ diff --git a/3rdParty/javax.xml/org/w3c/dom/Element.class b/3rdParty/javax.xml/org/w3c/dom/Element.class new file mode 100644 index 00000000..5bc8348e Binary files /dev/null and b/3rdParty/javax.xml/org/w3c/dom/Element.class differ diff --git a/3rdParty/javax.xml/org/w3c/dom/ElementTraversal.class b/3rdParty/javax.xml/org/w3c/dom/ElementTraversal.class new file mode 100644 index 00000000..400ff53e Binary files /dev/null and b/3rdParty/javax.xml/org/w3c/dom/ElementTraversal.class differ diff --git a/3rdParty/javax.xml/org/w3c/dom/Entity.class b/3rdParty/javax.xml/org/w3c/dom/Entity.class new file mode 100644 index 00000000..39f79ba6 Binary files /dev/null and b/3rdParty/javax.xml/org/w3c/dom/Entity.class differ diff --git a/3rdParty/javax.xml/org/w3c/dom/EntityReference.class b/3rdParty/javax.xml/org/w3c/dom/EntityReference.class new file mode 100644 index 00000000..b64160b8 Binary files /dev/null and b/3rdParty/javax.xml/org/w3c/dom/EntityReference.class differ diff --git a/3rdParty/javax.xml/org/w3c/dom/NameList.class b/3rdParty/javax.xml/org/w3c/dom/NameList.class new file mode 100644 index 00000000..d34da0e6 Binary files /dev/null and b/3rdParty/javax.xml/org/w3c/dom/NameList.class differ diff --git a/3rdParty/javax.xml/org/w3c/dom/NamedNodeMap.class b/3rdParty/javax.xml/org/w3c/dom/NamedNodeMap.class new file mode 100644 index 00000000..6fcb4fb9 Binary files /dev/null and b/3rdParty/javax.xml/org/w3c/dom/NamedNodeMap.class differ diff --git a/3rdParty/javax.xml/org/w3c/dom/Node.class b/3rdParty/javax.xml/org/w3c/dom/Node.class new file mode 100644 index 00000000..ce25d8ca Binary files /dev/null and b/3rdParty/javax.xml/org/w3c/dom/Node.class differ diff --git a/3rdParty/javax.xml/org/w3c/dom/NodeList.class b/3rdParty/javax.xml/org/w3c/dom/NodeList.class new file mode 100644 index 00000000..03374ffd Binary files /dev/null and b/3rdParty/javax.xml/org/w3c/dom/NodeList.class differ diff --git a/3rdParty/javax.xml/org/w3c/dom/Notation.class b/3rdParty/javax.xml/org/w3c/dom/Notation.class new file mode 100644 index 00000000..a1fbebd7 Binary files /dev/null and b/3rdParty/javax.xml/org/w3c/dom/Notation.class differ diff --git a/3rdParty/javax.xml/org/w3c/dom/ProcessingInstruction.class b/3rdParty/javax.xml/org/w3c/dom/ProcessingInstruction.class new file mode 100644 index 00000000..edcd545f Binary files /dev/null and b/3rdParty/javax.xml/org/w3c/dom/ProcessingInstruction.class differ diff --git a/3rdParty/javax.xml/org/w3c/dom/Text.class b/3rdParty/javax.xml/org/w3c/dom/Text.class new file mode 100644 index 00000000..b01d4f72 Binary files /dev/null and b/3rdParty/javax.xml/org/w3c/dom/Text.class differ diff --git a/3rdParty/javax.xml/org/w3c/dom/TypeInfo.class b/3rdParty/javax.xml/org/w3c/dom/TypeInfo.class new file mode 100644 index 00000000..aabf4b24 Binary files /dev/null and b/3rdParty/javax.xml/org/w3c/dom/TypeInfo.class differ diff --git a/3rdParty/javax.xml/org/w3c/dom/UserDataHandler.class b/3rdParty/javax.xml/org/w3c/dom/UserDataHandler.class new file mode 100644 index 00000000..f09dc64b Binary files /dev/null and b/3rdParty/javax.xml/org/w3c/dom/UserDataHandler.class differ diff --git a/3rdParty/javax.xml/org/w3c/dom/bootstrap/DOMImplementationRegistry$1.class b/3rdParty/javax.xml/org/w3c/dom/bootstrap/DOMImplementationRegistry$1.class new file mode 100644 index 00000000..56a51216 Binary files /dev/null and b/3rdParty/javax.xml/org/w3c/dom/bootstrap/DOMImplementationRegistry$1.class differ diff --git a/3rdParty/javax.xml/org/w3c/dom/bootstrap/DOMImplementationRegistry$2.class b/3rdParty/javax.xml/org/w3c/dom/bootstrap/DOMImplementationRegistry$2.class new file mode 100644 index 00000000..f87f2725 Binary files /dev/null and b/3rdParty/javax.xml/org/w3c/dom/bootstrap/DOMImplementationRegistry$2.class differ diff --git a/3rdParty/javax.xml/org/w3c/dom/bootstrap/DOMImplementationRegistry$3.class b/3rdParty/javax.xml/org/w3c/dom/bootstrap/DOMImplementationRegistry$3.class new file mode 100644 index 00000000..168ca353 Binary files /dev/null and b/3rdParty/javax.xml/org/w3c/dom/bootstrap/DOMImplementationRegistry$3.class differ diff --git a/3rdParty/javax.xml/org/w3c/dom/bootstrap/DOMImplementationRegistry$4.class b/3rdParty/javax.xml/org/w3c/dom/bootstrap/DOMImplementationRegistry$4.class new file mode 100644 index 00000000..3368977e Binary files /dev/null and b/3rdParty/javax.xml/org/w3c/dom/bootstrap/DOMImplementationRegistry$4.class differ diff --git a/3rdParty/javax.xml/org/w3c/dom/bootstrap/DOMImplementationRegistry.class b/3rdParty/javax.xml/org/w3c/dom/bootstrap/DOMImplementationRegistry.class new file mode 100644 index 00000000..ca7cdccf Binary files /dev/null and b/3rdParty/javax.xml/org/w3c/dom/bootstrap/DOMImplementationRegistry.class differ diff --git a/3rdParty/javax.xml/org/w3c/dom/css/CSS2Properties.class b/3rdParty/javax.xml/org/w3c/dom/css/CSS2Properties.class new file mode 100644 index 00000000..4863242d Binary files /dev/null and b/3rdParty/javax.xml/org/w3c/dom/css/CSS2Properties.class differ diff --git a/3rdParty/javax.xml/org/w3c/dom/css/CSSCharsetRule.class b/3rdParty/javax.xml/org/w3c/dom/css/CSSCharsetRule.class new file mode 100644 index 00000000..b757af81 Binary files /dev/null and b/3rdParty/javax.xml/org/w3c/dom/css/CSSCharsetRule.class differ diff --git a/3rdParty/javax.xml/org/w3c/dom/css/CSSFontFaceRule.class b/3rdParty/javax.xml/org/w3c/dom/css/CSSFontFaceRule.class new file mode 100644 index 00000000..8fb2c560 Binary files /dev/null and b/3rdParty/javax.xml/org/w3c/dom/css/CSSFontFaceRule.class differ diff --git a/3rdParty/javax.xml/org/w3c/dom/css/CSSImportRule.class b/3rdParty/javax.xml/org/w3c/dom/css/CSSImportRule.class new file mode 100644 index 00000000..29826fdd Binary files /dev/null and b/3rdParty/javax.xml/org/w3c/dom/css/CSSImportRule.class differ diff --git a/3rdParty/javax.xml/org/w3c/dom/css/CSSMediaRule.class b/3rdParty/javax.xml/org/w3c/dom/css/CSSMediaRule.class new file mode 100644 index 00000000..66f796cb Binary files /dev/null and b/3rdParty/javax.xml/org/w3c/dom/css/CSSMediaRule.class differ diff --git a/3rdParty/javax.xml/org/w3c/dom/css/CSSPageRule.class b/3rdParty/javax.xml/org/w3c/dom/css/CSSPageRule.class new file mode 100644 index 00000000..d606f6f4 Binary files /dev/null and b/3rdParty/javax.xml/org/w3c/dom/css/CSSPageRule.class differ diff --git a/3rdParty/javax.xml/org/w3c/dom/css/CSSPrimitiveValue.class b/3rdParty/javax.xml/org/w3c/dom/css/CSSPrimitiveValue.class new file mode 100644 index 00000000..27693329 Binary files /dev/null and b/3rdParty/javax.xml/org/w3c/dom/css/CSSPrimitiveValue.class differ diff --git a/3rdParty/javax.xml/org/w3c/dom/css/CSSRule.class b/3rdParty/javax.xml/org/w3c/dom/css/CSSRule.class new file mode 100644 index 00000000..003eb054 Binary files /dev/null and b/3rdParty/javax.xml/org/w3c/dom/css/CSSRule.class differ diff --git a/3rdParty/javax.xml/org/w3c/dom/css/CSSRuleList.class b/3rdParty/javax.xml/org/w3c/dom/css/CSSRuleList.class new file mode 100644 index 00000000..6df66943 Binary files /dev/null and b/3rdParty/javax.xml/org/w3c/dom/css/CSSRuleList.class differ diff --git a/3rdParty/javax.xml/org/w3c/dom/css/CSSStyleDeclaration.class b/3rdParty/javax.xml/org/w3c/dom/css/CSSStyleDeclaration.class new file mode 100644 index 00000000..3facaa42 Binary files /dev/null and b/3rdParty/javax.xml/org/w3c/dom/css/CSSStyleDeclaration.class differ diff --git a/3rdParty/javax.xml/org/w3c/dom/css/CSSStyleRule.class b/3rdParty/javax.xml/org/w3c/dom/css/CSSStyleRule.class new file mode 100644 index 00000000..9735ec89 Binary files /dev/null and b/3rdParty/javax.xml/org/w3c/dom/css/CSSStyleRule.class differ diff --git a/3rdParty/javax.xml/org/w3c/dom/css/CSSStyleSheet.class b/3rdParty/javax.xml/org/w3c/dom/css/CSSStyleSheet.class new file mode 100644 index 00000000..2534ea55 Binary files /dev/null and b/3rdParty/javax.xml/org/w3c/dom/css/CSSStyleSheet.class differ diff --git a/3rdParty/javax.xml/org/w3c/dom/css/CSSUnknownRule.class b/3rdParty/javax.xml/org/w3c/dom/css/CSSUnknownRule.class new file mode 100644 index 00000000..74f81f82 Binary files /dev/null and b/3rdParty/javax.xml/org/w3c/dom/css/CSSUnknownRule.class differ diff --git a/3rdParty/javax.xml/org/w3c/dom/css/CSSValue.class b/3rdParty/javax.xml/org/w3c/dom/css/CSSValue.class new file mode 100644 index 00000000..ee6bf8c3 Binary files /dev/null and b/3rdParty/javax.xml/org/w3c/dom/css/CSSValue.class differ diff --git a/3rdParty/javax.xml/org/w3c/dom/css/CSSValueList.class b/3rdParty/javax.xml/org/w3c/dom/css/CSSValueList.class new file mode 100644 index 00000000..1576db42 Binary files /dev/null and b/3rdParty/javax.xml/org/w3c/dom/css/CSSValueList.class differ diff --git a/3rdParty/javax.xml/org/w3c/dom/css/Counter.class b/3rdParty/javax.xml/org/w3c/dom/css/Counter.class new file mode 100644 index 00000000..7d409c9b Binary files /dev/null and b/3rdParty/javax.xml/org/w3c/dom/css/Counter.class differ diff --git a/3rdParty/javax.xml/org/w3c/dom/css/DOMImplementationCSS.class b/3rdParty/javax.xml/org/w3c/dom/css/DOMImplementationCSS.class new file mode 100644 index 00000000..d052230b Binary files /dev/null and b/3rdParty/javax.xml/org/w3c/dom/css/DOMImplementationCSS.class differ diff --git a/3rdParty/javax.xml/org/w3c/dom/css/DocumentCSS.class b/3rdParty/javax.xml/org/w3c/dom/css/DocumentCSS.class new file mode 100644 index 00000000..3c993f3e Binary files /dev/null and b/3rdParty/javax.xml/org/w3c/dom/css/DocumentCSS.class differ diff --git a/3rdParty/javax.xml/org/w3c/dom/css/ElementCSSInlineStyle.class b/3rdParty/javax.xml/org/w3c/dom/css/ElementCSSInlineStyle.class new file mode 100644 index 00000000..55465c3f Binary files /dev/null and b/3rdParty/javax.xml/org/w3c/dom/css/ElementCSSInlineStyle.class differ diff --git a/3rdParty/javax.xml/org/w3c/dom/css/RGBColor.class b/3rdParty/javax.xml/org/w3c/dom/css/RGBColor.class new file mode 100644 index 00000000..9a933ee1 Binary files /dev/null and b/3rdParty/javax.xml/org/w3c/dom/css/RGBColor.class differ diff --git a/3rdParty/javax.xml/org/w3c/dom/css/Rect.class b/3rdParty/javax.xml/org/w3c/dom/css/Rect.class new file mode 100644 index 00000000..af461561 Binary files /dev/null and b/3rdParty/javax.xml/org/w3c/dom/css/Rect.class differ diff --git a/3rdParty/javax.xml/org/w3c/dom/css/ViewCSS.class b/3rdParty/javax.xml/org/w3c/dom/css/ViewCSS.class new file mode 100644 index 00000000..72a70276 Binary files /dev/null and b/3rdParty/javax.xml/org/w3c/dom/css/ViewCSS.class differ diff --git a/3rdParty/javax.xml/org/w3c/dom/events/DocumentEvent.class b/3rdParty/javax.xml/org/w3c/dom/events/DocumentEvent.class new file mode 100644 index 00000000..28000cb0 Binary files /dev/null and b/3rdParty/javax.xml/org/w3c/dom/events/DocumentEvent.class differ diff --git a/3rdParty/javax.xml/org/w3c/dom/events/Event.class b/3rdParty/javax.xml/org/w3c/dom/events/Event.class new file mode 100644 index 00000000..4e0d51db Binary files /dev/null and b/3rdParty/javax.xml/org/w3c/dom/events/Event.class differ diff --git a/3rdParty/javax.xml/org/w3c/dom/events/EventException.class b/3rdParty/javax.xml/org/w3c/dom/events/EventException.class new file mode 100644 index 00000000..8207573a Binary files /dev/null and b/3rdParty/javax.xml/org/w3c/dom/events/EventException.class differ diff --git a/3rdParty/javax.xml/org/w3c/dom/events/EventListener.class b/3rdParty/javax.xml/org/w3c/dom/events/EventListener.class new file mode 100644 index 00000000..95ca0a59 Binary files /dev/null and b/3rdParty/javax.xml/org/w3c/dom/events/EventListener.class differ diff --git a/3rdParty/javax.xml/org/w3c/dom/events/EventTarget.class b/3rdParty/javax.xml/org/w3c/dom/events/EventTarget.class new file mode 100644 index 00000000..1b80b77d Binary files /dev/null and b/3rdParty/javax.xml/org/w3c/dom/events/EventTarget.class differ diff --git a/3rdParty/javax.xml/org/w3c/dom/events/MouseEvent.class b/3rdParty/javax.xml/org/w3c/dom/events/MouseEvent.class new file mode 100644 index 00000000..bee754a8 Binary files /dev/null and b/3rdParty/javax.xml/org/w3c/dom/events/MouseEvent.class differ diff --git a/3rdParty/javax.xml/org/w3c/dom/events/MutationEvent.class b/3rdParty/javax.xml/org/w3c/dom/events/MutationEvent.class new file mode 100644 index 00000000..e06d445f Binary files /dev/null and b/3rdParty/javax.xml/org/w3c/dom/events/MutationEvent.class differ diff --git a/3rdParty/javax.xml/org/w3c/dom/events/UIEvent.class b/3rdParty/javax.xml/org/w3c/dom/events/UIEvent.class new file mode 100644 index 00000000..44c19dee Binary files /dev/null and b/3rdParty/javax.xml/org/w3c/dom/events/UIEvent.class differ diff --git a/3rdParty/javax.xml/org/w3c/dom/html/HTMLAnchorElement.class b/3rdParty/javax.xml/org/w3c/dom/html/HTMLAnchorElement.class new file mode 100644 index 00000000..852d40ca Binary files /dev/null and b/3rdParty/javax.xml/org/w3c/dom/html/HTMLAnchorElement.class differ diff --git a/3rdParty/javax.xml/org/w3c/dom/html/HTMLAppletElement.class b/3rdParty/javax.xml/org/w3c/dom/html/HTMLAppletElement.class new file mode 100644 index 00000000..0acc3f65 Binary files /dev/null and b/3rdParty/javax.xml/org/w3c/dom/html/HTMLAppletElement.class differ diff --git a/3rdParty/javax.xml/org/w3c/dom/html/HTMLAreaElement.class b/3rdParty/javax.xml/org/w3c/dom/html/HTMLAreaElement.class new file mode 100644 index 00000000..2203e969 Binary files /dev/null and b/3rdParty/javax.xml/org/w3c/dom/html/HTMLAreaElement.class differ diff --git a/3rdParty/javax.xml/org/w3c/dom/html/HTMLBRElement.class b/3rdParty/javax.xml/org/w3c/dom/html/HTMLBRElement.class new file mode 100644 index 00000000..526f8d9e Binary files /dev/null and b/3rdParty/javax.xml/org/w3c/dom/html/HTMLBRElement.class differ diff --git a/3rdParty/javax.xml/org/w3c/dom/html/HTMLBaseElement.class b/3rdParty/javax.xml/org/w3c/dom/html/HTMLBaseElement.class new file mode 100644 index 00000000..89a19f2a Binary files /dev/null and b/3rdParty/javax.xml/org/w3c/dom/html/HTMLBaseElement.class differ diff --git a/3rdParty/javax.xml/org/w3c/dom/html/HTMLBaseFontElement.class b/3rdParty/javax.xml/org/w3c/dom/html/HTMLBaseFontElement.class new file mode 100644 index 00000000..f64db8d3 Binary files /dev/null and b/3rdParty/javax.xml/org/w3c/dom/html/HTMLBaseFontElement.class differ diff --git a/3rdParty/javax.xml/org/w3c/dom/html/HTMLBodyElement.class b/3rdParty/javax.xml/org/w3c/dom/html/HTMLBodyElement.class new file mode 100644 index 00000000..1d341607 Binary files /dev/null and b/3rdParty/javax.xml/org/w3c/dom/html/HTMLBodyElement.class differ diff --git a/3rdParty/javax.xml/org/w3c/dom/html/HTMLButtonElement.class b/3rdParty/javax.xml/org/w3c/dom/html/HTMLButtonElement.class new file mode 100644 index 00000000..43c2604a Binary files /dev/null and b/3rdParty/javax.xml/org/w3c/dom/html/HTMLButtonElement.class differ diff --git a/3rdParty/javax.xml/org/w3c/dom/html/HTMLCollection.class b/3rdParty/javax.xml/org/w3c/dom/html/HTMLCollection.class new file mode 100644 index 00000000..3cd342d5 Binary files /dev/null and b/3rdParty/javax.xml/org/w3c/dom/html/HTMLCollection.class differ diff --git a/3rdParty/javax.xml/org/w3c/dom/html/HTMLDListElement.class b/3rdParty/javax.xml/org/w3c/dom/html/HTMLDListElement.class new file mode 100644 index 00000000..463ab7b5 Binary files /dev/null and b/3rdParty/javax.xml/org/w3c/dom/html/HTMLDListElement.class differ diff --git a/3rdParty/javax.xml/org/w3c/dom/html/HTMLDirectoryElement.class b/3rdParty/javax.xml/org/w3c/dom/html/HTMLDirectoryElement.class new file mode 100644 index 00000000..e81d498b Binary files /dev/null and b/3rdParty/javax.xml/org/w3c/dom/html/HTMLDirectoryElement.class differ diff --git a/3rdParty/javax.xml/org/w3c/dom/html/HTMLDivElement.class b/3rdParty/javax.xml/org/w3c/dom/html/HTMLDivElement.class new file mode 100644 index 00000000..9694261f Binary files /dev/null and b/3rdParty/javax.xml/org/w3c/dom/html/HTMLDivElement.class differ diff --git a/3rdParty/javax.xml/org/w3c/dom/html/HTMLDocument.class b/3rdParty/javax.xml/org/w3c/dom/html/HTMLDocument.class new file mode 100644 index 00000000..2a1b853b Binary files /dev/null and b/3rdParty/javax.xml/org/w3c/dom/html/HTMLDocument.class differ diff --git a/3rdParty/javax.xml/org/w3c/dom/html/HTMLElement.class b/3rdParty/javax.xml/org/w3c/dom/html/HTMLElement.class new file mode 100644 index 00000000..c0e772db Binary files /dev/null and b/3rdParty/javax.xml/org/w3c/dom/html/HTMLElement.class differ diff --git a/3rdParty/javax.xml/org/w3c/dom/html/HTMLFieldSetElement.class b/3rdParty/javax.xml/org/w3c/dom/html/HTMLFieldSetElement.class new file mode 100644 index 00000000..a51a69ab Binary files /dev/null and b/3rdParty/javax.xml/org/w3c/dom/html/HTMLFieldSetElement.class differ diff --git a/3rdParty/javax.xml/org/w3c/dom/html/HTMLFontElement.class b/3rdParty/javax.xml/org/w3c/dom/html/HTMLFontElement.class new file mode 100644 index 00000000..35828a66 Binary files /dev/null and b/3rdParty/javax.xml/org/w3c/dom/html/HTMLFontElement.class differ diff --git a/3rdParty/javax.xml/org/w3c/dom/html/HTMLFormElement.class b/3rdParty/javax.xml/org/w3c/dom/html/HTMLFormElement.class new file mode 100644 index 00000000..155c6c55 Binary files /dev/null and b/3rdParty/javax.xml/org/w3c/dom/html/HTMLFormElement.class differ diff --git a/3rdParty/javax.xml/org/w3c/dom/html/HTMLFrameElement.class b/3rdParty/javax.xml/org/w3c/dom/html/HTMLFrameElement.class new file mode 100644 index 00000000..2b381450 Binary files /dev/null and b/3rdParty/javax.xml/org/w3c/dom/html/HTMLFrameElement.class differ diff --git a/3rdParty/javax.xml/org/w3c/dom/html/HTMLFrameSetElement.class b/3rdParty/javax.xml/org/w3c/dom/html/HTMLFrameSetElement.class new file mode 100644 index 00000000..6621f85d Binary files /dev/null and b/3rdParty/javax.xml/org/w3c/dom/html/HTMLFrameSetElement.class differ diff --git a/3rdParty/javax.xml/org/w3c/dom/html/HTMLHRElement.class b/3rdParty/javax.xml/org/w3c/dom/html/HTMLHRElement.class new file mode 100644 index 00000000..acfebfb0 Binary files /dev/null and b/3rdParty/javax.xml/org/w3c/dom/html/HTMLHRElement.class differ diff --git a/3rdParty/javax.xml/org/w3c/dom/html/HTMLHeadElement.class b/3rdParty/javax.xml/org/w3c/dom/html/HTMLHeadElement.class new file mode 100644 index 00000000..ec19df3e Binary files /dev/null and b/3rdParty/javax.xml/org/w3c/dom/html/HTMLHeadElement.class differ diff --git a/3rdParty/javax.xml/org/w3c/dom/html/HTMLHeadingElement.class b/3rdParty/javax.xml/org/w3c/dom/html/HTMLHeadingElement.class new file mode 100644 index 00000000..ad7af928 Binary files /dev/null and b/3rdParty/javax.xml/org/w3c/dom/html/HTMLHeadingElement.class differ diff --git a/3rdParty/javax.xml/org/w3c/dom/html/HTMLHtmlElement.class b/3rdParty/javax.xml/org/w3c/dom/html/HTMLHtmlElement.class new file mode 100644 index 00000000..388c101f Binary files /dev/null and b/3rdParty/javax.xml/org/w3c/dom/html/HTMLHtmlElement.class differ diff --git a/3rdParty/javax.xml/org/w3c/dom/html/HTMLIFrameElement.class b/3rdParty/javax.xml/org/w3c/dom/html/HTMLIFrameElement.class new file mode 100644 index 00000000..1d143dc2 Binary files /dev/null and b/3rdParty/javax.xml/org/w3c/dom/html/HTMLIFrameElement.class differ diff --git a/3rdParty/javax.xml/org/w3c/dom/html/HTMLImageElement.class b/3rdParty/javax.xml/org/w3c/dom/html/HTMLImageElement.class new file mode 100644 index 00000000..ed004fb4 Binary files /dev/null and b/3rdParty/javax.xml/org/w3c/dom/html/HTMLImageElement.class differ diff --git a/3rdParty/javax.xml/org/w3c/dom/html/HTMLInputElement.class b/3rdParty/javax.xml/org/w3c/dom/html/HTMLInputElement.class new file mode 100644 index 00000000..fbb2a5af Binary files /dev/null and b/3rdParty/javax.xml/org/w3c/dom/html/HTMLInputElement.class differ diff --git a/3rdParty/javax.xml/org/w3c/dom/html/HTMLIsIndexElement.class b/3rdParty/javax.xml/org/w3c/dom/html/HTMLIsIndexElement.class new file mode 100644 index 00000000..d1b94fbd Binary files /dev/null and b/3rdParty/javax.xml/org/w3c/dom/html/HTMLIsIndexElement.class differ diff --git a/3rdParty/javax.xml/org/w3c/dom/html/HTMLLIElement.class b/3rdParty/javax.xml/org/w3c/dom/html/HTMLLIElement.class new file mode 100644 index 00000000..d8e9e6d2 Binary files /dev/null and b/3rdParty/javax.xml/org/w3c/dom/html/HTMLLIElement.class differ diff --git a/3rdParty/javax.xml/org/w3c/dom/html/HTMLLabelElement.class b/3rdParty/javax.xml/org/w3c/dom/html/HTMLLabelElement.class new file mode 100644 index 00000000..f1b4b4eb Binary files /dev/null and b/3rdParty/javax.xml/org/w3c/dom/html/HTMLLabelElement.class differ diff --git a/3rdParty/javax.xml/org/w3c/dom/html/HTMLLegendElement.class b/3rdParty/javax.xml/org/w3c/dom/html/HTMLLegendElement.class new file mode 100644 index 00000000..4aff8b90 Binary files /dev/null and b/3rdParty/javax.xml/org/w3c/dom/html/HTMLLegendElement.class differ diff --git a/3rdParty/javax.xml/org/w3c/dom/html/HTMLLinkElement.class b/3rdParty/javax.xml/org/w3c/dom/html/HTMLLinkElement.class new file mode 100644 index 00000000..9ed05aab Binary files /dev/null and b/3rdParty/javax.xml/org/w3c/dom/html/HTMLLinkElement.class differ diff --git a/3rdParty/javax.xml/org/w3c/dom/html/HTMLMapElement.class b/3rdParty/javax.xml/org/w3c/dom/html/HTMLMapElement.class new file mode 100644 index 00000000..b2ccf6ae Binary files /dev/null and b/3rdParty/javax.xml/org/w3c/dom/html/HTMLMapElement.class differ diff --git a/3rdParty/javax.xml/org/w3c/dom/html/HTMLMenuElement.class b/3rdParty/javax.xml/org/w3c/dom/html/HTMLMenuElement.class new file mode 100644 index 00000000..31b64ffc Binary files /dev/null and b/3rdParty/javax.xml/org/w3c/dom/html/HTMLMenuElement.class differ diff --git a/3rdParty/javax.xml/org/w3c/dom/html/HTMLMetaElement.class b/3rdParty/javax.xml/org/w3c/dom/html/HTMLMetaElement.class new file mode 100644 index 00000000..a04ea515 Binary files /dev/null and b/3rdParty/javax.xml/org/w3c/dom/html/HTMLMetaElement.class differ diff --git a/3rdParty/javax.xml/org/w3c/dom/html/HTMLModElement.class b/3rdParty/javax.xml/org/w3c/dom/html/HTMLModElement.class new file mode 100644 index 00000000..d35ce3d4 Binary files /dev/null and b/3rdParty/javax.xml/org/w3c/dom/html/HTMLModElement.class differ diff --git a/3rdParty/javax.xml/org/w3c/dom/html/HTMLOListElement.class b/3rdParty/javax.xml/org/w3c/dom/html/HTMLOListElement.class new file mode 100644 index 00000000..cce2c85b Binary files /dev/null and b/3rdParty/javax.xml/org/w3c/dom/html/HTMLOListElement.class differ diff --git a/3rdParty/javax.xml/org/w3c/dom/html/HTMLObjectElement.class b/3rdParty/javax.xml/org/w3c/dom/html/HTMLObjectElement.class new file mode 100644 index 00000000..8333a5f6 Binary files /dev/null and b/3rdParty/javax.xml/org/w3c/dom/html/HTMLObjectElement.class differ diff --git a/3rdParty/javax.xml/org/w3c/dom/html/HTMLOptGroupElement.class b/3rdParty/javax.xml/org/w3c/dom/html/HTMLOptGroupElement.class new file mode 100644 index 00000000..e8718abc Binary files /dev/null and b/3rdParty/javax.xml/org/w3c/dom/html/HTMLOptGroupElement.class differ diff --git a/3rdParty/javax.xml/org/w3c/dom/html/HTMLOptionElement.class b/3rdParty/javax.xml/org/w3c/dom/html/HTMLOptionElement.class new file mode 100644 index 00000000..cb5f57d0 Binary files /dev/null and b/3rdParty/javax.xml/org/w3c/dom/html/HTMLOptionElement.class differ diff --git a/3rdParty/javax.xml/org/w3c/dom/html/HTMLParagraphElement.class b/3rdParty/javax.xml/org/w3c/dom/html/HTMLParagraphElement.class new file mode 100644 index 00000000..aad584a1 Binary files /dev/null and b/3rdParty/javax.xml/org/w3c/dom/html/HTMLParagraphElement.class differ diff --git a/3rdParty/javax.xml/org/w3c/dom/html/HTMLParamElement.class b/3rdParty/javax.xml/org/w3c/dom/html/HTMLParamElement.class new file mode 100644 index 00000000..0768773e Binary files /dev/null and b/3rdParty/javax.xml/org/w3c/dom/html/HTMLParamElement.class differ diff --git a/3rdParty/javax.xml/org/w3c/dom/html/HTMLPreElement.class b/3rdParty/javax.xml/org/w3c/dom/html/HTMLPreElement.class new file mode 100644 index 00000000..671da0ff Binary files /dev/null and b/3rdParty/javax.xml/org/w3c/dom/html/HTMLPreElement.class differ diff --git a/3rdParty/javax.xml/org/w3c/dom/html/HTMLQuoteElement.class b/3rdParty/javax.xml/org/w3c/dom/html/HTMLQuoteElement.class new file mode 100644 index 00000000..fb270531 Binary files /dev/null and b/3rdParty/javax.xml/org/w3c/dom/html/HTMLQuoteElement.class differ diff --git a/3rdParty/javax.xml/org/w3c/dom/html/HTMLScriptElement.class b/3rdParty/javax.xml/org/w3c/dom/html/HTMLScriptElement.class new file mode 100644 index 00000000..97becbae Binary files /dev/null and b/3rdParty/javax.xml/org/w3c/dom/html/HTMLScriptElement.class differ diff --git a/3rdParty/javax.xml/org/w3c/dom/html/HTMLSelectElement.class b/3rdParty/javax.xml/org/w3c/dom/html/HTMLSelectElement.class new file mode 100644 index 00000000..47f3171c Binary files /dev/null and b/3rdParty/javax.xml/org/w3c/dom/html/HTMLSelectElement.class differ diff --git a/3rdParty/javax.xml/org/w3c/dom/html/HTMLStyleElement.class b/3rdParty/javax.xml/org/w3c/dom/html/HTMLStyleElement.class new file mode 100644 index 00000000..fec46a11 Binary files /dev/null and b/3rdParty/javax.xml/org/w3c/dom/html/HTMLStyleElement.class differ diff --git a/3rdParty/javax.xml/org/w3c/dom/html/HTMLTableCaptionElement.class b/3rdParty/javax.xml/org/w3c/dom/html/HTMLTableCaptionElement.class new file mode 100644 index 00000000..b9580a45 Binary files /dev/null and b/3rdParty/javax.xml/org/w3c/dom/html/HTMLTableCaptionElement.class differ diff --git a/3rdParty/javax.xml/org/w3c/dom/html/HTMLTableCellElement.class b/3rdParty/javax.xml/org/w3c/dom/html/HTMLTableCellElement.class new file mode 100644 index 00000000..fbbfb350 Binary files /dev/null and b/3rdParty/javax.xml/org/w3c/dom/html/HTMLTableCellElement.class differ diff --git a/3rdParty/javax.xml/org/w3c/dom/html/HTMLTableColElement.class b/3rdParty/javax.xml/org/w3c/dom/html/HTMLTableColElement.class new file mode 100644 index 00000000..df7afef2 Binary files /dev/null and b/3rdParty/javax.xml/org/w3c/dom/html/HTMLTableColElement.class differ diff --git a/3rdParty/javax.xml/org/w3c/dom/html/HTMLTableElement.class b/3rdParty/javax.xml/org/w3c/dom/html/HTMLTableElement.class new file mode 100644 index 00000000..87c96d7b Binary files /dev/null and b/3rdParty/javax.xml/org/w3c/dom/html/HTMLTableElement.class differ diff --git a/3rdParty/javax.xml/org/w3c/dom/html/HTMLTableRowElement.class b/3rdParty/javax.xml/org/w3c/dom/html/HTMLTableRowElement.class new file mode 100644 index 00000000..12d63ead Binary files /dev/null and b/3rdParty/javax.xml/org/w3c/dom/html/HTMLTableRowElement.class differ diff --git a/3rdParty/javax.xml/org/w3c/dom/html/HTMLTableSectionElement.class b/3rdParty/javax.xml/org/w3c/dom/html/HTMLTableSectionElement.class new file mode 100644 index 00000000..805a358c Binary files /dev/null and b/3rdParty/javax.xml/org/w3c/dom/html/HTMLTableSectionElement.class differ diff --git a/3rdParty/javax.xml/org/w3c/dom/html/HTMLTextAreaElement.class b/3rdParty/javax.xml/org/w3c/dom/html/HTMLTextAreaElement.class new file mode 100644 index 00000000..760ce399 Binary files /dev/null and b/3rdParty/javax.xml/org/w3c/dom/html/HTMLTextAreaElement.class differ diff --git a/3rdParty/javax.xml/org/w3c/dom/html/HTMLTitleElement.class b/3rdParty/javax.xml/org/w3c/dom/html/HTMLTitleElement.class new file mode 100644 index 00000000..28158eb3 Binary files /dev/null and b/3rdParty/javax.xml/org/w3c/dom/html/HTMLTitleElement.class differ diff --git a/3rdParty/javax.xml/org/w3c/dom/html/HTMLUListElement.class b/3rdParty/javax.xml/org/w3c/dom/html/HTMLUListElement.class new file mode 100644 index 00000000..c3c8bcab Binary files /dev/null and b/3rdParty/javax.xml/org/w3c/dom/html/HTMLUListElement.class differ diff --git a/3rdParty/javax.xml/org/w3c/dom/ls/DOMImplementationLS.class b/3rdParty/javax.xml/org/w3c/dom/ls/DOMImplementationLS.class new file mode 100644 index 00000000..11dca812 Binary files /dev/null and b/3rdParty/javax.xml/org/w3c/dom/ls/DOMImplementationLS.class differ diff --git a/3rdParty/javax.xml/org/w3c/dom/ls/LSException.class b/3rdParty/javax.xml/org/w3c/dom/ls/LSException.class new file mode 100644 index 00000000..90677a62 Binary files /dev/null and b/3rdParty/javax.xml/org/w3c/dom/ls/LSException.class differ diff --git a/3rdParty/javax.xml/org/w3c/dom/ls/LSInput.class b/3rdParty/javax.xml/org/w3c/dom/ls/LSInput.class new file mode 100644 index 00000000..6cdac64f Binary files /dev/null and b/3rdParty/javax.xml/org/w3c/dom/ls/LSInput.class differ diff --git a/3rdParty/javax.xml/org/w3c/dom/ls/LSLoadEvent.class b/3rdParty/javax.xml/org/w3c/dom/ls/LSLoadEvent.class new file mode 100644 index 00000000..d22b61ff Binary files /dev/null and b/3rdParty/javax.xml/org/w3c/dom/ls/LSLoadEvent.class differ diff --git a/3rdParty/javax.xml/org/w3c/dom/ls/LSOutput.class b/3rdParty/javax.xml/org/w3c/dom/ls/LSOutput.class new file mode 100644 index 00000000..715aed3f Binary files /dev/null and b/3rdParty/javax.xml/org/w3c/dom/ls/LSOutput.class differ diff --git a/3rdParty/javax.xml/org/w3c/dom/ls/LSParser.class b/3rdParty/javax.xml/org/w3c/dom/ls/LSParser.class new file mode 100644 index 00000000..6c744bd4 Binary files /dev/null and b/3rdParty/javax.xml/org/w3c/dom/ls/LSParser.class differ diff --git a/3rdParty/javax.xml/org/w3c/dom/ls/LSParserFilter.class b/3rdParty/javax.xml/org/w3c/dom/ls/LSParserFilter.class new file mode 100644 index 00000000..80eb89ce Binary files /dev/null and b/3rdParty/javax.xml/org/w3c/dom/ls/LSParserFilter.class differ diff --git a/3rdParty/javax.xml/org/w3c/dom/ls/LSProgressEvent.class b/3rdParty/javax.xml/org/w3c/dom/ls/LSProgressEvent.class new file mode 100644 index 00000000..d2fa1dbb Binary files /dev/null and b/3rdParty/javax.xml/org/w3c/dom/ls/LSProgressEvent.class differ diff --git a/3rdParty/javax.xml/org/w3c/dom/ls/LSResourceResolver.class b/3rdParty/javax.xml/org/w3c/dom/ls/LSResourceResolver.class new file mode 100644 index 00000000..a75a5e7e Binary files /dev/null and b/3rdParty/javax.xml/org/w3c/dom/ls/LSResourceResolver.class differ diff --git a/3rdParty/javax.xml/org/w3c/dom/ls/LSSerializer.class b/3rdParty/javax.xml/org/w3c/dom/ls/LSSerializer.class new file mode 100644 index 00000000..35d2ab9a Binary files /dev/null and b/3rdParty/javax.xml/org/w3c/dom/ls/LSSerializer.class differ diff --git a/3rdParty/javax.xml/org/w3c/dom/ls/LSSerializerFilter.class b/3rdParty/javax.xml/org/w3c/dom/ls/LSSerializerFilter.class new file mode 100644 index 00000000..6cede8bc Binary files /dev/null and b/3rdParty/javax.xml/org/w3c/dom/ls/LSSerializerFilter.class differ diff --git a/3rdParty/javax.xml/org/w3c/dom/ranges/DocumentRange.class b/3rdParty/javax.xml/org/w3c/dom/ranges/DocumentRange.class new file mode 100644 index 00000000..379cd1ff Binary files /dev/null and b/3rdParty/javax.xml/org/w3c/dom/ranges/DocumentRange.class differ diff --git a/3rdParty/javax.xml/org/w3c/dom/ranges/Range.class b/3rdParty/javax.xml/org/w3c/dom/ranges/Range.class new file mode 100644 index 00000000..2404a53d Binary files /dev/null and b/3rdParty/javax.xml/org/w3c/dom/ranges/Range.class differ diff --git a/3rdParty/javax.xml/org/w3c/dom/ranges/RangeException.class b/3rdParty/javax.xml/org/w3c/dom/ranges/RangeException.class new file mode 100644 index 00000000..77a75a74 Binary files /dev/null and b/3rdParty/javax.xml/org/w3c/dom/ranges/RangeException.class differ diff --git a/3rdParty/javax.xml/org/w3c/dom/stylesheets/DocumentStyle.class b/3rdParty/javax.xml/org/w3c/dom/stylesheets/DocumentStyle.class new file mode 100644 index 00000000..1e116bc7 Binary files /dev/null and b/3rdParty/javax.xml/org/w3c/dom/stylesheets/DocumentStyle.class differ diff --git a/3rdParty/javax.xml/org/w3c/dom/stylesheets/LinkStyle.class b/3rdParty/javax.xml/org/w3c/dom/stylesheets/LinkStyle.class new file mode 100644 index 00000000..e0fc7bc0 Binary files /dev/null and b/3rdParty/javax.xml/org/w3c/dom/stylesheets/LinkStyle.class differ diff --git a/3rdParty/javax.xml/org/w3c/dom/stylesheets/MediaList.class b/3rdParty/javax.xml/org/w3c/dom/stylesheets/MediaList.class new file mode 100644 index 00000000..801c6305 Binary files /dev/null and b/3rdParty/javax.xml/org/w3c/dom/stylesheets/MediaList.class differ diff --git a/3rdParty/javax.xml/org/w3c/dom/stylesheets/StyleSheet.class b/3rdParty/javax.xml/org/w3c/dom/stylesheets/StyleSheet.class new file mode 100644 index 00000000..834689b5 Binary files /dev/null and b/3rdParty/javax.xml/org/w3c/dom/stylesheets/StyleSheet.class differ diff --git a/3rdParty/javax.xml/org/w3c/dom/stylesheets/StyleSheetList.class b/3rdParty/javax.xml/org/w3c/dom/stylesheets/StyleSheetList.class new file mode 100644 index 00000000..3d0ee038 Binary files /dev/null and b/3rdParty/javax.xml/org/w3c/dom/stylesheets/StyleSheetList.class differ diff --git a/3rdParty/javax.xml/org/w3c/dom/traversal/DocumentTraversal.class b/3rdParty/javax.xml/org/w3c/dom/traversal/DocumentTraversal.class new file mode 100644 index 00000000..60d00017 Binary files /dev/null and b/3rdParty/javax.xml/org/w3c/dom/traversal/DocumentTraversal.class differ diff --git a/3rdParty/javax.xml/org/w3c/dom/traversal/NodeFilter.class b/3rdParty/javax.xml/org/w3c/dom/traversal/NodeFilter.class new file mode 100644 index 00000000..5abec1a1 Binary files /dev/null and b/3rdParty/javax.xml/org/w3c/dom/traversal/NodeFilter.class differ diff --git a/3rdParty/javax.xml/org/w3c/dom/traversal/NodeIterator.class b/3rdParty/javax.xml/org/w3c/dom/traversal/NodeIterator.class new file mode 100644 index 00000000..85797f93 Binary files /dev/null and b/3rdParty/javax.xml/org/w3c/dom/traversal/NodeIterator.class differ diff --git a/3rdParty/javax.xml/org/w3c/dom/traversal/TreeWalker.class b/3rdParty/javax.xml/org/w3c/dom/traversal/TreeWalker.class new file mode 100644 index 00000000..6016f126 Binary files /dev/null and b/3rdParty/javax.xml/org/w3c/dom/traversal/TreeWalker.class differ diff --git a/3rdParty/javax.xml/org/w3c/dom/views/AbstractView.class b/3rdParty/javax.xml/org/w3c/dom/views/AbstractView.class new file mode 100644 index 00000000..734a1350 Binary files /dev/null and b/3rdParty/javax.xml/org/w3c/dom/views/AbstractView.class differ diff --git a/3rdParty/javax.xml/org/w3c/dom/views/DocumentView.class b/3rdParty/javax.xml/org/w3c/dom/views/DocumentView.class new file mode 100644 index 00000000..1761fd47 Binary files /dev/null and b/3rdParty/javax.xml/org/w3c/dom/views/DocumentView.class differ diff --git a/3rdParty/javax.xml/org/w3c/dom/xpath/XPathEvaluator.class b/3rdParty/javax.xml/org/w3c/dom/xpath/XPathEvaluator.class new file mode 100644 index 00000000..f62db787 Binary files /dev/null and b/3rdParty/javax.xml/org/w3c/dom/xpath/XPathEvaluator.class differ diff --git a/3rdParty/javax.xml/org/w3c/dom/xpath/XPathException.class b/3rdParty/javax.xml/org/w3c/dom/xpath/XPathException.class new file mode 100644 index 00000000..894516d5 Binary files /dev/null and b/3rdParty/javax.xml/org/w3c/dom/xpath/XPathException.class differ diff --git a/3rdParty/javax.xml/org/w3c/dom/xpath/XPathExpression.class b/3rdParty/javax.xml/org/w3c/dom/xpath/XPathExpression.class new file mode 100644 index 00000000..70f44896 Binary files /dev/null and b/3rdParty/javax.xml/org/w3c/dom/xpath/XPathExpression.class differ diff --git a/3rdParty/javax.xml/org/w3c/dom/xpath/XPathNSResolver.class b/3rdParty/javax.xml/org/w3c/dom/xpath/XPathNSResolver.class new file mode 100644 index 00000000..ac4c2de3 Binary files /dev/null and b/3rdParty/javax.xml/org/w3c/dom/xpath/XPathNSResolver.class differ diff --git a/3rdParty/javax.xml/org/w3c/dom/xpath/XPathNamespace.class b/3rdParty/javax.xml/org/w3c/dom/xpath/XPathNamespace.class new file mode 100644 index 00000000..d8912e57 Binary files /dev/null and b/3rdParty/javax.xml/org/w3c/dom/xpath/XPathNamespace.class differ diff --git a/3rdParty/javax.xml/org/w3c/dom/xpath/XPathResult.class b/3rdParty/javax.xml/org/w3c/dom/xpath/XPathResult.class new file mode 100644 index 00000000..020dcd0a Binary files /dev/null and b/3rdParty/javax.xml/org/w3c/dom/xpath/XPathResult.class differ diff --git a/3rdParty/javax.xml/org/xml/sax/AttributeList.class b/3rdParty/javax.xml/org/xml/sax/AttributeList.class new file mode 100644 index 00000000..d277f9d8 Binary files /dev/null and b/3rdParty/javax.xml/org/xml/sax/AttributeList.class differ diff --git a/3rdParty/javax.xml/org/xml/sax/Attributes.class b/3rdParty/javax.xml/org/xml/sax/Attributes.class new file mode 100644 index 00000000..e147515f Binary files /dev/null and b/3rdParty/javax.xml/org/xml/sax/Attributes.class differ diff --git a/3rdParty/javax.xml/org/xml/sax/ContentHandler.class b/3rdParty/javax.xml/org/xml/sax/ContentHandler.class new file mode 100644 index 00000000..54ed4b0f Binary files /dev/null and b/3rdParty/javax.xml/org/xml/sax/ContentHandler.class differ diff --git a/3rdParty/javax.xml/org/xml/sax/DTDHandler.class b/3rdParty/javax.xml/org/xml/sax/DTDHandler.class new file mode 100644 index 00000000..73e74d1e Binary files /dev/null and b/3rdParty/javax.xml/org/xml/sax/DTDHandler.class differ diff --git a/3rdParty/javax.xml/org/xml/sax/DocumentHandler.class b/3rdParty/javax.xml/org/xml/sax/DocumentHandler.class new file mode 100644 index 00000000..01198d09 Binary files /dev/null and b/3rdParty/javax.xml/org/xml/sax/DocumentHandler.class differ diff --git a/3rdParty/javax.xml/org/xml/sax/EntityResolver.class b/3rdParty/javax.xml/org/xml/sax/EntityResolver.class new file mode 100644 index 00000000..564b38d5 Binary files /dev/null and b/3rdParty/javax.xml/org/xml/sax/EntityResolver.class differ diff --git a/3rdParty/javax.xml/org/xml/sax/ErrorHandler.class b/3rdParty/javax.xml/org/xml/sax/ErrorHandler.class new file mode 100644 index 00000000..42504a87 Binary files /dev/null and b/3rdParty/javax.xml/org/xml/sax/ErrorHandler.class differ diff --git a/3rdParty/javax.xml/org/xml/sax/HandlerBase.class b/3rdParty/javax.xml/org/xml/sax/HandlerBase.class new file mode 100644 index 00000000..4c19f03d Binary files /dev/null and b/3rdParty/javax.xml/org/xml/sax/HandlerBase.class differ diff --git a/3rdParty/javax.xml/org/xml/sax/InputSource.class b/3rdParty/javax.xml/org/xml/sax/InputSource.class new file mode 100644 index 00000000..cf41554e Binary files /dev/null and b/3rdParty/javax.xml/org/xml/sax/InputSource.class differ diff --git a/3rdParty/javax.xml/org/xml/sax/Locator.class b/3rdParty/javax.xml/org/xml/sax/Locator.class new file mode 100644 index 00000000..a21def19 Binary files /dev/null and b/3rdParty/javax.xml/org/xml/sax/Locator.class differ diff --git a/3rdParty/javax.xml/org/xml/sax/Parser.class b/3rdParty/javax.xml/org/xml/sax/Parser.class new file mode 100644 index 00000000..93a54152 Binary files /dev/null and b/3rdParty/javax.xml/org/xml/sax/Parser.class differ diff --git a/3rdParty/javax.xml/org/xml/sax/SAXException.class b/3rdParty/javax.xml/org/xml/sax/SAXException.class new file mode 100644 index 00000000..7cdf6707 Binary files /dev/null and b/3rdParty/javax.xml/org/xml/sax/SAXException.class differ diff --git a/3rdParty/javax.xml/org/xml/sax/SAXNotRecognizedException.class b/3rdParty/javax.xml/org/xml/sax/SAXNotRecognizedException.class new file mode 100644 index 00000000..41b5ec58 Binary files /dev/null and b/3rdParty/javax.xml/org/xml/sax/SAXNotRecognizedException.class differ diff --git a/3rdParty/javax.xml/org/xml/sax/SAXNotSupportedException.class b/3rdParty/javax.xml/org/xml/sax/SAXNotSupportedException.class new file mode 100644 index 00000000..7bcce96e Binary files /dev/null and b/3rdParty/javax.xml/org/xml/sax/SAXNotSupportedException.class differ diff --git a/3rdParty/javax.xml/org/xml/sax/SAXParseException.class b/3rdParty/javax.xml/org/xml/sax/SAXParseException.class new file mode 100644 index 00000000..23a9807c Binary files /dev/null and b/3rdParty/javax.xml/org/xml/sax/SAXParseException.class differ diff --git a/3rdParty/javax.xml/org/xml/sax/XMLFilter.class b/3rdParty/javax.xml/org/xml/sax/XMLFilter.class new file mode 100644 index 00000000..b08db3be Binary files /dev/null and b/3rdParty/javax.xml/org/xml/sax/XMLFilter.class differ diff --git a/3rdParty/javax.xml/org/xml/sax/XMLReader.class b/3rdParty/javax.xml/org/xml/sax/XMLReader.class new file mode 100644 index 00000000..d02c40e0 Binary files /dev/null and b/3rdParty/javax.xml/org/xml/sax/XMLReader.class differ diff --git a/3rdParty/javax.xml/org/xml/sax/ext/Attributes2.class b/3rdParty/javax.xml/org/xml/sax/ext/Attributes2.class new file mode 100644 index 00000000..36f8321b Binary files /dev/null and b/3rdParty/javax.xml/org/xml/sax/ext/Attributes2.class differ diff --git a/3rdParty/javax.xml/org/xml/sax/ext/Attributes2Impl.class b/3rdParty/javax.xml/org/xml/sax/ext/Attributes2Impl.class new file mode 100644 index 00000000..7484a7df Binary files /dev/null and b/3rdParty/javax.xml/org/xml/sax/ext/Attributes2Impl.class differ diff --git a/3rdParty/javax.xml/org/xml/sax/ext/DeclHandler.class b/3rdParty/javax.xml/org/xml/sax/ext/DeclHandler.class new file mode 100644 index 00000000..aba93134 Binary files /dev/null and b/3rdParty/javax.xml/org/xml/sax/ext/DeclHandler.class differ diff --git a/3rdParty/javax.xml/org/xml/sax/ext/DefaultHandler2.class b/3rdParty/javax.xml/org/xml/sax/ext/DefaultHandler2.class new file mode 100644 index 00000000..43bf0051 Binary files /dev/null and b/3rdParty/javax.xml/org/xml/sax/ext/DefaultHandler2.class differ diff --git a/3rdParty/javax.xml/org/xml/sax/ext/EntityResolver2.class b/3rdParty/javax.xml/org/xml/sax/ext/EntityResolver2.class new file mode 100644 index 00000000..d40319a9 Binary files /dev/null and b/3rdParty/javax.xml/org/xml/sax/ext/EntityResolver2.class differ diff --git a/3rdParty/javax.xml/org/xml/sax/ext/LexicalHandler.class b/3rdParty/javax.xml/org/xml/sax/ext/LexicalHandler.class new file mode 100644 index 00000000..45788640 Binary files /dev/null and b/3rdParty/javax.xml/org/xml/sax/ext/LexicalHandler.class differ diff --git a/3rdParty/javax.xml/org/xml/sax/ext/Locator2.class b/3rdParty/javax.xml/org/xml/sax/ext/Locator2.class new file mode 100644 index 00000000..ef7887c0 Binary files /dev/null and b/3rdParty/javax.xml/org/xml/sax/ext/Locator2.class differ diff --git a/3rdParty/javax.xml/org/xml/sax/ext/Locator2Impl.class b/3rdParty/javax.xml/org/xml/sax/ext/Locator2Impl.class new file mode 100644 index 00000000..fd2ddc0b Binary files /dev/null and b/3rdParty/javax.xml/org/xml/sax/ext/Locator2Impl.class differ diff --git a/3rdParty/javax.xml/org/xml/sax/helpers/AttributeListImpl.class b/3rdParty/javax.xml/org/xml/sax/helpers/AttributeListImpl.class new file mode 100644 index 00000000..36c2a71a Binary files /dev/null and b/3rdParty/javax.xml/org/xml/sax/helpers/AttributeListImpl.class differ diff --git a/3rdParty/javax.xml/org/xml/sax/helpers/AttributesImpl.class b/3rdParty/javax.xml/org/xml/sax/helpers/AttributesImpl.class new file mode 100644 index 00000000..b5834cd9 Binary files /dev/null and b/3rdParty/javax.xml/org/xml/sax/helpers/AttributesImpl.class differ diff --git a/3rdParty/javax.xml/org/xml/sax/helpers/DefaultHandler.class b/3rdParty/javax.xml/org/xml/sax/helpers/DefaultHandler.class new file mode 100644 index 00000000..8a8c7398 Binary files /dev/null and b/3rdParty/javax.xml/org/xml/sax/helpers/DefaultHandler.class differ diff --git a/3rdParty/javax.xml/org/xml/sax/helpers/LocatorImpl.class b/3rdParty/javax.xml/org/xml/sax/helpers/LocatorImpl.class new file mode 100644 index 00000000..5c2c00fa Binary files /dev/null and b/3rdParty/javax.xml/org/xml/sax/helpers/LocatorImpl.class differ diff --git a/3rdParty/javax.xml/org/xml/sax/helpers/NamespaceSupport$Context.class b/3rdParty/javax.xml/org/xml/sax/helpers/NamespaceSupport$Context.class new file mode 100644 index 00000000..285c5b7f Binary files /dev/null and b/3rdParty/javax.xml/org/xml/sax/helpers/NamespaceSupport$Context.class differ diff --git a/3rdParty/javax.xml/org/xml/sax/helpers/NamespaceSupport.class b/3rdParty/javax.xml/org/xml/sax/helpers/NamespaceSupport.class new file mode 100644 index 00000000..0a88a90d Binary files /dev/null and b/3rdParty/javax.xml/org/xml/sax/helpers/NamespaceSupport.class differ diff --git a/3rdParty/javax.xml/org/xml/sax/helpers/NewInstance.class b/3rdParty/javax.xml/org/xml/sax/helpers/NewInstance.class new file mode 100644 index 00000000..2f471fd3 Binary files /dev/null and b/3rdParty/javax.xml/org/xml/sax/helpers/NewInstance.class differ diff --git a/3rdParty/javax.xml/org/xml/sax/helpers/ParserAdapter$AttributeListAdapter.class b/3rdParty/javax.xml/org/xml/sax/helpers/ParserAdapter$AttributeListAdapter.class new file mode 100644 index 00000000..d82f7e8d Binary files /dev/null and b/3rdParty/javax.xml/org/xml/sax/helpers/ParserAdapter$AttributeListAdapter.class differ diff --git a/3rdParty/javax.xml/org/xml/sax/helpers/ParserAdapter.class b/3rdParty/javax.xml/org/xml/sax/helpers/ParserAdapter.class new file mode 100644 index 00000000..eb63b26a Binary files /dev/null and b/3rdParty/javax.xml/org/xml/sax/helpers/ParserAdapter.class differ diff --git a/3rdParty/javax.xml/org/xml/sax/helpers/ParserFactory.class b/3rdParty/javax.xml/org/xml/sax/helpers/ParserFactory.class new file mode 100644 index 00000000..9285824d Binary files /dev/null and b/3rdParty/javax.xml/org/xml/sax/helpers/ParserFactory.class differ diff --git a/3rdParty/javax.xml/org/xml/sax/helpers/SecuritySupport$1.class b/3rdParty/javax.xml/org/xml/sax/helpers/SecuritySupport$1.class new file mode 100644 index 00000000..5b41d88d Binary files /dev/null and b/3rdParty/javax.xml/org/xml/sax/helpers/SecuritySupport$1.class differ diff --git a/3rdParty/javax.xml/org/xml/sax/helpers/SecuritySupport$2.class b/3rdParty/javax.xml/org/xml/sax/helpers/SecuritySupport$2.class new file mode 100644 index 00000000..31dc84fc Binary files /dev/null and b/3rdParty/javax.xml/org/xml/sax/helpers/SecuritySupport$2.class differ diff --git a/3rdParty/javax.xml/org/xml/sax/helpers/SecuritySupport$3.class b/3rdParty/javax.xml/org/xml/sax/helpers/SecuritySupport$3.class new file mode 100644 index 00000000..fa696f0e Binary files /dev/null and b/3rdParty/javax.xml/org/xml/sax/helpers/SecuritySupport$3.class differ diff --git a/3rdParty/javax.xml/org/xml/sax/helpers/SecuritySupport$4.class b/3rdParty/javax.xml/org/xml/sax/helpers/SecuritySupport$4.class new file mode 100644 index 00000000..6fa76343 Binary files /dev/null and b/3rdParty/javax.xml/org/xml/sax/helpers/SecuritySupport$4.class differ diff --git a/3rdParty/javax.xml/org/xml/sax/helpers/SecuritySupport.class b/3rdParty/javax.xml/org/xml/sax/helpers/SecuritySupport.class new file mode 100644 index 00000000..57d497ab Binary files /dev/null and b/3rdParty/javax.xml/org/xml/sax/helpers/SecuritySupport.class differ diff --git a/3rdParty/javax.xml/org/xml/sax/helpers/XMLFilterImpl.class b/3rdParty/javax.xml/org/xml/sax/helpers/XMLFilterImpl.class new file mode 100644 index 00000000..5ee1710b Binary files /dev/null and b/3rdParty/javax.xml/org/xml/sax/helpers/XMLFilterImpl.class differ diff --git a/3rdParty/javax.xml/org/xml/sax/helpers/XMLReaderAdapter$AttributesAdapter.class b/3rdParty/javax.xml/org/xml/sax/helpers/XMLReaderAdapter$AttributesAdapter.class new file mode 100644 index 00000000..8879afaa Binary files /dev/null and b/3rdParty/javax.xml/org/xml/sax/helpers/XMLReaderAdapter$AttributesAdapter.class differ diff --git a/3rdParty/javax.xml/org/xml/sax/helpers/XMLReaderAdapter.class b/3rdParty/javax.xml/org/xml/sax/helpers/XMLReaderAdapter.class new file mode 100644 index 00000000..00b3373e Binary files /dev/null and b/3rdParty/javax.xml/org/xml/sax/helpers/XMLReaderAdapter.class differ diff --git a/3rdParty/javax.xml/org/xml/sax/helpers/XMLReaderFactory.class b/3rdParty/javax.xml/org/xml/sax/helpers/XMLReaderFactory.class new file mode 100644 index 00000000..8f94d4fb Binary files /dev/null and b/3rdParty/javax.xml/org/xml/sax/helpers/XMLReaderFactory.class differ diff --git a/3rdParty/javax.xml/pom.xml b/3rdParty/javax.xml/pom.xml new file mode 100644 index 00000000..862de841 --- /dev/null +++ b/3rdParty/javax.xml/pom.xml @@ -0,0 +1,21 @@ + + + 4.0.0 + + + com.kdmanalytics.libs.libsjava + plugins + 2.4.0-SNAPSHOT + + + com.kdmanalytics.libs.libsjava.plugins + javax.xml + 1.4.0-SNAPSHOT + + JAXP XML + + eclipse-plugin + + diff --git a/3rdParty/net.sf.trove4j/.classpath b/3rdParty/net.sf.trove4j/.classpath new file mode 100644 index 00000000..8669931a --- /dev/null +++ b/3rdParty/net.sf.trove4j/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/3rdParty/net.sf.trove4j/.project b/3rdParty/net.sf.trove4j/.project new file mode 100644 index 00000000..1376f23b --- /dev/null +++ b/3rdParty/net.sf.trove4j/.project @@ -0,0 +1,28 @@ + + + net.sf.trove4j + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + + org.eclipse.pde.PluginNature + org.eclipse.jdt.core.javanature + + diff --git a/3rdParty/net.sf.trove4j/.settings/org.eclipse.jdt.core.prefs b/3rdParty/net.sf.trove4j/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 00000000..11f6e462 --- /dev/null +++ b/3rdParty/net.sf.trove4j/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,7 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 +org.eclipse.jdt.core.compiler.compliance=1.7 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.7 diff --git a/3rdParty/net.sf.trove4j/META-INF/MANIFEST.MF b/3rdParty/net.sf.trove4j/META-INF/MANIFEST.MF new file mode 100644 index 00000000..a137395f --- /dev/null +++ b/3rdParty/net.sf.trove4j/META-INF/MANIFEST.MF @@ -0,0 +1,31 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: Trove4j +Bundle-SymbolicName: net.sf.trove4j +Bundle-Version: 3.0.3 +Bundle-ClassPath: net.sf.trove4j_3.0.3.jar +Bundle-Vendor: Google +Export-Package: gnu.trove, + gnu.trove.decorator, + gnu.trove.function, + gnu.trove.impl, + gnu.trove.impl.hash, + gnu.trove.impl.sync, + gnu.trove.impl.unmodifiable, + gnu.trove.iterator, + gnu.trove.iterator.hash, + gnu.trove.list, + gnu.trove.list.array, + gnu.trove.list.linked, + gnu.trove.map, + gnu.trove.map.custom_hash, + gnu.trove.map.hash, + gnu.trove.procedure, + gnu.trove.procedure.array, + gnu.trove.queue, + gnu.trove.set, + gnu.trove.set.hash, + gnu.trove.stack, + gnu.trove.stack.array, + gnu.trove.strategy +Bundle-RequiredExecutionEnvironment: JavaSE-1.7 diff --git a/3rdParty/net.sf.trove4j/build.properties b/3rdParty/net.sf.trove4j/build.properties new file mode 100644 index 00000000..0bc4580e --- /dev/null +++ b/3rdParty/net.sf.trove4j/build.properties @@ -0,0 +1,2 @@ +bin.includes = META-INF/,\ + net.sf.trove4j_3.0.3.jar diff --git a/3rdParty/net.sf.trove4j/net.sf.trove4j_3.0.3.jar b/3rdParty/net.sf.trove4j/net.sf.trove4j_3.0.3.jar new file mode 100644 index 00000000..3d2af9d4 Binary files /dev/null and b/3rdParty/net.sf.trove4j/net.sf.trove4j_3.0.3.jar differ diff --git a/3rdParty/org.apache.commons.io/.classpath b/3rdParty/org.apache.commons.io/.classpath new file mode 100644 index 00000000..b34b76fc --- /dev/null +++ b/3rdParty/org.apache.commons.io/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/3rdParty/org.apache.commons.io/.project b/3rdParty/org.apache.commons.io/.project new file mode 100644 index 00000000..8323cfda --- /dev/null +++ b/3rdParty/org.apache.commons.io/.project @@ -0,0 +1,28 @@ + + + org.apache.commons.io + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + + org.eclipse.pde.PluginNature + org.eclipse.jdt.core.javanature + + diff --git a/3rdParty/org.apache.commons.io/.settings/org.eclipse.jdt.core.prefs b/3rdParty/org.apache.commons.io/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 00000000..11f6e462 --- /dev/null +++ b/3rdParty/org.apache.commons.io/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,7 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 +org.eclipse.jdt.core.compiler.compliance=1.7 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.7 diff --git a/3rdParty/org.apache.commons.io/META-INF/LICENSE.txt b/3rdParty/org.apache.commons.io/META-INF/LICENSE.txt new file mode 100644 index 00000000..43e91eb0 --- /dev/null +++ b/3rdParty/org.apache.commons.io/META-INF/LICENSE.txt @@ -0,0 +1,203 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + diff --git a/3rdParty/org.apache.commons.io/META-INF/MANIFEST.MF b/3rdParty/org.apache.commons.io/META-INF/MANIFEST.MF new file mode 100644 index 00000000..d093aaa0 --- /dev/null +++ b/3rdParty/org.apache.commons.io/META-INF/MANIFEST.MF @@ -0,0 +1,18 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: Apache Commons Io +Bundle-SymbolicName: org.apache.commons.io +Bundle-Version: 2.4.0 +Bundle-ClassPath: org.apache.commons.io_2.4.0.jar +Bundle-Vendor: Kdm Analytics Inc. +Export-Package: org.apache.commons.io, + org.apache.commons.io.comparator, + org.apache.commons.io.filefilter, + org.apache.commons.io.input, + org.apache.commons.io.monitor, + org.apache.commons.io.output +Bundle-RequiredExecutionEnvironment: JavaSE-1.7 +Created-By: Apache Maven +Build-Jdk: 1.7.0_25 +Archiver-Version: Plexus Archiver +Built-By: jenkins diff --git a/3rdParty/org.apache.commons.io/META-INF/NOTICE.txt b/3rdParty/org.apache.commons.io/META-INF/NOTICE.txt new file mode 100644 index 00000000..7632eb8e --- /dev/null +++ b/3rdParty/org.apache.commons.io/META-INF/NOTICE.txt @@ -0,0 +1,6 @@ +Apache Commons IO +Copyright 2002-2012 The Apache Software Foundation + +This product includes software developed by +The Apache Software Foundation (http://www.apache.org/). + diff --git a/3rdParty/org.apache.commons.io/META-INF/maven/com.kdmanalytics.libs.libsjava.plugins/org.apache.commons.io/pom.properties b/3rdParty/org.apache.commons.io/META-INF/maven/com.kdmanalytics.libs.libsjava.plugins/org.apache.commons.io/pom.properties new file mode 100644 index 00000000..80a21b50 --- /dev/null +++ b/3rdParty/org.apache.commons.io/META-INF/maven/com.kdmanalytics.libs.libsjava.plugins/org.apache.commons.io/pom.properties @@ -0,0 +1,5 @@ +#Generated by Maven +#Thu Sep 12 11:09:00 EDT 2013 +version=2.4.0 +groupId=com.kdmanalytics.libs.libsjava.plugins +artifactId=org.apache.commons.io diff --git a/3rdParty/org.apache.commons.io/META-INF/maven/com.kdmanalytics.libs.libsjava.plugins/org.apache.commons.io/pom.xml b/3rdParty/org.apache.commons.io/META-INF/maven/com.kdmanalytics.libs.libsjava.plugins/org.apache.commons.io/pom.xml new file mode 100644 index 00000000..173614d2 --- /dev/null +++ b/3rdParty/org.apache.commons.io/META-INF/maven/com.kdmanalytics.libs.libsjava.plugins/org.apache.commons.io/pom.xml @@ -0,0 +1,21 @@ + + + 4.0.0 + + + com.kdmanalytics.libs.libsjava + plugins + 2.3.1 + + + com.kdmanalytics.libs.libsjava.plugins + org.apache.commons.io + 2.4.0 + + Apache Commons IO + + eclipse-plugin + + diff --git a/3rdParty/org.apache.commons.io/META-INF/maven/commons-io/commons-io/pom.properties b/3rdParty/org.apache.commons.io/META-INF/maven/commons-io/commons-io/pom.properties new file mode 100644 index 00000000..b306d111 --- /dev/null +++ b/3rdParty/org.apache.commons.io/META-INF/maven/commons-io/commons-io/pom.properties @@ -0,0 +1,5 @@ +#Generated by Maven +#Tue Jun 12 18:19:43 EDT 2012 +version=2.4 +groupId=commons-io +artifactId=commons-io diff --git a/3rdParty/org.apache.commons.io/META-INF/maven/commons-io/commons-io/pom.xml b/3rdParty/org.apache.commons.io/META-INF/maven/commons-io/commons-io/pom.xml new file mode 100644 index 00000000..f6c1def6 --- /dev/null +++ b/3rdParty/org.apache.commons.io/META-INF/maven/commons-io/commons-io/pom.xml @@ -0,0 +1,323 @@ + + + + + org.apache.commons + commons-parent + 25 + + 4.0.0 + commons-io + commons-io + 2.4 + Commons IO + + 2002 + +The Commons IO library contains utility classes, stream implementations, file filters, +file comparators, endian transformation classes, and much more. + + + http://commons.apache.org/io/ + + + jira + http://issues.apache.org/jira/browse/IO + + + + + apache.website + Apache Commons IO Site + ${commons.deployment.protocol}://people.apache.org/www/commons.apache.org/${commons.componentid} + + + + + scm:svn:http://svn.apache.org/repos/asf/commons/proper/io/trunk + scm:svn:https://svn.apache.org/repos/asf/commons/proper/io/trunk + http://svn.apache.org/viewvc/commons/proper/io/trunk + + + + + Scott Sanders + sanders + sanders@apache.org + + + Java Developer + + + + dIon Gillard + dion + dion@apache.org + + + Java Developer + + + + Nicola Ken Barozzi + nicolaken + nicolaken@apache.org + + + Java Developer + + + + Henri Yandell + bayard + bayard@apache.org + + + Java Developer + + + + Stephen Colebourne + scolebourne + + + Java Developer + + 0 + + + Jeremias Maerki + jeremias + jeremias@apache.org + + + Java Developer + + +1 + + + Matthew Hawthorne + matth + matth@apache.org + + + Java Developer + + + + Martin Cooper + martinc + martinc@apache.org + + + Java Developer + + + + Rob Oxspring + roxspring + roxspring@apache.org + + + Java Developer + + + + Jochen Wiedmann + jochen + jochen.wiedmann@gmail.com + + + Niall Pemberton + niallp + + Java Developer + + + + Jukka Zitting + jukka + + Java Developer + + + + Gary Gregory + ggregory + ggregory@apache.org + http://www.garygregory.com + -5 + + + + + + Rahul Akolkar + + + Jason Anderson + + + Nathan Beyer + + + Emmanuel Bourg + + + Chris Eldredge + + + Magnus Grimsell + + + Jim Harrington + + + Thomas Ledoux + + + Andy Lehane + + + Marcelo Liberato + + + Alban Peignier + alban.peignier at free.fr + + + Ian Springer + + + Masato Tezuka + + + James Urie + + + Frank W. Zammetti + + + + + + junit + junit + 4.10 + test + + + + + 1.6 + 1.6 + io + RC1 + 2.4 + (requires JDK 1.6+) + 2.2 + (requires JDK 1.5+) + IO + 12310477 + + + org.apache.commons.io; + org.apache.commons.io.comparator; + org.apache.commons.io.filefilter; + org.apache.commons.io.input; + org.apache.commons.io.output;version=1.4.9999;-noimport:=true, + + org.apache.commons.io; + org.apache.commons.io.comparator; + org.apache.commons.io.filefilter; + org.apache.commons.io.input; + org.apache.commons.io.output; + org.apache.commons.io.*;version=${project.version};-noimport:=true + + + + + + + + + org.apache.maven.plugins + maven-surefire-plugin + + pertest + + -Xmx25M + + + **/*Test*.class + + + **/*AbstractTestCase* + **/testtools/** + + **/*$* + + + + + maven-assembly-plugin + + + src/main/assembly/bin.xml + src/main/assembly/src.xml + + gnu + + + + + + + + + org.apache.maven.plugins + maven-checkstyle-plugin + 2.9.1 + + ${basedir}/checkstyle.xml + false + + + + org.codehaus.mojo + findbugs-maven-plugin + 2.4.0 + + Normal + Default + ${basedir}/findbugs-exclude-filter.xml + + + + org.apache.rat + apache-rat-plugin + + + src/test/resources/**/*.bin + .pmd + + + + + + diff --git a/3rdParty/org.apache.commons.io/org.apache.commons.io_2.4.0.jar b/3rdParty/org.apache.commons.io/org.apache.commons.io_2.4.0.jar new file mode 100644 index 00000000..6a485b0a Binary files /dev/null and b/3rdParty/org.apache.commons.io/org.apache.commons.io_2.4.0.jar differ diff --git a/3rdParty/org.apache.commons.lang3/.classpath b/3rdParty/org.apache.commons.lang3/.classpath new file mode 100644 index 00000000..e599dc45 --- /dev/null +++ b/3rdParty/org.apache.commons.lang3/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/3rdParty/org.apache.commons.lang3/.project b/3rdParty/org.apache.commons.lang3/.project new file mode 100644 index 00000000..df8d236b --- /dev/null +++ b/3rdParty/org.apache.commons.lang3/.project @@ -0,0 +1,28 @@ + + + org.apache.commons.lang3 + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + + org.eclipse.pde.PluginNature + org.eclipse.jdt.core.javanature + + diff --git a/3rdParty/org.apache.commons.lang3/.settings/org.eclipse.jdt.core.prefs b/3rdParty/org.apache.commons.lang3/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 00000000..11f6e462 --- /dev/null +++ b/3rdParty/org.apache.commons.lang3/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,7 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 +org.eclipse.jdt.core.compiler.compliance=1.7 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.7 diff --git a/3rdParty/org.apache.commons.lang3/META-INF/LICENSE.txt b/3rdParty/org.apache.commons.lang3/META-INF/LICENSE.txt new file mode 100644 index 00000000..d6456956 --- /dev/null +++ b/3rdParty/org.apache.commons.lang3/META-INF/LICENSE.txt @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/3rdParty/org.apache.commons.lang3/META-INF/MANIFEST.MF b/3rdParty/org.apache.commons.lang3/META-INF/MANIFEST.MF new file mode 100644 index 00000000..1a605157 --- /dev/null +++ b/3rdParty/org.apache.commons.lang3/META-INF/MANIFEST.MF @@ -0,0 +1,24 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: Apache Commons Lang3 +Bundle-SymbolicName: org.apache.commons.lang3 +Bundle-Version: 3.1.0 +Bundle-ClassPath: org.apache.commons.lang3_3.1.0.jar +Bundle-Vendor: Kdm Analytics Inc.c +Export-Package: org.apache.commons.lang3, + org.apache.commons.lang3.builder, + org.apache.commons.lang3.concurrent, + org.apache.commons.lang3.event, + org.apache.commons.lang3.exception, + org.apache.commons.lang3.math, + org.apache.commons.lang3.mutable, + org.apache.commons.lang3.reflect, + org.apache.commons.lang3.text, + org.apache.commons.lang3.text.translate, + org.apache.commons.lang3.time, + org.apache.commons.lang3.tuple +Bundle-RequiredExecutionEnvironment: JavaSE-1.7 +Created-By: Apache Maven +Build-Jdk: 1.7.0_25 +Archiver-Version: Plexus Archiver +Built-By: jenkins diff --git a/3rdParty/org.apache.commons.lang3/META-INF/NOTICE.txt b/3rdParty/org.apache.commons.lang3/META-INF/NOTICE.txt new file mode 100644 index 00000000..2f0ca384 --- /dev/null +++ b/3rdParty/org.apache.commons.lang3/META-INF/NOTICE.txt @@ -0,0 +1,8 @@ +Apache Commons Lang +Copyright 2001-2011 The Apache Software Foundation + +This product includes software developed by +The Apache Software Foundation (http://www.apache.org/). + +This product includes software from the Spring Framework, +under the Apache License 2.0 (see: StringUtils.containsWhitespace()) diff --git a/3rdParty/org.apache.commons.lang3/META-INF/maven/com.kdmanalytics.libs.libsjava.plugins/org.apache.commons.lang3/pom.properties b/3rdParty/org.apache.commons.lang3/META-INF/maven/com.kdmanalytics.libs.libsjava.plugins/org.apache.commons.lang3/pom.properties new file mode 100644 index 00000000..acd43058 --- /dev/null +++ b/3rdParty/org.apache.commons.lang3/META-INF/maven/com.kdmanalytics.libs.libsjava.plugins/org.apache.commons.lang3/pom.properties @@ -0,0 +1,5 @@ +#Generated by Maven +#Thu Sep 12 11:09:01 EDT 2013 +version=3.1.0 +groupId=com.kdmanalytics.libs.libsjava.plugins +artifactId=org.apache.commons.lang3 diff --git a/3rdParty/org.apache.commons.lang3/META-INF/maven/com.kdmanalytics.libs.libsjava.plugins/org.apache.commons.lang3/pom.xml b/3rdParty/org.apache.commons.lang3/META-INF/maven/com.kdmanalytics.libs.libsjava.plugins/org.apache.commons.lang3/pom.xml new file mode 100644 index 00000000..2ac57798 --- /dev/null +++ b/3rdParty/org.apache.commons.lang3/META-INF/maven/com.kdmanalytics.libs.libsjava.plugins/org.apache.commons.lang3/pom.xml @@ -0,0 +1,21 @@ + + + 4.0.0 + + + com.kdmanalytics.libs.libsjava + plugins + 2.3.1 + + + com.kdmanalytics.libs.libsjava.plugins + org.apache.commons.lang3 + 3.1.0 + + Apache Commons Lang3 Library + + eclipse-plugin + + diff --git a/3rdParty/org.apache.commons.lang3/META-INF/maven/org.apache.commons/commons-lang3/pom.properties b/3rdParty/org.apache.commons.lang3/META-INF/maven/org.apache.commons/commons-lang3/pom.properties new file mode 100644 index 00000000..6ed41682 --- /dev/null +++ b/3rdParty/org.apache.commons.lang3/META-INF/maven/org.apache.commons/commons-lang3/pom.properties @@ -0,0 +1,5 @@ +#Generated by Maven +#Wed Nov 09 23:00:26 GMT-08:00 2011 +version=3.1 +groupId=org.apache.commons +artifactId=commons-lang3 diff --git a/3rdParty/org.apache.commons.lang3/META-INF/maven/org.apache.commons/commons-lang3/pom.xml b/3rdParty/org.apache.commons.lang3/META-INF/maven/org.apache.commons/commons-lang3/pom.xml new file mode 100644 index 00000000..cd281f84 --- /dev/null +++ b/3rdParty/org.apache.commons.lang3/META-INF/maven/org.apache.commons/commons-lang3/pom.xml @@ -0,0 +1,596 @@ + + + + + org.apache.commons + commons-parent + 22 + + 4.0.0 + org.apache.commons + commons-lang3 + 3.1 + Commons Lang + + 2001 + + Commons Lang, a package of Java utility classes for the + classes that are in java.lang's hierarchy, or are considered to be so + standard as to justify existence in java.lang. + + + http://commons.apache.org/lang/ + + + jira + http://issues.apache.org/jira/browse/LANG + + + + scm:svn:http://svn.apache.org/repos/asf/commons/proper/lang/trunk + scm:svn:https://svn.apache.org/repos/asf/commons/proper/lang/trunk + http://svn.apache.org/viewvc/commons/proper/lang/trunk + + + + + Daniel Rall + dlr + dlr@finemaltcoding.com + CollabNet, Inc. + + Java Developer + + + + Stephen Colebourne + scolebourne + scolebourne@joda.org + SITA ATS Ltd + 0 + + Java Developer + + + + Henri Yandell + bayard + bayard@apache.org + + + Java Developer + + + + Steven Caswell + scaswell + stevencaswell@apache.org + + + Java Developer + + -5 + + + Robert Burrell Donkin + rdonkin + rdonkin@apache.org + + + Java Developer + + + + Gary D. Gregory + ggregory + ggregory@apache.org + -5 + + Java Developer + + + + Phil Steitz + psteitz + + + Java Developer + + + + Fredrik Westermarck + fredrik + + + + Java Developer + + + + James Carman + jcarman + jcarman@apache.org + Carman Consulting, Inc. + + Java Developer + + + + Niall Pemberton + niallp + + Java Developer + + + + Matt Benson + mbenson + + Java Developer + + + + Joerg Schaible + joehni + joerg.schaible@gmx.de + + Java Developer + + +1 + + + Oliver Heger + oheger + oheger@apache.org + +1 + + Java Developer + + + + Paul Benedict + pbenedict + pbenedict@apache.org + + Java Developer + + + + + + C. Scott Ananian + + + Chris Audley + + + Stephane Bailliez + + + Michael Becke + + + Benjamin Bentmann + + + Ola Berg + + + Nathan Beyer + + + Stefan Bodewig + + + Janek Bogucki + + + Mike Bowler + + + Sean Brown + + + Alexander Day Chaffee + + + Al Chou + + + Greg Coladonato + + + Maarten Coene + + + Justin Couch + + + Michael Davey + + + Norm Deane + + + Morgan Delagrange + + + Ringo De Smet + + + Russel Dittmar + + + Steve Downey + + + Matthias Eichel + + + Christopher Elkins + + + Chris Feldhacker + + + Roland Foerther + + + Pete Gieser + + + Jason Gritman + + + Matthew Hawthorne + + + Michael Heuer + + + Chris Hyzer + + + Paul Jack + + + Marc Johnson + + + Shaun Kalley + + + Tetsuya Kaneuchi + + + Nissim Karpenstein + + + Ed Korthof + + + Holger Krauth + + + Rafal Krupinski + + + Rafal Krzewski + + + David Leppik + + + Eli Lindsey + + + Sven Ludwig + + + Craig R. McClanahan + + + Rand McNeely + + + Hendrik Maryns + + + Dave Meikle + + + Nikolay Metchev + + + Kasper Nielsen + + + Tim O'Brien + + + Brian S O'Neill + + + Andrew C. Oliver + + + Alban Peignier + + + Moritz Petersen + + + Dmitri Plotnikov + + + Neeme Praks + + + Eric Pugh + + + Stephen Putman + + + Travis Reeder + + + Antony Riley + + + Valentin Rocher + + + Scott Sanders + + + Ralph Schaer + + + Henning P. Schmiedehausen + + + Sean Schofield + + + Robert Scholte + + + Reuben Sivan + + + Ville Skytta + + + David M. Sledge + + + Michael A. Smith + + + Jan Sorensen + + + Glen Stampoultzis + + + Scott Stanchfield + + + Jon S. Stevens + + + Sean C. Sullivan + + + Ashwin Suresh + + + Helge Tesgaard + + + Arun Mammen Thomas + + + Masato Tezuka + + + Jeff Varszegi + + + Chris Webb + + + Mario Winterer + + + Stepan Koltsov + + + Holger Hoffstatte + + + Derek C. Ashmore + + + + + + + junit + junit + 4.10 + test + + + + commons-io + commons-io + 2.1 + test + + + + org.easymock + easymock + 3.0 + test + + + + + ISO-8859-1 + UTF-8 + 1.5 + 1.5 + lang3 + 3.1 + (Java 5.0+) + LANG + 12310481 + + + + + + + org.apache.maven.plugins + maven-surefire-plugin + + + plain + + + **/*Test.java + + + + + + + + maven-assembly-plugin + + + src/assembly/bin.xml + src/assembly/src.xml + + gnu + + + + org.apache.maven.plugins + maven-jar-plugin + + + + test-jar + + + + + + + + + + + org.apache.maven.plugins + maven-changes-plugin + 2.6 + + ${basedir}/src/site/changes/changes.xml + + %URL%/%ISSUE% + + + templates + + RELEASE-NOTES.txt + + + + + changes-report + + + + + + maven-checkstyle-plugin + 2.7 + + ${basedir}/checkstyle.xml + false + + + + + org.codehaus.mojo + findbugs-maven-plugin + 2.3.2 + + Normal + Default + ${basedir}/findbugs-exclude-filter.xml + + + + org.codehaus.mojo + cobertura-maven-plugin + 2.5.1 + + + org.codehaus.mojo + clirr-maven-plugin + 2.3 + + info + + + + maven-pmd-plugin + 2.5 + + ${maven.compile.target} + + + + + pmd + cpd + + + + + + org.codehaus.mojo + taglist-maven-plugin + 2.4 + + + TODO + NOPMD + NOTE + + + + + org.codehaus.mojo + javancss-maven-plugin + 2.0 + + + + + diff --git a/3rdParty/org.apache.commons.lang3/org.apache.commons.lang3_3.1.0.jar b/3rdParty/org.apache.commons.lang3/org.apache.commons.lang3_3.1.0.jar new file mode 100644 index 00000000..aa17fb5d Binary files /dev/null and b/3rdParty/org.apache.commons.lang3/org.apache.commons.lang3_3.1.0.jar differ diff --git a/3rdParty/org.apache.commons.lang3/templates/release-notes.vm b/3rdParty/org.apache.commons.lang3/templates/release-notes.vm new file mode 100644 index 00000000..51b0da26 --- /dev/null +++ b/3rdParty/org.apache.commons.lang3/templates/release-notes.vm @@ -0,0 +1,136 @@ +## Licensed to the Apache Software Foundation (ASF) under one +## or more contributor license agreements. See the NOTICE file +## distributed with this work for additional information +## regarding copyright ownership. The ASF licenses this file +## to you under the Apache License, Version 2.0 (the +## "License"); you may not use this file except in compliance +## with the License. You may obtain a copy of the License at +## +## http://www.apache.org/licenses/LICENSE-2.0 +## +## Unless required by applicable law or agreed to in writing, +## software distributed under the License is distributed on an +## "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +## KIND, either express or implied. See the License for the +## specific language governing permissions and limitations +## under the License. + + Apache ${project.name} Package + Version ${version} + Release Notes + + +INTRODUCTION: + +This document contains the release notes for the 3.0.1 version of Apache Commons Lang. +Commons Lang is a set of utility functions and reusable components that should be of use in any +Java environment. + +Lang 3.0 and onwards now targets Java 5.0, making use of features that arrived with Java 5.0 such as generics, +variable arguments, autoboxing, concurrency and formatted output. + +For the advice on upgrading from 2.x to 3.x, see the following page: + + http://commons.apache.org/lang/article3_0.html + +## Hack to improve layout: replace all pairs of spaces with a single new-line +##$release.description.replaceAll(" ", " +##") + +#if ($release.getActions().size() == 0) +No changes defined in this version. +#else +Changes in this version include: + +#if ($release.getActions('add').size() !=0) +New features: +#foreach($actionItem in $release.getActions('add')) +#set($action=$actionItem.getAction()) +#if ($actionItem.getIssue()) +#set($issue=$actionItem.getIssue()) +#else +#set($issue="") +#end +#if ($actionItem.getDueTo()) +#set($dueto=$actionItem.getDueTo()) +#else +#set($dueto="") +#end +o#if($!issue != "") $issue: #end ${action} #if($!dueto != "")Thanks to $dueto. #end + +#set($issue="") +#set($dueto="") +#end +#end + +#if ($release.getActions('fix').size() !=0) +Fixed Bugs: +#foreach($actionItem in $release.getActions('fix')) +#set($action=$actionItem.getAction()) +#if ($actionItem.getIssue()) +#set($issue=$actionItem.getIssue()) +#else +#set($issue="") +#end +#if ($actionItem.getDueTo()) +#set($dueto=$actionItem.getDueTo()) +#else +#set($dueto="") +#end +o#if($!issue != "") $issue: #end ${action} #if($!dueto != "")Thanks to $dueto. #end + +#set($issue="") +#set($dueto="") +#end +#end + +#if ($release.getActions('update').size() !=0) +Changes: +#foreach($actionItem in $release.getActions('update')) +#set($action=$actionItem.getAction()) +#if ($actionItem.getIssue()) +#set($issue=$actionItem.getIssue()) +#else +#set($issue="") +#end +#if ($actionItem.getDueTo()) +#set($dueto=$actionItem.getDueTo()) +#else +#set($dueto="") +#end +o#if($!issue != "") $issue: #end ${action} #if($!dueto != "")Thanks to $dueto. #end + +#set($issue="") +#set($dueto="") +#end +#end + +#if ($release.getActions('remove').size() !=0) +Removed: +#foreach($actionItem in $release.getActions('remove')) +#set($action=$actionItem.getAction()) +#if ($actionItem.getIssue()) +#set($issue=$actionItem.getIssue()) +#else +#set($issue="") +#end +#if ($actionItem.getDueTo()) +#set($dueto=$actionItem.getDueTo()) +#else +#set($dueto="") +#end +o#if($!issue != "") $issue: #end ${action} #if($!dueto != "")Thanks to $dueto. #end + +#set($issue="") +#set($dueto="") +#end +#end +## End of main loop +#end + +For complete information on ${project.name}, including instructions on how to submit bug reports, +patches, or suggestions for improvement, see the Apache ${project.name} website: + +${project.url} + + diff --git a/3rdParty/org.apache.log4j/.classpath b/3rdParty/org.apache.log4j/.classpath new file mode 100644 index 00000000..5cf8279b --- /dev/null +++ b/3rdParty/org.apache.log4j/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/3rdParty/org.apache.log4j/.project b/3rdParty/org.apache.log4j/.project new file mode 100644 index 00000000..55612ab2 --- /dev/null +++ b/3rdParty/org.apache.log4j/.project @@ -0,0 +1,28 @@ + + + org.apache.log4j + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + + org.eclipse.pde.PluginNature + org.eclipse.jdt.core.javanature + + diff --git a/3rdParty/org.apache.log4j/.settings/org.eclipse.jdt.core.prefs b/3rdParty/org.apache.log4j/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 00000000..f287d53c --- /dev/null +++ b/3rdParty/org.apache.log4j/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,7 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 +org.eclipse.jdt.core.compiler.compliance=1.6 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.6 diff --git a/3rdParty/org.apache.log4j/META-INF/LICENSE b/3rdParty/org.apache.log4j/META-INF/LICENSE new file mode 100644 index 00000000..6279e520 --- /dev/null +++ b/3rdParty/org.apache.log4j/META-INF/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 1999-2005 The Apache Software Foundation + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/3rdParty/org.apache.log4j/META-INF/MANIFEST.MF b/3rdParty/org.apache.log4j/META-INF/MANIFEST.MF new file mode 100644 index 00000000..b6d5eaf8 --- /dev/null +++ b/3rdParty/org.apache.log4j/META-INF/MANIFEST.MF @@ -0,0 +1,33 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: Log4j Code Library Plugin +Bundle-SymbolicName: org.apache.log4j +Bundle-Version: 1.2.16 +Bundle-ClassPath: org.apache.log4j_1.2.16.jar +Bundle-Vendor: KDM Analytics Inc. +Export-Package: org.apache.log4j;version="1.2.16", + org.apache.log4j.chainsaw;version="1.2.16", + org.apache.log4j.config;version="1.2.16", + org.apache.log4j.helpers;version="1.2.16", + org.apache.log4j.jdbc;version="1.2.16", + org.apache.log4j.jmx;version="1.2.16", + org.apache.log4j.lf5;version="1.2.16", + org.apache.log4j.lf5.util;version="1.2.16", + org.apache.log4j.lf5.viewer;version="1.2.16", + org.apache.log4j.lf5.viewer.categoryexplorer;version="1.2.16", + org.apache.log4j.lf5.viewer.configure;version="1.2.16", + org.apache.log4j.net;version="1.2.16", + org.apache.log4j.nt;version="1.2.16", + org.apache.log4j.or;version="1.2.16", + org.apache.log4j.or.jms;version="1.2.16", + org.apache.log4j.or.sax;version="1.2.16", + org.apache.log4j.pattern;version="1.2.16", + org.apache.log4j.spi;version="1.2.16", + org.apache.log4j.varia;version="1.2.16", + org.apache.log4j.xml;version="1.2.16" +Created-By: Apache Maven +Archiver-Version: Plexus Archiver +Eclipse-BuddyPolicy: registered +Built-By: kgirard +Build-Jdk: 1.6.0_26 +Bundle-RequiredExecutionEnvironment: JavaSE-1.6 diff --git a/3rdParty/org.apache.log4j/META-INF/NOTICE b/3rdParty/org.apache.log4j/META-INF/NOTICE new file mode 100644 index 00000000..03757323 --- /dev/null +++ b/3rdParty/org.apache.log4j/META-INF/NOTICE @@ -0,0 +1,5 @@ +Apache log4j +Copyright 2007 The Apache Software Foundation + +This product includes software developed at +The Apache Software Foundation (http://www.apache.org/). \ No newline at end of file diff --git a/3rdParty/org.apache.log4j/META-INF/maven/com.kdmanalytics.libs.libsjava.plugins/org.apache.log4j/pom.properties b/3rdParty/org.apache.log4j/META-INF/maven/com.kdmanalytics.libs.libsjava.plugins/org.apache.log4j/pom.properties new file mode 100644 index 00000000..27f64c7b --- /dev/null +++ b/3rdParty/org.apache.log4j/META-INF/maven/com.kdmanalytics.libs.libsjava.plugins/org.apache.log4j/pom.properties @@ -0,0 +1,5 @@ +#Generated by Maven +#Thu Nov 22 18:23:14 EST 2012 +version=1.2.16 +groupId=com.kdmanalytics.libs.libsjava.plugins +artifactId=org.apache.log4j diff --git a/3rdParty/org.apache.log4j/META-INF/maven/com.kdmanalytics.libs.libsjava.plugins/org.apache.log4j/pom.xml b/3rdParty/org.apache.log4j/META-INF/maven/com.kdmanalytics.libs.libsjava.plugins/org.apache.log4j/pom.xml new file mode 100644 index 00000000..2974b0f5 --- /dev/null +++ b/3rdParty/org.apache.log4j/META-INF/maven/com.kdmanalytics.libs.libsjava.plugins/org.apache.log4j/pom.xml @@ -0,0 +1,19 @@ + + + 4.0.0 + + + com.kdmanalytics.libs.libsjava + plugins + 2.0.5 + + + com.kdmanalytics.libs.libsjava.plugins + org.apache.log4j + 1.2.16 + KDM Analytics Apache Commons Log4j Plugin + eclipse-plugin + + diff --git a/3rdParty/org.apache.log4j/META-INF/maven/log4j/log4j/pom.properties b/3rdParty/org.apache.log4j/META-INF/maven/log4j/log4j/pom.properties new file mode 100644 index 00000000..2abb0987 --- /dev/null +++ b/3rdParty/org.apache.log4j/META-INF/maven/log4j/log4j/pom.properties @@ -0,0 +1,5 @@ +#Generated by org.apache.felix.bundleplugin +#Tue Mar 30 23:16:23 CDT 2010 +version=1.2.16 +groupId=log4j +artifactId=log4j diff --git a/3rdParty/org.apache.log4j/META-INF/maven/log4j/log4j/pom.xml b/3rdParty/org.apache.log4j/META-INF/maven/log4j/log4j/pom.xml new file mode 100644 index 00000000..977ca834 --- /dev/null +++ b/3rdParty/org.apache.log4j/META-INF/maven/log4j/log4j/pom.xml @@ -0,0 +1,545 @@ + + + + 4.0.0 + log4j + log4j + bundle + Apache Log4j + 1.2.16 + Apache Log4j 1.2 + http://logging.apache.org/log4j/1.2/ + + Bugzilla + http://issues.apache.org/bugzilla/ + + + Gump + http://vmgump.apache.org/gump/public/logging-log4j-12/logging-log4j-12/index.html + + 1999 + + + log4j-user + log4j-user-subscribe@logging.apache.org + log4j-user-unsubscribe@logging.apache.org + log4j-user@logging.apache.org + http://mail-archives.apache.org/mod_mbox/logging-log4j-user/ + + http://marc.info/?l=log4j-user + http://dir.gmane.org/gmane.comp.jakarta.log4j.user + + + + log4j-dev + log4j-dev-subscribe@logging.apache.org + log4j-dev-unsubscribe@logging.apache.org + log4j-dev@logging.apache.org + http://mail-archives.apache.org/mod_mbox/logging-log4j-dev/ + + http://marc.info/?l=log4j-dev + http://dir.gmane.org/gmane.comp.jakarta.log4j.devel + + + + + + The Apache Software License, Version 2.0 + http://www.apache.org/licenses/LICENSE-2.0.txt + repo + + + + scm:svn:http://svn.apache.org/repos/asf/logging/log4j/tags/v1_2_16 + scm:svn:https://svn.apache.org/repos/asf/logging/log4j/tags/v1_2_16 + http://svn.apache.org/viewvc/logging/log4j/tags/v1_2_16 + + + Apache Software Foundation + http://www.apache.org + + + + + org.apache.maven.plugins + maven-resources-plugin + + UTF-8 + + + + maven-surefire-plugin + 2.5 + + tests + plain + pertest + true + + org/apache/log4j/LevelTest.java + org/apache/log4j/PriorityTest.java + org/apache/log4j/CategoryTest.java + org/apache/log4j/FileAppenderTest.java + org/apache/log4j/LogManagerTest.java + org/apache/log4j/helpers.LogLogTest.java + org/apache/log4j/LayoutTest.java + org/apache/log4j/helpers.DateLayoutTest.java + org/apache/log4j/TTCCLayoutTest.java + org/apache/log4j/xml.XMLLayoutTest.java + org/apache/log4j/HTMLLayoutTest.java + org/apache/log4j/PatternLayoutTest.java + org/apache/log4j/spi.LoggingEventTest.java + org/apache/log4j/spi.ThrowableInformationTest.java + org/apache/log4j/spi.LocationInfoTest.java + org/apache/log4j/PropertyConfiguratorTest.java + org/apache/log4j/MinimumTestCase.java + org/apache/log4j/LoggerTestCase.java + org/apache/log4j/PatternLayoutTestCase.java + org/apache/log4j/HierarchyThresholdTestCase.java + org/apache/log4j/xml/DOMTestCase.java + org/apache/log4j/xml/CustomLevelTestCase.java + org/apache/log4j/customLogger/XLoggerTestCase.java + + + org/apache/log4j/xml/XMLLayoutTestCase.java + org/apache/log4j/xml/AsyncAppenderTestCase.java + org/apache/log4j/varia/LevelMatchFilterTestCase.java + + + org/apache/log4j/helpers/BoundedFIFOTestCase.java + org/apache/log4j/helpers/CyclicBufferTestCase.java + org/apache/log4j/helpers/PatternParserTestCase.java + org/apache/log4j/or/ORTestCase.java + org/apache/log4j/DRFATestCase.java + org/apache/log4j/RFATestCase.java + org/apache/log4j/varia/ERFATestCase.java + org/apache/log4j/net/SyslogAppenderTest + org/apache/log4j/nt/NTEventLogAppenderTest + org/apache/log4j/net/SocketAppenderTest + + + + + maven-compiler-plugin + 2.1 + + 1.3 + 1.1 + UTF-8 + + + + maven-jar-plugin + 2.3 + + + + + org.apache.log4j + + log4j + ${project.version} + "Apache Software Foundation" + + + + + + + + maven-antrun-plugin + 1.2 + + + + process-classes + ntdll + + + + + + + + + + + + run + + + + + test-compile + mkdir_tests_output + + + + + + + run + + + + clean + rmdir_tests_output + + + + + + + + run + + + + test + runAll + + + + + + + + + + + run + + + + + site + untag-site + + + + + + + + + + + run + + + + post-site + post-site + + + + + + + run + + + + site-deploy + site-deploy + + + + + + + run + + + + + + ant + ant-nodeps + 1.6.5 + + + ant-contrib + ant-contrib + 1.0b2 + + + ant + ant-junit + 1.6.5 + + + junit + junit + 3.8.1 + test + + + sun.jdk + tools + 1.4.2 + system + ${tools.jar} + + + + + + + maven-assembly-plugin + 2.2-beta-5 + + + src/assembly/bin.xml + + false + + + + + assembly + + + + + + maven-javadoc-plugin + 2.6.1 + + true + UTF-8 + + + + + jar + javadoc + + + + site + pre-site + + javadoc + + + + + + maven-release-plugin + 2.0-beta-9 + + + package site-deploy assembly:attached deploy + + + + maven-source-plugin + 2.1.1 + + + + jar + + + + + + + org.codehaus.mojo + clirr-maven-plugin + 2.2.2 + + 1.2.15 + + + + org.codehaus.mojo + rat-maven-plugin + 1.0-alpha-3 + + + tests/witness/** + + + + + org.apache.felix + maven-bundle-plugin + 2.0.1 + true + + + + !org.apache.log4j.lf5.*,!org.apache.log4j.chainsaw.*,org.apache.log4j.* + com.sun.jdmk.comm;resolution:=optional, + javax.jms;resolution:=optional, + javax.mail.*;resolution:=optional, + javax.management;resolution:=optional, + javax.naming;resolution:=optional, + com.sun.jdmk.comm;resolution:=optional, + com.ibm.uvm.tools;resolution:=optional, + javax.swing.*;resolution:=optional, + * + http://logging.apache.org/log4j/1.2 + + + + + tests/src/java + + + tests/resources + + + + + + mac + + + mac + + + + ${java.home}/../Classes/classes.jar + ${user.home}/.m2/repository + build + + + + default + + true + + + ${java.home}/../lib/tools.jar + ${user.home}/.m2/repository + build + + + + + + + + javax.mail + mail + 1.4.1 + true + + + + oro + oro + 2.0.8 + test + + + junit + junit + 3.8.2 + test + + + org.apache.geronimo.specs + geronimo-jms_1.1_spec + 1.0 + true + + + + true + + + maven-project-info-reports-plugin + 2.1.2 + + + + scm + dependencies + cim + issue-tracking + mailing-list + license + + + + + + maven-jxr-plugin + 2.1 + + + maven-changes-plugin + 2.3 + + + + changes-report + + + + + %URL%/show_bug.cgi?id=%ISSUE% + + + + + + + logging.repo + scp://people.apache.org/www/people.apache.org/builds/logging/repo/ + + + logging.site + scp://localhost/${user.dir}/target/site-deploy + + + + diff --git a/3rdParty/org.apache.log4j/org.apache.log4j_1.2.16.jar b/3rdParty/org.apache.log4j/org.apache.log4j_1.2.16.jar new file mode 100644 index 00000000..772bc56c Binary files /dev/null and b/3rdParty/org.apache.log4j/org.apache.log4j_1.2.16.jar differ diff --git a/3rdParty/org.apache.xml.resolver/.classpath b/3rdParty/org.apache.xml.resolver/.classpath new file mode 100644 index 00000000..f2d41466 --- /dev/null +++ b/3rdParty/org.apache.xml.resolver/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/3rdParty/org.apache.xml.resolver/.project b/3rdParty/org.apache.xml.resolver/.project new file mode 100644 index 00000000..5773173f --- /dev/null +++ b/3rdParty/org.apache.xml.resolver/.project @@ -0,0 +1,28 @@ + + + org.apache.xml.resolver + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + + org.eclipse.pde.PluginNature + org.eclipse.jdt.core.javanature + + diff --git a/3rdParty/org.apache.xml.resolver/.settings/org.eclipse.jdt.core.prefs b/3rdParty/org.apache.xml.resolver/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 00000000..442ef9ce --- /dev/null +++ b/3rdParty/org.apache.xml.resolver/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,8 @@ +#Fri Aug 26 10:31:10 EDT 2011 +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 +org.eclipse.jdt.core.compiler.compliance=1.6 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.6 diff --git a/3rdParty/org.apache.xml.resolver/META-INF/INDEX.LIST b/3rdParty/org.apache.xml.resolver/META-INF/INDEX.LIST new file mode 100644 index 00000000..07ff324f --- /dev/null +++ b/3rdParty/org.apache.xml.resolver/META-INF/INDEX.LIST @@ -0,0 +1,14 @@ +JarIndex-Version: 1.0 + +resolver.jar +org +org/apache +org/apache/env +org/apache/xml +org/apache/xml/resolver +org/apache/xml/resolver/apps +org/apache/xml/resolver/etc +org/apache/xml/resolver/helpers +org/apache/xml/resolver/readers +org/apache/xml/resolver/tools + diff --git a/3rdParty/org.apache.xml.resolver/META-INF/LICENSE.txt b/3rdParty/org.apache.xml.resolver/META-INF/LICENSE.txt new file mode 100644 index 00000000..261eeb9e --- /dev/null +++ b/3rdParty/org.apache.xml.resolver/META-INF/LICENSE.txt @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/3rdParty/org.apache.xml.resolver/META-INF/MANIFEST.MF b/3rdParty/org.apache.xml.resolver/META-INF/MANIFEST.MF new file mode 100644 index 00000000..5292aa91 --- /dev/null +++ b/3rdParty/org.apache.xml.resolver/META-INF/MANIFEST.MF @@ -0,0 +1,16 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: Apache Xerces XML Resolver Plugin +Bundle-SymbolicName: org.apache.xml.resolver +Bundle-Version: 1.2.0 +Bundle-ClassPath: org.apache.xml.resolver +Bundle-Vendor: KDM Analytics Inc. +Export-Package: org.apache.env;version="1.2.0", + org.apache.xml.resolver;version="1.2.0", + org.apache.xml.resolver.apps;version="1.2.0", + org.apache.xml.resolver.etc;version="1.2.0", + org.apache.xml.resolver.helpers;version="1.2.0", + org.apache.xml.resolver.readers;version="1.2.0", + org.apache.xml.resolver.tools;version="1.2.0" +Require-Bundle: system.bundle +Bundle-RequiredExecutionEnvironment: JavaSE-1.6 diff --git a/3rdParty/org.apache.xml.resolver/META-INF/NOTICE.txt b/3rdParty/org.apache.xml.resolver/META-INF/NOTICE.txt new file mode 100644 index 00000000..cf064e38 --- /dev/null +++ b/3rdParty/org.apache.xml.resolver/META-INF/NOTICE.txt @@ -0,0 +1,9 @@ +Apache XML Commons Resolver +Copyright 2006 The Apache Software Foundation. + +This product includes software developed at +The Apache Software Foundation http://www.apache.org/ + +Portions of this code are derived from classes placed in the +public domain by Arbortext on 10 Apr 2000. See: +http://www.arbortext.com/customer_support/updates_and_technical_notes/catalogs/docs/README.htm diff --git a/3rdParty/org.apache.xml.resolver/build.properties b/3rdParty/org.apache.xml.resolver/build.properties new file mode 100644 index 00000000..1ac73bad --- /dev/null +++ b/3rdParty/org.apache.xml.resolver/build.properties @@ -0,0 +1,3 @@ +output.. = . +bin.includes = META-INF/,\ + org/ diff --git a/3rdParty/org.apache.xml.resolver/org/apache/env/WhichFactory.properties b/3rdParty/org.apache.xml.resolver/org/apache/env/WhichFactory.properties new file mode 100644 index 00000000..6803778d --- /dev/null +++ b/3rdParty/org.apache.xml.resolver/org/apache/env/WhichFactory.properties @@ -0,0 +1,31 @@ +# Used by org.apache.env.WhichFactory +# Maps a simple name to a FQCN of a WhichProject implementation + +# xml.apache.org common projects +commons=org.apache.env.WhichXmlCommons +Commons=org.apache.env.WhichXmlCommons +xml-commons=org.apache.env.WhichXmlCommons +XmlCommons=org.apache.env.WhichXmlCommons + +xalan=org.apache.env.WhichXalan +Xalan=org.apache.env.WhichXalan +xml-xalan=org.apache.env.WhichXalan + +xerces=org.apache.env.WhichXerces +Xerces=org.apache.env.WhichXerces +xml-xerces=org.apache.env.WhichXerces + +crimson=org.apache.env.WhichCrimson +Crimson=org.apache.env.WhichCrimson +xml-crimson=org.apache.env.WhichCrimson + + +# jakarta.apache.org common projects +ant=org.apache.env.WhichAnt +Ant=org.apache.env.WhichAnt +jakarta-ant=org.apache.env.WhichAnt + + +# External projects +saxon=org.apache.env.WhichSaxon +Saxon=org.apache.env.WhichSaxon diff --git a/3rdParty/org.apache.xml.resolver/org/apache/env/WhichJar.properties b/3rdParty/org.apache.xml.resolver/org/apache/env/WhichJar.properties new file mode 100644 index 00000000..1fafd2fe --- /dev/null +++ b/3rdParty/org.apache.xml.resolver/org/apache/env/WhichJar.properties @@ -0,0 +1,148 @@ +# Used by org.apache.env.WhichJar +# Format: NNNN.jarname.jar=description +# Where: NNNN is actual size in bytes of jarname.jar +# from an *officially shipped* version + +# xml-xalan releases +857192.xalan.jar=from xalan-j_1_1 +440237.xalan.jar=from xalan-j_1_2 +436094.xalan.jar=from xalan-j_1_2_1 +426249.xalan.jar=from xalan-j_1_2_2 +702536.xalan.jar=from xalan-j_2_0_0 +720930.xalan.jar=from xalan-j_2_0_1 +732330.xalan.jar=from xalan-j_2_1_0 +872241.xalan.jar=from xalan-j_2_2_D10 +882739.xalan.jar=from xalan-j_2_2_D11 +892188.xalan.jar=from xalan-j_2_2_D13 +897409.xalan.jar=from xalan-j_2_2_D14 +923866.xalan.jar=from xalan-j_2_2_0 +905872.xalan.jar=from xalan-j_2_3_D1 +906122.xalan.jar=from xalan-j_2_3_0 +983377.xalan.jar=from xalan-j_2_4_D1 +906248.xalan.jar=from xalan-j_2_3_1-bin +997276.xalan.jar=from xalan-j_2_4_0-bin +1031036.xalan.jar=from xalan-j_2_4_1-bin +2645149.xalan.jar=from xalan-j_2_5_0-bin (singlejar) +2907319.xalan.jar=from xalan-j_2_5_1-bin (singlejar) + +596540.xsltc.jar=from xalan-j_2_2_0 +590247.xsltc.jar=from xalan-j_2_3_D1 +589914.xsltc.jar=from xalan-j_2_3_0 +1268634.xsltc.jar=from xalan-j_2_3_0 (bundled version) +1306667.xsltc.jar=from xalan-j_2_4_D1 +589915.xsltc.jar=from xalan-j_2_3_1-bin +1328227.xsltc.jar=from xalan-j_2_4_0-bin +1344009.xsltc.jar=from xalan-j_2_4_1-bin +# Separate xsltc.jar not supported in normal releases after 2.4.1 + +857171.xalan.jar=from lotusxsl-j_1_0_1 +802165.xalan.jar=from lotusxsl-j_2_0_0 +857692.xalan.jar=from lotusxsl-j_2_2 +424490.xalan.jar=from Xerces Tools releases - ERROR.DO NOT USE! + +92409.xml-apis.jar=from xalan-j_2_2_D13 +93717.xml-apis.jar=from xalan-j_2_2_D14 +100196.xml-apis.jar=from xalan-j_2_2_0 or xalan-j_2_3_D1 +108484.xml-apis.jar=from xalan-j_2_3_x,2_4_x from xml-commons-1.0.b2 +109049.xml-apis.jar=from xalan-j_2_4_0-bin +113749.xml-apis.jar=from xalan-j_2_4_1-bin +124720.xml-apis.jar=from xalan-j_2_5_x-bin + +# xml-xerces releases +1591855.xerces.jar=from xalan-j_1_1 from xerces-1... +1498679.xerces.jar=from xalan-j_1_2 from xerces-1_2_0.bin +1484896.xerces.jar=from xalan-j_1_2_1 from xerces-1_2_1.bin +804460.xerces.jar=from xalan-j_1_2_2 from xerces-1_2_2.bin +1499244.xerces.jar=from xalan-j_2_0_0 from xerces-1_2_3.bin +1605266.xerces.jar=from xalan-j_2_0_1 from xerces-1_3_0.bin +904030.xerces.jar=from xalan-j_2_1_0 from xerces-1_4.bin +1190776.xerces.jar=from lotusxsl_1_0_1 apparently-from xerces-1_0_3.bin +1489400.xerces.jar=from lotusxsl-j_2_0_0 from XML4J-3_1_1 +1787796.xerces.jar=from lotusxsl-j_2_2 or xerces-1_4_1.bin +904030.xerces.jar=from xerces-1_4_0.bin +1802885.xerces.jar=from xerces-1_4_2.bin +1808883.xerces.jar=from xalan-j_2_2_D10,D11,D12 or xerces-1_4_3.bin +1803877.xerces.jar=from XML4J-3_2_1 +1812019.xerces.jar=from xalan-j_2_2_D14 or xerces-1_4_4.bin +1734594.xerces.jar=from Xerces-J-bin.2.0.0.beta3 +1845256.xercesImpl.jar=from Xerces-J-bin.2.0.0.beta4 +1861586.xerces.jar=from deprecatedXerces-J-bin.2.0.0 +1730053.xercesImpl.jar=from Xerces-J-bin.2.0.0 +1860418.xerces.jar=from deprecatedXerces-J-bin.2.0.1 +1728861.xercesImpl.jar=from Xerces-J-bin.2.0.1 +1011677.xerces.jar=from deprecatedXerces-J-bin.2.0.2 +933730.xercesImpl.jar=from Xerces-J-bin.2.0.2 +3387328.xerces.jar=from deprecatedXML4J-bin.4.0.4 +3244060.xercesImpl.jar=from XML4J-bin.4.0.4 +972027.xercesImpl.jar=from Xerces-J-bin.2.1.0 +831587.xercesImpl.jar=from Xerces-J-bin.2.2.0 +834966.xercesImpl.jar=from Xerces-J-bin.2.2.1 +885362.xercesImpl.jar=from Xerces-J-bin.2.3.0 +895924.xercesImpl.jar=from Xerces-J-bin.2.4.0 +927669.xercesImpl.jar=from Xerces-J-bin.2.5.0 + +# xml-crimson and JAXP or related releases +5618.jaxp.jar=from jaxp1.0.1 +136133.parser.jar=from jaxp1.0.1 +28404.jaxp.jar=from jaxp-1.1 +187162.crimson.jar=from jaxp-1.1 +801714.xalan.jar=from jaxp-1.1 +196399.crimson.jar=from crimson-1.1.1 +33323.jaxp.jar=from crimson-1.1.1 or jakarta-ant-1.4.1b1 +152717.crimson.jar=from crimson-1.1.2beta2 +206384.crimson.jar=from crimson-1.1.3 or jakarta-ant-1.4.1b1 +136198.parser.jar=from jakarta-ant-1.3 or 1.2 +5537.jaxp.jar=from jakarta-ant-1.3 or 1.2 +88143.xml-apis.jar=from crimson-1.1.2beta2 + + +# lotusxsl releases (from xml-xalan releases) +120274.lotusxsl.jar=from lotusxsl-0_16_4 +120293.lotusxsl.jar=from lotusxsl-0_16_5 +283777.lotusxsl.jar=from lotusxsl-0_17_2 +305577.lotusxsl.jar=from lotusxsl-0_17_3 +304500.lotusxsl.jar=from lotusxsl-0_17_4 +714959.lotusxsl.jar=from lotusxsl-0_18_1 +717674.lotusxsl.jar=from lotusxsl-0_18_2 +752343.lotusxsl.jar=from lotusxsl-0_18_3 +907101.lotusxsl.jar=from lotusxsl-0_18_4 + + +# jakarta-ant releases +330479.ant.jar=from jakarta-ant-1.2-bin +295934.ant.jar=from jakarta-ant-1.3-bin +417114.ant.jar=from jakarta-ant-1.4.1b1-bin +704665.ant.jar=from jakarta-ant-1.5Beta1-bin +642472.ant.jar=from jakarta-ant-1.5Beta2-bin +716139.ant.jar=from jakarta-ant-1.5-bin +717666.ant.jar=from jakarta-ant-1.5.1-bin +732490.ant.jar=from apache-ant-1.5.2-bin +737884.ant.jar=from apache-ant-1.5.3-1-bin +736810.ant.jar=from apache-ant-1.5.4-bin + + + +# Sun releases of JAXP or JDK 1.4.x +26710.dom.jar=from java_xml_pack-summer-02 +27052.jaxp-api.jar=from java_xml_pack-summer-02 +26206.sax.jar=from java_xml_pack-summer-02 +906806.xalan.jar=from java_xml_pack-summer-02 or jwsdp-1_0-windows-i586 +974690.xercesImpl.jar=from java_xml_pack-summer-02 or jwsdp-1_0-windows-i586 or jwsdp-1_0_01-windows-i586 +1277537.xsltc.jar=from java_xml_pack-summer-02 or jwsdp-1_0-windows-i586 WARNING! NEEDS PATCH FROM xsltc-1_0 +1280284.xsltc.jar=from java_xml_pack-summer-02 patched from xsltc-1_0 + +906847.xalan.jar=from jwsdp-1_0_01-windows-i586 +1308721.xsltc.jar=from jwsdp-1_0_01-windows-i586 +27052.jaxp-api.jar=from jwsdp-1_0_01-windows-i586 + +1267125.xalan.jar=from jwsdp-1_1-windows-i586 +1129554.xercesImpl.jar=from jwsdp-1_1-windows-i586 +1344022.xsltc.jar=from jwsdp-1_1-windows-i586 +27073.jaxp-api.jar=from jwsdp-1_1-windows-i586 + +1271111.xalan.jar=from jwsdp-1_2-windows-i586 +1202684.xercesImpl.jar=from jwsdp-1_2-windows-i586 +1347371.xsltc.jar=from jwsdp-1_2-windows-i586 +27049.jaxp-api.jar=from jwsdp-1_2-windows-i586 + +# other projects/releases \ No newline at end of file diff --git a/3rdParty/org.apache.xml.resolver/org/apache/xml/resolver/Catalog.class b/3rdParty/org.apache.xml.resolver/org/apache/xml/resolver/Catalog.class new file mode 100644 index 00000000..1a631eda Binary files /dev/null and b/3rdParty/org.apache.xml.resolver/org/apache/xml/resolver/Catalog.class differ diff --git a/3rdParty/org.apache.xml.resolver/org/apache/xml/resolver/CatalogEntry.class b/3rdParty/org.apache.xml.resolver/org/apache/xml/resolver/CatalogEntry.class new file mode 100644 index 00000000..fd26f70c Binary files /dev/null and b/3rdParty/org.apache.xml.resolver/org/apache/xml/resolver/CatalogEntry.class differ diff --git a/3rdParty/org.apache.xml.resolver/org/apache/xml/resolver/CatalogException.class b/3rdParty/org.apache.xml.resolver/org/apache/xml/resolver/CatalogException.class new file mode 100644 index 00000000..cbd169e3 Binary files /dev/null and b/3rdParty/org.apache.xml.resolver/org/apache/xml/resolver/CatalogException.class differ diff --git a/3rdParty/org.apache.xml.resolver/org/apache/xml/resolver/CatalogManager.class b/3rdParty/org.apache.xml.resolver/org/apache/xml/resolver/CatalogManager.class new file mode 100644 index 00000000..2cf09088 Binary files /dev/null and b/3rdParty/org.apache.xml.resolver/org/apache/xml/resolver/CatalogManager.class differ diff --git a/3rdParty/org.apache.xml.resolver/org/apache/xml/resolver/Resolver.class b/3rdParty/org.apache.xml.resolver/org/apache/xml/resolver/Resolver.class new file mode 100644 index 00000000..3f5a9cfe Binary files /dev/null and b/3rdParty/org.apache.xml.resolver/org/apache/xml/resolver/Resolver.class differ diff --git a/3rdParty/org.apache.xml.resolver/org/apache/xml/resolver/Version.class b/3rdParty/org.apache.xml.resolver/org/apache/xml/resolver/Version.class new file mode 100644 index 00000000..00c2fd9a Binary files /dev/null and b/3rdParty/org.apache.xml.resolver/org/apache/xml/resolver/Version.class differ diff --git a/3rdParty/org.apache.xml.resolver/org/apache/xml/resolver/apps/XParseError.class b/3rdParty/org.apache.xml.resolver/org/apache/xml/resolver/apps/XParseError.class new file mode 100644 index 00000000..a2cc12eb Binary files /dev/null and b/3rdParty/org.apache.xml.resolver/org/apache/xml/resolver/apps/XParseError.class differ diff --git a/3rdParty/org.apache.xml.resolver/org/apache/xml/resolver/apps/resolver.class b/3rdParty/org.apache.xml.resolver/org/apache/xml/resolver/apps/resolver.class new file mode 100644 index 00000000..9221fea1 Binary files /dev/null and b/3rdParty/org.apache.xml.resolver/org/apache/xml/resolver/apps/resolver.class differ diff --git a/3rdParty/org.apache.xml.resolver/org/apache/xml/resolver/apps/xparse.class b/3rdParty/org.apache.xml.resolver/org/apache/xml/resolver/apps/xparse.class new file mode 100644 index 00000000..5f3e2c9d Binary files /dev/null and b/3rdParty/org.apache.xml.resolver/org/apache/xml/resolver/apps/xparse.class differ diff --git a/3rdParty/org.apache.xml.resolver/org/apache/xml/resolver/apps/xread.class b/3rdParty/org.apache.xml.resolver/org/apache/xml/resolver/apps/xread.class new file mode 100644 index 00000000..e359d9a4 Binary files /dev/null and b/3rdParty/org.apache.xml.resolver/org/apache/xml/resolver/apps/xread.class differ diff --git a/3rdParty/org.apache.xml.resolver/org/apache/xml/resolver/etc/catalog.dtd b/3rdParty/org.apache.xml.resolver/org/apache/xml/resolver/etc/catalog.dtd new file mode 100644 index 00000000..620c1fa0 --- /dev/null +++ b/3rdParty/org.apache.xml.resolver/org/apache/xml/resolver/etc/catalog.dtd @@ -0,0 +1,149 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/3rdParty/org.apache.xml.resolver/org/apache/xml/resolver/etc/catalog.rng b/3rdParty/org.apache.xml.resolver/org/apache/xml/resolver/etc/catalog.rng new file mode 100644 index 00000000..9c19eb29 --- /dev/null +++ b/3rdParty/org.apache.xml.resolver/org/apache/xml/resolver/etc/catalog.rng @@ -0,0 +1,235 @@ + + + + + + + + + + + + + + [a-zA-Z0-9-'()+,./:=?;!*#@$_%]* + + + + + + + + + + + + + + system + public + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/3rdParty/org.apache.xml.resolver/org/apache/xml/resolver/etc/catalog.xsd b/3rdParty/org.apache.xml.resolver/org/apache/xml/resolver/etc/catalog.xsd new file mode 100644 index 00000000..0a37330a --- /dev/null +++ b/3rdParty/org.apache.xml.resolver/org/apache/xml/resolver/etc/catalog.xsd @@ -0,0 +1,196 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/3rdParty/org.apache.xml.resolver/org/apache/xml/resolver/etc/xcatalog.dtd b/3rdParty/org.apache.xml.resolver/org/apache/xml/resolver/etc/xcatalog.dtd new file mode 100644 index 00000000..d229b724 --- /dev/null +++ b/3rdParty/org.apache.xml.resolver/org/apache/xml/resolver/etc/xcatalog.dtd @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + diff --git a/3rdParty/org.apache.xml.resolver/org/apache/xml/resolver/helpers/BootstrapResolver.class b/3rdParty/org.apache.xml.resolver/org/apache/xml/resolver/helpers/BootstrapResolver.class new file mode 100644 index 00000000..77ba2eca Binary files /dev/null and b/3rdParty/org.apache.xml.resolver/org/apache/xml/resolver/helpers/BootstrapResolver.class differ diff --git a/3rdParty/org.apache.xml.resolver/org/apache/xml/resolver/helpers/Debug.class b/3rdParty/org.apache.xml.resolver/org/apache/xml/resolver/helpers/Debug.class new file mode 100644 index 00000000..36d30b59 Binary files /dev/null and b/3rdParty/org.apache.xml.resolver/org/apache/xml/resolver/helpers/Debug.class differ diff --git a/3rdParty/org.apache.xml.resolver/org/apache/xml/resolver/helpers/FileURL.class b/3rdParty/org.apache.xml.resolver/org/apache/xml/resolver/helpers/FileURL.class new file mode 100644 index 00000000..4a14726e Binary files /dev/null and b/3rdParty/org.apache.xml.resolver/org/apache/xml/resolver/helpers/FileURL.class differ diff --git a/3rdParty/org.apache.xml.resolver/org/apache/xml/resolver/helpers/Namespaces.class b/3rdParty/org.apache.xml.resolver/org/apache/xml/resolver/helpers/Namespaces.class new file mode 100644 index 00000000..b96ed138 Binary files /dev/null and b/3rdParty/org.apache.xml.resolver/org/apache/xml/resolver/helpers/Namespaces.class differ diff --git a/3rdParty/org.apache.xml.resolver/org/apache/xml/resolver/helpers/PublicId.class b/3rdParty/org.apache.xml.resolver/org/apache/xml/resolver/helpers/PublicId.class new file mode 100644 index 00000000..a794677a Binary files /dev/null and b/3rdParty/org.apache.xml.resolver/org/apache/xml/resolver/helpers/PublicId.class differ diff --git a/3rdParty/org.apache.xml.resolver/org/apache/xml/resolver/readers/CatalogReader.class b/3rdParty/org.apache.xml.resolver/org/apache/xml/resolver/readers/CatalogReader.class new file mode 100644 index 00000000..be59a44e Binary files /dev/null and b/3rdParty/org.apache.xml.resolver/org/apache/xml/resolver/readers/CatalogReader.class differ diff --git a/3rdParty/org.apache.xml.resolver/org/apache/xml/resolver/readers/DOMCatalogParser.class b/3rdParty/org.apache.xml.resolver/org/apache/xml/resolver/readers/DOMCatalogParser.class new file mode 100644 index 00000000..b50e2967 Binary files /dev/null and b/3rdParty/org.apache.xml.resolver/org/apache/xml/resolver/readers/DOMCatalogParser.class differ diff --git a/3rdParty/org.apache.xml.resolver/org/apache/xml/resolver/readers/DOMCatalogReader.class b/3rdParty/org.apache.xml.resolver/org/apache/xml/resolver/readers/DOMCatalogReader.class new file mode 100644 index 00000000..b33e0aea Binary files /dev/null and b/3rdParty/org.apache.xml.resolver/org/apache/xml/resolver/readers/DOMCatalogReader.class differ diff --git a/3rdParty/org.apache.xml.resolver/org/apache/xml/resolver/readers/ExtendedXMLCatalogReader.class b/3rdParty/org.apache.xml.resolver/org/apache/xml/resolver/readers/ExtendedXMLCatalogReader.class new file mode 100644 index 00000000..f719a4b0 Binary files /dev/null and b/3rdParty/org.apache.xml.resolver/org/apache/xml/resolver/readers/ExtendedXMLCatalogReader.class differ diff --git a/3rdParty/org.apache.xml.resolver/org/apache/xml/resolver/readers/OASISXMLCatalogReader.class b/3rdParty/org.apache.xml.resolver/org/apache/xml/resolver/readers/OASISXMLCatalogReader.class new file mode 100644 index 00000000..0faadc0f Binary files /dev/null and b/3rdParty/org.apache.xml.resolver/org/apache/xml/resolver/readers/OASISXMLCatalogReader.class differ diff --git a/3rdParty/org.apache.xml.resolver/org/apache/xml/resolver/readers/SAXCatalogParser.class b/3rdParty/org.apache.xml.resolver/org/apache/xml/resolver/readers/SAXCatalogParser.class new file mode 100644 index 00000000..ba122183 Binary files /dev/null and b/3rdParty/org.apache.xml.resolver/org/apache/xml/resolver/readers/SAXCatalogParser.class differ diff --git a/3rdParty/org.apache.xml.resolver/org/apache/xml/resolver/readers/SAXCatalogReader.class b/3rdParty/org.apache.xml.resolver/org/apache/xml/resolver/readers/SAXCatalogReader.class new file mode 100644 index 00000000..78c3a775 Binary files /dev/null and b/3rdParty/org.apache.xml.resolver/org/apache/xml/resolver/readers/SAXCatalogReader.class differ diff --git a/3rdParty/org.apache.xml.resolver/org/apache/xml/resolver/readers/SAXParserHandler.class b/3rdParty/org.apache.xml.resolver/org/apache/xml/resolver/readers/SAXParserHandler.class new file mode 100644 index 00000000..c64894ee Binary files /dev/null and b/3rdParty/org.apache.xml.resolver/org/apache/xml/resolver/readers/SAXParserHandler.class differ diff --git a/3rdParty/org.apache.xml.resolver/org/apache/xml/resolver/readers/TR9401CatalogReader.class b/3rdParty/org.apache.xml.resolver/org/apache/xml/resolver/readers/TR9401CatalogReader.class new file mode 100644 index 00000000..91edb771 Binary files /dev/null and b/3rdParty/org.apache.xml.resolver/org/apache/xml/resolver/readers/TR9401CatalogReader.class differ diff --git a/3rdParty/org.apache.xml.resolver/org/apache/xml/resolver/readers/TextCatalogReader.class b/3rdParty/org.apache.xml.resolver/org/apache/xml/resolver/readers/TextCatalogReader.class new file mode 100644 index 00000000..ea185215 Binary files /dev/null and b/3rdParty/org.apache.xml.resolver/org/apache/xml/resolver/readers/TextCatalogReader.class differ diff --git a/3rdParty/org.apache.xml.resolver/org/apache/xml/resolver/readers/XCatalogReader.class b/3rdParty/org.apache.xml.resolver/org/apache/xml/resolver/readers/XCatalogReader.class new file mode 100644 index 00000000..6392a2c0 Binary files /dev/null and b/3rdParty/org.apache.xml.resolver/org/apache/xml/resolver/readers/XCatalogReader.class differ diff --git a/3rdParty/org.apache.xml.resolver/org/apache/xml/resolver/tools/CatalogResolver.class b/3rdParty/org.apache.xml.resolver/org/apache/xml/resolver/tools/CatalogResolver.class new file mode 100644 index 00000000..e4d4ff53 Binary files /dev/null and b/3rdParty/org.apache.xml.resolver/org/apache/xml/resolver/tools/CatalogResolver.class differ diff --git a/3rdParty/org.apache.xml.resolver/org/apache/xml/resolver/tools/ResolvingParser.class b/3rdParty/org.apache.xml.resolver/org/apache/xml/resolver/tools/ResolvingParser.class new file mode 100644 index 00000000..4923a65b Binary files /dev/null and b/3rdParty/org.apache.xml.resolver/org/apache/xml/resolver/tools/ResolvingParser.class differ diff --git a/3rdParty/org.apache.xml.resolver/org/apache/xml/resolver/tools/ResolvingXMLFilter.class b/3rdParty/org.apache.xml.resolver/org/apache/xml/resolver/tools/ResolvingXMLFilter.class new file mode 100644 index 00000000..9b3fe060 Binary files /dev/null and b/3rdParty/org.apache.xml.resolver/org/apache/xml/resolver/tools/ResolvingXMLFilter.class differ diff --git a/3rdParty/org.apache.xml.resolver/org/apache/xml/resolver/tools/ResolvingXMLReader.class b/3rdParty/org.apache.xml.resolver/org/apache/xml/resolver/tools/ResolvingXMLReader.class new file mode 100644 index 00000000..51d7a14c Binary files /dev/null and b/3rdParty/org.apache.xml.resolver/org/apache/xml/resolver/tools/ResolvingXMLReader.class differ diff --git a/3rdParty/org.apache.xml.resolver/pom.xml b/3rdParty/org.apache.xml.resolver/pom.xml new file mode 100644 index 00000000..ea05413e --- /dev/null +++ b/3rdParty/org.apache.xml.resolver/pom.xml @@ -0,0 +1,20 @@ + + + 4.0.0 + + + com.kdmanalytics.libs.libsjava + plugins + 2.0.5-SNAPSHOT + + + com.kdmanalytics.libs.libsjava.plugins + org.apache.xml.resolver + 1.2.0 + + KDM Analytics Apache Xerces-J Resolver Plugin + + eclipse-plugin + + diff --git a/3rdParty/org.apache.xml.serializer/.classpath b/3rdParty/org.apache.xml.serializer/.classpath new file mode 100644 index 00000000..439a599f --- /dev/null +++ b/3rdParty/org.apache.xml.serializer/.classpath @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/3rdParty/org.apache.xml.serializer/.project b/3rdParty/org.apache.xml.serializer/.project new file mode 100644 index 00000000..4ba95cc0 --- /dev/null +++ b/3rdParty/org.apache.xml.serializer/.project @@ -0,0 +1,28 @@ + + + org.apache.xml.serializer + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + + org.eclipse.pde.PluginNature + org.eclipse.jdt.core.javanature + + diff --git a/3rdParty/org.apache.xml.serializer/.settings/org.eclipse.jdt.core.prefs b/3rdParty/org.apache.xml.serializer/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 00000000..322fc67e --- /dev/null +++ b/3rdParty/org.apache.xml.serializer/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,8 @@ +#Fri Aug 26 10:32:25 EDT 2011 +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 +org.eclipse.jdt.core.compiler.compliance=1.6 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.6 diff --git a/3rdParty/org.apache.xml.serializer/META-INF/LICENSE.txt b/3rdParty/org.apache.xml.serializer/META-INF/LICENSE.txt new file mode 100644 index 00000000..261eeb9e --- /dev/null +++ b/3rdParty/org.apache.xml.serializer/META-INF/LICENSE.txt @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/3rdParty/org.apache.xml.serializer/META-INF/MANIFEST.MF b/3rdParty/org.apache.xml.serializer/META-INF/MANIFEST.MF new file mode 100644 index 00000000..6f42ccc7 --- /dev/null +++ b/3rdParty/org.apache.xml.serializer/META-INF/MANIFEST.MF @@ -0,0 +1,11 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: Apache Xerces XML Serializer +Bundle-SymbolicName: org.apache.xml.serializer +Bundle-Version: 2.7.1 +Bundle-ClassPath: org.apache.xml.serializer +Bundle-Vendor: KDM Analytics Inc. +Export-Package: org.apache.xml.serializer;version="2.7.1", + org.apache.xml.serializer.dom3;version="2.7.1" +Require-Bundle: system.bundle +Bundle-RequiredExecutionEnvironment: JavaSE-1.6 diff --git a/3rdParty/org.apache.xml.serializer/META-INF/NOTICE.txt b/3rdParty/org.apache.xml.serializer/META-INF/NOTICE.txt new file mode 100644 index 00000000..c4458581 --- /dev/null +++ b/3rdParty/org.apache.xml.serializer/META-INF/NOTICE.txt @@ -0,0 +1,18 @@ + ========================================================================= + == NOTICE file corresponding to section 4(d) of the Apache License, == + == Version 2.0, in this case for the Apache Xalan Java distribution. == + ========================================================================= + + Apache Xalan (Xalan serializer) + Copyright 1999-2006 The Apache Software Foundation + + This product includes software developed at + The Apache Software Foundation (http://www.apache.org/). + + Portions of this software was originally based on the following: + - software copyright (c) 1999-2002, Lotus Development Corporation., + http://www.lotus.com. + - software copyright (c) 2001-2002, Sun Microsystems., + http://www.sun.com. + - software copyright (c) 2003, IBM Corporation., + http://www.ibm.com. diff --git a/3rdParty/org.apache.xml.serializer/build.properties b/3rdParty/org.apache.xml.serializer/build.properties new file mode 100644 index 00000000..876835f3 --- /dev/null +++ b/3rdParty/org.apache.xml.serializer/build.properties @@ -0,0 +1,4 @@ +source.. = . +output.. = . +bin.includes = META-INF/,\ + org/ diff --git a/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/AttributesImplSerializer.class b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/AttributesImplSerializer.class new file mode 100644 index 00000000..5ef56fe9 Binary files /dev/null and b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/AttributesImplSerializer.class differ diff --git a/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/CharInfo$1.class b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/CharInfo$1.class new file mode 100644 index 00000000..2870ccd8 Binary files /dev/null and b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/CharInfo$1.class differ diff --git a/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/CharInfo$CharKey.class b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/CharInfo$CharKey.class new file mode 100644 index 00000000..8b3fbbd5 Binary files /dev/null and b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/CharInfo$CharKey.class differ diff --git a/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/CharInfo.class b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/CharInfo.class new file mode 100644 index 00000000..82c31ae1 Binary files /dev/null and b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/CharInfo.class differ diff --git a/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/DOM3Serializer.class b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/DOM3Serializer.class new file mode 100644 index 00000000..05cabb5e Binary files /dev/null and b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/DOM3Serializer.class differ diff --git a/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/DOMSerializer.class b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/DOMSerializer.class new file mode 100644 index 00000000..3459957c Binary files /dev/null and b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/DOMSerializer.class differ diff --git a/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/ElemContext.class b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/ElemContext.class new file mode 100644 index 00000000..5ae25ba4 Binary files /dev/null and b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/ElemContext.class differ diff --git a/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/ElemDesc.class b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/ElemDesc.class new file mode 100644 index 00000000..4a9b7487 Binary files /dev/null and b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/ElemDesc.class differ diff --git a/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/EmptySerializer.class b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/EmptySerializer.class new file mode 100644 index 00000000..fab1067a Binary files /dev/null and b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/EmptySerializer.class differ diff --git a/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/EncodingInfo$1.class b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/EncodingInfo$1.class new file mode 100644 index 00000000..fbd7cded Binary files /dev/null and b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/EncodingInfo$1.class differ diff --git a/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/EncodingInfo$EncodingImpl.class b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/EncodingInfo$EncodingImpl.class new file mode 100644 index 00000000..96ad9ccd Binary files /dev/null and b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/EncodingInfo$EncodingImpl.class differ diff --git a/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/EncodingInfo$InEncoding.class b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/EncodingInfo$InEncoding.class new file mode 100644 index 00000000..e2bb6212 Binary files /dev/null and b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/EncodingInfo$InEncoding.class differ diff --git a/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/EncodingInfo.class b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/EncodingInfo.class new file mode 100644 index 00000000..e79cdaa4 Binary files /dev/null and b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/EncodingInfo.class differ diff --git a/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/Encodings.class b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/Encodings.class new file mode 100644 index 00000000..4dfa8605 Binary files /dev/null and b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/Encodings.class differ diff --git a/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/Encodings.properties b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/Encodings.properties new file mode 100644 index 00000000..6094d834 --- /dev/null +++ b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/Encodings.properties @@ -0,0 +1,260 @@ +## +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +## +# +# $Id: Encodings.properties 468654 2006-10-28 07:09:23Z minchau $ +# +# Each entry in this properties file is: +# 1) The Java name for the encoding +# 2) A comma separated list of the MIME names for the encoding, +# with the first one being the preferred MIME name. +# 3) An optional high char. Characters at or below this value are +# definately in the encoding, but characters above it may or may not be. +# This value is given only for performance reasons. +# A value of zero is the same as no value at all. +# +# For example this line in this file: +# ASCII ASCII,US-ASCII 0x007F +# Means the Java name for the encoding is "ASCII". The MIME names for this +# encoding which may appear in a stylesheet are "ASCII" or "US-ASCII" +# and the optional high code point value is given, and it is 0X007F +# which means that the contiguous block of chars from +# 0x0001 to 0x007F ( 127 in base 10) are all in the encoding. +# Higher values above this char might be in the encoding, although in the +# case of this particular encoding there are no higher chars. +# +# +# , +# +# +ASCII ASCII,US-ASCII 0x007F +# +# Big5, Traditional Chinese +Big5 BIG5,csBig5 0x007F +#Big5 with Hong Kong extensions, Traditional Chinese (incorporating 2001 revision) +Big5_HKSCS BIG5-HKSCS 0x007F +# USA, Canada (Bilingual, French), Netherlands, Portugal, Brazil, Australia +Cp037 EBCDIC-CP-US,EBCDIC-CP-CA,EBCDIC-CP-WT,EBCDIC-CP-NL,IBM037 0x0019 +# IBM Austria, Germany +Cp273 IBM273,csIBM273 0x0019 +Cp274 csIBM274,EBCDIC-BE +Cp275 csIBM275,EBCDIC-BR +# IBM Denmark, Norway +Cp277 EBCDIC-CP-DK,EBCDIC-CP-NO,IBM277,csIBM277 0x0019 +# IBM Finland, Sweden +Cp278 EBCDIC-CP-FI,EBCDIC-CP-SE,IBM278,csIBM278 0x0019 +# IBM Italy +Cp280 EBCDIC-CP-IT,IBM280,csIBM280 0x0019 +Cp281 EBCDIC-JP-E,csIBM281 +# IBM Catalan/Spain, Spanish Latin America +Cp284 EBCDIC-CP-ES,IBM284,csIBM284 0x0019 +# IBM United Kingdom, Ireland +Cp285 EBCDIC-CP-GB,IBM284,csIBM285 0x0019 +Cp290 EBCDIC-JP-kana,IBM290,csIBM290 0x0019 +# IBM France +Cp297 EBCDIC-CP-FR,IBM297,csIBM297 0x0019 +# IBM Arabic +Cp420 EBCDIC-CP-AR1,IBM420,csIBM420 0x0019 +Cp423 EBCDIC-CP-GR,IBM423,csIBM423 +# IBM Hebrew +Cp424 EBCDIC-CP-HE,IBM424,csIBM424 0x0019 +Cp437 437,IBM437,csPC8CodePage437 0x007F +# EBCDIC 500V1 +Cp500 EBCDIC-CP-CH,EBCDIC-CP-BE,IBM500,csIBM500 0x0019 +# PC Baltic +Cp775 IBM775,csPC775Baltic 0x007F +# IBM Thailand extended SBCS +Cp838 IBM-Thai,838,csIBMThai 0x0019 +# MS-DOS Latin-1 +Cp850 850,csPC850Multilingual,IBM850 0x007F +Cp851 851,IBM851,csIBM851 +# MS-DOS Latin-2 +Cp852 IBM852,852,csPCp852 0x007F +# IBM Cyrillic +Cp855 IBM855,855,csIBM855 0x007F +# IBM Turkish +Cp857 IBM857,857,csIBM857 0x007F +# Variant of Cp850 with Euro character +Cp858 IBM00858 0x007F +# MS-DOS Portuguese +Cp860 860,csIBM860,IBM860 0x007F +# MS-DOS Icelandic +Cp861 IBM861,861,csIBM861,cp-is 0x007F +# +Cp862 IBM862,862,csPCi62LatinHebrew 0x007F +# MS-DOS Canadian French +Cp863 IBM863,863,csIBM863 0x007F +# PC Arabic +Cp864 IBM864,864,csIBM864 0x007F +# MS-DOS Nordic +Cp865 IBM865,865,csIBM865 0x007F +# MS-DOS Russian +Cp866 IBM866,866,csIBM866 0x007F +# MS-DOS Pakistan +Cp868 IBM868,cp-ar,csIBM868 0x007F +# IBM Modern Greek +Cp869 IBM869,869,cp-gr,csIBM869 0x007F +# IBM Multilingual Latin-2 +Cp870 EBCDIC-CP-ROECE,EBCDIC-CP-YU,IBM870,csIBM870 0x0019 +# IBM Iceland +Cp871 EBCDIC-CP-IS,IBM871,csIBM871 0x0019 +Cp880 EBCDIC-Cyrillic,IBM880,csIBM880 +Cp891 IBM891,csIBM891 +Cp903 IBM903,csIBM903 +Cp904 IBM904,csIBM904 +Cp905 IBM905,csIBM905,EBCDIC-CP-TR +# IBM Pakistan (Urdu) +Cp918 EBCDIC-CP-AR2,IBM918,csIBM918 0x0019 +# GBK, Simplified Chinese +Cp936 GBK,MS936,WINDOWS-936 +# IBM Latin-5, Turkey +Cp1026 IBM1026,csIBM1026 0x0019 +# Latin-1 character set for EBCDIC hosts +Cp1047 IBM1047,IBM-1047 0x0019 +# Variant of Cp037 with Euro character +Cp1140 IBM01140 0x0019 +# Variant of Cp273 with Euro character +Cp1141 IBM01141 0x0019 +# Variant of Cp277 with Euro character +Cp1142 IBM01142 0x0019 +# Variant of Cp278 with Euro character +Cp1143 IBM01143 0x0019 +# Variant of Cp280 with Euro character +Cp1144 IBM01144 0x0019 +# Variant of Cp284 with Euro character +Cp1145 IBM01145 0x0019 +# Variant of Cp285 with Euro character +Cp1146 IBM01146 0x0019 +# Variant of Cp297 with Euro character +Cp1147 IBM01147 0x0019 +# Variant of Cp500 with Euro character +Cp1148 IBM01148 0x0019 +# Variant of Cp871 with Euro character +Cp1149 IBM01149 0x0019 +Cp1250 WINDOWS-1250 0x007F +Cp1251 WINDOWS-1251 0x007F +Cp1252 WINDOWS-1252 0x007F +Cp1253 WINDOWS-1253 0x007F +Cp1254 WINDOWS-1254 0x007F +# Windows Hebrew +Cp1255 WINDOWS-1255 0x007F +# Windows Arabic +Cp1256 WINDOWS-1256 0x007F +Cp1257 WINDOWS-1257 0x007F +# Windows Vietnamese +Cp1258 WINDOWS-1258 0x007F +EUC-CN EUC-CN 0x007F +EUC_CN EUC-CN 0x007F +# +#JISX 0201, 0208 and 0212, EUC encoding Japanese +EUC-JP EUC-JP 0x007F +EUC_JP EUC-JP 0x007F +# KS C 5601, EUC encoding, Korean +EUC-KR EUC-KR 0x007F +EUC_KR EUC-KR 0x007F +# CNS11643 (Plane 1-7,15), EUC encoding, Traditional Chinese +EUC-TW EUC-TW 0x007F +EUC_TW EUC-TW,x-EUC-TW 0x007F +EUCJIS EUC-JP 0x007F +# +# GB2312, EUC encoding, Simplified Chinese +GB2312 GB2312 0x007F + +# GB2312 and CNS11643 in ISO 2022 CN form, Simplified and Traditional Chinese (conversion to Unicode only) +ISO2022CN ISO-2022-CN +# JIS X 0201, 0208, in ISO 2022 form, Japanese +ISO2022JP ISO-2022-JP +# ISO 2022 KR, Korean +ISO2022KR ISO-2022-KR 0x007F +# +# +ISO8859-1 ISO-8859-1 0x00FF +ISO8859_1 ISO-8859-1 0x00FF +8859-1 ISO-8859-1 0x00FF +8859_1 ISO-8859-1 0x00FF +# +ISO8859-2 ISO-8859-2 0x00A0 +ISO8859_2 ISO-8859-2 0x00A0 +8859-2 ISO-8859-2 0x00A0 +8859_2 ISO-8859-2 0x00A0 +# +# Latin Alphabet No. 3 +ISO8859-3 ISO-8859-3 0x00A0 +ISO8859_3 ISO-8859-3 0x00A0 +8859-3 ISO-8859-3 0x00A0 +8859_3 ISO-8859-3 0x00A0 +# +ISO8859-4 ISO-8859-4 0x00A0 +ISO8859_4 ISO-8859-4 0x00A0 +8859-4 ISO-8859-4 0x00A0 +8859_4 ISO-8859-4 0x00A0 +# +ISO8859-5 ISO-8859-5 0x00A0 +ISO8859_5 ISO-8859-5 0x00A0 +8859-5 ISO-8859-5 0x00A0 +8859_5 ISO-8859-5 0x00A0 +# +# Latin/Arabic Alphabet +ISO8859-6 ISO-8859-6 0x00A0 +ISO8859_6 ISO-8859-6 0x00A0 +8859-6 ISO-8859-6 0x00A0 +8859_6 ISO-8859-6 0x00A0 +# +ISO8859-7 ISO-8859-7 0x00A0 +ISO8859_7 ISO-8859-7 0x00A0 +8859-7 ISO-8859-7 0x00A0 +8859_7 ISO-8859-7 0x00A0 +# +ISO8859-8 ISO-8859-8 0x00A0 +ISO8859_8 ISO-8859-8 0x00A0 +8859-8 ISO-8859-8 0x00A0 +8859_8 ISO-8859-8 0x00A0 +# +ISO8859-9 ISO-8859-9 0x00CF +ISO8859_9 ISO-8859-9 0x00CF +8859-9 ISO-8859-9 0x00CF +8859_9 ISO-8859-9 0x00CF +# +ISO8859-10 ISO-8859-10 0x007E +ISO8859_10 ISO-8859-10 0x007E +ISO8859-11 ISO-8859-11 0x007E +ISO8859_11 ISO-8859-11 0x007E +ISO8859-12 ISO-8859-12 0x007F +ISO8859_12 ISO-8859-12 0x007F +ISO8859-13 ISO-8859-13 0x00A0 +ISO8859_13 ISO-8859-13 0x00A0 +ISO8859-14 ISO-8859-14 0x007E +ISO8859_14 ISO-8859-14 0x007E +ISO8859-15 ISO-8859-15 0x00A3 +ISO8859_15 ISO-8859-15 0x00A3 +JIS ISO-2022-JP 0x007F +KOI8_R KOI8-R 0x007F +KSC5601 EUC-KR 0x007F +KS_C_5601-1987 KS_C_5601-1987,iso-ir-149,KS_C_5601-1989,KSC_5601,csKSC56011987 0x007F +MacTEC MacRoman +# Windows Japanese +MS932 windows-31j +# Shift-JIS, Japanese +SJIS SHIFT_JIS 0x007F +# TIS620, Thai +TIS620 TIS-620 +UTF8 UTF-8 0xFFFF +Unicode UNICODE,UTF-16 0xFFFF + +# note that more character set names and their aliases +# can be found at http://www.iana.org/assignments/character-sets + diff --git a/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/ExtendedContentHandler.class b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/ExtendedContentHandler.class new file mode 100644 index 00000000..64e79f35 Binary files /dev/null and b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/ExtendedContentHandler.class differ diff --git a/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/ExtendedLexicalHandler.class b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/ExtendedLexicalHandler.class new file mode 100644 index 00000000..3e9f5c52 Binary files /dev/null and b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/ExtendedLexicalHandler.class differ diff --git a/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/HTMLEntities.properties b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/HTMLEntities.properties new file mode 100644 index 00000000..1987e8a6 --- /dev/null +++ b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/HTMLEntities.properties @@ -0,0 +1,311 @@ +## +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +## +# +# $Id: HTMLEntities.properties 468654 2006-10-28 07:09:23Z minchau $ +# +# @version $Revision: 468654 $ $Date: 2006-10-28 03:09:23 -0400 (Sat, 28 Oct 2006) $ +# This file must be encoded in UTF-8; see CharInfo.java +# +# Character entity references for markup-significant +# +quot=34 +amp=38 +lt=60 +gt=62 +nbsp=160 +# +# Character entity references for ISO 8859-1 characters +# +iexcl=161 +cent=162 +pound=163 +curren=164 +yen=165 +brvbar=166 +sect=167 +uml=168 +copy=169 +ordf=170 +laquo=171 +not=172 +shy=173 +reg=174 +macr=175 +deg=176 +plusmn=177 +sup2=178 +sup3=179 +acute=180 +micro=181 +para=182 +middot=183 +cedil=184 +sup1=185 +ordm=186 +raquo=187 +frac14=188 +frac12=189 +frac34=190 +iquest=191 +Agrave=192 +Aacute=193 +Acirc=194 +Atilde=195 +Auml=196 +Aring=197 +AElig=198 +Ccedil=199 +Egrave=200 +Eacute=201 +Ecirc=202 +Euml=203 +Igrave=204 +Iacute=205 +Icirc=206 +Iuml=207 +ETH=208 +Ntilde=209 +Ograve=210 +Oacute=211 +Ocirc=212 +Otilde=213 +Ouml=214 +times=215 +Oslash=216 +Ugrave=217 +Uacute=218 +Ucirc=219 +Uuml=220 +Yacute=221 +THORN=222 +szlig=223 +agrave=224 +aacute=225 +acirc=226 +atilde=227 +auml=228 +aring=229 +aelig=230 +ccedil=231 +egrave=232 +eacute=233 +ecirc=234 +euml=235 +igrave=236 +iacute=237 +icirc=238 +iuml=239 +eth=240 +ntilde=241 +ograve=242 +oacute=243 +ocirc=244 +otilde=245 +ouml=246 +divide=247 +oslash=248 +ugrave=249 +uacute=250 +ucirc=251 +uuml=252 +yacute=253 +thorn=254 +yuml=255 +# +# Character entity references for symbols, mathematical symbols, and Greek letters +# +# Latin Extended -- Netscape can't handle +# fnof 402 +# +# Greek - Netscape can't handle these +# Alpha 913 +# Beta 914 +# Gamma 915 +# Delta 916 +# Epsilon 917 +# Zeta 918 +# Eta 919 +# Theta 920 +# Iota 921 +# Kappa 922 +# Lambda 923 +# Mu 924 +# Nu 925 +# Xi 926 +# Omicron 927 +# Pi 928 +# Rho 929 +# Sigma 931 +# Tau 932 +# Upsilon 933 +# Phi 934 +# Chi 935 +# Psi 936 +# Omega 937 +# alpha 945 +# beta 946 +# gamma 947 +# delta 948 +# epsilon 949 +# zeta 950 +# eta 951 +# theta 952 +# iota 953 +# kappa 954 +# lambda 955 +# mu 956 +# nu 957 +# xi 958 +# omicron 959 +# pi 960 +# rho 961 +# sigmaf 962 +# sigma 963 +# tau 964 +# upsilon 965 +# phi 966 +# chi 967 +# psi 968 +# omega 969 +# thetasym 977 +# upsih 978 +# piv 982 +# +# General Punctuation +bull=8226 +hellip=8230 +prime=8242 +Prime=8243 +oline=8254 +frasl=8260 +# +# Letterlike Symbols +weierp=8472 +image=8465 +real=8476 +trade=8482 +alefsym=8501 +# +# Arrows +larr=8592 +uarr=8593 +rarr=8594 +darr=8595 +harr=8596 +crarr=8629 +lArr=8656 +uArr=8657 +rArr=8658 +dArr=8659 +hArr=8660 +# +# Mathematical Operators +forall=8704 +part=8706 +exist=8707 +empty=8709 +nabla=8711 +isin=8712 +notin=8713 +ni=8715 +prod=8719 +sum=8721 +minus=8722 +lowast=8727 +radic=8730 +prop=8733 +infin=8734 +ang=8736 +and=8743 +or=8744 +cap=8745 +cup=8746 +int=8747 +there4=8756 +sim=8764 +cong=8773 +asymp=8776 +ne=8800 +equiv=8801 +le=8804 +ge=8805 +sub=8834 +sup=8835 +nsub=8836 +sube=8838 +supe=8839 +oplus=8853 +otimes=8855 +perp=8869 +sdot=8901 +# +# Miscellaneous Technical +lceil=8968 +rceil=8969 +lfloor=8970 +rfloor=8971 +lang=9001 +rang=9002 +# +# Geometric Shapes +loz=9674 +# +# Miscellaneous Symbols +spades=9824 +clubs=9827 +hearts=9829 +diams=9830 +# +# Character entity references for internationalization characters +# +# Latin Extended-A +# Netscape can't handle! +# OElig 338 +# oelig 339 + +#-- NN 4.7 does not seem to support these, so they might ought to be commented. +# Scaron 352 +# scaron 353 +# Yuml 376 +# +# Spacing Modifier Letters -- Netscape can't handle +# circ 710 +# tilde 732 +# +# General Punctuation +ensp=8194 +emsp=8195 +thinsp=8201 +zwnj=8204 +zwj=8205 +lrm=8206 +rlm=8207 +ndash=8211 +mdash=8212 +lsquo=8216 +rsquo=8217 +sbquo=8218 +ldquo=8220 +rdquo=8221 +bdquo=8222 +dagger=8224 +Dagger=8225 +permil=8240 +lsaquo=8249 +rsaquo=8250 +euro=8364 diff --git a/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/Method.class b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/Method.class new file mode 100644 index 00000000..72774000 Binary files /dev/null and b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/Method.class differ diff --git a/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/NamespaceMappings$MappingRecord.class b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/NamespaceMappings$MappingRecord.class new file mode 100644 index 00000000..d26c1aa8 Binary files /dev/null and b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/NamespaceMappings$MappingRecord.class differ diff --git a/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/NamespaceMappings$Stack.class b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/NamespaceMappings$Stack.class new file mode 100644 index 00000000..da639b62 Binary files /dev/null and b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/NamespaceMappings$Stack.class differ diff --git a/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/NamespaceMappings.class b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/NamespaceMappings.class new file mode 100644 index 00000000..25e66d88 Binary files /dev/null and b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/NamespaceMappings.class differ diff --git a/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/ObjectFactory$ConfigurationError.class b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/ObjectFactory$ConfigurationError.class new file mode 100644 index 00000000..da084559 Binary files /dev/null and b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/ObjectFactory$ConfigurationError.class differ diff --git a/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/ObjectFactory.class b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/ObjectFactory.class new file mode 100644 index 00000000..cb881342 Binary files /dev/null and b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/ObjectFactory.class differ diff --git a/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/OutputPropertiesFactory$1.class b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/OutputPropertiesFactory$1.class new file mode 100644 index 00000000..04a6deb2 Binary files /dev/null and b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/OutputPropertiesFactory$1.class differ diff --git a/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/OutputPropertiesFactory.class b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/OutputPropertiesFactory.class new file mode 100644 index 00000000..33b901d6 Binary files /dev/null and b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/OutputPropertiesFactory.class differ diff --git a/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/OutputPropertyUtils.class b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/OutputPropertyUtils.class new file mode 100644 index 00000000..7985d354 Binary files /dev/null and b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/OutputPropertyUtils.class differ diff --git a/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/SecuritySupport.class b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/SecuritySupport.class new file mode 100644 index 00000000..b3a5b05a Binary files /dev/null and b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/SecuritySupport.class differ diff --git a/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/SecuritySupport12$1.class b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/SecuritySupport12$1.class new file mode 100644 index 00000000..f4ff2bc6 Binary files /dev/null and b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/SecuritySupport12$1.class differ diff --git a/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/SecuritySupport12$2.class b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/SecuritySupport12$2.class new file mode 100644 index 00000000..87627d28 Binary files /dev/null and b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/SecuritySupport12$2.class differ diff --git a/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/SecuritySupport12$3.class b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/SecuritySupport12$3.class new file mode 100644 index 00000000..6b82d72c Binary files /dev/null and b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/SecuritySupport12$3.class differ diff --git a/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/SecuritySupport12$4.class b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/SecuritySupport12$4.class new file mode 100644 index 00000000..6ea6ada7 Binary files /dev/null and b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/SecuritySupport12$4.class differ diff --git a/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/SecuritySupport12$5.class b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/SecuritySupport12$5.class new file mode 100644 index 00000000..0837eb9e Binary files /dev/null and b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/SecuritySupport12$5.class differ diff --git a/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/SecuritySupport12$6.class b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/SecuritySupport12$6.class new file mode 100644 index 00000000..0b1bb4da Binary files /dev/null and b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/SecuritySupport12$6.class differ diff --git a/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/SecuritySupport12$7.class b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/SecuritySupport12$7.class new file mode 100644 index 00000000..8fdce28d Binary files /dev/null and b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/SecuritySupport12$7.class differ diff --git a/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/SecuritySupport12$8.class b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/SecuritySupport12$8.class new file mode 100644 index 00000000..6e57da10 Binary files /dev/null and b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/SecuritySupport12$8.class differ diff --git a/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/SecuritySupport12.class b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/SecuritySupport12.class new file mode 100644 index 00000000..e768e9ea Binary files /dev/null and b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/SecuritySupport12.class differ diff --git a/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/SerializationHandler.class b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/SerializationHandler.class new file mode 100644 index 00000000..670ad7ab Binary files /dev/null and b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/SerializationHandler.class differ diff --git a/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/Serializer.class b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/Serializer.class new file mode 100644 index 00000000..8d96bd1b Binary files /dev/null and b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/Serializer.class differ diff --git a/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/SerializerBase.class b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/SerializerBase.class new file mode 100644 index 00000000..039681f7 Binary files /dev/null and b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/SerializerBase.class differ diff --git a/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/SerializerConstants.class b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/SerializerConstants.class new file mode 100644 index 00000000..8c67625b Binary files /dev/null and b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/SerializerConstants.class differ diff --git a/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/SerializerFactory.class b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/SerializerFactory.class new file mode 100644 index 00000000..cb75e970 Binary files /dev/null and b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/SerializerFactory.class differ diff --git a/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/SerializerTrace.class b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/SerializerTrace.class new file mode 100644 index 00000000..6c055944 Binary files /dev/null and b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/SerializerTrace.class differ diff --git a/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/SerializerTraceWriter.class b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/SerializerTraceWriter.class new file mode 100644 index 00000000..b1cce7b3 Binary files /dev/null and b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/SerializerTraceWriter.class differ diff --git a/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/ToHTMLSAXHandler.class b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/ToHTMLSAXHandler.class new file mode 100644 index 00000000..78a99e48 Binary files /dev/null and b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/ToHTMLSAXHandler.class differ diff --git a/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/ToHTMLStream$Trie$Node.class b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/ToHTMLStream$Trie$Node.class new file mode 100644 index 00000000..0a8d999d Binary files /dev/null and b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/ToHTMLStream$Trie$Node.class differ diff --git a/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/ToHTMLStream$Trie.class b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/ToHTMLStream$Trie.class new file mode 100644 index 00000000..fb16d396 Binary files /dev/null and b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/ToHTMLStream$Trie.class differ diff --git a/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/ToHTMLStream.class b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/ToHTMLStream.class new file mode 100644 index 00000000..601d5a3d Binary files /dev/null and b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/ToHTMLStream.class differ diff --git a/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/ToSAXHandler.class b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/ToSAXHandler.class new file mode 100644 index 00000000..10a299a8 Binary files /dev/null and b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/ToSAXHandler.class differ diff --git a/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/ToStream$BoolStack.class b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/ToStream$BoolStack.class new file mode 100644 index 00000000..71ec4c1c Binary files /dev/null and b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/ToStream$BoolStack.class differ diff --git a/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/ToStream$WritertoStringBuffer.class b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/ToStream$WritertoStringBuffer.class new file mode 100644 index 00000000..b1bdd66d Binary files /dev/null and b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/ToStream$WritertoStringBuffer.class differ diff --git a/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/ToStream.class b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/ToStream.class new file mode 100644 index 00000000..ef833326 Binary files /dev/null and b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/ToStream.class differ diff --git a/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/ToTextSAXHandler.class b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/ToTextSAXHandler.class new file mode 100644 index 00000000..b7c1babd Binary files /dev/null and b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/ToTextSAXHandler.class differ diff --git a/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/ToTextStream.class b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/ToTextStream.class new file mode 100644 index 00000000..9fb12037 Binary files /dev/null and b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/ToTextStream.class differ diff --git a/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/ToUnknownStream.class b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/ToUnknownStream.class new file mode 100644 index 00000000..5c7e2541 Binary files /dev/null and b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/ToUnknownStream.class differ diff --git a/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/ToXMLSAXHandler.class b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/ToXMLSAXHandler.class new file mode 100644 index 00000000..c927fde0 Binary files /dev/null and b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/ToXMLSAXHandler.class differ diff --git a/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/ToXMLStream.class b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/ToXMLStream.class new file mode 100644 index 00000000..f313869e Binary files /dev/null and b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/ToXMLStream.class differ diff --git a/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/TransformStateSetter.class b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/TransformStateSetter.class new file mode 100644 index 00000000..6e62caf8 Binary files /dev/null and b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/TransformStateSetter.class differ diff --git a/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/TreeWalker.class b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/TreeWalker.class new file mode 100644 index 00000000..4f622a35 Binary files /dev/null and b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/TreeWalker.class differ diff --git a/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/Version.class b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/Version.class new file mode 100644 index 00000000..c238bb76 Binary files /dev/null and b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/Version.class differ diff --git a/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/WriterChain.class b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/WriterChain.class new file mode 100644 index 00000000..904f71e2 Binary files /dev/null and b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/WriterChain.class differ diff --git a/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/WriterToASCI.class b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/WriterToASCI.class new file mode 100644 index 00000000..113c4a87 Binary files /dev/null and b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/WriterToASCI.class differ diff --git a/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/WriterToUTF8Buffered.class b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/WriterToUTF8Buffered.class new file mode 100644 index 00000000..81c89933 Binary files /dev/null and b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/WriterToUTF8Buffered.class differ diff --git a/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/XMLEntities.properties b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/XMLEntities.properties new file mode 100644 index 00000000..23d0a64e --- /dev/null +++ b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/XMLEntities.properties @@ -0,0 +1,30 @@ +## +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +## +# +# $Id: XMLEntities.properties 468654 2006-10-28 07:09:23Z minchau $ +# +# @version $Revision: 468654 $ $Date: 2006-10-28 03:09:23 -0400 (Sat, 28 Oct 2006) $ +# This file must be encoded in UTF-8; see CharInfo.java +# +# Character entity references for markup-significant +# +quot=34 +amp=38 +lt=60 +gt=62 + diff --git a/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/XSLOutputAttributes.class b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/XSLOutputAttributes.class new file mode 100644 index 00000000..ffaf5480 Binary files /dev/null and b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/XSLOutputAttributes.class differ diff --git a/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/dom3/DOM3SerializerImpl.class b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/dom3/DOM3SerializerImpl.class new file mode 100644 index 00000000..d14cec2f Binary files /dev/null and b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/dom3/DOM3SerializerImpl.class differ diff --git a/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/dom3/DOM3TreeWalker.class b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/dom3/DOM3TreeWalker.class new file mode 100644 index 00000000..3995626a Binary files /dev/null and b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/dom3/DOM3TreeWalker.class differ diff --git a/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/dom3/DOMConstants.class b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/dom3/DOMConstants.class new file mode 100644 index 00000000..45da1fb0 Binary files /dev/null and b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/dom3/DOMConstants.class differ diff --git a/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/dom3/DOMErrorHandlerImpl.class b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/dom3/DOMErrorHandlerImpl.class new file mode 100644 index 00000000..5e7b54b5 Binary files /dev/null and b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/dom3/DOMErrorHandlerImpl.class differ diff --git a/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/dom3/DOMErrorImpl.class b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/dom3/DOMErrorImpl.class new file mode 100644 index 00000000..fdd2605e Binary files /dev/null and b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/dom3/DOMErrorImpl.class differ diff --git a/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/dom3/DOMLocatorImpl.class b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/dom3/DOMLocatorImpl.class new file mode 100644 index 00000000..85c28971 Binary files /dev/null and b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/dom3/DOMLocatorImpl.class differ diff --git a/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/dom3/DOMOutputImpl.class b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/dom3/DOMOutputImpl.class new file mode 100644 index 00000000..0d4ecf53 Binary files /dev/null and b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/dom3/DOMOutputImpl.class differ diff --git a/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/dom3/DOMStringListImpl.class b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/dom3/DOMStringListImpl.class new file mode 100644 index 00000000..4ce66e3d Binary files /dev/null and b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/dom3/DOMStringListImpl.class differ diff --git a/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/dom3/LSSerializerImpl$1.class b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/dom3/LSSerializerImpl$1.class new file mode 100644 index 00000000..473ce93b Binary files /dev/null and b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/dom3/LSSerializerImpl$1.class differ diff --git a/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/dom3/LSSerializerImpl$ThrowableMethods.class b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/dom3/LSSerializerImpl$ThrowableMethods.class new file mode 100644 index 00000000..2c40d715 Binary files /dev/null and b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/dom3/LSSerializerImpl$ThrowableMethods.class differ diff --git a/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/dom3/LSSerializerImpl.class b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/dom3/LSSerializerImpl.class new file mode 100644 index 00000000..e3f08ec7 Binary files /dev/null and b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/dom3/LSSerializerImpl.class differ diff --git a/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/dom3/NamespaceSupport$Prefixes.class b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/dom3/NamespaceSupport$Prefixes.class new file mode 100644 index 00000000..2d06636d Binary files /dev/null and b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/dom3/NamespaceSupport$Prefixes.class differ diff --git a/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/dom3/NamespaceSupport.class b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/dom3/NamespaceSupport.class new file mode 100644 index 00000000..7d7716b8 Binary files /dev/null and b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/dom3/NamespaceSupport.class differ diff --git a/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/output_html.properties b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/output_html.properties new file mode 100644 index 00000000..43724e4e --- /dev/null +++ b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/output_html.properties @@ -0,0 +1,44 @@ +## +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +## +# +# $Id: output_html.properties 468654 2006-10-28 07:09:23Z minchau $ +# +# Specify defaults when method="html". These defaults use output_xml.properties +# as a base. +# + +# XSLT properties do not need namespace qualification. +method=html +indent=yes +media-type=text/html +version=4.0 + +# Xalan-specific output properties. These can be overridden in the stylesheet +# assigning a xalan namespace. For example: +# +# +# ... +# Note that the colon after the protocol needs to be escaped. +{http\u003a//xml.apache.org/xalan}indent-amount=0 +{http\u003a//xml.apache.org/xalan}content-handler=org.apache.xml.serializer.ToHTMLStream +{http\u003a//xml.apache.org/xalan}entities=org/apache/xml/serializer/HTMLEntities +{http\u003a//xml.apache.org/xalan}use-url-escaping=yes +{http\u003a//xml.apache.org/xalan}omit-meta-tag=no diff --git a/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/output_text.properties b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/output_text.properties new file mode 100644 index 00000000..ed0ed86a --- /dev/null +++ b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/output_text.properties @@ -0,0 +1,37 @@ +## +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +## +# +# $Id: output_text.properties 468654 2006-10-28 07:09:23Z minchau $ +# +# Specify defaults when method="text". +# + +# XSLT properties do not need namespace qualification. +method=text +media-type=text/plain + +# Xalan-specific output properties. These can be overridden in the stylesheet +# assigning a xalan namespace. For example: +# +# +# ... +# Note that the colon after the protocol needs to be escaped. +{http\u003a//xml.apache.org/xalan}content-handler=org.apache.xml.serializer.ToTextStream diff --git a/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/output_unknown.properties b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/output_unknown.properties new file mode 100644 index 00000000..3f7cea19 --- /dev/null +++ b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/output_unknown.properties @@ -0,0 +1,46 @@ +## +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +## +# +# $Id: output_unknown.properties 468654 2006-10-28 07:09:23Z minchau $ +# +# Specify defaults when no method="..." is specified. +# This type of output will quickly switch to "xml" or "html" +# depending on the first element name. +# + +# XSLT properties do not need namespace qualification. +method=xml +version=1.0 +encoding=UTF-8 +indent=no +omit-xml-declaration=no +standalone=no +media-type=text/xml + +# Xalan-specific output properties. These can be overridden in the stylesheet +# assigning a xalan namespace. For example: +# +# +# ... +# Note that the colon after the protocol needs to be escaped. +{http\u003a//xml.apache.org/xalan}indent-amount=0 +{http\u003a//xml.apache.org/xalan}content-handler=org.apache.xml.serializer.ToUnknownStream + diff --git a/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/output_xml.properties b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/output_xml.properties new file mode 100644 index 00000000..24696c87 --- /dev/null +++ b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/output_xml.properties @@ -0,0 +1,46 @@ +## +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +## +# +# $Id: output_xml.properties 468654 2006-10-28 07:09:23Z minchau $ +# +# Specify defaults when method="xml". These defaults serve as a base for +# other defaults, such as output_html and output_text. +# + +# XSLT properties do not need namespace qualification. +method=xml +version=1.0 +encoding=UTF-8 +indent=no +omit-xml-declaration=no +standalone=no +media-type=text/xml + +# Xalan-specific output properties. These can be overridden in the stylesheet +# assigning a xalan namespace. For example: +# +# +# ... +# Note that the colon after the protocol needs to be escaped. +{http\u003a//xml.apache.org/xalan}indent-amount=0 +{http\u003a//xml.apache.org/xalan}content-handler=org.apache.xml.serializer.ToXMLStream +{http\u003a//xml.apache.org/xalan}entities=org/apache/xml/serializer/XMLEntities + diff --git a/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/utils/AttList.class b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/utils/AttList.class new file mode 100644 index 00000000..3550ca26 Binary files /dev/null and b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/utils/AttList.class differ diff --git a/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/utils/BoolStack.class b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/utils/BoolStack.class new file mode 100644 index 00000000..8a28d6e3 Binary files /dev/null and b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/utils/BoolStack.class differ diff --git a/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/utils/DOM2Helper.class b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/utils/DOM2Helper.class new file mode 100644 index 00000000..1ffce586 Binary files /dev/null and b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/utils/DOM2Helper.class differ diff --git a/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/utils/Messages.class b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/utils/Messages.class new file mode 100644 index 00000000..fdc4eebe Binary files /dev/null and b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/utils/Messages.class differ diff --git a/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/utils/MsgKey.class b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/utils/MsgKey.class new file mode 100644 index 00000000..d2a2a5ad Binary files /dev/null and b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/utils/MsgKey.class differ diff --git a/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/utils/SerializerMessages.class b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/utils/SerializerMessages.class new file mode 100644 index 00000000..cc7495ba Binary files /dev/null and b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/utils/SerializerMessages.class differ diff --git a/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/utils/SerializerMessages_ca.class b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/utils/SerializerMessages_ca.class new file mode 100644 index 00000000..88bb8955 Binary files /dev/null and b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/utils/SerializerMessages_ca.class differ diff --git a/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/utils/SerializerMessages_cs.class b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/utils/SerializerMessages_cs.class new file mode 100644 index 00000000..6e4e23f4 Binary files /dev/null and b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/utils/SerializerMessages_cs.class differ diff --git a/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/utils/SerializerMessages_de.class b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/utils/SerializerMessages_de.class new file mode 100644 index 00000000..43819fb8 Binary files /dev/null and b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/utils/SerializerMessages_de.class differ diff --git a/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/utils/SerializerMessages_en.class b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/utils/SerializerMessages_en.class new file mode 100644 index 00000000..bd90b6e0 Binary files /dev/null and b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/utils/SerializerMessages_en.class differ diff --git a/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/utils/SerializerMessages_es.class b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/utils/SerializerMessages_es.class new file mode 100644 index 00000000..b4101272 Binary files /dev/null and b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/utils/SerializerMessages_es.class differ diff --git a/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/utils/SerializerMessages_fr.class b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/utils/SerializerMessages_fr.class new file mode 100644 index 00000000..1d7359cf Binary files /dev/null and b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/utils/SerializerMessages_fr.class differ diff --git a/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/utils/SerializerMessages_hu.class b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/utils/SerializerMessages_hu.class new file mode 100644 index 00000000..7d4fd552 Binary files /dev/null and b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/utils/SerializerMessages_hu.class differ diff --git a/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/utils/SerializerMessages_it.class b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/utils/SerializerMessages_it.class new file mode 100644 index 00000000..4f991273 Binary files /dev/null and b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/utils/SerializerMessages_it.class differ diff --git a/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/utils/SerializerMessages_ja.class b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/utils/SerializerMessages_ja.class new file mode 100644 index 00000000..41aff459 Binary files /dev/null and b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/utils/SerializerMessages_ja.class differ diff --git a/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/utils/SerializerMessages_ko.class b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/utils/SerializerMessages_ko.class new file mode 100644 index 00000000..980d6fe5 Binary files /dev/null and b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/utils/SerializerMessages_ko.class differ diff --git a/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/utils/SerializerMessages_pl.class b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/utils/SerializerMessages_pl.class new file mode 100644 index 00000000..14c0d7d9 Binary files /dev/null and b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/utils/SerializerMessages_pl.class differ diff --git a/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/utils/SerializerMessages_pt_BR.class b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/utils/SerializerMessages_pt_BR.class new file mode 100644 index 00000000..20777faa Binary files /dev/null and b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/utils/SerializerMessages_pt_BR.class differ diff --git a/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/utils/SerializerMessages_ru.class b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/utils/SerializerMessages_ru.class new file mode 100644 index 00000000..72af220d Binary files /dev/null and b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/utils/SerializerMessages_ru.class differ diff --git a/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/utils/SerializerMessages_sk.class b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/utils/SerializerMessages_sk.class new file mode 100644 index 00000000..d6119081 Binary files /dev/null and b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/utils/SerializerMessages_sk.class differ diff --git a/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/utils/SerializerMessages_sl.class b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/utils/SerializerMessages_sl.class new file mode 100644 index 00000000..3c93b5fe Binary files /dev/null and b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/utils/SerializerMessages_sl.class differ diff --git a/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/utils/SerializerMessages_sv.class b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/utils/SerializerMessages_sv.class new file mode 100644 index 00000000..68447c77 Binary files /dev/null and b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/utils/SerializerMessages_sv.class differ diff --git a/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/utils/SerializerMessages_tr.class b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/utils/SerializerMessages_tr.class new file mode 100644 index 00000000..bf50621b Binary files /dev/null and b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/utils/SerializerMessages_tr.class differ diff --git a/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/utils/SerializerMessages_zh.class b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/utils/SerializerMessages_zh.class new file mode 100644 index 00000000..5a015b64 Binary files /dev/null and b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/utils/SerializerMessages_zh.class differ diff --git a/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/utils/SerializerMessages_zh_CN.class b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/utils/SerializerMessages_zh_CN.class new file mode 100644 index 00000000..f9b35f0d Binary files /dev/null and b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/utils/SerializerMessages_zh_CN.class differ diff --git a/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/utils/SerializerMessages_zh_TW.class b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/utils/SerializerMessages_zh_TW.class new file mode 100644 index 00000000..7ff29908 Binary files /dev/null and b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/utils/SerializerMessages_zh_TW.class differ diff --git a/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/utils/StringToIntTable.class b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/utils/StringToIntTable.class new file mode 100644 index 00000000..ef334214 Binary files /dev/null and b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/utils/StringToIntTable.class differ diff --git a/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/utils/SystemIDResolver.class b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/utils/SystemIDResolver.class new file mode 100644 index 00000000..7c7dd46d Binary files /dev/null and b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/utils/SystemIDResolver.class differ diff --git a/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/utils/URI$MalformedURIException.class b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/utils/URI$MalformedURIException.class new file mode 100644 index 00000000..00b3d97b Binary files /dev/null and b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/utils/URI$MalformedURIException.class differ diff --git a/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/utils/URI.class b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/utils/URI.class new file mode 100644 index 00000000..bb493f99 Binary files /dev/null and b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/utils/URI.class differ diff --git a/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/utils/Utils.class b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/utils/Utils.class new file mode 100644 index 00000000..44274155 Binary files /dev/null and b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/utils/Utils.class differ diff --git a/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/utils/WrappedRuntimeException.class b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/utils/WrappedRuntimeException.class new file mode 100644 index 00000000..7999d45e Binary files /dev/null and b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/utils/WrappedRuntimeException.class differ diff --git a/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/utils/XML11Char.class b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/utils/XML11Char.class new file mode 100644 index 00000000..86b81747 Binary files /dev/null and b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/utils/XML11Char.class differ diff --git a/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/utils/XMLChar.class b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/utils/XMLChar.class new file mode 100644 index 00000000..0cad44f8 Binary files /dev/null and b/3rdParty/org.apache.xml.serializer/org/apache/xml/serializer/utils/XMLChar.class differ diff --git a/3rdParty/org.apache.xml.serializer/pom.xml b/3rdParty/org.apache.xml.serializer/pom.xml new file mode 100644 index 00000000..9d8078bf --- /dev/null +++ b/3rdParty/org.apache.xml.serializer/pom.xml @@ -0,0 +1,21 @@ + + + 4.0.0 + + + com.kdmanalytics.libs.libsjava + plugins + 2.0.5-SNAPSHOT + + + com.kdmanalytics.libs.libsjava.plugins + org.apache.xml.serializer + 2.7.1 + + KDM Analytics Apache Xerces-J Serilizer Plugin + + eclipse-plugin + + diff --git a/3rdParty/org.openrdf.sesame/.classpath b/3rdParty/org.openrdf.sesame/.classpath new file mode 100644 index 00000000..69a2cdc7 --- /dev/null +++ b/3rdParty/org.openrdf.sesame/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/3rdParty/org.openrdf.sesame/.project b/3rdParty/org.openrdf.sesame/.project new file mode 100644 index 00000000..359014b4 --- /dev/null +++ b/3rdParty/org.openrdf.sesame/.project @@ -0,0 +1,28 @@ + + + org.openrdf.sesame + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + + org.eclipse.pde.PluginNature + org.eclipse.jdt.core.javanature + + diff --git a/3rdParty/org.openrdf.sesame/.settings/org.eclipse.jdt.core.prefs b/3rdParty/org.openrdf.sesame/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 00000000..11f6e462 --- /dev/null +++ b/3rdParty/org.openrdf.sesame/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,7 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 +org.eclipse.jdt.core.compiler.compliance=1.7 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.7 diff --git a/3rdParty/org.openrdf.sesame/META-INF/MANIFEST.MF b/3rdParty/org.openrdf.sesame/META-INF/MANIFEST.MF new file mode 100644 index 00000000..b4919c8f --- /dev/null +++ b/3rdParty/org.openrdf.sesame/META-INF/MANIFEST.MF @@ -0,0 +1,129 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: Open RDF Sesame +Bundle-SymbolicName: org.openrdf.sesame +Bundle-Version: 2.4.2 +Bundle-ClassPath: openrdf-sesame-2.4.2-onejar.jar +Bundle-Vendor: KDM Analytics Inc. +Export-Package: info.aduna.collections, + info.aduna.collections.iterators, + info.aduna.concurrent, + info.aduna.concurrent.locks, + info.aduna.i18n.languagetag, + info.aduna.io, + info.aduna.iteration, + info.aduna.lang, + info.aduna.lang.reflect, + info.aduna.lang.service, + info.aduna.net, + info.aduna.net.http, + info.aduna.platform, + info.aduna.platform.support, + info.aduna.text, + info.aduna.webapp.filters, + info.aduna.webapp.util, + info.aduna.xml, + org.openrdf, + org.openrdf.console, + org.openrdf.http.client, + org.openrdf.http.protocol, + org.openrdf.http.protocol.error, + org.openrdf.http.protocol.transaction, + org.openrdf.http.protocol.transaction.operations, + org.openrdf.http.server, + org.openrdf.http.server.protocol, + org.openrdf.http.server.repository, + org.openrdf.http.server.repository.contexts, + org.openrdf.http.server.repository.namespaces, + org.openrdf.http.server.repository.size, + org.openrdf.http.server.repository.statements, + org.openrdf.model, + org.openrdf.model.datatypes, + org.openrdf.model.impl, + org.openrdf.model.util, + org.openrdf.model.vocabulary, + org.openrdf.query, + org.openrdf.query.algebra, + org.openrdf.query.algebra.evaluation, + org.openrdf.query.algebra.evaluation.function, + org.openrdf.query.algebra.evaluation.impl, + org.openrdf.query.algebra.evaluation.iterator, + org.openrdf.query.algebra.evaluation.util, + org.openrdf.query.algebra.helpers, + org.openrdf.query.dawg, + org.openrdf.query.impl, + org.openrdf.query.parser, + org.openrdf.query.parser.serql, + org.openrdf.query.parser.serql.ast, + org.openrdf.query.parser.sparql, + org.openrdf.query.parser.sparql.ast, + org.openrdf.query.resultio, + org.openrdf.query.resultio.binary, + org.openrdf.query.resultio.sparqljson, + org.openrdf.query.resultio.sparqlxml, + org.openrdf.query.resultio.text, + org.openrdf.repository, + org.openrdf.repository.base, + org.openrdf.repository.config, + org.openrdf.repository.contextaware, + org.openrdf.repository.contextaware.config, + org.openrdf.repository.dataset, + org.openrdf.repository.dataset.config, + org.openrdf.repository.event, + org.openrdf.repository.event.base, + org.openrdf.repository.event.util, + org.openrdf.repository.http, + org.openrdf.repository.http.config, + org.openrdf.repository.manager, + org.openrdf.repository.manager.util, + org.openrdf.repository.sail, + org.openrdf.repository.sail.config, + org.openrdf.repository.util, + org.openrdf.rio, + org.openrdf.rio.helpers, + org.openrdf.rio.n3, + org.openrdf.rio.ntriples, + org.openrdf.rio.rdfxml, + org.openrdf.rio.rdfxml.util, + org.openrdf.rio.trig, + org.openrdf.rio.trix, + org.openrdf.rio.turtle, + org.openrdf.sail, + org.openrdf.sail.config, + org.openrdf.sail.helpers, + org.openrdf.sail.inferencer, + org.openrdf.sail.inferencer.fc, + org.openrdf.sail.inferencer.fc.config, + org.openrdf.sail.memory, + org.openrdf.sail.memory.config, + org.openrdf.sail.memory.model, + org.openrdf.sail.nativerdf, + org.openrdf.sail.nativerdf.btree, + org.openrdf.sail.nativerdf.config, + org.openrdf.sail.nativerdf.datastore, + org.openrdf.sail.nativerdf.model, + org.openrdf.sail.rdbms, + org.openrdf.sail.rdbms.algebra, + org.openrdf.sail.rdbms.algebra.base, + org.openrdf.sail.rdbms.algebra.factories, + org.openrdf.sail.rdbms.config, + org.openrdf.sail.rdbms.evaluation, + org.openrdf.sail.rdbms.exceptions, + org.openrdf.sail.rdbms.iteration, + org.openrdf.sail.rdbms.iteration.base, + org.openrdf.sail.rdbms.managers, + org.openrdf.sail.rdbms.managers.base, + org.openrdf.sail.rdbms.managers.helpers, + org.openrdf.sail.rdbms.model, + org.openrdf.sail.rdbms.mysql, + org.openrdf.sail.rdbms.optimizers, + org.openrdf.sail.rdbms.postgresql, + org.openrdf.sail.rdbms.schema, + org.openrdf.sail.rdbms.util +Require-Bundle: org.slf4j.api;bundle-version="1.7.5";visibility:=reexport, + org.slf4j.log4j;bundle-version="1.7.5";visibility:=reexport +Created-By: Apache Maven +Archiver-Version: Plexus Archiver +Built-By: jenkins +Build-Jdk: 1.7.0_25 +Bundle-RequiredExecutionEnvironment: JavaSE-1.7 diff --git a/3rdParty/org.openrdf.sesame/META-INF/maven/com.kdmanalytics.libs.libsjava.plugins/org.openrdf.sesame/pom.properties b/3rdParty/org.openrdf.sesame/META-INF/maven/com.kdmanalytics.libs.libsjava.plugins/org.openrdf.sesame/pom.properties new file mode 100644 index 00000000..eee4a1b7 --- /dev/null +++ b/3rdParty/org.openrdf.sesame/META-INF/maven/com.kdmanalytics.libs.libsjava.plugins/org.openrdf.sesame/pom.properties @@ -0,0 +1,5 @@ +#Generated by Maven +#Thu Sep 12 11:09:25 EDT 2013 +version=2.4.2 +groupId=com.kdmanalytics.libs.libsjava.plugins +artifactId=org.openrdf.sesame diff --git a/3rdParty/org.openrdf.sesame/META-INF/maven/com.kdmanalytics.libs.libsjava.plugins/org.openrdf.sesame/pom.xml b/3rdParty/org.openrdf.sesame/META-INF/maven/com.kdmanalytics.libs.libsjava.plugins/org.openrdf.sesame/pom.xml new file mode 100644 index 00000000..72180864 --- /dev/null +++ b/3rdParty/org.openrdf.sesame/META-INF/maven/com.kdmanalytics.libs.libsjava.plugins/org.openrdf.sesame/pom.xml @@ -0,0 +1,21 @@ + + + 4.0.0 + + + com.kdmanalytics.libs.libsjava + plugins + 2.3.1 + + + com.kdmanalytics.libs.libsjava.plugins + org.openrdf.sesame + 2.4.2 + + OpenRDF Sesame Library + + eclipse-plugin + + diff --git a/3rdParty/org.openrdf.sesame/META-INF/maven/info.aduna.commons/aduna-commons-collections/pom.properties b/3rdParty/org.openrdf.sesame/META-INF/maven/info.aduna.commons/aduna-commons-collections/pom.properties new file mode 100644 index 00000000..8c0f223d --- /dev/null +++ b/3rdParty/org.openrdf.sesame/META-INF/maven/info.aduna.commons/aduna-commons-collections/pom.properties @@ -0,0 +1,5 @@ +#Generated by org.apache.felix.bundleplugin +#Fri Jan 29 10:40:43 CET 2010 +version=2.7.0 +groupId=info.aduna.commons +artifactId=aduna-commons-collections diff --git a/3rdParty/org.openrdf.sesame/META-INF/maven/info.aduna.commons/aduna-commons-collections/pom.xml b/3rdParty/org.openrdf.sesame/META-INF/maven/info.aduna.commons/aduna-commons-collections/pom.xml new file mode 100644 index 00000000..10d74fd0 --- /dev/null +++ b/3rdParty/org.openrdf.sesame/META-INF/maven/info.aduna.commons/aduna-commons-collections/pom.xml @@ -0,0 +1,69 @@ + + + 4.0.0 + + + info.aduna.commons + aduna-commons + 16 + ../../pom.xml + + + aduna-commons-collections + 2.7.0 + + Aduna Commons: Collections + Extensions to the Java Collections Framework. + + + Aduna + http://www.aduna-software.com/ + + + + + Aduna BSD license + http://repo.aduna-software.org/legal/aduna-bsd.txt + repo + A BSD-style OSS license + + + + + + info.aduna.commons + aduna-commons-concurrent + 2.6.0 + + + + + + + maven-jar-plugin + + + ${project.build.outputDirectory}/META-INF/MANIFEST.MF + + + + + org.apache.felix + maven-bundle-plugin + true + + + info.aduna.collections,info.aduna.collections.iterators + + + + + + + + scm:svn:http://repo.aduna-software.org/svn/info.aduna/commons/collections/tags/2.7.0 + scm:svn:https://repo.aduna-software.org/svn/info.aduna/commons/collections/tags/2.7.0 + http://repo.aduna-software.org/websvn/listing.php?repname=aduna&path=/info.aduna/commons/collections/branches/2.7?repname=aduna&path=/info.aduna/commons/collections/tags/2.7.0?repname=aduna&path=/info.aduna/commons/collections/branches/2.7?repname=aduna&path=/info.aduna/commons/collections/trunk/ + + + diff --git a/3rdParty/org.openrdf.sesame/META-INF/maven/info.aduna.commons/aduna-commons-concurrent/pom.properties b/3rdParty/org.openrdf.sesame/META-INF/maven/info.aduna.commons/aduna-commons-concurrent/pom.properties new file mode 100644 index 00000000..cecbd41b --- /dev/null +++ b/3rdParty/org.openrdf.sesame/META-INF/maven/info.aduna.commons/aduna-commons-concurrent/pom.properties @@ -0,0 +1,5 @@ +#Generated by org.apache.felix.bundleplugin +#Fri Jan 29 10:37:09 CET 2010 +version=2.6.0 +groupId=info.aduna.commons +artifactId=aduna-commons-concurrent diff --git a/3rdParty/org.openrdf.sesame/META-INF/maven/info.aduna.commons/aduna-commons-concurrent/pom.xml b/3rdParty/org.openrdf.sesame/META-INF/maven/info.aduna.commons/aduna-commons-concurrent/pom.xml new file mode 100644 index 00000000..7d0091f9 --- /dev/null +++ b/3rdParty/org.openrdf.sesame/META-INF/maven/info.aduna.commons/aduna-commons-concurrent/pom.xml @@ -0,0 +1,68 @@ + + + 4.0.0 + + + info.aduna.commons + aduna-commons + 16 + ../../pom.xml + + + aduna-commons-concurrent + 2.6.0 + + Aduna Commons: Concurrent + Extensions to the Java Concurrency package + + + Aduna + http://www.aduna-software.com/ + + + + + Aduna BSD license + http://repo.aduna-software.org/legal/aduna-bsd.txt + repo + A BSD-style OSS license + + + + + + org.slf4j + slf4j-api + + + + + + + maven-jar-plugin + + + ${project.build.outputDirectory}/META-INF/MANIFEST.MF + + + + + org.apache.felix + maven-bundle-plugin + true + + + info.aduna.concurrent,info.aduna.concurrent.locks + + + + + + + + scm:svn:http://repo.aduna-software.org/svn/info.aduna/commons/concurrent/tags/2.6.0 + scm:svn:https://repo.aduna-software.org/svn/info.aduna/commons/concurrent/tags/2.6.0 + http://repo.aduna-software.org/websvn/listing.php?repname=aduna&path=/info.aduna/commons/concurrent/branches/2.6?repname=aduna&path=/info.aduna/commons/concurrent/tags/2.6.0?repname=aduna&path=/info.aduna/commons/concurrent/branches/2.6?repname=aduna&path=/info.aduna/commons/concurrent/trunk/ + + + diff --git a/3rdParty/org.openrdf.sesame/META-INF/maven/info.aduna.commons/aduna-commons-i18n/pom.properties b/3rdParty/org.openrdf.sesame/META-INF/maven/info.aduna.commons/aduna-commons-i18n/pom.properties new file mode 100644 index 00000000..de81b14e --- /dev/null +++ b/3rdParty/org.openrdf.sesame/META-INF/maven/info.aduna.commons/aduna-commons-i18n/pom.properties @@ -0,0 +1,5 @@ +#Generated by org.apache.felix.bundleplugin +#Fri Jan 29 11:36:20 CET 2010 +version=1.3.0 +groupId=info.aduna.commons +artifactId=aduna-commons-i18n diff --git a/3rdParty/org.openrdf.sesame/META-INF/maven/info.aduna.commons/aduna-commons-i18n/pom.xml b/3rdParty/org.openrdf.sesame/META-INF/maven/info.aduna.commons/aduna-commons-i18n/pom.xml new file mode 100644 index 00000000..6b5d1737 --- /dev/null +++ b/3rdParty/org.openrdf.sesame/META-INF/maven/info.aduna.commons/aduna-commons-i18n/pom.xml @@ -0,0 +1,68 @@ + + + 4.0.0 + + + info.aduna.commons + aduna-commons + 16 + ../../pom.xml + + + aduna-commons-i18n + 1.3.0 + + Aduna Commons: i18n + Internationalization and localization utilities. + + + Aduna + http://www.aduna-software.com/ + + + + + Aduna BSD license + http://repo.aduna-software.org/legal/aduna-bsd.txt + repo + A BSD-style OSS license + + + + + + junit + junit + + + + + + + maven-jar-plugin + + + ${project.build.outputDirectory}/META-INF/MANIFEST.MF + + + + + org.apache.felix + maven-bundle-plugin + true + + + info.aduna.i18n.languagetag + + + + + + + + scm:svn:http://repo.aduna-software.org/svn/info.aduna/commons/i18n/tags/1.3.0 + scm:svn:https://repo.aduna-software.org/svn/info.aduna/commons/i18n/tags/1.3.0 + http://repo.aduna-software.org/websvn/listing.php?repname=aduna&path=/info.aduna/commons/i18n/branches/1.3?repname=aduna&path=/info.aduna/commons/i18n/tags/1.3.0?repname=aduna&path=/info.aduna/commons/i18n/branches/1.3?repname=aduna&path=/info.aduna/commons/i18n/trunk/ + + + diff --git a/3rdParty/org.openrdf.sesame/META-INF/maven/info.aduna.commons/aduna-commons-io/pom.properties b/3rdParty/org.openrdf.sesame/META-INF/maven/info.aduna.commons/aduna-commons-io/pom.properties new file mode 100644 index 00000000..99f223f7 --- /dev/null +++ b/3rdParty/org.openrdf.sesame/META-INF/maven/info.aduna.commons/aduna-commons-io/pom.properties @@ -0,0 +1,5 @@ +#Generated by org.apache.felix.bundleplugin +#Fri Jan 29 11:39:26 CET 2010 +version=2.8.0 +groupId=info.aduna.commons +artifactId=aduna-commons-io diff --git a/3rdParty/org.openrdf.sesame/META-INF/maven/info.aduna.commons/aduna-commons-io/pom.xml b/3rdParty/org.openrdf.sesame/META-INF/maven/info.aduna.commons/aduna-commons-io/pom.xml new file mode 100644 index 00000000..27df7c6c --- /dev/null +++ b/3rdParty/org.openrdf.sesame/META-INF/maven/info.aduna.commons/aduna-commons-io/pom.xml @@ -0,0 +1,68 @@ + + + 4.0.0 + + + info.aduna.commons + aduna-commons + 16 + ../../pom.xml + + + aduna-commons-io + 2.8.0 + + Aduna Commons: IO + Extensions to the Java IO functionality. + + + Aduna + http://www.aduna-software.com/ + + + + + Aduna BSD license + http://repo.aduna-software.org/legal/aduna-bsd.txt + repo + A BSD-style OSS license + + + + + + org.slf4j + slf4j-api + + + + + + + maven-jar-plugin + + + ${project.build.outputDirectory}/META-INF/MANIFEST.MF + + + + + org.apache.felix + maven-bundle-plugin + true + + + info.aduna.io + + + + + + + + scm:svn:http://repo.aduna-software.org/svn/info.aduna/commons/io/tags/2.8.0 + scm:svn:https://repo.aduna-software.org/svn/info.aduna/commons/io/tags/2.8.0 + http://repo.aduna-software.org/websvn/listing.php?repname=aduna&path=/info.aduna/commons/io/branches/2.8?repname=aduna&path=/info.aduna/commons/io/tags/2.8.0?repname=aduna&path=/info.aduna/commons/io/branches/2.8?repname=aduna&path=/info.aduna/commons/io/trunk/ + + + diff --git a/3rdParty/org.openrdf.sesame/META-INF/maven/info.aduna.commons/aduna-commons-iteration/pom.properties b/3rdParty/org.openrdf.sesame/META-INF/maven/info.aduna.commons/aduna-commons-iteration/pom.properties new file mode 100644 index 00000000..f3f3568e --- /dev/null +++ b/3rdParty/org.openrdf.sesame/META-INF/maven/info.aduna.commons/aduna-commons-iteration/pom.properties @@ -0,0 +1,5 @@ +#Generated by org.apache.felix.bundleplugin +#Fri Jan 29 11:42:51 CET 2010 +version=2.7.0 +groupId=info.aduna.commons +artifactId=aduna-commons-iteration diff --git a/3rdParty/org.openrdf.sesame/META-INF/maven/info.aduna.commons/aduna-commons-iteration/pom.xml b/3rdParty/org.openrdf.sesame/META-INF/maven/info.aduna.commons/aduna-commons-iteration/pom.xml new file mode 100644 index 00000000..62e41985 --- /dev/null +++ b/3rdParty/org.openrdf.sesame/META-INF/maven/info.aduna.commons/aduna-commons-iteration/pom.xml @@ -0,0 +1,86 @@ + + + 4.0.0 + + + info.aduna.commons + aduna-commons + 16 + ../../pom.xml + + + aduna-commons-iteration + 2.7.0 + + Aduna Commons: Iteration + Iterations and iterators for various purposes. + + + Aduna + http://www.aduna-software.com/ + + + + + Aduna BSD license + http://repo.aduna-software.org/legal/aduna-bsd.txt + repo + A BSD-style OSS license + + + + + + info.aduna.commons + aduna-commons-concurrent + 2.6.0 + + + + org.slf4j + slf4j-api + + + + org.slf4j + slf4j-simple + test + true + + + + junit + junit + + + + + + + maven-jar-plugin + + + ${project.build.outputDirectory}/META-INF/MANIFEST.MF + + + + + org.apache.felix + maven-bundle-plugin + true + + + info.aduna.iteration + + + + + + + + scm:svn:http://repo.aduna-software.org/svn/info.aduna/commons/iteration/tags/2.7.0 + scm:svn:https://repo.aduna-software.org/svn/info.aduna/commons/iteration/tags/2.7.0 + http://repo.aduna-software.org/websvn/listing.php?repname=aduna&path=/info.aduna/commons/iteration/branches/2.7?repname=aduna&path=/info.aduna/commons/iteration/tags/2.7.0?repname=aduna&path=/info.aduna/commons/iteration/branches/2.7?repname=aduna&path=/info.aduna/commons/iteration/trunk/ + + + diff --git a/3rdParty/org.openrdf.sesame/META-INF/maven/info.aduna.commons/aduna-commons-lang/pom.properties b/3rdParty/org.openrdf.sesame/META-INF/maven/info.aduna.commons/aduna-commons-lang/pom.properties new file mode 100644 index 00000000..8fcf9d31 --- /dev/null +++ b/3rdParty/org.openrdf.sesame/META-INF/maven/info.aduna.commons/aduna-commons-lang/pom.properties @@ -0,0 +1,5 @@ +#Generated by org.apache.felix.bundleplugin +#Fri Jan 29 11:44:53 CET 2010 +version=2.8.0 +groupId=info.aduna.commons +artifactId=aduna-commons-lang diff --git a/3rdParty/org.openrdf.sesame/META-INF/maven/info.aduna.commons/aduna-commons-lang/pom.xml b/3rdParty/org.openrdf.sesame/META-INF/maven/info.aduna.commons/aduna-commons-lang/pom.xml new file mode 100644 index 00000000..55cfe180 --- /dev/null +++ b/3rdParty/org.openrdf.sesame/META-INF/maven/info.aduna.commons/aduna-commons-lang/pom.xml @@ -0,0 +1,68 @@ + + + 4.0.0 + + + info.aduna.commons + aduna-commons + 16 + ../../pom.xml + + + aduna-commons-lang + 2.8.0 + + Aduna Commons: Lang + Extensions to the Java lang package. + + + Aduna + http://www.aduna-software.com/ + + + + + Aduna BSD license + http://repo.aduna-software.org/legal/aduna-bsd.txt + repo + A BSD-style OSS license + + + + + + org.slf4j + slf4j-api + + + + + + + maven-jar-plugin + + + ${project.build.outputDirectory}/META-INF/MANIFEST.MF + + + + + org.apache.felix + maven-bundle-plugin + true + + + info.aduna.lang,info.aduna.lang.reflect,info.aduna.lang.service + + + + + + + + scm:svn:http://repo.aduna-software.org/svn/info.aduna/commons/lang/tags/2.8.0 + scm:svn:https://repo.aduna-software.org/svn/info.aduna/commons/lang/tags/2.8.0 + http://repo.aduna-software.org/websvn/listing.php?repname=aduna&path=/info.aduna/commons/lang/branches/2.8?repname=aduna&path=/info.aduna/commons/lang/tags/2.8.0?repname=aduna&path=/info.aduna/commons/lang/branches/2.8?repname=aduna&path=/info.aduna/commons/lang/trunk/ + + + diff --git a/3rdParty/org.openrdf.sesame/META-INF/maven/info.aduna.commons/aduna-commons-net/pom.properties b/3rdParty/org.openrdf.sesame/META-INF/maven/info.aduna.commons/aduna-commons-net/pom.properties new file mode 100644 index 00000000..a0f2c1fa --- /dev/null +++ b/3rdParty/org.openrdf.sesame/META-INF/maven/info.aduna.commons/aduna-commons-net/pom.properties @@ -0,0 +1,5 @@ +#Generated by org.apache.felix.bundleplugin +#Fri Jan 29 11:52:22 CET 2010 +version=2.6.0 +groupId=info.aduna.commons +artifactId=aduna-commons-net diff --git a/3rdParty/org.openrdf.sesame/META-INF/maven/info.aduna.commons/aduna-commons-net/pom.xml b/3rdParty/org.openrdf.sesame/META-INF/maven/info.aduna.commons/aduna-commons-net/pom.xml new file mode 100644 index 00000000..da461771 --- /dev/null +++ b/3rdParty/org.openrdf.sesame/META-INF/maven/info.aduna.commons/aduna-commons-net/pom.xml @@ -0,0 +1,69 @@ + + + 4.0.0 + + + info.aduna.commons + aduna-commons + 16 + ../../pom.xml + + + aduna-commons-net + 2.6.0 + + Aduna Commons: Net + Extensions to the Java networking functionality. + + + Aduna + http://www.aduna-software.com/ + + + + + Aduna BSD license + http://repo.aduna-software.org/legal/aduna-bsd.txt + repo + A BSD-style OSS license + + + + + + info.aduna.commons + aduna-commons-text + 2.6.0 + + + + + + + maven-jar-plugin + + + ${project.build.outputDirectory}/META-INF/MANIFEST.MF + + + + + org.apache.felix + maven-bundle-plugin + true + + + info.aduna.net,info.aduna.net.http + + + + + + + + scm:svn:http://repo.aduna-software.org/svn/info.aduna/commons/net/tags/2.6.0 + scm:svn:https://repo.aduna-software.org/svn/info.aduna/commons/net/tags/2.6.0 + http://repo.aduna-software.org/websvn/listing.php?repname=aduna&path=/info.aduna/commons/net/branches/2.6?repname=aduna&path=/info.aduna/commons/net/tags/2.6.0?repname=aduna&path=/info.aduna/commons/net/branches/2.6?repname=aduna&path=/info.aduna/commons/net/trunk/ + + + diff --git a/3rdParty/org.openrdf.sesame/META-INF/maven/info.aduna.commons/aduna-commons-platform-info/pom.properties b/3rdParty/org.openrdf.sesame/META-INF/maven/info.aduna.commons/aduna-commons-platform-info/pom.properties new file mode 100644 index 00000000..c1370539 --- /dev/null +++ b/3rdParty/org.openrdf.sesame/META-INF/maven/info.aduna.commons/aduna-commons-platform-info/pom.properties @@ -0,0 +1,5 @@ +#Generated by org.apache.felix.bundleplugin +#Fri Jan 29 13:27:44 CET 2010 +version=2.8.0 +groupId=info.aduna.commons +artifactId=aduna-commons-platform-info diff --git a/3rdParty/org.openrdf.sesame/META-INF/maven/info.aduna.commons/aduna-commons-platform-info/pom.xml b/3rdParty/org.openrdf.sesame/META-INF/maven/info.aduna.commons/aduna-commons-platform-info/pom.xml new file mode 100644 index 00000000..fc78afe1 --- /dev/null +++ b/3rdParty/org.openrdf.sesame/META-INF/maven/info.aduna.commons/aduna-commons-platform-info/pom.xml @@ -0,0 +1,60 @@ + + + 4.0.0 + + + info.aduna.commons + aduna-commons-platform + 2.8.0 + + + aduna-commons-platform-info + + Aduna Commons: Platform - Info + Platform information functionality. + + + Aduna + http://www.aduna-software.com/ + + + + + Aduna BSD license + http://repo.aduna-software.org/legal/aduna-bsd.txt + repo + A BSD-style OSS license + + + + + + org.slf4j + slf4j-api + + + + + + + maven-jar-plugin + + + ${project.build.outputDirectory}/META-INF/MANIFEST.MF + + + + + org.apache.felix + maven-bundle-plugin + true + + + info.aduna.platform,info.aduna.platform.support + + + + + + + diff --git a/3rdParty/org.openrdf.sesame/META-INF/maven/info.aduna.commons/aduna-commons-text/pom.properties b/3rdParty/org.openrdf.sesame/META-INF/maven/info.aduna.commons/aduna-commons-text/pom.properties new file mode 100644 index 00000000..ca76102c --- /dev/null +++ b/3rdParty/org.openrdf.sesame/META-INF/maven/info.aduna.commons/aduna-commons-text/pom.properties @@ -0,0 +1,5 @@ +#Generated by org.apache.felix.bundleplugin +#Fri Jan 29 11:49:27 CET 2010 +version=2.6.0 +groupId=info.aduna.commons +artifactId=aduna-commons-text diff --git a/3rdParty/org.openrdf.sesame/META-INF/maven/info.aduna.commons/aduna-commons-text/pom.xml b/3rdParty/org.openrdf.sesame/META-INF/maven/info.aduna.commons/aduna-commons-text/pom.xml new file mode 100644 index 00000000..ed523774 --- /dev/null +++ b/3rdParty/org.openrdf.sesame/META-INF/maven/info.aduna.commons/aduna-commons-text/pom.xml @@ -0,0 +1,61 @@ + + + 4.0.0 + + + info.aduna.commons + aduna-commons + 16 + ../../pom.xml + + + aduna-commons-text + 2.6.0 + + Aduna Commons: Text + Manipulate/transform/parse text in various ways. + + + Aduna + http://www.aduna-software.com/ + + + + + Aduna BSD license + http://repo.aduna-software.org/legal/aduna-bsd.txt + repo + A BSD-style OSS license + + + + + + + maven-jar-plugin + + + ${project.build.outputDirectory}/META-INF/MANIFEST.MF + + + + + org.apache.felix + maven-bundle-plugin + true + + + info.aduna.text + + + + + + + + scm:svn:http://repo.aduna-software.org/svn/info.aduna/commons/text/tags/2.6.0 + scm:svn:https://repo.aduna-software.org/svn/info.aduna/commons/text/tags/2.6.0 + http://repo.aduna-software.org/websvn/listing.php?repname=aduna&path=/info.aduna/commons/text/branches/2.6?repname=aduna&path=/info.aduna/commons/text/tags/2.6.0?repname=aduna&path=/info.aduna/commons/text/branches/2.6?repname=aduna&path=/info.aduna/commons/text/trunk/ + + + diff --git a/3rdParty/org.openrdf.sesame/META-INF/maven/info.aduna.commons/aduna-commons-webapp-core/pom.properties b/3rdParty/org.openrdf.sesame/META-INF/maven/info.aduna.commons/aduna-commons-webapp-core/pom.properties new file mode 100644 index 00000000..3cc74d80 --- /dev/null +++ b/3rdParty/org.openrdf.sesame/META-INF/maven/info.aduna.commons/aduna-commons-webapp-core/pom.properties @@ -0,0 +1,5 @@ +#Generated by org.apache.felix.bundleplugin +#Fri Jan 29 13:33:42 CET 2010 +version=2.8.0 +groupId=info.aduna.commons +artifactId=aduna-commons-webapp-core diff --git a/3rdParty/org.openrdf.sesame/META-INF/maven/info.aduna.commons/aduna-commons-webapp-core/pom.xml b/3rdParty/org.openrdf.sesame/META-INF/maven/info.aduna.commons/aduna-commons-webapp-core/pom.xml new file mode 100644 index 00000000..3a71a4ed --- /dev/null +++ b/3rdParty/org.openrdf.sesame/META-INF/maven/info.aduna.commons/aduna-commons-webapp-core/pom.xml @@ -0,0 +1,73 @@ + + + 4.0.0 + + + info.aduna.commons + aduna-commons-webapp + 2.8.0 + + + aduna-commons-webapp-core + + Aduna Commons: Webapp - Core + Core webapp functionality. + + + Aduna + http://www.aduna-software.com/ + + + + + Aduna BSD license + http://repo.aduna-software.org/legal/aduna-bsd.txt + repo + A BSD-style OSS license + + + + + + info.aduna.commons + aduna-commons-text + + + info.aduna.commons + aduna-commons-net + + + + javax.servlet + servlet-api + + + javax.activation + activation + + + + + + + maven-jar-plugin + + + ${project.build.outputDirectory}/META-INF/MANIFEST.MF + + + + + org.apache.felix + maven-bundle-plugin + true + + + info.aduna.webapp.* + + + + + + + diff --git a/3rdParty/org.openrdf.sesame/META-INF/maven/info.aduna.commons/aduna-commons-xml/pom.properties b/3rdParty/org.openrdf.sesame/META-INF/maven/info.aduna.commons/aduna-commons-xml/pom.properties new file mode 100644 index 00000000..73c59891 --- /dev/null +++ b/3rdParty/org.openrdf.sesame/META-INF/maven/info.aduna.commons/aduna-commons-xml/pom.properties @@ -0,0 +1,5 @@ +#Generated by org.apache.felix.bundleplugin +#Fri Jan 29 12:45:01 CET 2010 +version=2.6.0 +groupId=info.aduna.commons +artifactId=aduna-commons-xml diff --git a/3rdParty/org.openrdf.sesame/META-INF/maven/info.aduna.commons/aduna-commons-xml/pom.xml b/3rdParty/org.openrdf.sesame/META-INF/maven/info.aduna.commons/aduna-commons-xml/pom.xml new file mode 100644 index 00000000..3444942a --- /dev/null +++ b/3rdParty/org.openrdf.sesame/META-INF/maven/info.aduna.commons/aduna-commons-xml/pom.xml @@ -0,0 +1,74 @@ + + + 4.0.0 + + + info.aduna.commons + aduna-commons + 16 + ../../pom.xml + + + aduna-commons-xml + 2.6.0 + + Aduna Commons: XML + Extensions to the Java XML functionality. + + + Aduna + http://www.aduna-software.com/ + + + + + Aduna BSD license + http://repo.aduna-software.org/legal/aduna-bsd.txt + repo + A BSD-style OSS license + + + + + + info.aduna.commons + aduna-commons-text + 2.6.0 + + + + org.slf4j + slf4j-api + + + + + + + maven-jar-plugin + + + ${project.build.outputDirectory}/META-INF/MANIFEST.MF + + + + + org.apache.felix + maven-bundle-plugin + true + + + info.aduna.xml + + + + + + + + scm:svn:http://repo.aduna-software.org/svn/info.aduna/commons/xml/tags/2.6.0 + scm:svn:https://repo.aduna-software.org/svn/info.aduna/commons/xml/tags/2.6.0 + http://repo.aduna-software.org/websvn/listing.php?repname=aduna&path=/info.aduna/commons/xml/branches/2.6?repname=aduna&path=/info.aduna/commons/xml/tags/2.6.0?repname=aduna&path=/info.aduna/commons/xml/branches/2.6?repname=aduna&path=/info.aduna/commons/xml/trunk/ + + + diff --git a/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-console/pom.properties b/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-console/pom.properties new file mode 100644 index 00000000..8d7dae99 --- /dev/null +++ b/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-console/pom.properties @@ -0,0 +1,5 @@ +#Generated by Maven +#Fri Jan 29 20:28:39 CET 2010 +version=2.3.1 +groupId=org.openrdf.sesame +artifactId=sesame-console diff --git a/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-console/pom.xml b/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-console/pom.xml new file mode 100644 index 00000000..d5e8b133 --- /dev/null +++ b/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-console/pom.xml @@ -0,0 +1,98 @@ + + + 4.0.0 + + + org.openrdf.sesame + sesame-core + 2.3.1 + + + sesame-console + + OpenRDF Sesame: Console + Command line user interface to Sesame repositories. + + + + org.openrdf.sesame + sesame-runtime + + + + org.openrdf.sesame + sesame-queryparser-serql + + + org.openrdf.sesame + sesame-queryparser-sparql + + + org.openrdf.sesame + sesame-rio-ntriples + + + + info.aduna.appbase + aduna-appbase-core + + + + info.aduna.commons + aduna-commons-iteration + + + info.aduna.commons + aduna-commons-io + + + info.aduna.commons + aduna-commons-text + + + + commons-cli + commons-cli + + + + org.slf4j + slf4j-jdk14 + runtime + true + + + org.slf4j + jcl-over-slf4j + runtime + true + + + + + + + org.apache.maven.plugins + maven-jar-plugin + + + + org.openrdf.console.Console + org.openrdf.console + true + + + + + + + + + + + scm:svn:https://repo.aduna-software.org/svn/org.openrdf/sesame/tags/2.3.1/core/console + scm:svn:https://repo.aduna-software.org/svn/org.openrdf/sesame/tags/2.3.1/core/console + http://repo.aduna-software.org/websvn/listing.php?repname=aduna&path=/org.openrdf/sesame/tags/2.3.1/core/console?repname=aduna&path=/org.openrdf/sesame/branches/2.3/core/console/ + + + diff --git a/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-http-client/pom.properties b/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-http-client/pom.properties new file mode 100644 index 00000000..54b40900 --- /dev/null +++ b/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-http-client/pom.properties @@ -0,0 +1,5 @@ +#Generated by Maven +#Fri Jan 29 20:28:08 CET 2010 +version=2.3.1 +groupId=org.openrdf.sesame +artifactId=sesame-http-client diff --git a/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-http-client/pom.xml b/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-http-client/pom.xml new file mode 100644 index 00000000..279aa34a --- /dev/null +++ b/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-http-client/pom.xml @@ -0,0 +1,77 @@ + + + 4.0.0 + + + org.openrdf.sesame + sesame-http + 2.3.1 + + + sesame-http-client + + OpenRDF Sesame: HTTP client + Client functionality for communicating with an OpenRDF server over HTTP. + + + + org.openrdf.sesame + sesame-http-protocol + + + org.openrdf.sesame + sesame-query + + + org.openrdf.sesame + sesame-queryresultio-api + + + org.openrdf.sesame + sesame-rio-api + + + org.openrdf.sesame + sesame-model + + + org.openrdf.sesame + sesame-repository-api + + + + info.aduna.commons + aduna-commons-io + + + info.aduna.commons + aduna-commons-net + + + info.aduna.commons + aduna-commons-io + + + + commons-httpclient + commons-httpclient + + + + commons-codec + commons-codec + + + + org.slf4j + slf4j-api + + + + + scm:svn:https://repo.aduna-software.org/svn/org.openrdf/sesame/tags/2.3.1/core/http/client + scm:svn:https://repo.aduna-software.org/svn/org.openrdf/sesame/tags/2.3.1/core/http/client + http://repo.aduna-software.org/websvn/listing.php?repname=aduna&path=/org.openrdf/sesame/tags/2.3.1/core/http/client?repname=aduna&path=/org.openrdf/sesame/branches/2.3/core/http/client/ + + + diff --git a/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-http-protocol/pom.properties b/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-http-protocol/pom.properties new file mode 100644 index 00000000..7433b988 --- /dev/null +++ b/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-http-protocol/pom.properties @@ -0,0 +1,5 @@ +#Generated by Maven +#Fri Jan 29 20:28:06 CET 2010 +version=2.3.1 +groupId=org.openrdf.sesame +artifactId=sesame-http-protocol diff --git a/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-http-protocol/pom.xml b/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-http-protocol/pom.xml new file mode 100644 index 00000000..f09e6866 --- /dev/null +++ b/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-http-protocol/pom.xml @@ -0,0 +1,51 @@ + + + 4.0.0 + + + org.openrdf.sesame + sesame-http + 2.3.1 + + + sesame-http-protocol + + OpenRDF Sesame: HTTP protocol + HTTP protocol (REST-style) + + + + org.openrdf.sesame + sesame-repository-api + + + org.openrdf.sesame + sesame-rio-ntriples + + + org.openrdf.sesame + sesame-model + + + + info.aduna.commons + aduna-commons-lang + + + info.aduna.commons + aduna-commons-xml + + + + junit + junit + + + + + scm:svn:https://repo.aduna-software.org/svn/org.openrdf/sesame/tags/2.3.1/core/http/protocol + scm:svn:https://repo.aduna-software.org/svn/org.openrdf/sesame/tags/2.3.1/core/http/protocol + http://repo.aduna-software.org/websvn/listing.php?repname=aduna&path=/org.openrdf/sesame/tags/2.3.1/core/http/protocol?repname=aduna&path=/org.openrdf/sesame/branches/2.3/core/http/protocol/ + + + \ No newline at end of file diff --git a/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-http-server-spring/pom.properties b/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-http-server-spring/pom.properties new file mode 100644 index 00000000..11fa00c9 --- /dev/null +++ b/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-http-server-spring/pom.properties @@ -0,0 +1,5 @@ +#Generated by Maven +#Fri Jan 29 20:28:41 CET 2010 +version=2.3.1 +groupId=org.openrdf.sesame +artifactId=sesame-http-server-spring diff --git a/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-http-server-spring/pom.xml b/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-http-server-spring/pom.xml new file mode 100644 index 00000000..46feaf7d --- /dev/null +++ b/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-http-server-spring/pom.xml @@ -0,0 +1,76 @@ + + + 4.0.0 + + + org.openrdf.sesame + sesame-http + 2.3.1 + + + sesame-http-server-spring + + OpenRDF Sesame: HTTP server - core + HTTP server implementing a REST-style protocol + + + + org.openrdf.sesame + sesame-runtime + + + + info.aduna.appbase + aduna-appbase-webapp-base-core + + + + info.aduna.commons + aduna-commons-collections + + + info.aduna.commons + aduna-commons-iteration + + + info.aduna.commons + aduna-commons-io + + + info.aduna.commons + aduna-commons-webapp-core + + + + javax.servlet + servlet-api + + + + org.springframework + spring-aop + runtime + + + org.springframework + spring-webmvc + + + + cglib + cglib + + + + org.slf4j + slf4j-api + + + + + scm:svn:https://repo.aduna-software.org/svn/org.openrdf/sesame/tags/2.3.1/core/http/server-spring + scm:svn:https://repo.aduna-software.org/svn/org.openrdf/sesame/tags/2.3.1/core/http/server-spring + http://repo.aduna-software.org/websvn/listing.php?repname=aduna&path=/org.openrdf/sesame/tags/2.3.1/core/http/server-spring?repname=aduna&path=/org.openrdf/sesame/branches/2.3/core/http/server-spring/ + + + diff --git a/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-model/pom.properties b/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-model/pom.properties new file mode 100644 index 00000000..597dd91f --- /dev/null +++ b/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-model/pom.properties @@ -0,0 +1,5 @@ +#Generated by Maven +#Fri Jan 29 20:27:24 CET 2010 +version=2.3.1 +groupId=org.openrdf.sesame +artifactId=sesame-model diff --git a/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-model/pom.xml b/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-model/pom.xml new file mode 100644 index 00000000..fdd1adbe --- /dev/null +++ b/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-model/pom.xml @@ -0,0 +1,38 @@ + + + 4.0.0 + + + org.openrdf.sesame + sesame-core + 2.3.1 + + + sesame-model + + OpenRDF Sesame: Model + RDF model interfaces and implementations. + + + + info.aduna.commons + aduna-commons-collections + + + info.aduna.commons + aduna-commons-i18n + + + + junit + junit + + + + + scm:svn:https://repo.aduna-software.org/svn/org.openrdf/sesame/tags/2.3.1/core/model + scm:svn:https://repo.aduna-software.org/svn/org.openrdf/sesame/tags/2.3.1/core/model + http://repo.aduna-software.org/websvn/listing.php?repname=aduna&path=/org.openrdf/sesame/tags/2.3.1/core/model?repname=aduna&path=/org.openrdf/sesame/branches/2.3/core/model/ + + + diff --git a/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-query/pom.properties b/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-query/pom.properties new file mode 100644 index 00000000..91cfeea0 --- /dev/null +++ b/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-query/pom.properties @@ -0,0 +1,5 @@ +#Generated by Maven +#Fri Jan 29 20:27:27 CET 2010 +version=2.3.1 +groupId=org.openrdf.sesame +artifactId=sesame-query diff --git a/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-query/pom.xml b/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-query/pom.xml new file mode 100644 index 00000000..4e6a4336 --- /dev/null +++ b/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-query/pom.xml @@ -0,0 +1,44 @@ + + + 4.0.0 + + + org.openrdf.sesame + sesame-core + 2.3.1 + + + sesame-query + + OpenRDF Sesame: Query + Query interfaces and implementations + + + + org.openrdf.sesame + sesame-model + + + org.openrdf.sesame + sesame-rio-api + + + + info.aduna.commons + aduna-commons-iteration + + + + junit + junit + + + + + + scm:svn:https://repo.aduna-software.org/svn/org.openrdf/sesame/tags/2.3.1/core/query + scm:svn:https://repo.aduna-software.org/svn/org.openrdf/sesame/tags/2.3.1/core/query + http://repo.aduna-software.org/websvn/listing.php?repname=aduna&path=/org.openrdf/sesame/tags/2.3.1/core/query?repname=aduna&path=/org.openrdf/sesame/branches/2.3/core/query/ + + + diff --git a/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-queryalgebra-evaluation/pom.properties b/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-queryalgebra-evaluation/pom.properties new file mode 100644 index 00000000..ccc88f0d --- /dev/null +++ b/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-queryalgebra-evaluation/pom.properties @@ -0,0 +1,5 @@ +#Generated by Maven +#Fri Jan 29 20:28:00 CET 2010 +version=2.3.1 +groupId=org.openrdf.sesame +artifactId=sesame-queryalgebra-evaluation diff --git a/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-queryalgebra-evaluation/pom.xml b/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-queryalgebra-evaluation/pom.xml new file mode 100644 index 00000000..8ec9077f --- /dev/null +++ b/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-queryalgebra-evaluation/pom.xml @@ -0,0 +1,65 @@ + + + 4.0.0 + + + org.openrdf.sesame + sesame-queryalgebra + 2.3.1 + + + sesame-queryalgebra-evaluation + + OpenRDF Sesame: Query algebra - evaluation + Evaluation strategy API and implementations for the query algebra model. + + + + org.openrdf.sesame + sesame-queryalgebra-model + + + org.openrdf.sesame + sesame-model + + + org.openrdf.sesame + sesame-query + + + + info.aduna.commons + aduna-commons-collections + + + info.aduna.commons + aduna-commons-iteration + + + info.aduna.commons + aduna-commons-lang + + + + org.slf4j + slf4j-api + + + ch.qos.logback + logback-classic + test + + + + junit + junit + + + + + scm:svn:https://repo.aduna-software.org/svn/org.openrdf/sesame/tags/2.3.1/core/queryalgebra/evaluation + scm:svn:https://repo.aduna-software.org/svn/org.openrdf/sesame/tags/2.3.1/core/queryalgebra/evaluation + http://repo.aduna-software.org/websvn/listing.php?repname=aduna&path=/org.openrdf/sesame/tags/2.3.1/core/queryalgebra/evaluation?repname=aduna&path=/org.openrdf/sesame/branches/2.3/core/queryalgebra/evaluation/ + + + diff --git a/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-queryalgebra-model/pom.properties b/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-queryalgebra-model/pom.properties new file mode 100644 index 00000000..9aef143a --- /dev/null +++ b/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-queryalgebra-model/pom.properties @@ -0,0 +1,5 @@ +#Generated by Maven +#Fri Jan 29 20:27:30 CET 2010 +version=2.3.1 +groupId=org.openrdf.sesame +artifactId=sesame-queryalgebra-model diff --git a/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-queryalgebra-model/pom.xml b/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-queryalgebra-model/pom.xml new file mode 100644 index 00000000..a1aaa7a5 --- /dev/null +++ b/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-queryalgebra-model/pom.xml @@ -0,0 +1,33 @@ + + + 4.0.0 + + + org.openrdf.sesame + sesame-core + 2.3.1 + + + sesame-queryalgebra-model + + OpenRDF Sesame: Query algebra - model + A generic query algebra for RDF queries. + + + + org.openrdf.sesame + sesame-model + + + info.aduna.commons + aduna-commons-collections + + + + + scm:svn:https://repo.aduna-software.org/svn/org.openrdf/sesame/tags/2.3.1/core/queryalgebra/model + scm:svn:https://repo.aduna-software.org/svn/org.openrdf/sesame/tags/2.3.1/core/queryalgebra/model + http://repo.aduna-software.org/websvn/listing.php?repname=aduna&path=/org.openrdf/sesame/tags/2.3.1/core/queryalgebra/model?repname=aduna&path=/org.openrdf/sesame/branches/2.3/core/queryalgebra/model/ + + + diff --git a/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-queryparser-api/pom.properties b/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-queryparser-api/pom.properties new file mode 100644 index 00000000..3bee8843 --- /dev/null +++ b/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-queryparser-api/pom.properties @@ -0,0 +1,5 @@ +#Generated by Maven +#Fri Jan 29 20:27:31 CET 2010 +version=2.3.1 +groupId=org.openrdf.sesame +artifactId=sesame-queryparser-api diff --git a/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-queryparser-api/pom.xml b/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-queryparser-api/pom.xml new file mode 100644 index 00000000..e9a2cff8 --- /dev/null +++ b/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-queryparser-api/pom.xml @@ -0,0 +1,38 @@ + + + 4.0.0 + + + org.openrdf.sesame + sesame-queryparser + 2.3.1 + + + sesame-queryparser-api + + OpenRDF Sesame: Query parser - API + Query language parsers API. + + + + org.openrdf.sesame + sesame-query + + + org.openrdf.sesame + sesame-queryalgebra-model + + + + info.aduna.commons + aduna-commons-lang + + + + + scm:svn:https://repo.aduna-software.org/svn/org.openrdf/sesame/tags/2.3.1/core/queryparser/api + scm:svn:https://repo.aduna-software.org/svn/org.openrdf/sesame/tags/2.3.1/core/queryparser/api + http://repo.aduna-software.org/websvn/listing.php?repname=aduna&path=/org.openrdf/sesame/tags/2.3.1/core/queryparser/api?repname=aduna&path=/org.openrdf/sesame/branches/2.3/core/queryparser/api/ + + + \ No newline at end of file diff --git a/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-queryparser-serql/pom.properties b/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-queryparser-serql/pom.properties new file mode 100644 index 00000000..50b9f081 --- /dev/null +++ b/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-queryparser-serql/pom.properties @@ -0,0 +1,5 @@ +#Generated by Maven +#Fri Jan 29 20:27:33 CET 2010 +version=2.3.1 +groupId=org.openrdf.sesame +artifactId=sesame-queryparser-serql diff --git a/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-queryparser-serql/pom.xml b/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-queryparser-serql/pom.xml new file mode 100644 index 00000000..e598d0d6 --- /dev/null +++ b/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-queryparser-serql/pom.xml @@ -0,0 +1,55 @@ + + + 4.0.0 + + + org.openrdf.sesame + sesame-queryparser + 2.3.1 + + + sesame-queryparser-serql + + OpenRDF Sesame: Query parser - SeRQL + Query language parser implementation for SeRQL. + + + + org.openrdf.sesame + sesame-queryparser-api + + + org.openrdf.sesame + sesame-query + + + org.openrdf.sesame + sesame-queryalgebra-model + + + org.openrdf.sesame + sesame-model + + + + info.aduna.commons + aduna-commons-collections + + + info.aduna.commons + aduna-commons-text + + + + org.slf4j + slf4j-api + + + + + scm:svn:https://repo.aduna-software.org/svn/org.openrdf/sesame/tags/2.3.1/core/queryparser/serql + scm:svn:https://repo.aduna-software.org/svn/org.openrdf/sesame/tags/2.3.1/core/queryparser/serql + http://repo.aduna-software.org/websvn/listing.php?repname=aduna&path=/org.openrdf/sesame/tags/2.3.1/core/queryparser/serql?repname=aduna&path=/org.openrdf/sesame/branches/2.3/core/queryparser/serql/ + + + diff --git a/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-queryparser-sparql/pom.properties b/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-queryparser-sparql/pom.properties new file mode 100644 index 00000000..576f1d28 --- /dev/null +++ b/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-queryparser-sparql/pom.properties @@ -0,0 +1,5 @@ +#Generated by Maven +#Fri Jan 29 20:27:35 CET 2010 +version=2.3.1 +groupId=org.openrdf.sesame +artifactId=sesame-queryparser-sparql diff --git a/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-queryparser-sparql/pom.xml b/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-queryparser-sparql/pom.xml new file mode 100644 index 00000000..18b5b8fc --- /dev/null +++ b/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-queryparser-sparql/pom.xml @@ -0,0 +1,50 @@ + + + 4.0.0 + + + org.openrdf.sesame + sesame-queryparser + 2.3.1 + + + sesame-queryparser-sparql + + OpenRDF Sesame: Query parser - SPARQL + Query language parser implementation for SPARQL. + + + + org.openrdf.sesame + sesame-queryparser-api + + + org.openrdf.sesame + sesame-query + + + org.openrdf.sesame + sesame-queryalgebra-model + + + org.openrdf.sesame + sesame-model + + + + info.aduna.commons + aduna-commons-net + + + info.aduna.commons + aduna-commons-text + + + + + scm:svn:https://repo.aduna-software.org/svn/org.openrdf/sesame/tags/2.3.1/core/queryparser/sparql + scm:svn:https://repo.aduna-software.org/svn/org.openrdf/sesame/tags/2.3.1/core/queryparser/sparql + http://repo.aduna-software.org/websvn/listing.php?repname=aduna&path=/org.openrdf/sesame/tags/2.3.1/core/queryparser/sparql?repname=aduna&path=/org.openrdf/sesame/branches/2.3/core/queryparser/sparql/ + + + \ No newline at end of file diff --git a/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-queryresultio-api/pom.properties b/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-queryresultio-api/pom.properties new file mode 100644 index 00000000..6cea2e9c --- /dev/null +++ b/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-queryresultio-api/pom.properties @@ -0,0 +1,5 @@ +#Generated by Maven +#Fri Jan 29 20:27:37 CET 2010 +version=2.3.1 +groupId=org.openrdf.sesame +artifactId=sesame-queryresultio-api diff --git a/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-queryresultio-api/pom.xml b/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-queryresultio-api/pom.xml new file mode 100644 index 00000000..df882a60 --- /dev/null +++ b/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-queryresultio-api/pom.xml @@ -0,0 +1,42 @@ + + + 4.0.0 + + + org.openrdf.sesame + sesame-queryresultio + 2.3.1 + + + sesame-queryresultio-api + + OpenRDF Sesame: Query result IO - API + Query result IO API + + + + org.openrdf.sesame + sesame-model + + + org.openrdf.sesame + sesame-query + + + org.openrdf.sesame + sesame-rio-api + + + + info.aduna.commons + aduna-commons-lang + + + + + scm:svn:https://repo.aduna-software.org/svn/org.openrdf/sesame/tags/2.3.1/core/queryresultio/api + scm:svn:https://repo.aduna-software.org/svn/org.openrdf/sesame/tags/2.3.1/core/queryresultio/api + http://repo.aduna-software.org/websvn/listing.php?repname=aduna&path=/org.openrdf/sesame/tags/2.3.1/core/queryresultio/api?repname=aduna&path=/org.openrdf/sesame/branches/2.3/core/queryresultio/api/ + + + diff --git a/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-queryresultio-binary/pom.properties b/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-queryresultio-binary/pom.properties new file mode 100644 index 00000000..82c2307b --- /dev/null +++ b/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-queryresultio-binary/pom.properties @@ -0,0 +1,5 @@ +#Generated by Maven +#Fri Jan 29 20:27:39 CET 2010 +version=2.3.1 +groupId=org.openrdf.sesame +artifactId=sesame-queryresultio-binary diff --git a/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-queryresultio-binary/pom.xml b/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-queryresultio-binary/pom.xml new file mode 100644 index 00000000..7836ce06 --- /dev/null +++ b/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-queryresultio-binary/pom.xml @@ -0,0 +1,54 @@ + + + 4.0.0 + + + org.openrdf.sesame + sesame-queryresultio + 2.3.1 + + + sesame-queryresultio-binary + + OpenRDF Sesame: Query result IO - binary + Query result parser and writer implementation for OpenRDF's binary query results format. + + + + org.openrdf.sesame + sesame-queryresultio-api + + + org.openrdf.sesame + sesame-query + + + org.openrdf.sesame + sesame-model + + + + info.aduna.commons + aduna-commons-io + + + + junit + junit + test + + + + ch.qos.logback + logback-classic + test + + + + + scm:svn:https://repo.aduna-software.org/svn/org.openrdf/sesame/tags/2.3.1/core/queryresultio/binary + scm:svn:https://repo.aduna-software.org/svn/org.openrdf/sesame/tags/2.3.1/core/queryresultio/binary + http://repo.aduna-software.org/websvn/listing.php?repname=aduna&path=/org.openrdf/sesame/tags/2.3.1/core/queryresultio/binary?repname=aduna&path=/org.openrdf/sesame/branches/2.3/core/queryresultio/binary/ + + + \ No newline at end of file diff --git a/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-queryresultio-sparqljson/pom.properties b/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-queryresultio-sparqljson/pom.properties new file mode 100644 index 00000000..b3e41697 --- /dev/null +++ b/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-queryresultio-sparqljson/pom.properties @@ -0,0 +1,5 @@ +#Generated by Maven +#Fri Jan 29 20:27:40 CET 2010 +version=2.3.1 +groupId=org.openrdf.sesame +artifactId=sesame-queryresultio-sparqljson diff --git a/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-queryresultio-sparqljson/pom.xml b/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-queryresultio-sparqljson/pom.xml new file mode 100644 index 00000000..2997822b --- /dev/null +++ b/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-queryresultio-sparqljson/pom.xml @@ -0,0 +1,46 @@ + + + 4.0.0 + + + org.openrdf.sesame + sesame-queryresultio + 2.3.1 + + + sesame-queryresultio-sparqljson + + OpenRDF Sesame: Query result IO - SPARQL/JSON + Query result writer implementation for the SPARQL Query Results JSON Format. + + + + org.openrdf.sesame + sesame-queryresultio-api + + + org.openrdf.sesame + sesame-query + + + org.openrdf.sesame + sesame-model + + + + info.aduna.commons + aduna-commons-io + + + info.aduna.commons + aduna-commons-text + + + + + scm:svn:https://repo.aduna-software.org/svn/org.openrdf/sesame/tags/2.3.1/core/queryresultio/sparqljson + scm:svn:https://repo.aduna-software.org/svn/org.openrdf/sesame/tags/2.3.1/core/queryresultio/sparqljson + http://repo.aduna-software.org/websvn/listing.php?repname=aduna&path=/org.openrdf/sesame/tags/2.3.1/core/queryresultio/sparqljson?repname=aduna&path=/org.openrdf/sesame/branches/2.3/core/queryresultio/sparqljson/ + + + \ No newline at end of file diff --git a/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-queryresultio-sparqlxml/pom.properties b/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-queryresultio-sparqlxml/pom.properties new file mode 100644 index 00000000..698ad7b0 --- /dev/null +++ b/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-queryresultio-sparqlxml/pom.properties @@ -0,0 +1,5 @@ +#Generated by Maven +#Fri Jan 29 20:27:43 CET 2010 +version=2.3.1 +groupId=org.openrdf.sesame +artifactId=sesame-queryresultio-sparqlxml diff --git a/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-queryresultio-sparqlxml/pom.xml b/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-queryresultio-sparqlxml/pom.xml new file mode 100644 index 00000000..9eeaf883 --- /dev/null +++ b/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-queryresultio-sparqlxml/pom.xml @@ -0,0 +1,54 @@ + + + 4.0.0 + + + org.openrdf.sesame + sesame-queryresultio + 2.3.1 + + + sesame-queryresultio-sparqlxml + + OpenRDF Sesame: Query result IO - SPARQL/XML + Query result parser and writer implementation for the SPARQL Query Results XML Format. + + + + org.openrdf.sesame + sesame-queryresultio-api + + + org.openrdf.sesame + sesame-query + + + org.openrdf.sesame + sesame-model + + + + info.aduna.commons + aduna-commons-xml + + + + junit + junit + test + + + + ch.qos.logback + logback-classic + test + + + + + scm:svn:https://repo.aduna-software.org/svn/org.openrdf/sesame/tags/2.3.1/core/queryresultio/sparqlxml + scm:svn:https://repo.aduna-software.org/svn/org.openrdf/sesame/tags/2.3.1/core/queryresultio/sparqlxml + http://repo.aduna-software.org/websvn/listing.php?repname=aduna&path=/org.openrdf/sesame/tags/2.3.1/core/queryresultio/sparqlxml?repname=aduna&path=/org.openrdf/sesame/branches/2.3/core/queryresultio/sparqlxml/ + + + \ No newline at end of file diff --git a/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-queryresultio-text/pom.properties b/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-queryresultio-text/pom.properties new file mode 100644 index 00000000..387896a9 --- /dev/null +++ b/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-queryresultio-text/pom.properties @@ -0,0 +1,5 @@ +#Generated by Maven +#Fri Jan 29 20:27:45 CET 2010 +version=2.3.1 +groupId=org.openrdf.sesame +artifactId=sesame-queryresultio-text diff --git a/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-queryresultio-text/pom.xml b/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-queryresultio-text/pom.xml new file mode 100644 index 00000000..d5d02874 --- /dev/null +++ b/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-queryresultio-text/pom.xml @@ -0,0 +1,50 @@ + + + 4.0.0 + + + org.openrdf.sesame + sesame-queryresultio + 2.3.1 + + + sesame-queryresultio-text + + OpenRDF Sesame: Query result IO - plain text booleans + Query result parser and writer implementation for OpenRDF's plain text boolean query results format. + + + + org.openrdf.sesame + sesame-queryresultio-api + + + org.openrdf.sesame + sesame-query + + + + info.aduna.commons + aduna-commons-io + + + + junit + junit + test + + + + ch.qos.logback + logback-classic + test + + + + + scm:svn:https://repo.aduna-software.org/svn/org.openrdf/sesame/tags/2.3.1/core/queryresultio/text + scm:svn:https://repo.aduna-software.org/svn/org.openrdf/sesame/tags/2.3.1/core/queryresultio/text + http://repo.aduna-software.org/websvn/listing.php?repname=aduna&path=/org.openrdf/sesame/tags/2.3.1/core/queryresultio/text?repname=aduna&path=/org.openrdf/sesame/branches/2.3/core/queryresultio/text/ + + + \ No newline at end of file diff --git a/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-repository-api/pom.properties b/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-repository-api/pom.properties new file mode 100644 index 00000000..8e52fca3 --- /dev/null +++ b/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-repository-api/pom.properties @@ -0,0 +1,5 @@ +#Generated by Maven +#Fri Jan 29 20:27:47 CET 2010 +version=2.3.1 +groupId=org.openrdf.sesame +artifactId=sesame-repository-api diff --git a/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-repository-api/pom.xml b/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-repository-api/pom.xml new file mode 100644 index 00000000..2b321289 --- /dev/null +++ b/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-repository-api/pom.xml @@ -0,0 +1,55 @@ + + + 4.0.0 + + + org.openrdf.sesame + sesame-repository + 2.3.1 + + + sesame-repository-api + + OpenRDF Sesame: Repository - API + API for interacting with repositories of RDF data. + + + + org.openrdf.sesame + sesame-query + + + org.openrdf.sesame + sesame-rio-api + + + org.openrdf.sesame + sesame-model + + + + info.aduna.commons + aduna-commons-iteration + + + info.aduna.commons + aduna-commons-lang + + + info.aduna.commons + aduna-commons-io + + + + org.slf4j + slf4j-api + + + + + scm:svn:https://repo.aduna-software.org/svn/org.openrdf/sesame/tags/2.3.1/core/repository/api + scm:svn:https://repo.aduna-software.org/svn/org.openrdf/sesame/tags/2.3.1/core/repository/api + http://repo.aduna-software.org/websvn/listing.php?repname=aduna&path=/org.openrdf/sesame/tags/2.3.1/core/repository/api?repname=aduna&path=/org.openrdf/sesame/branches/2.3/core/repository/api/ + + + diff --git a/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-repository-contextaware/pom.properties b/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-repository-contextaware/pom.properties new file mode 100644 index 00000000..3f1ac9e0 --- /dev/null +++ b/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-repository-contextaware/pom.properties @@ -0,0 +1,5 @@ +#Generated by Maven +#Fri Jan 29 20:28:14 CET 2010 +version=2.3.1 +groupId=org.openrdf.sesame +artifactId=sesame-repository-contextaware diff --git a/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-repository-contextaware/pom.xml b/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-repository-contextaware/pom.xml new file mode 100644 index 00000000..909f1f1e --- /dev/null +++ b/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-repository-contextaware/pom.xml @@ -0,0 +1,56 @@ + + + 4.0.0 + + + org.openrdf.sesame + sesame-repository + 2.3.1 + + + sesame-repository-contextaware + + OpenRDF Sesame: Repository - context aware (wrapper) + Implementation that allows default values to be set on a wrapped repository + + + + org.openrdf.sesame + sesame-repository-api + + + org.openrdf.sesame + sesame-query + + + org.openrdf.sesame + sesame-rio-api + + + org.openrdf.sesame + sesame-model + + + + info.aduna.commons + aduna-commons-iteration + + + + junit + junit + + + ch.qos.logback + logback-classic + test + + + + + scm:svn:https://repo.aduna-software.org/svn/org.openrdf/sesame/tags/2.3.1/core/repository/contextaware + scm:svn:https://repo.aduna-software.org/svn/org.openrdf/sesame/tags/2.3.1/core/repository/contextaware + http://repo.aduna-software.org/websvn/listing.php?repname=aduna&path=/org.openrdf/sesame/tags/2.3.1/core/repository/contextaware?repname=aduna&path=/org.openrdf/sesame/branches/2.3/core/repository/contextaware/ + + + \ No newline at end of file diff --git a/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-repository-dataset/pom.properties b/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-repository-dataset/pom.properties new file mode 100644 index 00000000..02e9a5d7 --- /dev/null +++ b/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-repository-dataset/pom.properties @@ -0,0 +1,5 @@ +#Generated by Maven +#Fri Jan 29 20:28:12 CET 2010 +version=2.3.1 +groupId=org.openrdf.sesame +artifactId=sesame-repository-dataset diff --git a/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-repository-dataset/pom.xml b/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-repository-dataset/pom.xml new file mode 100644 index 00000000..4ee25a75 --- /dev/null +++ b/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-repository-dataset/pom.xml @@ -0,0 +1,45 @@ + + + 4.0.0 + + + org.openrdf.sesame + sesame-repository + 2.3.1 + + + sesame-repository-dataset + + OpenRDF Sesame: DatasetRepository (wrapper) + Implementation that loads all referenced datasets into a wrapped repository + + + + org.openrdf.sesame + sesame-repository-sail + + + org.openrdf.sesame + sesame-repository-api + + + org.openrdf.sesame + sesame-rio-api + + + org.openrdf.sesame + sesame-query + + + org.openrdf.sesame + sesame-model + + + + + scm:svn:https://repo.aduna-software.org/svn/org.openrdf/sesame/tags/2.3.1/core/repository/dataset + scm:svn:https://repo.aduna-software.org/svn/org.openrdf/sesame/tags/2.3.1/core/repository/dataset + http://repo.aduna-software.org/websvn/listing.php?repname=aduna&path=/org.openrdf/sesame/tags/2.3.1/core/repository/dataset?repname=aduna&path=/org.openrdf/sesame/branches/2.3/core/repository/dataset/ + + + \ No newline at end of file diff --git a/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-repository-event/pom.properties b/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-repository-event/pom.properties new file mode 100644 index 00000000..62f27979 --- /dev/null +++ b/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-repository-event/pom.properties @@ -0,0 +1,5 @@ +#Generated by Maven +#Fri Jan 29 20:27:48 CET 2010 +version=2.3.1 +groupId=org.openrdf.sesame +artifactId=sesame-repository-event diff --git a/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-repository-event/pom.xml b/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-repository-event/pom.xml new file mode 100644 index 00000000..d3da08b3 --- /dev/null +++ b/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-repository-event/pom.xml @@ -0,0 +1,33 @@ + + + 4.0.0 + + + org.openrdf.sesame + sesame-repository + 2.3.1 + + + sesame-repository-event + + OpenRDF Sesame: Repository - event (wrapper) + Implementation that notifies listeners of events on a wrapped repository + + + + org.openrdf.sesame + sesame-repository-api + + + org.openrdf.sesame + sesame-model + + + + + scm:svn:https://repo.aduna-software.org/svn/org.openrdf/sesame/tags/2.3.1/core/repository/event + scm:svn:https://repo.aduna-software.org/svn/org.openrdf/sesame/tags/2.3.1/core/repository/event + http://repo.aduna-software.org/websvn/listing.php?repname=aduna&path=/org.openrdf/sesame/tags/2.3.1/core/repository/event?repname=aduna&path=/org.openrdf/sesame/branches/2.3/core/repository/event/ + + + \ No newline at end of file diff --git a/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-repository-http/pom.properties b/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-repository-http/pom.properties new file mode 100644 index 00000000..55ceabd1 --- /dev/null +++ b/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-repository-http/pom.properties @@ -0,0 +1,5 @@ +#Generated by Maven +#Fri Jan 29 20:28:09 CET 2010 +version=2.3.1 +groupId=org.openrdf.sesame +artifactId=sesame-repository-http diff --git a/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-repository-http/pom.xml b/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-repository-http/pom.xml new file mode 100644 index 00000000..ba22af42 --- /dev/null +++ b/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-repository-http/pom.xml @@ -0,0 +1,63 @@ + + + 4.0.0 + + + org.openrdf.sesame + sesame-repository + 2.3.1 + + + sesame-repository-http + + OpenRDF Sesame: HTTPRepository + "Virtual" repository that communicates with a (remote) repository over the HTTP protocol. + + + + org.openrdf.sesame + sesame-repository-api + + + org.openrdf.sesame + sesame-http-client + + + org.openrdf.sesame + sesame-http-protocol + + + org.openrdf.sesame + sesame-query + + + org.openrdf.sesame + sesame-queryresultio-api + + + org.openrdf.sesame + sesame-rio-api + + + org.openrdf.sesame + sesame-model + + + + info.aduna.commons + aduna-commons-iteration + + + + org.slf4j + slf4j-api + + + + + scm:svn:https://repo.aduna-software.org/svn/org.openrdf/sesame/tags/2.3.1/core/repository/http + scm:svn:https://repo.aduna-software.org/svn/org.openrdf/sesame/tags/2.3.1/core/repository/http + http://repo.aduna-software.org/websvn/listing.php?repname=aduna&path=/org.openrdf/sesame/tags/2.3.1/core/repository/http?repname=aduna&path=/org.openrdf/sesame/branches/2.3/core/repository/http/ + + + diff --git a/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-repository-manager/pom.properties b/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-repository-manager/pom.properties new file mode 100644 index 00000000..7258557a --- /dev/null +++ b/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-repository-manager/pom.properties @@ -0,0 +1,5 @@ +#Generated by Maven +#Fri Jan 29 20:28:10 CET 2010 +version=2.3.1 +groupId=org.openrdf.sesame +artifactId=sesame-repository-manager diff --git a/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-repository-manager/pom.xml b/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-repository-manager/pom.xml new file mode 100644 index 00000000..966753b0 --- /dev/null +++ b/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-repository-manager/pom.xml @@ -0,0 +1,75 @@ + + + 4.0.0 + + + org.openrdf.sesame + sesame-repository + 2.3.1 + + + sesame-repository-manager + + OpenRDF Sesame: Repository manager + Repository manager + + + + org.openrdf.sesame + sesame-repository-api + + + org.openrdf.sesame + sesame-repository-event + + + org.openrdf.sesame + sesame-repository-sail + + + org.openrdf.sesame + sesame-sail-api + + + org.openrdf.sesame + sesame-sail-memory + + + org.openrdf.sesame + sesame-repository-http + + + org.openrdf.sesame + sesame-http-client + + + org.openrdf.sesame + sesame-http-protocol + + + org.openrdf.sesame + sesame-query + + + org.openrdf.sesame + sesame-model + + + + info.aduna.commons + aduna-commons-io + + + + org.slf4j + slf4j-api + + + + + scm:svn:https://repo.aduna-software.org/svn/org.openrdf/sesame/tags/2.3.1/core/repository/manager + scm:svn:https://repo.aduna-software.org/svn/org.openrdf/sesame/tags/2.3.1/core/repository/manager + http://repo.aduna-software.org/websvn/listing.php?repname=aduna&path=/org.openrdf/sesame/tags/2.3.1/core/repository/manager?repname=aduna&path=/org.openrdf/sesame/branches/2.3/core/repository/manager/ + + + \ No newline at end of file diff --git a/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-repository-sail/pom.properties b/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-repository-sail/pom.properties new file mode 100644 index 00000000..9915f693 --- /dev/null +++ b/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-repository-sail/pom.properties @@ -0,0 +1,5 @@ +#Generated by Maven +#Fri Jan 29 20:27:51 CET 2010 +version=2.3.1 +groupId=org.openrdf.sesame +artifactId=sesame-repository-sail diff --git a/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-repository-sail/pom.xml b/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-repository-sail/pom.xml new file mode 100644 index 00000000..53b42656 --- /dev/null +++ b/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-repository-sail/pom.xml @@ -0,0 +1,58 @@ + + + 4.0.0 + + + org.openrdf.sesame + sesame-repository + 2.3.1 + + + sesame-repository-sail + + OpenRDF Sesame: SailRepository + Repository that uses a Sail stack. + + + + org.openrdf.sesame + sesame-repository-api + + + org.openrdf.sesame + sesame-sail-api + + + org.openrdf.sesame + sesame-queryparser-api + + + org.openrdf.sesame + sesame-queryalgebra-model + + + org.openrdf.sesame + sesame-query + + + org.openrdf.sesame + sesame-rio-api + + + org.openrdf.sesame + sesame-model + + + + info.aduna.commons + aduna-commons-iteration + + + + + scm:svn:https://repo.aduna-software.org/svn/org.openrdf/sesame/tags/2.3.1/core/repository/sail + scm:svn:https://repo.aduna-software.org/svn/org.openrdf/sesame/tags/2.3.1/core/repository/sail + http://repo.aduna-software.org/websvn/listing.php?repname=aduna&path=/org.openrdf/sesame/tags/2.3.1/core/repository/sail?repname=aduna&path=/org.openrdf/sesame/branches/2.3/core/repository/sail/ + + + diff --git a/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-rio-api/pom.properties b/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-rio-api/pom.properties new file mode 100644 index 00000000..e15faee3 --- /dev/null +++ b/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-rio-api/pom.properties @@ -0,0 +1,5 @@ +#Generated by Maven +#Fri Jan 29 20:27:25 CET 2010 +version=2.3.1 +groupId=org.openrdf.sesame +artifactId=sesame-rio-api diff --git a/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-rio-api/pom.xml b/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-rio-api/pom.xml new file mode 100644 index 00000000..ce54c27c --- /dev/null +++ b/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-rio-api/pom.xml @@ -0,0 +1,38 @@ + + + 4.0.0 + + + org.openrdf.sesame + sesame-rio + 2.3.1 + + + sesame-rio-api + + OpenRDF Sesame: Rio - API + Rio API. + + + + org.openrdf.sesame + sesame-model + + + + info.aduna.commons + aduna-commons-lang + + + info.aduna.commons + aduna-commons-net + + + + + scm:svn:https://repo.aduna-software.org/svn/org.openrdf/sesame/tags/2.3.1/core/rio/api + scm:svn:https://repo.aduna-software.org/svn/org.openrdf/sesame/tags/2.3.1/core/rio/api + http://repo.aduna-software.org/websvn/listing.php?repname=aduna&path=/org.openrdf/sesame/tags/2.3.1/core/rio/api?repname=aduna&path=/org.openrdf/sesame/branches/2.3/core/rio/api/ + + + \ No newline at end of file diff --git a/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-rio-n3/pom.properties b/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-rio-n3/pom.properties new file mode 100644 index 00000000..0215c223 --- /dev/null +++ b/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-rio-n3/pom.properties @@ -0,0 +1,5 @@ +#Generated by Maven +#Fri Jan 29 20:28:16 CET 2010 +version=2.3.1 +groupId=org.openrdf.sesame +artifactId=sesame-rio-n3 diff --git a/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-rio-n3/pom.xml b/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-rio-n3/pom.xml new file mode 100644 index 00000000..496ad861 --- /dev/null +++ b/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-rio-n3/pom.xml @@ -0,0 +1,37 @@ + + + 4.0.0 + + + org.openrdf.sesame + sesame-rio + 2.3.1 + + + sesame-rio-n3 + + OpenRDF Sesame: Rio - N3 (writer-only) + Rio writer implementation for the N3 file format. + + + + org.openrdf.sesame + sesame-model + + + org.openrdf.sesame + sesame-rio-api + + + org.openrdf.sesame + sesame-rio-turtle + + + + + scm:svn:https://repo.aduna-software.org/svn/org.openrdf/sesame/tags/2.3.1/core/rio/n3 + scm:svn:https://repo.aduna-software.org/svn/org.openrdf/sesame/tags/2.3.1/core/rio/n3 + http://repo.aduna-software.org/websvn/listing.php?repname=aduna&path=/org.openrdf/sesame/tags/2.3.1/core/rio/n3?repname=aduna&path=/org.openrdf/sesame/branches/2.3/core/rio/n3/ + + + \ No newline at end of file diff --git a/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-rio-ntriples/pom.properties b/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-rio-ntriples/pom.properties new file mode 100644 index 00000000..a3c7e68c --- /dev/null +++ b/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-rio-ntriples/pom.properties @@ -0,0 +1,5 @@ +#Generated by Maven +#Fri Jan 29 20:28:04 CET 2010 +version=2.3.1 +groupId=org.openrdf.sesame +artifactId=sesame-rio-ntriples diff --git a/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-rio-ntriples/pom.xml b/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-rio-ntriples/pom.xml new file mode 100644 index 00000000..7c7b8a1b --- /dev/null +++ b/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-rio-ntriples/pom.xml @@ -0,0 +1,33 @@ + + + 4.0.0 + + + org.openrdf.sesame + sesame-rio + 2.3.1 + + + sesame-rio-ntriples + + OpenRDF Sesame: Rio - N-Triples + Rio parser and writer implementation for the N-Triples file format. + + + + org.openrdf.sesame + sesame-model + + + org.openrdf.sesame + sesame-rio-api + + + + + scm:svn:https://repo.aduna-software.org/svn/org.openrdf/sesame/tags/2.3.1/core/rio/ntriples + scm:svn:https://repo.aduna-software.org/svn/org.openrdf/sesame/tags/2.3.1/core/rio/ntriples + http://repo.aduna-software.org/websvn/listing.php?repname=aduna&path=/org.openrdf/sesame/tags/2.3.1/core/rio/ntriples?repname=aduna&path=/org.openrdf/sesame/branches/2.3/core/rio/ntriples/ + + + \ No newline at end of file diff --git a/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-rio-rdfxml/pom.properties b/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-rio-rdfxml/pom.properties new file mode 100644 index 00000000..fe3d0e3f --- /dev/null +++ b/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-rio-rdfxml/pom.properties @@ -0,0 +1,5 @@ +#Generated by Maven +#Fri Jan 29 20:28:18 CET 2010 +version=2.3.1 +groupId=org.openrdf.sesame +artifactId=sesame-rio-rdfxml diff --git a/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-rio-rdfxml/pom.xml b/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-rio-rdfxml/pom.xml new file mode 100644 index 00000000..3f998800 --- /dev/null +++ b/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-rio-rdfxml/pom.xml @@ -0,0 +1,42 @@ + + + 4.0.0 + + + org.openrdf.sesame + sesame-rio + 2.3.1 + + + sesame-rio-rdfxml + + OpenRDF Sesame: Rio - RDF/XML + Rio parser and writer implementation for the RDF/XML file format. + + + + org.openrdf.sesame + sesame-model + + + org.openrdf.sesame + sesame-rio-api + + + + info.aduna.commons + aduna-commons-net + + + info.aduna.commons + aduna-commons-xml + + + + + scm:svn:https://repo.aduna-software.org/svn/org.openrdf/sesame/tags/2.3.1/core/rio/rdfxml + scm:svn:https://repo.aduna-software.org/svn/org.openrdf/sesame/tags/2.3.1/core/rio/rdfxml + http://repo.aduna-software.org/websvn/listing.php?repname=aduna&path=/org.openrdf/sesame/tags/2.3.1/core/rio/rdfxml?repname=aduna&path=/org.openrdf/sesame/branches/2.3/core/rio/rdfxml/ + + + \ No newline at end of file diff --git a/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-rio-trig/pom.properties b/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-rio-trig/pom.properties new file mode 100644 index 00000000..4e6a609a --- /dev/null +++ b/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-rio-trig/pom.properties @@ -0,0 +1,5 @@ +#Generated by Maven +#Fri Jan 29 20:28:20 CET 2010 +version=2.3.1 +groupId=org.openrdf.sesame +artifactId=sesame-rio-trig diff --git a/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-rio-trig/pom.xml b/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-rio-trig/pom.xml new file mode 100644 index 00000000..6a7ec39b --- /dev/null +++ b/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-rio-trig/pom.xml @@ -0,0 +1,41 @@ + + + 4.0.0 + + + org.openrdf.sesame + sesame-rio + 2.3.1 + + + sesame-rio-trig + + OpenRDF Sesame: Rio - TriG + Rio parser and writer implementation for the TriG file format. + + + + org.openrdf.sesame + sesame-model + + + org.openrdf.sesame + sesame-rio-api + + + org.openrdf.sesame + sesame-rio-turtle + + + info.aduna.commons + aduna-commons-io + + + + + scm:svn:https://repo.aduna-software.org/svn/org.openrdf/sesame/tags/2.3.1/core/rio/trig + scm:svn:https://repo.aduna-software.org/svn/org.openrdf/sesame/tags/2.3.1/core/rio/trig + http://repo.aduna-software.org/websvn/listing.php?repname=aduna&path=/org.openrdf/sesame/tags/2.3.1/core/rio/trig?repname=aduna&path=/org.openrdf/sesame/branches/2.3/core/rio/trig/ + + + \ No newline at end of file diff --git a/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-rio-trix/pom.properties b/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-rio-trix/pom.properties new file mode 100644 index 00000000..1bdfb6c7 --- /dev/null +++ b/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-rio-trix/pom.properties @@ -0,0 +1,5 @@ +#Generated by Maven +#Fri Jan 29 20:28:19 CET 2010 +version=2.3.1 +groupId=org.openrdf.sesame +artifactId=sesame-rio-trix diff --git a/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-rio-trix/pom.xml b/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-rio-trix/pom.xml new file mode 100644 index 00000000..4cf42e08 --- /dev/null +++ b/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-rio-trix/pom.xml @@ -0,0 +1,38 @@ + + + 4.0.0 + + + org.openrdf.sesame + sesame-rio + 2.3.1 + + + sesame-rio-trix + + OpenRDF Sesame: Rio - TriX + Rio parser and writer implementation for the TriX file format. + + + + org.openrdf.sesame + sesame-model + + + org.openrdf.sesame + sesame-rio-api + + + + info.aduna.commons + aduna-commons-xml + + + + + scm:svn:https://repo.aduna-software.org/svn/org.openrdf/sesame/tags/2.3.1/core/rio/trix + scm:svn:https://repo.aduna-software.org/svn/org.openrdf/sesame/tags/2.3.1/core/rio/trix + http://repo.aduna-software.org/websvn/listing.php?repname=aduna&path=/org.openrdf/sesame/tags/2.3.1/core/rio/trix?repname=aduna&path=/org.openrdf/sesame/branches/2.3/core/rio/trix/ + + + \ No newline at end of file diff --git a/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-rio-turtle/pom.properties b/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-rio-turtle/pom.properties new file mode 100644 index 00000000..88903e4c --- /dev/null +++ b/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-rio-turtle/pom.properties @@ -0,0 +1,5 @@ +#Generated by Maven +#Fri Jan 29 20:28:15 CET 2010 +version=2.3.1 +groupId=org.openrdf.sesame +artifactId=sesame-rio-turtle diff --git a/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-rio-turtle/pom.xml b/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-rio-turtle/pom.xml new file mode 100644 index 00000000..196e7300 --- /dev/null +++ b/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-rio-turtle/pom.xml @@ -0,0 +1,43 @@ + + + 4.0.0 + + + org.openrdf.sesame + sesame-rio + 2.3.1 + + + sesame-rio-turtle + + OpenRDF Sesame: Rio - Turtle + Rio parser and writer implementation for the Turtle file format. + + + + org.openrdf.sesame + sesame-model + + + org.openrdf.sesame + sesame-rio-api + + + + info.aduna.commons + aduna-commons-io + + + + info.aduna.commons + aduna-commons-text + + + + + scm:svn:https://repo.aduna-software.org/svn/org.openrdf/sesame/tags/2.3.1/core/rio/turtle + scm:svn:https://repo.aduna-software.org/svn/org.openrdf/sesame/tags/2.3.1/core/rio/turtle + http://repo.aduna-software.org/websvn/listing.php?repname=aduna&path=/org.openrdf/sesame/tags/2.3.1/core/rio/turtle?repname=aduna&path=/org.openrdf/sesame/branches/2.3/core/rio/turtle/ + + + \ No newline at end of file diff --git a/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-runtime/pom.properties b/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-runtime/pom.properties new file mode 100644 index 00000000..11901c0d --- /dev/null +++ b/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-runtime/pom.properties @@ -0,0 +1,5 @@ +#Generated by Maven +#Fri Jan 29 20:28:37 CET 2010 +version=2.3.1 +groupId=org.openrdf.sesame +artifactId=sesame-runtime diff --git a/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-runtime/pom.xml b/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-runtime/pom.xml new file mode 100644 index 00000000..96704ae2 --- /dev/null +++ b/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-runtime/pom.xml @@ -0,0 +1,182 @@ + + + 4.0.0 + + + org.openrdf.sesame + sesame-core + 2.3.1 + + + sesame-runtime + + OpenRDF Sesame: Runtime + Runtime dependencies for an OpenRDF application + + + + org.openrdf.sesame + sesame-model + + + + org.openrdf.sesame + sesame-query + + + org.openrdf.sesame + sesame-queryalgebra-model + + + + org.openrdf.sesame + sesame-queryparser-api + + + org.openrdf.sesame + sesame-queryparser-serql + runtime + + + org.openrdf.sesame + sesame-queryparser-sparql + runtime + + + + + org.openrdf.sesame + sesame-queryresultio-api + + + org.openrdf.sesame + sesame-queryresultio-binary + runtime + + + org.openrdf.sesame + sesame-queryresultio-sparqljson + runtime + + + org.openrdf.sesame + sesame-queryresultio-sparqlxml + runtime + + + org.openrdf.sesame + sesame-queryresultio-text + runtime + + + + org.openrdf.sesame + sesame-repository-api + + + org.openrdf.sesame + sesame-repository-manager + + + org.openrdf.sesame + sesame-repository-http + runtime + + + org.openrdf.sesame + sesame-repository-sail + runtime + + + org.openrdf.sesame + sesame-repository-dataset + runtime + + + org.openrdf.sesame + sesame-repository-contextaware + + + + org.openrdf.sesame + sesame-http-protocol + + + org.openrdf.sesame + sesame-http-client + runtime + + + + org.openrdf.sesame + sesame-rio-api + + + org.openrdf.sesame + sesame-rio-ntriples + runtime + + + org.openrdf.sesame + sesame-rio-n3 + runtime + + + org.openrdf.sesame + sesame-rio-rdfxml + runtime + + + org.openrdf.sesame + sesame-rio-trix + runtime + + + org.openrdf.sesame + sesame-rio-turtle + runtime + + + org.openrdf.sesame + sesame-rio-trig + runtime + + + + org.openrdf.sesame + sesame-sail-api + + + org.openrdf.sesame + sesame-sail-inferencer + runtime + + + org.openrdf.sesame + sesame-sail-memory + runtime + + + org.openrdf.sesame + sesame-sail-nativerdf + runtime + + + org.openrdf.sesame + sesame-sail-rdbms + runtime + + + + org.slf4j + slf4j-api + + + + + scm:svn:https://repo.aduna-software.org/svn/org.openrdf/sesame/tags/2.3.1/core/runtime + scm:svn:https://repo.aduna-software.org/svn/org.openrdf/sesame/tags/2.3.1/core/runtime + http://repo.aduna-software.org/websvn/listing.php?repname=aduna&path=/org.openrdf/sesame/tags/2.3.1/core/runtime?repname=aduna&path=/org.openrdf/sesame/branches/2.3/core/runtime/ + + + diff --git a/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-sail-api/pom.properties b/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-sail-api/pom.properties new file mode 100644 index 00000000..540f1981 --- /dev/null +++ b/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-sail-api/pom.properties @@ -0,0 +1,5 @@ +#Generated by Maven +#Fri Jan 29 20:27:49 CET 2010 +version=2.3.1 +groupId=org.openrdf.sesame +artifactId=sesame-sail-api diff --git a/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-sail-api/pom.xml b/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-sail-api/pom.xml new file mode 100644 index 00000000..8a7b86c1 --- /dev/null +++ b/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-sail-api/pom.xml @@ -0,0 +1,55 @@ + + + 4.0.0 + + + org.openrdf.sesame + sesame-sail + 2.3.1 + + + sesame-sail-api + + OpenRDF Sesame: Sail API + RDF Storage And Inference Layer ("Sail") API. + + + + org.openrdf.sesame + sesame-query + + + org.openrdf.sesame + sesame-queryalgebra-model + + + org.openrdf.sesame + sesame-model + + + + info.aduna.commons + aduna-commons-iteration + + + info.aduna.commons + aduna-commons-concurrent + + + info.aduna.commons + aduna-commons-lang + + + + org.slf4j + slf4j-api + + + + + scm:svn:https://repo.aduna-software.org/svn/org.openrdf/sesame/tags/2.3.1/core/sail/api + scm:svn:https://repo.aduna-software.org/svn/org.openrdf/sesame/tags/2.3.1/core/sail/api + http://repo.aduna-software.org/websvn/listing.php?repname=aduna&path=/org.openrdf/sesame/tags/2.3.1/core/sail/api?repname=aduna&path=/org.openrdf/sesame/branches/2.3/core/sail/api/ + + + diff --git a/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-sail-inferencer/pom.properties b/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-sail-inferencer/pom.properties new file mode 100644 index 00000000..0e4e1dd3 --- /dev/null +++ b/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-sail-inferencer/pom.properties @@ -0,0 +1,5 @@ +#Generated by Maven +#Fri Jan 29 20:27:52 CET 2010 +version=2.3.1 +groupId=org.openrdf.sesame +artifactId=sesame-sail-inferencer diff --git a/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-sail-inferencer/pom.xml b/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-sail-inferencer/pom.xml new file mode 100644 index 00000000..7a3560ff --- /dev/null +++ b/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-sail-inferencer/pom.xml @@ -0,0 +1,68 @@ + + + 4.0.0 + + + org.openrdf.sesame + sesame-sail + 2.3.1 + + + sesame-sail-inferencer + + OpenRDF Sesame: Inferencer Sails + Stackable Sail implementation that adds RDF Schema inferencing to an RDF store. + + + + org.openrdf.sesame + sesame-sail-api + + + org.openrdf.sesame + sesame-queryalgebra-model + + + org.openrdf.sesame + sesame-query + + + org.openrdf.sesame + sesame-queryparser-api + + + org.openrdf.sesame + sesame-queryparser-serql + runtime + + + org.openrdf.sesame + sesame-rio-api + + + org.openrdf.sesame + sesame-model + + + + info.aduna.commons + aduna-commons-iteration + + + info.aduna.commons + aduna-commons-text + + + + org.slf4j + slf4j-api + + + + + scm:svn:https://repo.aduna-software.org/svn/org.openrdf/sesame/tags/2.3.1/core/sail/inferencer + scm:svn:https://repo.aduna-software.org/svn/org.openrdf/sesame/tags/2.3.1/core/sail/inferencer + http://repo.aduna-software.org/websvn/listing.php?repname=aduna&path=/org.openrdf/sesame/tags/2.3.1/core/sail/inferencer?repname=aduna&path=/org.openrdf/sesame/branches/2.3/core/sail/inferencer/ + + + diff --git a/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-sail-memory/pom.properties b/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-sail-memory/pom.properties new file mode 100644 index 00000000..d089641e --- /dev/null +++ b/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-sail-memory/pom.properties @@ -0,0 +1,5 @@ +#Generated by Maven +#Fri Jan 29 20:28:03 CET 2010 +version=2.3.1 +groupId=org.openrdf.sesame +artifactId=sesame-sail-memory diff --git a/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-sail-memory/pom.xml b/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-sail-memory/pom.xml new file mode 100644 index 00000000..dda54720 --- /dev/null +++ b/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-sail-memory/pom.xml @@ -0,0 +1,76 @@ + + + 4.0.0 + + + org.openrdf.sesame + sesame-sail + 2.3.1 + + + sesame-sail-memory + + OpenRDF Sesame: MemoryStore + Sail implementation that stores data in main memory, optionally using a dump-restore file for persistence. + + + + org.openrdf.sesame + sesame-sail-api + + + org.openrdf.sesame + sesame-sail-inferencer + + + org.openrdf.sesame + sesame-queryalgebra-evaluation + + + org.openrdf.sesame + sesame-queryalgebra-model + + + org.openrdf.sesame + sesame-query + + + org.openrdf.sesame + sesame-model + + + + info.aduna.commons + aduna-commons-iteration + + + info.aduna.commons + aduna-commons-concurrent + + + info.aduna.commons + aduna-commons-io + + + info.aduna.commons + aduna-commons-lang + + + + org.slf4j + slf4j-api + + + + junit + junit + + + + + scm:svn:https://repo.aduna-software.org/svn/org.openrdf/sesame/tags/2.3.1/core/sail/memory + scm:svn:https://repo.aduna-software.org/svn/org.openrdf/sesame/tags/2.3.1/core/sail/memory + http://repo.aduna-software.org/websvn/listing.php?repname=aduna&path=/org.openrdf/sesame/tags/2.3.1/core/sail/memory?repname=aduna&path=/org.openrdf/sesame/branches/2.3/core/sail/memory/ + + + diff --git a/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-sail-nativerdf/pom.properties b/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-sail-nativerdf/pom.properties new file mode 100644 index 00000000..c79887c7 --- /dev/null +++ b/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-sail-nativerdf/pom.properties @@ -0,0 +1,5 @@ +#Generated by Maven +#Fri Jan 29 20:28:23 CET 2010 +version=2.3.1 +groupId=org.openrdf.sesame +artifactId=sesame-sail-nativerdf diff --git a/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-sail-nativerdf/pom.xml b/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-sail-nativerdf/pom.xml new file mode 100644 index 00000000..78bee3d8 --- /dev/null +++ b/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-sail-nativerdf/pom.xml @@ -0,0 +1,78 @@ + + + 4.0.0 + + + org.openrdf.sesame + sesame-sail + 2.3.1 + + + sesame-sail-nativerdf + + OpenRDF Sesame: NativeStore + Sail implementation that stores data directly to disk in dedicated file formats. + + + + org.openrdf.sesame + sesame-sail-api + + + org.openrdf.sesame + sesame-sail-inferencer + + + org.openrdf.sesame + sesame-queryalgebra-evaluation + + + org.openrdf.sesame + sesame-queryalgebra-model + + + org.openrdf.sesame + sesame-query + + + org.openrdf.sesame + sesame-model + + + + info.aduna.commons + aduna-commons-io + + + info.aduna.commons + aduna-commons-iteration + + + info.aduna.commons + aduna-commons-concurrent + + + + org.slf4j + slf4j-api + + + + ch.qos.logback + logback-classic + test + + + + junit + junit + + + + + scm:svn:https://repo.aduna-software.org/svn/org.openrdf/sesame/tags/2.3.1/core/sail/nativerdf + scm:svn:https://repo.aduna-software.org/svn/org.openrdf/sesame/tags/2.3.1/core/sail/nativerdf + http://repo.aduna-software.org/websvn/listing.php?repname=aduna&path=/org.openrdf/sesame/tags/2.3.1/core/sail/nativerdf?repname=aduna&path=/org.openrdf/sesame/branches/2.3/core/sail/nativerdf/ + + + diff --git a/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-sail-rdbms/pom.properties b/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-sail-rdbms/pom.properties new file mode 100644 index 00000000..e0eab3e5 --- /dev/null +++ b/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-sail-rdbms/pom.properties @@ -0,0 +1,5 @@ +#Generated by Maven +#Fri Jan 29 20:28:36 CET 2010 +version=2.3.1 +groupId=org.openrdf.sesame +artifactId=sesame-sail-rdbms diff --git a/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-sail-rdbms/pom.xml b/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-sail-rdbms/pom.xml new file mode 100644 index 00000000..e9b1103a --- /dev/null +++ b/3rdParty/org.openrdf.sesame/META-INF/maven/org.openrdf.sesame/sesame-sail-rdbms/pom.xml @@ -0,0 +1,87 @@ + + + 4.0.0 + + + org.openrdf.sesame + sesame-sail + 2.3.1 + + + sesame-sail-rdbms + + OpenRDF Sesame: RDBMS Sail + Sail implementation that stores data in a relational database. + + + + org.openrdf.sesame + sesame-sail-api + + + + org.openrdf.sesame + sesame-queryalgebra-evaluation + + + org.openrdf.sesame + sesame-queryalgebra-model + + + org.openrdf.sesame + sesame-query + + + + org.openrdf.sesame + sesame-model + + + + info.aduna.commons + aduna-commons-collections + + + info.aduna.commons + aduna-commons-iteration + + + info.aduna.commons + aduna-commons-concurrent + + + + org.slf4j + slf4j-api + + + + commons-dbcp + commons-dbcp + + + + junit + junit + + + + postgresql + postgresql + provided + + + + mysql + mysql-connector-java + provided + + + + + scm:svn:https://repo.aduna-software.org/svn/org.openrdf/sesame/tags/2.3.1/core/sail/rdbms + scm:svn:https://repo.aduna-software.org/svn/org.openrdf/sesame/tags/2.3.1/core/sail/rdbms + http://repo.aduna-software.org/websvn/listing.php?repname=aduna&path=/org.openrdf/sesame/tags/2.3.1/core/sail/rdbms?repname=aduna&path=/org.openrdf/sesame/branches/2.3/core/sail/rdbms/ + + + diff --git a/3rdParty/org.openrdf.sesame/META-INF/services/org.openrdf.query.algebra.evaluation.function.Function b/3rdParty/org.openrdf.sesame/META-INF/services/org.openrdf.query.algebra.evaluation.function.Function new file mode 100644 index 00000000..4a2d12fe --- /dev/null +++ b/3rdParty/org.openrdf.sesame/META-INF/services/org.openrdf.query.algebra.evaluation.function.Function @@ -0,0 +1,7 @@ +org.openrdf.query.algebra.evaluation.function.StringCast +org.openrdf.query.algebra.evaluation.function.FloatCast +org.openrdf.query.algebra.evaluation.function.DoubleCast +org.openrdf.query.algebra.evaluation.function.DecimalCast +org.openrdf.query.algebra.evaluation.function.IntegerCast +org.openrdf.query.algebra.evaluation.function.BooleanCast +org.openrdf.query.algebra.evaluation.function.DateTimeCast diff --git a/3rdParty/org.openrdf.sesame/META-INF/services/org.openrdf.query.parser.QueryParserFactory b/3rdParty/org.openrdf.sesame/META-INF/services/org.openrdf.query.parser.QueryParserFactory new file mode 100644 index 00000000..67ded36b --- /dev/null +++ b/3rdParty/org.openrdf.sesame/META-INF/services/org.openrdf.query.parser.QueryParserFactory @@ -0,0 +1,4 @@ +org.openrdf.query.parser.serql.SeRQLParserFactory + +org.openrdf.query.parser.sparql.SPARQLParserFactory + diff --git a/3rdParty/org.openrdf.sesame/META-INF/services/org.openrdf.query.resultio.BooleanQueryResultParserFactory b/3rdParty/org.openrdf.sesame/META-INF/services/org.openrdf.query.resultio.BooleanQueryResultParserFactory new file mode 100644 index 00000000..1f93cac9 --- /dev/null +++ b/3rdParty/org.openrdf.sesame/META-INF/services/org.openrdf.query.resultio.BooleanQueryResultParserFactory @@ -0,0 +1,4 @@ +org.openrdf.query.resultio.sparqlxml.SPARQLBooleanXMLParserFactory + +org.openrdf.query.resultio.text.BooleanTextParserFactory + diff --git a/3rdParty/org.openrdf.sesame/META-INF/services/org.openrdf.query.resultio.BooleanQueryResultWriterFactory b/3rdParty/org.openrdf.sesame/META-INF/services/org.openrdf.query.resultio.BooleanQueryResultWriterFactory new file mode 100644 index 00000000..dd8f0f81 --- /dev/null +++ b/3rdParty/org.openrdf.sesame/META-INF/services/org.openrdf.query.resultio.BooleanQueryResultWriterFactory @@ -0,0 +1,4 @@ +org.openrdf.query.resultio.sparqlxml.SPARQLBooleanXMLWriterFactory + +org.openrdf.query.resultio.text.BooleanTextWriterFactory + diff --git a/3rdParty/org.openrdf.sesame/META-INF/services/org.openrdf.query.resultio.TupleQueryResultParserFactory b/3rdParty/org.openrdf.sesame/META-INF/services/org.openrdf.query.resultio.TupleQueryResultParserFactory new file mode 100644 index 00000000..88e3db1f --- /dev/null +++ b/3rdParty/org.openrdf.sesame/META-INF/services/org.openrdf.query.resultio.TupleQueryResultParserFactory @@ -0,0 +1,4 @@ +org.openrdf.query.resultio.binary.BinaryQueryResultParserFactory + +org.openrdf.query.resultio.sparqlxml.SPARQLResultsXMLParserFactory + diff --git a/3rdParty/org.openrdf.sesame/META-INF/services/org.openrdf.query.resultio.TupleQueryResultWriterFactory b/3rdParty/org.openrdf.sesame/META-INF/services/org.openrdf.query.resultio.TupleQueryResultWriterFactory new file mode 100644 index 00000000..275d6a3f --- /dev/null +++ b/3rdParty/org.openrdf.sesame/META-INF/services/org.openrdf.query.resultio.TupleQueryResultWriterFactory @@ -0,0 +1,6 @@ +org.openrdf.query.resultio.binary.BinaryQueryResultWriterFactory + +org.openrdf.query.resultio.sparqljson.SPARQLResultsJSONWriterFactory + +org.openrdf.query.resultio.sparqlxml.SPARQLResultsXMLWriterFactory + diff --git a/3rdParty/org.openrdf.sesame/META-INF/services/org.openrdf.repository.config.RepositoryFactory b/3rdParty/org.openrdf.sesame/META-INF/services/org.openrdf.repository.config.RepositoryFactory new file mode 100644 index 00000000..c1960dba --- /dev/null +++ b/3rdParty/org.openrdf.sesame/META-INF/services/org.openrdf.repository.config.RepositoryFactory @@ -0,0 +1,8 @@ +org.openrdf.repository.contextaware.config.ContextAwareFactory + +org.openrdf.repository.dataset.config.DatasetRepositoryFactory + +org.openrdf.repository.http.config.HTTPRepositoryFactory + +org.openrdf.repository.sail.config.SailRepositoryFactory + diff --git a/3rdParty/org.openrdf.sesame/META-INF/services/org.openrdf.rio.RDFParserFactory b/3rdParty/org.openrdf.sesame/META-INF/services/org.openrdf.rio.RDFParserFactory new file mode 100644 index 00000000..a06f472a --- /dev/null +++ b/3rdParty/org.openrdf.sesame/META-INF/services/org.openrdf.rio.RDFParserFactory @@ -0,0 +1,12 @@ +org.openrdf.rio.n3.N3ParserFactory + +org.openrdf.rio.ntriples.NTriplesParserFactory + +org.openrdf.rio.rdfxml.RDFXMLParserFactory + +org.openrdf.rio.trig.TriGParserFactory + +org.openrdf.rio.trix.TriXParserFactory + +org.openrdf.rio.turtle.TurtleParserFactory + diff --git a/3rdParty/org.openrdf.sesame/META-INF/services/org.openrdf.rio.RDFWriterFactory b/3rdParty/org.openrdf.sesame/META-INF/services/org.openrdf.rio.RDFWriterFactory new file mode 100644 index 00000000..d1aa3037 --- /dev/null +++ b/3rdParty/org.openrdf.sesame/META-INF/services/org.openrdf.rio.RDFWriterFactory @@ -0,0 +1,12 @@ +org.openrdf.rio.n3.N3WriterFactory + +org.openrdf.rio.ntriples.NTriplesWriterFactory + +org.openrdf.rio.rdfxml.RDFXMLWriterFactory + +org.openrdf.rio.trig.TriGWriterFactory + +org.openrdf.rio.trix.TriXWriterFactory + +org.openrdf.rio.turtle.TurtleWriterFactory + diff --git a/3rdParty/org.openrdf.sesame/META-INF/services/org.openrdf.sail.config.SailFactory b/3rdParty/org.openrdf.sesame/META-INF/services/org.openrdf.sail.config.SailFactory new file mode 100644 index 00000000..6ea91f3b --- /dev/null +++ b/3rdParty/org.openrdf.sesame/META-INF/services/org.openrdf.sail.config.SailFactory @@ -0,0 +1,6 @@ +org.openrdf.sail.inferencer.fc.config.ForwardChainingRDFSInferencerFactory +org.openrdf.sail.inferencer.fc.config.DirectTypeHierarchyInferencerFactory +org.openrdf.sail.memory.config.MemoryStoreFactory +org.openrdf.sail.nativerdf.config.NativeStoreFactory + +org.openrdf.sail.rdbms.config.RdbmsStoreFactory diff --git a/3rdParty/org.openrdf.sesame/META-INF/services/org.openrdf.sail.rdbms.RdbmsProvider b/3rdParty/org.openrdf.sesame/META-INF/services/org.openrdf.sail.rdbms.RdbmsProvider new file mode 100644 index 00000000..107174dc --- /dev/null +++ b/3rdParty/org.openrdf.sesame/META-INF/services/org.openrdf.sail.rdbms.RdbmsProvider @@ -0,0 +1,2 @@ +org.openrdf.sail.rdbms.postgresql.PgSqlProvider +org.openrdf.sail.rdbms.mysql.MySqlProvider \ No newline at end of file diff --git a/3rdParty/org.openrdf.sesame/openrdf-sesame-2.4.2-onejar.jar b/3rdParty/org.openrdf.sesame/openrdf-sesame-2.4.2-onejar.jar new file mode 100644 index 00000000..324bf93b Binary files /dev/null and b/3rdParty/org.openrdf.sesame/openrdf-sesame-2.4.2-onejar.jar differ diff --git a/3rdParty/org.openrdf.sesame/org.openrdf.sesame_2.4.2.jar b/3rdParty/org.openrdf.sesame/org.openrdf.sesame_2.4.2.jar new file mode 100644 index 00000000..edff902d Binary files /dev/null and b/3rdParty/org.openrdf.sesame/org.openrdf.sesame_2.4.2.jar differ diff --git a/3rdParty/org.slf4j.api/.classpath b/3rdParty/org.slf4j.api/.classpath new file mode 100644 index 00000000..9d73ca56 --- /dev/null +++ b/3rdParty/org.slf4j.api/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/3rdParty/org.slf4j.api/.project b/3rdParty/org.slf4j.api/.project new file mode 100644 index 00000000..aa907905 --- /dev/null +++ b/3rdParty/org.slf4j.api/.project @@ -0,0 +1,28 @@ + + + org.slf4j.api + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + + org.eclipse.pde.PluginNature + org.eclipse.jdt.core.javanature + + diff --git a/3rdParty/org.slf4j.api/.settings/org.eclipse.jdt.core.prefs b/3rdParty/org.slf4j.api/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 00000000..11f6e462 --- /dev/null +++ b/3rdParty/org.slf4j.api/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,7 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 +org.eclipse.jdt.core.compiler.compliance=1.7 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.7 diff --git a/3rdParty/org.slf4j.api/META-INF/MANIFEST.MF b/3rdParty/org.slf4j.api/META-INF/MANIFEST.MF new file mode 100644 index 00000000..acecf2b3 --- /dev/null +++ b/3rdParty/org.slf4j.api/META-INF/MANIFEST.MF @@ -0,0 +1,15 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: SlF4J Api +Bundle-SymbolicName: org.slf4j.api +Bundle-Version: 1.7.5 +Bundle-ClassPath: org.slf4j.api_1.7.5.jar +Bundle-Vendor: KDM Analytics +Export-Package: org.slf4j, + org.slf4j.helpers, + org.slf4j.spi +Bundle-RequiredExecutionEnvironment: JavaSE-1.7 +Created-By: Apache Maven +Build-Jdk: 1.7.0_25 +Archiver-Version: Plexus Archiver +Built-By: jenkins diff --git a/3rdParty/org.slf4j.api/META-INF/maven/com.kdmanalytics.libs.libsjava.plugins/org.slf4j.api/pom.properties b/3rdParty/org.slf4j.api/META-INF/maven/com.kdmanalytics.libs.libsjava.plugins/org.slf4j.api/pom.properties new file mode 100644 index 00000000..76e8a858 --- /dev/null +++ b/3rdParty/org.slf4j.api/META-INF/maven/com.kdmanalytics.libs.libsjava.plugins/org.slf4j.api/pom.properties @@ -0,0 +1,5 @@ +#Generated by Maven +#Thu Sep 12 11:09:24 EDT 2013 +version=1.7.5 +groupId=com.kdmanalytics.libs.libsjava.plugins +artifactId=org.slf4j.api diff --git a/3rdParty/org.slf4j.api/META-INF/maven/com.kdmanalytics.libs.libsjava.plugins/org.slf4j.api/pom.xml b/3rdParty/org.slf4j.api/META-INF/maven/com.kdmanalytics.libs.libsjava.plugins/org.slf4j.api/pom.xml new file mode 100644 index 00000000..1e8b0e1d --- /dev/null +++ b/3rdParty/org.slf4j.api/META-INF/maven/com.kdmanalytics.libs.libsjava.plugins/org.slf4j.api/pom.xml @@ -0,0 +1,21 @@ + + + 4.0.0 + + + com.kdmanalytics.libs.libsjava + plugins + 2.3.1 + + + com.kdmanalytics.libs.libsjava.plugins + org.slf4j.api + 1.7.5 + + SLF4j API + + eclipse-plugin + + diff --git a/3rdParty/org.slf4j.api/META-INF/maven/org.slf4j/slf4j-api/pom.properties b/3rdParty/org.slf4j.api/META-INF/maven/org.slf4j/slf4j-api/pom.properties new file mode 100644 index 00000000..843f637c --- /dev/null +++ b/3rdParty/org.slf4j.api/META-INF/maven/org.slf4j/slf4j-api/pom.properties @@ -0,0 +1,5 @@ +#Generated by Maven +#Mon Mar 25 21:49:23 CET 2013 +version=1.7.5 +groupId=org.slf4j +artifactId=slf4j-api diff --git a/3rdParty/org.slf4j.api/META-INF/maven/org.slf4j/slf4j-api/pom.xml b/3rdParty/org.slf4j.api/META-INF/maven/org.slf4j/slf4j-api/pom.xml new file mode 100644 index 00000000..3ea5231a --- /dev/null +++ b/3rdParty/org.slf4j.api/META-INF/maven/org.slf4j/slf4j-api/pom.xml @@ -0,0 +1,89 @@ + + + + org.slf4j + slf4j-parent + 1.7.5 + + + 4.0.0 + + org.slf4j + slf4j-api + jar + SLF4J API Module + The slf4j API + + http://www.slf4j.org + + + + + + + + + org.apache.maven.plugins + maven-surefire-plugin + + once + plain + false + + **/AllTest.java + **/PackageTest.java + + + + + + org.apache.maven.plugins + maven-jar-plugin + + + + ${parsedVersion.osgiVersion} + ${project.description} + ${project.version} + + ${project.build.outputDirectory}/META-INF/MANIFEST.MF + + + + + bundle-test-jar + package + + jar + test-jar + + + + + + + org.apache.maven.plugins + maven-antrun-plugin + + + process-classes + + run + + + + + + Removing slf4j-api's dummy StaticLoggerBinder and StaticMarkerBinder + + + + + + + + + + \ No newline at end of file diff --git a/3rdParty/org.slf4j.api/org.slf4j.api_1.7.5.jar b/3rdParty/org.slf4j.api/org.slf4j.api_1.7.5.jar new file mode 100644 index 00000000..ce34617c Binary files /dev/null and b/3rdParty/org.slf4j.api/org.slf4j.api_1.7.5.jar differ diff --git a/3rdParty/org.slf4j.log4j/.classpath b/3rdParty/org.slf4j.log4j/.classpath new file mode 100644 index 00000000..31871d83 --- /dev/null +++ b/3rdParty/org.slf4j.log4j/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/3rdParty/org.slf4j.log4j/.project b/3rdParty/org.slf4j.log4j/.project new file mode 100644 index 00000000..0c64169a --- /dev/null +++ b/3rdParty/org.slf4j.log4j/.project @@ -0,0 +1,28 @@ + + + org.slf4j.log4j + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + + org.eclipse.pde.PluginNature + org.eclipse.jdt.core.javanature + + diff --git a/3rdParty/org.slf4j.log4j/.settings/org.eclipse.jdt.core.prefs b/3rdParty/org.slf4j.log4j/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 00000000..11f6e462 --- /dev/null +++ b/3rdParty/org.slf4j.log4j/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,7 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 +org.eclipse.jdt.core.compiler.compliance=1.7 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.7 diff --git a/3rdParty/org.slf4j.log4j/META-INF/MANIFEST.MF b/3rdParty/org.slf4j.log4j/META-INF/MANIFEST.MF new file mode 100644 index 00000000..38d22259 --- /dev/null +++ b/3rdParty/org.slf4j.log4j/META-INF/MANIFEST.MF @@ -0,0 +1,13 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: SLF4J Log4j Integration +Bundle-SymbolicName: org.slf4j.log4j +Bundle-Version: 1.7.5 +Bundle-ClassPath: org.slf4j.log4j_1.7.5.jar +Bundle-Vendor: KDM Analytics Inc. +Export-Package: org.slf4j.impl;version="1.7.5" +Bundle-RequiredExecutionEnvironment: JavaSE-1.7 +Created-By: Apache Maven +Build-Jdk: 1.7.0_25 +Archiver-Version: Plexus Archiver +Built-By: jenkins diff --git a/3rdParty/org.slf4j.log4j/META-INF/maven/com.kdmanalytics.libs.libsjava.plugins/org.slf4j.log4j/pom.properties b/3rdParty/org.slf4j.log4j/META-INF/maven/com.kdmanalytics.libs.libsjava.plugins/org.slf4j.log4j/pom.properties new file mode 100644 index 00000000..4550689e --- /dev/null +++ b/3rdParty/org.slf4j.log4j/META-INF/maven/com.kdmanalytics.libs.libsjava.plugins/org.slf4j.log4j/pom.properties @@ -0,0 +1,5 @@ +#Generated by Maven +#Thu Sep 12 11:09:24 EDT 2013 +version=1.7.5 +groupId=com.kdmanalytics.libs.libsjava.plugins +artifactId=org.slf4j.log4j diff --git a/3rdParty/org.slf4j.log4j/META-INF/maven/com.kdmanalytics.libs.libsjava.plugins/org.slf4j.log4j/pom.xml b/3rdParty/org.slf4j.log4j/META-INF/maven/com.kdmanalytics.libs.libsjava.plugins/org.slf4j.log4j/pom.xml new file mode 100644 index 00000000..273c4afe --- /dev/null +++ b/3rdParty/org.slf4j.log4j/META-INF/maven/com.kdmanalytics.libs.libsjava.plugins/org.slf4j.log4j/pom.xml @@ -0,0 +1,21 @@ + + + 4.0.0 + + + com.kdmanalytics.libs.libsjava + plugins + 2.3.1 + + + com.kdmanalytics.libs.libsjava.plugins + org.slf4j.log4j + 1.7.5 + + SLF4J Log4j + + eclipse-plugin + + diff --git a/3rdParty/org.slf4j.log4j/META-INF/maven/org.slf4j/slf4j-log4j12/pom.properties b/3rdParty/org.slf4j.log4j/META-INF/maven/org.slf4j/slf4j-log4j12/pom.properties new file mode 100644 index 00000000..4caa0dc9 --- /dev/null +++ b/3rdParty/org.slf4j.log4j/META-INF/maven/org.slf4j/slf4j-log4j12/pom.properties @@ -0,0 +1,5 @@ +#Generated by Maven +#Mon Mar 25 21:49:28 CET 2013 +version=1.7.5 +groupId=org.slf4j +artifactId=slf4j-log4j12 diff --git a/3rdParty/org.slf4j.log4j/META-INF/maven/org.slf4j/slf4j-log4j12/pom.xml b/3rdParty/org.slf4j.log4j/META-INF/maven/org.slf4j/slf4j-log4j12/pom.xml new file mode 100644 index 00000000..70d6d3e5 --- /dev/null +++ b/3rdParty/org.slf4j.log4j/META-INF/maven/org.slf4j/slf4j-log4j12/pom.xml @@ -0,0 +1,53 @@ + + + + org.slf4j + slf4j-parent + 1.7.5 + + + 4.0.0 + + org.slf4j + slf4j-log4j12 + jar + SLF4J LOG4J-12 Binding + SLF4J LOG4J-12 Binding + http://www.slf4j.org + + + + + org.slf4j + slf4j-api + + + + log4j + log4j + + + + + + + org.apache.maven.plugins + maven-jar-plugin + + + + ${parsedVersion.osgiVersion} + ${project.description} + ${project.version} + + ${project.build.outputDirectory}/META-INF/MANIFEST.MF + + + + + + + \ No newline at end of file diff --git a/3rdParty/org.slf4j.log4j/org.slf4j.log4j_1.7.5.jar b/3rdParty/org.slf4j.log4j/org.slf4j.log4j_1.7.5.jar new file mode 100644 index 00000000..9ef432cc Binary files /dev/null and b/3rdParty/org.slf4j.log4j/org.slf4j.log4j_1.7.5.jar differ diff --git a/3rdParty/org.slf4j.log4j12/.classpath b/3rdParty/org.slf4j.log4j12/.classpath new file mode 100644 index 00000000..4b1a7a67 --- /dev/null +++ b/3rdParty/org.slf4j.log4j12/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/3rdParty/org.slf4j.log4j12/.project b/3rdParty/org.slf4j.log4j12/.project new file mode 100644 index 00000000..37e75d8f --- /dev/null +++ b/3rdParty/org.slf4j.log4j12/.project @@ -0,0 +1,28 @@ + + + org.slf4j.log4j12 + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + + org.eclipse.pde.PluginNature + org.eclipse.jdt.core.javanature + + diff --git a/3rdParty/org.slf4j.log4j12/.settings/org.eclipse.jdt.core.prefs b/3rdParty/org.slf4j.log4j12/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 00000000..f287d53c --- /dev/null +++ b/3rdParty/org.slf4j.log4j12/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,7 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 +org.eclipse.jdt.core.compiler.compliance=1.6 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.6 diff --git a/3rdParty/org.slf4j.log4j12/META-INF/MANIFEST.MF b/3rdParty/org.slf4j.log4j12/META-INF/MANIFEST.MF new file mode 100644 index 00000000..38ed1eb5 --- /dev/null +++ b/3rdParty/org.slf4j.log4j12/META-INF/MANIFEST.MF @@ -0,0 +1,13 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: Log4j12 +Bundle-SymbolicName: org.slf4j.log4j12 +Bundle-Version: 1.6.4 +Bundle-ClassPath: org.slf4j.log4j12_1.6.4.jar +Bundle-Vendor: kdm anlaytics +Export-Package: org.slf4j.impl;version="1.6.4" +Bundle-RequiredExecutionEnvironment: JavaSE-1.6 +Created-By: Apache Maven +Build-Jdk: 1.6.0_26 +Archiver-Version: Plexus Archiver +Built-By: kgirard diff --git a/3rdParty/org.slf4j.log4j12/META-INF/maven/com.kdmanalytics.libs.libsjava.plugins/org.slf4j.log4j12/pom.properties b/3rdParty/org.slf4j.log4j12/META-INF/maven/com.kdmanalytics.libs.libsjava.plugins/org.slf4j.log4j12/pom.properties new file mode 100644 index 00000000..e6ed84e6 --- /dev/null +++ b/3rdParty/org.slf4j.log4j12/META-INF/maven/com.kdmanalytics.libs.libsjava.plugins/org.slf4j.log4j12/pom.properties @@ -0,0 +1,5 @@ +#Generated by Maven +#Thu Nov 22 18:23:36 EST 2012 +version=1.6.4 +groupId=com.kdmanalytics.libs.libsjava.plugins +artifactId=org.slf4j.log4j12 diff --git a/3rdParty/org.slf4j.log4j12/META-INF/maven/com.kdmanalytics.libs.libsjava.plugins/org.slf4j.log4j12/pom.xml b/3rdParty/org.slf4j.log4j12/META-INF/maven/com.kdmanalytics.libs.libsjava.plugins/org.slf4j.log4j12/pom.xml new file mode 100644 index 00000000..ae52d515 --- /dev/null +++ b/3rdParty/org.slf4j.log4j12/META-INF/maven/com.kdmanalytics.libs.libsjava.plugins/org.slf4j.log4j12/pom.xml @@ -0,0 +1,19 @@ + + + 4.0.0 + + + com.kdmanalytics.libs.libsjava + plugins + 2.0.5 + + + com.kdmanalytics.libs.libsjava.plugins + org.slf4j.log4j12 + 1.6.4 + + KDM Analytics SLF4J Log4J Plugin + + eclipse-plugin + diff --git a/3rdParty/org.slf4j.log4j12/META-INF/maven/org.slf4j/slf4j-log4j12/pom.properties b/3rdParty/org.slf4j.log4j12/META-INF/maven/org.slf4j/slf4j-log4j12/pom.properties new file mode 100644 index 00000000..076cc0c0 --- /dev/null +++ b/3rdParty/org.slf4j.log4j12/META-INF/maven/org.slf4j/slf4j-log4j12/pom.properties @@ -0,0 +1,5 @@ +#Generated by Maven +#Mon Oct 31 23:40:13 CET 2011 +version=1.6.4 +groupId=org.slf4j +artifactId=slf4j-log4j12 diff --git a/3rdParty/org.slf4j.log4j12/META-INF/maven/org.slf4j/slf4j-log4j12/pom.xml b/3rdParty/org.slf4j.log4j12/META-INF/maven/org.slf4j/slf4j-log4j12/pom.xml new file mode 100644 index 00000000..33cec073 --- /dev/null +++ b/3rdParty/org.slf4j.log4j12/META-INF/maven/org.slf4j/slf4j-log4j12/pom.xml @@ -0,0 +1,56 @@ + + + + org.slf4j + slf4j-parent + 1.6.4 + + + 4.0.0 + + org.slf4j + slf4j-log4j12 + jar + SLF4J LOG4J-12 Binding + + http://www.slf4j.org + + + The slf4j log4j-12 binding + + + + + org.slf4j + slf4j-api + + + + log4j + log4j + + + + + + + org.apache.maven.plugins + maven-jar-plugin + + + + ${parsedVersion.osgiVersion} + ${project.description} + ${project.version} + + ${project.build.outputDirectory}/META-INF/MANIFEST.MF + + + + + + + \ No newline at end of file diff --git a/3rdParty/org.slf4j.log4j12/org.slf4j.log4j12_1.6.4.jar b/3rdParty/org.slf4j.log4j12/org.slf4j.log4j12_1.6.4.jar new file mode 100644 index 00000000..8f0f322a Binary files /dev/null and b/3rdParty/org.slf4j.log4j12/org.slf4j.log4j12_1.6.4.jar differ diff --git a/3rdParty/org.slf4j/.classpath b/3rdParty/org.slf4j/.classpath new file mode 100644 index 00000000..540521d7 --- /dev/null +++ b/3rdParty/org.slf4j/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/3rdParty/org.slf4j/.project b/3rdParty/org.slf4j/.project new file mode 100644 index 00000000..9a7d6716 --- /dev/null +++ b/3rdParty/org.slf4j/.project @@ -0,0 +1,28 @@ + + + org.slf4j + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + + org.eclipse.pde.PluginNature + org.eclipse.jdt.core.javanature + + diff --git a/3rdParty/org.slf4j/.settings/org.eclipse.jdt.core.prefs b/3rdParty/org.slf4j/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 00000000..f287d53c --- /dev/null +++ b/3rdParty/org.slf4j/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,7 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 +org.eclipse.jdt.core.compiler.compliance=1.6 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.6 diff --git a/3rdParty/org.slf4j/META-INF/MANIFEST.MF b/3rdParty/org.slf4j/META-INF/MANIFEST.MF new file mode 100644 index 00000000..200a1fee --- /dev/null +++ b/3rdParty/org.slf4j/META-INF/MANIFEST.MF @@ -0,0 +1,15 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: Slf4j +Bundle-SymbolicName: org.slf4j +Bundle-Version: 1.6.4 +Bundle-ClassPath: org.slf4j_1.6.4.jar +Bundle-Vendor: kdm analytics +Export-Package: org.slf4j, + org.slf4j.helpers, + org.slf4j.spi +Bundle-RequiredExecutionEnvironment: JavaSE-1.6 +Created-By: Apache Maven +Build-Jdk: 1.6.0_26 +Archiver-Version: Plexus Archiver +Built-By: kgirard diff --git a/3rdParty/org.slf4j/META-INF/maven/com.kdmanalytics.libs.libsjava.plugins/org.slf4j/pom.properties b/3rdParty/org.slf4j/META-INF/maven/com.kdmanalytics.libs.libsjava.plugins/org.slf4j/pom.properties new file mode 100644 index 00000000..8a6e5396 --- /dev/null +++ b/3rdParty/org.slf4j/META-INF/maven/com.kdmanalytics.libs.libsjava.plugins/org.slf4j/pom.properties @@ -0,0 +1,5 @@ +#Generated by Maven +#Thu Nov 22 18:23:32 EST 2012 +version=1.6.4 +groupId=com.kdmanalytics.libs.libsjava.plugins +artifactId=org.slf4j diff --git a/3rdParty/org.slf4j/META-INF/maven/com.kdmanalytics.libs.libsjava.plugins/org.slf4j/pom.xml b/3rdParty/org.slf4j/META-INF/maven/com.kdmanalytics.libs.libsjava.plugins/org.slf4j/pom.xml new file mode 100644 index 00000000..7d177b38 --- /dev/null +++ b/3rdParty/org.slf4j/META-INF/maven/com.kdmanalytics.libs.libsjava.plugins/org.slf4j/pom.xml @@ -0,0 +1,21 @@ + + + 4.0.0 + + + com.kdmanalytics.libs.libsjava + plugins + 2.0.5 + + + com.kdmanalytics.libs.libsjava.plugins + org.slf4j + 1.6.4 + + KDM Analytics SLF4J Plugin + + eclipse-plugin + + diff --git a/3rdParty/org.slf4j/META-INF/maven/org.slf4j/slf4j-api/pom.properties b/3rdParty/org.slf4j/META-INF/maven/org.slf4j/slf4j-api/pom.properties new file mode 100644 index 00000000..2aa84cb4 --- /dev/null +++ b/3rdParty/org.slf4j/META-INF/maven/org.slf4j/slf4j-api/pom.properties @@ -0,0 +1,5 @@ +#Generated by Maven +#Mon Oct 31 23:40:09 CET 2011 +version=1.6.4 +groupId=org.slf4j +artifactId=slf4j-api diff --git a/3rdParty/org.slf4j/META-INF/maven/org.slf4j/slf4j-api/pom.xml b/3rdParty/org.slf4j/META-INF/maven/org.slf4j/slf4j-api/pom.xml new file mode 100644 index 00000000..0be770bd --- /dev/null +++ b/3rdParty/org.slf4j/META-INF/maven/org.slf4j/slf4j-api/pom.xml @@ -0,0 +1,89 @@ + + + + org.slf4j + slf4j-parent + 1.6.4 + + + 4.0.0 + + org.slf4j + slf4j-api + jar + SLF4J API Module + + http://www.slf4j.org + The slf4j API + + + + + + + + + org.apache.maven.plugins + maven-surefire-plugin + + once + plain + false + + **/AllTest.java + **/PackageTest.java + + + + + + org.apache.maven.plugins + maven-jar-plugin + + + + ${parsedVersion.osgiVersion} + ${project.description} + ${project.version} + + ${project.build.outputDirectory}/META-INF/MANIFEST.MF + + + + + bundle-test-jar + package + + jar + test-jar + + + + + + + org.apache.maven.plugins + maven-antrun-plugin + + + process-classes + + run + + + + + + Removing slf4j-api's dummy StaticLoggerBinder and StaticMarkerBinder + + + + + + + + + + \ No newline at end of file diff --git a/3rdParty/org.slf4j/build.properties b/3rdParty/org.slf4j/build.properties new file mode 100644 index 00000000..2d931d03 --- /dev/null +++ b/3rdParty/org.slf4j/build.properties @@ -0,0 +1,3 @@ +bin.includes = META-INF/,\ + guava-14.0.1.jar,\ + org.slf4j_1.6.4.jar diff --git a/3rdParty/org.slf4j/org.slf4j_1.6.4.jar b/3rdParty/org.slf4j/org.slf4j_1.6.4.jar new file mode 100644 index 00000000..b74753d8 Binary files /dev/null and b/3rdParty/org.slf4j/org.slf4j_1.6.4.jar differ diff --git a/COPYING b/COPYING new file mode 100644 index 00000000..0013f682 --- /dev/null +++ b/COPYING @@ -0,0 +1,116 @@ +Open Software License v. 3.0 (OSL-3.0) +This Open Software License (the "License") applies to any original work of authorship (the +"Original Work") whose owner (the "Licensor") has placed the following licensing notice +adjacent to the copyright notice for the Original Work: +Licensed under the Open Software License version 3.0 +1) Grant of Copyright License. Licensor grants You a worldwide, royalty-free, non-exclusive, +sublicensable license, for the duration of the copyright, to do the following: +a) to reproduce the Original Work in copies, either alone or as part of a collective work; +b) to translate, adapt, alter, transform, modify, or arrange the Original Work, thereby creating +derivative works ("Derivative Works") based upon the Original Work; +c) to distribute or communicate copies of the Original Work and Derivative Works to the public, +with the proviso that copies of Original Work or Derivative Works that You distribute or +communicate shall be licensed under this Open Software License; +d) to perform the Original Work publicly; and +e) to display the Original Work publicly. +2) Grant of Patent License. Licensor grants You a worldwide, royalty-free, non-exclusive, +sublicensable license, under patent claims owned or controlled by the Licensor that are embodied +in the Original Work as furnished by the Licensor, for the duration of the patents, to make, use, +sell, offer for sale, have made, and import the Original Work and Derivative Works. +3) Grant of Source Code License. The term "Source Code" means the preferred form of the +Original Work for making modifications to it and all available documentation describing how to +modify the Original Work. Licensor agrees to provide a machine-readable copy of the Source +Code of the Original Work along with each copy of the Original Work that Licensor distributes. +Licensor reserves the right to satisfy this obligation by placing a machine-readable copy of the +Source Code in an information repository reasonably calculated to permit inexpensive and +convenient access by You for as long as Licensor continues to distribute the Original Work. +4) Exclusions From License Grant. Neither the names of Licensor, nor the names of any +contributors to the Original Work, nor any of their trademarks or service marks, may be used to +endorse or promote products derived from this Original Work without express prior permission +of the Licensor. Except as expressly stated herein, nothing in this License grants any license to +Licensor's trademarks, copyrights, patents, trade secrets or any other intellectual property. No +patent license is granted to make, use, sell, offer for sale, have made, or import embodiments of +any patent claims other than the licensed claims defined in Section 2. No license is granted to the +trademarks of Licensor even if such marks are included in the Original Work. Nothing in this License shall be interpreted to prohibit Licensor from licensing under terms different from this +License any Original Work that Licensor otherwise would have a right to license. +5) External Deployment. The term "External Deployment" means the use, distribution, or +communication of the Original Work or Derivative Works in any way such that the Original +Work or Derivative Works may be used by anyone other than You, whether those works are +distributed or communicated to those persons or made available as an application intended for +use over a network. As an express condition for the grants of license hereunder, You must treat +any External Deployment by You of the Original Work or a Derivative Work as a distribution +under section 1(c). +6) Attribution Rights. You must retain, in the Source Code of any Derivative Works that You +create, all copyright, patent, or trademark notices from the Source Code of the Original Work, as +well as any notices of licensing and any descriptive text identified therein as an "Attribution +Notice." You must cause the Source Code for any Derivative Works that You create to carry a +prominent Attribution Notice reasonably calculated to inform recipients that You have modified +the Original Work. +7) Warranty of Provenance and Disclaimer of Warranty. Licensor warrants that the +copyright in and to the Original Work and the patent rights granted herein by Licensor are owned +by the Licensor or are sublicensed to You under the terms of this License with the permission of +the contributor(s) of those copyrights and patent rights. Except as expressly stated in the +immediately preceding sentence, the Original Work is provided under this License on an "AS IS" +BASIS and WITHOUT WARRANTY, either express or implied, including, without limitation, +the warranties of non-infringement, merchantability or fitness for a particular purpose. THE +ENTIRE RISK AS TO THE QUALITY OF THE ORIGINAL WORK IS WITH YOU. This +DISCLAIMER OF WARRANTY constitutes an essential part of this License. No license to the +Original Work is granted by this License except under this disclaimer. +8) Limitation of Liability. Under no circumstances and under no legal theory, whether in tort +(including negligence), contract, or otherwise, shall the Licensor be liable to anyone for any +indirect, special, incidental, or consequential damages of any character arising as a result of this +License or the use of the Original Work including, without limitation, damages for loss of +goodwill, work stoppage, computer failure or malfunction, or any and all other commercial +damages or losses. This limitation of liability shall not apply to the extent applicable law +prohibits such limitation. +9) Acceptance and Termination. If, at any time, You expressly assented to this License, that +assent indicates your clear and irrevocable acceptance of this License and all of its terms and +conditions. If You distribute or communicate copies of the Original Work or a Derivative Work, +You must make a reasonable effort under the circumstances to obtain the express assent of +recipients to the terms of this License. This License conditions your rights to undertake the +activities listed in Section 1, including your right to create Derivative Works based upon the +Original Work, and doing so without honoring these terms and conditions is prohibited by +copyright law and international treaty. Nothing in this License is intended to affect copyright +exceptions and limitations (including "fair use" or "fair dealing"). This License shall terminate immediately and You may no longer exercise any of the rights granted to You by this License +upon your failure to honor the conditions in Section 1(c). +10) Termination for Patent Action. This License shall terminate automatically and You may no +longer exercise any of the rights granted to You by this License as of the date You commence an +action, including a cross-claim or counterclaim, against Licensor or any licensee alleging that the +Original Work infringes a patent. This termination provision shall not apply for an action +alleging patent infringement by combinations of the Original Work with other software or +hardware. +11) Jurisdiction, Venue and Governing Law. Any action or suit relating to this License may be +brought only in the courts of a jurisdiction wherein the Licensor resides or in which Licensor +conducts its primary business, and under the laws of that jurisdiction excluding its conflict-oflaw provisions. The application of the United Nations Convention on Contracts for the +International Sale of Goods is expressly excluded. Any use of the Original Work outside the +scope of this License or after its termination shall be subject to the requirements and penalties of +copyright or patent law in the appropriate jurisdiction. This section shall survive the termination +of this License. +12) Attorneys' Fees. In any action to enforce the terms of this License or seeking damages +relating thereto, the prevailing party shall be entitled to recover its costs and expenses, including, +without limitation, reasonable attorneys' fees and costs incurred in connection with such action, +including any appeal of such action. This section shall survive the termination of this License. +13) Miscellaneous. If any provision of this License is held to be unenforceable, such provision +shall be reformed only to the extent necessary to make it enforceable. +14) Definition of "You" in This License. "You" throughout this License, whether in upper or +lower case, means an individual or a legal entity exercising rights under, and complying with all +of the terms of, this License. For legal entities, "You" includes any entity that controls, is +controlled by, or is under common control with you. For purposes of this definition, "control" +means (i) the power, direct or indirect, to cause the direction or management of such entity, +whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the +outstanding shares, or (iii) beneficial ownership of such entity. +15) Right to Use. You may use the Original Work in all ways not otherwise restricted or +conditioned by this License or by law, and Licensor promises not to interfere with or be +responsible for such uses by You. +16) Modification of This License. This License is Copyright © 2005 Lawrence Rosen. +Permission is granted to copy, distribute, or communicate this License without modification. +Nothing in this License permits You to modify this License as applied to the Original Work or to +Derivative Works. However, You may modify the text of this License and copy, distribute or +communicate your modified version (the "Modified License") and apply it to other original +works of authorship subject to the following conditions: (i) You may not indicate in any way that +your Modified License is the "Open Software License" or "OSL" and you may not use those names in the name of your Modified License; (ii) You must replace the notice specified in the +first paragraph above with the notice "Licensed under " or with a +notice of your own that is not confusingly similar to the notice in this License; and (iii) You may +not claim that your original works are open source software unless your Modified License has +been approved by Open Source Initiative (OSI) and You comply with its license review and +certification process. diff --git a/INSTALL b/INSTALL new file mode 100644 index 00000000..daa7d8b0 --- /dev/null +++ b/INSTALL @@ -0,0 +1,176 @@ +////////////////////////////////////////////////////////////////////////////////// +// Copyright (c) 2013 KDM Analytics, Inc. All rights reserved. This program and the +// accompanying materials are made available under the terms of the Open Source +// Initiative OSI - Open Software License v3.0 which accompanies this +// distribution, and is available at http://www.opensource.org/licenses/osl-3.0.php/ +////////////////////////////////////////////////////////////////////////////////// + +http://kdmanalytics.com +adam@kdmanalytics.com + + +ADAPTORS +============ + +Required Generator Versions: + Cppcheck 1.40 + Findbugs 1.3.9 + Jlint 3.0 + Rats 2.3 + Splint 3.1.2 + +-------------------------------------------------------------------------------------------------------------------- + +Configuration: +In order to run the adaptors, there is some configuration that will be required. It is essential that the required vulnerability detection tools are pre-installed and have been added to path. Ensure that you are using an adaptor that is compatible with the version of your generator. Using a more recent generator than the adaptor is designed for, may result in missing CWE's, SFP's, and Clusters. + +House Keeping: +Because the TOIF output provides information relating to the parties and tools involved in the analysis of a project, this information must be entered into a file and handed to the Adaptor as an argument. The text file is a map of keys and values. The keys relate to facts and entities used in the project, while the values are information about that particular fact or entity. It is imperitive that this information is included. It is recomended that you follow this example. + +House Keeping Example: + + ########################### + # Facts + ########################### + + TOIFSegmentIsRelatedToProject=project1 + TOIFSegmentIsProducedByOrganization=org1 + TOIFSegmentIsOwnedByOrganization=org1 + TOIFSegmentIsGeneratedByPerson=person1 + TOIFSegmentIsSupervisedByPerson=person1 + + PersonIsInvolvedInProjectAsRole=person1;project1;role1 + OrganizationIsInvolvedInProjectAsRole=org1;project1;role2 + OrganizationIsPartOfOrganizationAsRole=org1;org2;role2 + PersonIsEmployedByOrganizationAsRole=person1;org1;role1 + + ########################### + # Entities + ########################### + + SegmentDescription=Segment relating to the findings on the wireshark project. + + #projectId=name;description + project1=Wireshark;Using Wireshark to test the TOIF tool chain. + + #personId=name;email;phone + person1=Adam Nunn;adam@kdmanalytics.com;555-1234 + #person2=Joe Bloggs;blogs@kdmanalytics.com;555-1234 + + #organizationId=name;description;address;phone;email + org1=KDM;Kdm Analytics;Richmond Road;555-5555;kdm@kdmanalytics.com + + #organizationId=name;description;address;phone;email + org2=Acme Corporation;Acme Corporation;blah;555-5555;thingamy@thingamy.com + + #roleId=name;description + role1=Software Developer;Developer on the TOIF Adaptors project + role2=company;employer + +-------------------------------------------------------------------------------------------------------------------- + +Running the Adaptor from command line: +The adaptor is run from the command line. Which adaptor to use with the framework is included in the arguments. + + toif --adaptor= --inputfile= --outputdirectory= --houseKeeping= [Additional arguments] + +“--adaptor” + The name of the adaptor class. This is usually the name of the adaptor jar file without the version number. This is the adaptor that is to be used with the input source file. From this class, the framework is able to discover house keeping facts about the adaptor as well as which generator to call and what options to use. + +“--inputFile” + The full path to the input source file. In order for the adaptors to create all the facts for this file, a full path must be provided + +“--outputDirectory” + The path to the output directory. This is the directory where the subdirectories containing the TOIF XML file will be written. + +“--houseKeeping” + The path to the file containing the facts about the project's house keeping. This file is specific to each adaptor and each project. This is because it is down to the user to provide the project details as well as which generator (scan tool) is running on the system. + +Any additional arguments may be entered after the ToifAdaptor's required arguments. These may be included files or compilation options, they will vary from generator to generator. + +eg splint takes -I and -D options: + java -cp "/home/user/adaptors/*" ToifAdaptor -a SplintAdaptor -i /home/user/foo.c -o /home/user/output -h housekeepingFile.txt -I./includes -D_U_= + +-------------------------------------------------------------------------------------------------------------------- + +Integrating with a C project's build: +The best way to integrate the adaptors into the build, is by wrapping the compiler and the adaptors into a script. When the compiler is called, the adaptors will be run for every source file used. To get the build process to use this wrapper instead of the compiler on its own, the compiler flag needs to be set during configuration of the make: + + ./configure CC=myGccWrapper + +The make can then be continued as normal: + + make + make install + +-------------------------------------------------------------------------------------------------------------------- + +Integrating with Java project build: +It may be possible to integrate into a Java project's build by modifying Apache Ant's “build.xml” file. Create a new target which will find all the “.class” files in the destination directory of the project. For each file, the javaAdaptors script will be run with the arguments that are specified: + + + + + + + + + + + + + + + + + + + +To run the adaptors and compile the project, the following command should be given: + + ant check + +-------------------------------------------------------------------------------------------------------------------- + +Validation: + +Validation of the ouput of the TOIF tool can be performed with xmllint. + + xmllint --noout --schema + +Note: xmllint accepts the "*" to validate more than one file at a time. + +-------------------------------------------------------------------------------------------------------------------- + +ASSIMILATOR +============ + +The assimilator merges TOIF findings into a common fact-orientated repository or file. + +-------------------------------------------------------------------------------------------------------------------- + +To run the assimilator, execute the assimilator script on the command line, specifying the repository location and the files to merge. + +assimilator.sh -k + + -k used to specify a output .kdm file. + + + +-------------------------------------------------------------------------------------------------------------------- + +REPORT VIEW +============ + +Report views allow you to view the toif findings in eclipse. + +-------------------------------------------------------------------------------------------------------------------- + +The UpdateSite.zip file can be used like a regular updatesite in eclipse. When installing new software from the help menu, "Add" the UpdateSite.zip as an archive and follow the regular eclipse-plugin process. +Kdm files should be imported via right clicking on the project, selecting "Import" -> "SFP/CWE" -> "Import integrated SFP/CWE File". The project will then need to be selected and the kdm file choosen from the browse buton. +You can then go "Project" -> "SFP/CWE" -> "(Re)Build Defect model". + +Known Issuse: + The trace back currently shows numbers as reported by the toif adaptors unlike the code locations in the views list (which are normalized to kdm locations). + + Before "(Re)Build Defect Model" is used on a different project, the toif view should be closed. diff --git a/README b/README new file mode 100644 index 00000000..4fe1228e --- /dev/null +++ b/README @@ -0,0 +1,4 @@ +toif +==== + +The Tool Output Integration Framework (TOIF) is a powerful composite vulnerability detection platform that automatically combines results from separate code defect scanner tools into one common reporting format and defect management platform. TOIF normalizes and analyzes the results of each tool to add weighting to defect reports, remove duplicates and assign consistent Common Weakness Enumeration (CWE) codes. The management platform provides the list of defects, along with sorting by defect type and tool, weighting and action status (defect citing). diff --git a/com.kdmanalytics.standAlone.toif.report/.classpath b/com.kdmanalytics.standAlone.toif.report/.classpath new file mode 100644 index 00000000..ad32c83a --- /dev/null +++ b/com.kdmanalytics.standAlone.toif.report/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/com.kdmanalytics.standAlone.toif.report/.project b/com.kdmanalytics.standAlone.toif.report/.project new file mode 100644 index 00000000..2d63abd6 --- /dev/null +++ b/com.kdmanalytics.standAlone.toif.report/.project @@ -0,0 +1,28 @@ + + + com.kdmanalytics.standAlone.toif.report + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + + org.eclipse.pde.PluginNature + org.eclipse.jdt.core.javanature + + diff --git a/com.kdmanalytics.standAlone.toif.report/.settings/org.eclipse.jdt.core.prefs b/com.kdmanalytics.standAlone.toif.report/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 00000000..56e50dde --- /dev/null +++ b/com.kdmanalytics.standAlone.toif.report/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,8 @@ +#Wed Apr 25 14:35:50 EDT 2012 +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 +org.eclipse.jdt.core.compiler.compliance=1.6 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.6 diff --git a/com.kdmanalytics.standAlone.toif.report/META-INF/MANIFEST.MF b/com.kdmanalytics.standAlone.toif.report/META-INF/MANIFEST.MF new file mode 100644 index 00000000..92e28de4 --- /dev/null +++ b/com.kdmanalytics.standAlone.toif.report/META-INF/MANIFEST.MF @@ -0,0 +1,14 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: TOIF Report +Bundle-SymbolicName: com.kdmanalytics.standAlone.toif.report;singleton:=true +Bundle-Version: 1.16.0.qualifier +Bundle-Activator: com.kdmanalytics.standalone.toif.report.Activator +Bundle-Vendor: KDM Analytics Inc. +Require-Bundle: org.eclipse.ui;bundle-version="[3.7.0,5.0.0)", + org.eclipse.core.runtime;bundle-version="[3.7.0,5.0.0)", + org.eclipse.core.resources;bundle-version="[3.7.0,5.0.0)", + org.openrdf.sesame;bundle-version="[2.4.0,2.5.0)", + com.kdmanalytics.toif.report;bundle-version="[1.6.0,2.0.0)" +Bundle-RequiredExecutionEnvironment: JavaSE-1.6 +Bundle-ActivationPolicy: lazy diff --git a/com.kdmanalytics.standAlone.toif.report/bin/com/kdmanalytics/standalone/toif/report/Activator.class b/com.kdmanalytics.standAlone.toif.report/bin/com/kdmanalytics/standalone/toif/report/Activator.class new file mode 100644 index 00000000..9889779e Binary files /dev/null and b/com.kdmanalytics.standAlone.toif.report/bin/com/kdmanalytics/standalone/toif/report/Activator.class differ diff --git a/com.kdmanalytics.standAlone.toif.report/bin/com/kdmanalytics/standalone/toif/report/repositoryMaker/RepositoryMaker.class b/com.kdmanalytics.standAlone.toif.report/bin/com/kdmanalytics/standalone/toif/report/repositoryMaker/RepositoryMaker.class new file mode 100644 index 00000000..323939dc Binary files /dev/null and b/com.kdmanalytics.standAlone.toif.report/bin/com/kdmanalytics/standalone/toif/report/repositoryMaker/RepositoryMaker.class differ diff --git a/com.kdmanalytics.standAlone.toif.report/build.properties b/com.kdmanalytics.standAlone.toif.report/build.properties new file mode 100644 index 00000000..e9863e28 --- /dev/null +++ b/com.kdmanalytics.standAlone.toif.report/build.properties @@ -0,0 +1,5 @@ +source.. = src/ +output.. = bin/ +bin.includes = META-INF/,\ + .,\ + plugin.xml diff --git a/com.kdmanalytics.standAlone.toif.report/plugin.xml b/com.kdmanalytics.standAlone.toif.report/plugin.xml new file mode 100644 index 00000000..f23f1f55 --- /dev/null +++ b/com.kdmanalytics.standAlone.toif.report/plugin.xml @@ -0,0 +1,11 @@ + + + + + + + + + diff --git a/com.kdmanalytics.standAlone.toif.report/src/com/kdmanalytics/standalone/toif/report/Activator.java b/com.kdmanalytics.standAlone.toif.report/src/com/kdmanalytics/standalone/toif/report/Activator.java new file mode 100644 index 00000000..d7d14c63 --- /dev/null +++ b/com.kdmanalytics.standAlone.toif.report/src/com/kdmanalytics/standalone/toif/report/Activator.java @@ -0,0 +1,56 @@ +/******************************************************************************* + * Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This program and the + * accompanying materials are made available under the terms of the Open Source + * Initiative OSI - Open Software License v3.0 which accompanies this + * distribution, and is available at http://www.opensource.org/licenses/osl-3.0.php/ + ******************************************************************************/ +package com.kdmanalytics.standalone.toif.report; + +import org.eclipse.ui.plugin.AbstractUIPlugin; +import org.osgi.framework.BundleContext; + +/** + * The activator class controls the plug-in life cycle + */ +public class Activator extends AbstractUIPlugin { + + // The plug-in ID + public static final String PLUGIN_ID = "com.kdmanalytics.standalone.toif.report"; //$NON-NLS-1$ + + // The shared instance + private static Activator plugin; + + /** + * The constructor + */ + public Activator() { + } + + /* + * (non-Javadoc) + * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) + */ + public void start(BundleContext context) throws Exception { + super.start(context); + plugin = this; + } + + /* + * (non-Javadoc) + * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) + */ + public void stop(BundleContext context) throws Exception { + plugin = null; + super.stop(context); + } + + /** + * Returns the shared instance + * + * @return the shared instance + */ + public static Activator getDefault() { + return plugin; + } + +} diff --git a/com.kdmanalytics.standAlone.toif.report/src/com/kdmanalytics/standalone/toif/report/repositoryMaker/RepositoryMaker.java b/com.kdmanalytics.standAlone.toif.report/src/com/kdmanalytics/standalone/toif/report/repositoryMaker/RepositoryMaker.java new file mode 100644 index 00000000..dfac0bd0 --- /dev/null +++ b/com.kdmanalytics.standAlone.toif.report/src/com/kdmanalytics/standalone/toif/report/repositoryMaker/RepositoryMaker.java @@ -0,0 +1,67 @@ +/** + * KDM Analytics Inc - (2012) + * + * @Author Adam Nunn + * @Date Mar 27, 2012 + */ +package com.kdmanalytics.standalone.toif.report.repositoryMaker; + +import java.io.File; + +import org.eclipse.core.resources.IFolder; +import org.openrdf.repository.Repository; +import org.openrdf.repository.sail.SailRepository; +import org.openrdf.sail.nativerdf.NativeStore; + +import com.kdmanalytics.toif.report.util.IRepositoryMaker; + +/** + * @author adam + * + */ +public class RepositoryMaker implements IRepositoryMaker +{ + + private IFolder folder; + + private Repository repository; + + public RepositoryMaker() + { + } + + /** + * @param folder + */ + public RepositoryMaker(IFolder folder) + { + this.folder = folder; + createRepository(); + } + + /** + * + */ + @Override + public void createRepository() + { + File file = new File(folder.getLocationURI()); + NativeStore nativeStore = new NativeStore(file); + repository = new SailRepository(nativeStore); + } + + /** + * @return + */ + @Override + public Repository getRepository() + { + return repository; + } + + @Override + public void setFolder(IFolder folder) { + this.folder = folder; + } + +} diff --git a/com.kdmanalytics.toif.assimilator/.classpath b/com.kdmanalytics.toif.assimilator/.classpath new file mode 100644 index 00000000..098194ca --- /dev/null +++ b/com.kdmanalytics.toif.assimilator/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/com.kdmanalytics.toif.assimilator/.project b/com.kdmanalytics.toif.assimilator/.project new file mode 100644 index 00000000..601cd5d6 --- /dev/null +++ b/com.kdmanalytics.toif.assimilator/.project @@ -0,0 +1,28 @@ + + + com.kdmanalytics.toif.assimilator + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + + org.eclipse.pde.PluginNature + org.eclipse.jdt.core.javanature + + diff --git a/com.kdmanalytics.toif.assimilator/.settings/org.eclipse.jdt.core.prefs b/com.kdmanalytics.toif.assimilator/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 00000000..7341ab16 --- /dev/null +++ b/com.kdmanalytics.toif.assimilator/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,11 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +org.eclipse.jdt.core.compiler.compliance=1.7 +org.eclipse.jdt.core.compiler.debug.lineNumber=generate +org.eclipse.jdt.core.compiler.debug.localVariable=generate +org.eclipse.jdt.core.compiler.debug.sourceFile=generate +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.7 diff --git a/com.kdmanalytics.toif.assimilator/.settings/org.eclipse.jdt.ui.prefs b/com.kdmanalytics.toif.assimilator/.settings/org.eclipse.jdt.ui.prefs new file mode 100644 index 00000000..9bf9b5f0 --- /dev/null +++ b/com.kdmanalytics.toif.assimilator/.settings/org.eclipse.jdt.ui.prefs @@ -0,0 +1,4 @@ +#Wed Mar 07 11:57:17 EST 2012 +eclipse.preferences.version=1 +org.eclipse.jdt.ui.javadoc=true +org.eclipse.jdt.ui.text.custom_code_templates= diff --git a/com.kdmanalytics.toif.assimilator/META-INF/MANIFEST.MF b/com.kdmanalytics.toif.assimilator/META-INF/MANIFEST.MF new file mode 100644 index 00000000..4c282abb --- /dev/null +++ b/com.kdmanalytics.toif.assimilator/META-INF/MANIFEST.MF @@ -0,0 +1,25 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: TOIF Assimilator +Bundle-SymbolicName: com.kdmanalytics.toif.assimilator;singleton:=true +Bundle-Version: 1.16.0.qualifier +Bundle-Activator: com.kdmanalytics.toif.assimilator.Activator +Bundle-Vendor: KDM Analytics Inc. +Require-Bundle: org.apache.xerces;bundle-version="[2.11.0,3.0.0)", + org.apache.log4j;bundle-version="[1.2.15,1.3.0)", + org.apache.commons.lang3;bundle-version="[3.1.0,4.0.0)", + org.apache.commons.io;bundle-version="[2.4.0,3.0.0)", + org.openrdf.sesame;bundle-version="[2.4.0,2.5.0)", + org.eclipse.core.runtime;bundle-version="[3.7.0,4.0.0)", + com.kdmanalytics.kdm.repositoryMerger;bundle-version="[1.0.0,2.0.0)", + com.google.guava;bundle-version="[14.0.1,15.0.0)", + com.kdmanalytics.toif.common;bundle-version="[1.14.0,2.0.0)" +Bundle-RequiredExecutionEnvironment: JavaSE-1.7 +Bundle-ActivationPolicy: lazy +Export-Package: com.kdmanalytics.toif.assimilator; uses:="com.kdmanaly + tics.toif.mergers, org.apache.log4j, org.eclipse.ui.plugin, org.os + gi.framework, org.openrdf.repository, com.kdmanalytics.kdm.reposito + ryMerger, org.openrdf.model",com.kdmanalytics.toif.assimilator.confi + g,com.kdmanalytics.toif.assimilator.exceptions,com.kdmanalytics.toif. + assimilator.toifRdfTypes;uses:="org.w3c.dom,org.openrdf.model",com.kd + manalytics.toif.mergers;uses:="org.openrdf.model,org.w3c.dom" diff --git a/com.kdmanalytics.toif.assimilator/bin/com/kdmanalytics/toif/assimilator/Activator.class b/com.kdmanalytics.toif.assimilator/bin/com/kdmanalytics/toif/assimilator/Activator.class new file mode 100644 index 00000000..518e5ac0 Binary files /dev/null and b/com.kdmanalytics.toif.assimilator/bin/com/kdmanalytics/toif/assimilator/Activator.class differ diff --git a/com.kdmanalytics.toif.assimilator/bin/com/kdmanalytics/toif/assimilator/Assimilator$1.class b/com.kdmanalytics.toif.assimilator/bin/com/kdmanalytics/toif/assimilator/Assimilator$1.class new file mode 100644 index 00000000..38e7edb9 Binary files /dev/null and b/com.kdmanalytics.toif.assimilator/bin/com/kdmanalytics/toif/assimilator/Assimilator$1.class differ diff --git a/com.kdmanalytics.toif.assimilator/bin/com/kdmanalytics/toif/assimilator/Assimilator$2.class b/com.kdmanalytics.toif.assimilator/bin/com/kdmanalytics/toif/assimilator/Assimilator$2.class new file mode 100644 index 00000000..037f676c Binary files /dev/null and b/com.kdmanalytics.toif.assimilator/bin/com/kdmanalytics/toif/assimilator/Assimilator$2.class differ diff --git a/com.kdmanalytics.toif.assimilator/bin/com/kdmanalytics/toif/assimilator/Assimilator$3.class b/com.kdmanalytics.toif.assimilator/bin/com/kdmanalytics/toif/assimilator/Assimilator$3.class new file mode 100644 index 00000000..8a848c3c Binary files /dev/null and b/com.kdmanalytics.toif.assimilator/bin/com/kdmanalytics/toif/assimilator/Assimilator$3.class differ diff --git a/com.kdmanalytics.toif.assimilator/bin/com/kdmanalytics/toif/assimilator/Assimilator$4.class b/com.kdmanalytics.toif.assimilator/bin/com/kdmanalytics/toif/assimilator/Assimilator$4.class new file mode 100644 index 00000000..8b102803 Binary files /dev/null and b/com.kdmanalytics.toif.assimilator/bin/com/kdmanalytics/toif/assimilator/Assimilator$4.class differ diff --git a/com.kdmanalytics.toif.assimilator/bin/com/kdmanalytics/toif/assimilator/Assimilator$5.class b/com.kdmanalytics.toif.assimilator/bin/com/kdmanalytics/toif/assimilator/Assimilator$5.class new file mode 100644 index 00000000..ad0173e8 Binary files /dev/null and b/com.kdmanalytics.toif.assimilator/bin/com/kdmanalytics/toif/assimilator/Assimilator$5.class differ diff --git a/com.kdmanalytics.toif.assimilator/bin/com/kdmanalytics/toif/assimilator/Assimilator$ThreadStatus.class b/com.kdmanalytics.toif.assimilator/bin/com/kdmanalytics/toif/assimilator/Assimilator$ThreadStatus.class new file mode 100644 index 00000000..38471789 Binary files /dev/null and b/com.kdmanalytics.toif.assimilator/bin/com/kdmanalytics/toif/assimilator/Assimilator$ThreadStatus.class differ diff --git a/com.kdmanalytics.toif.assimilator/bin/com/kdmanalytics/toif/assimilator/Assimilator.class b/com.kdmanalytics.toif.assimilator/bin/com/kdmanalytics/toif/assimilator/Assimilator.class new file mode 100644 index 00000000..1f3250e5 Binary files /dev/null and b/com.kdmanalytics.toif.assimilator/bin/com/kdmanalytics/toif/assimilator/Assimilator.class differ diff --git a/com.kdmanalytics.toif.assimilator/bin/com/kdmanalytics/toif/assimilator/AttributeUtilities.class b/com.kdmanalytics.toif.assimilator/bin/com/kdmanalytics/toif/assimilator/AttributeUtilities.class new file mode 100644 index 00000000..074999cf Binary files /dev/null and b/com.kdmanalytics.toif.assimilator/bin/com/kdmanalytics/toif/assimilator/AttributeUtilities.class differ diff --git a/com.kdmanalytics.toif.assimilator/bin/com/kdmanalytics/toif/assimilator/DelayedRelation.class b/com.kdmanalytics.toif.assimilator/bin/com/kdmanalytics/toif/assimilator/DelayedRelation.class new file mode 100644 index 00000000..1d082c66 Binary files /dev/null and b/com.kdmanalytics.toif.assimilator/bin/com/kdmanalytics/toif/assimilator/DelayedRelation.class differ diff --git a/com.kdmanalytics.toif.assimilator/bin/com/kdmanalytics/toif/assimilator/FilePathTree$Node.class b/com.kdmanalytics.toif.assimilator/bin/com/kdmanalytics/toif/assimilator/FilePathTree$Node.class new file mode 100644 index 00000000..0d4e0465 Binary files /dev/null and b/com.kdmanalytics.toif.assimilator/bin/com/kdmanalytics/toif/assimilator/FilePathTree$Node.class differ diff --git a/com.kdmanalytics.toif.assimilator/bin/com/kdmanalytics/toif/assimilator/FilePathTree.class b/com.kdmanalytics.toif.assimilator/bin/com/kdmanalytics/toif/assimilator/FilePathTree.class new file mode 100644 index 00000000..42ffb03d Binary files /dev/null and b/com.kdmanalytics.toif.assimilator/bin/com/kdmanalytics/toif/assimilator/FilePathTree.class differ diff --git a/com.kdmanalytics.toif.assimilator/bin/com/kdmanalytics/toif/assimilator/FilePathTrie$Node.class b/com.kdmanalytics.toif.assimilator/bin/com/kdmanalytics/toif/assimilator/FilePathTrie$Node.class new file mode 100644 index 00000000..f0e24a34 Binary files /dev/null and b/com.kdmanalytics.toif.assimilator/bin/com/kdmanalytics/toif/assimilator/FilePathTrie$Node.class differ diff --git a/com.kdmanalytics.toif.assimilator/bin/com/kdmanalytics/toif/assimilator/FilePathTrie.class b/com.kdmanalytics.toif.assimilator/bin/com/kdmanalytics/toif/assimilator/FilePathTrie.class new file mode 100644 index 00000000..bd4330ff Binary files /dev/null and b/com.kdmanalytics.toif.assimilator/bin/com/kdmanalytics/toif/assimilator/FilePathTrie.class differ diff --git a/com.kdmanalytics.toif.assimilator/bin/com/kdmanalytics/toif/assimilator/KdmXmiIdHandler.class b/com.kdmanalytics.toif.assimilator/bin/com/kdmanalytics/toif/assimilator/KdmXmiIdHandler.class new file mode 100644 index 00000000..8c6b8227 Binary files /dev/null and b/com.kdmanalytics.toif.assimilator/bin/com/kdmanalytics/toif/assimilator/KdmXmiIdHandler.class differ diff --git a/com.kdmanalytics.toif.assimilator/bin/com/kdmanalytics/toif/assimilator/KdmXmlHandler.class b/com.kdmanalytics.toif.assimilator/bin/com/kdmanalytics/toif/assimilator/KdmXmlHandler.class new file mode 100644 index 00000000..d9f981ca Binary files /dev/null and b/com.kdmanalytics.toif.assimilator/bin/com/kdmanalytics/toif/assimilator/KdmXmlHandler.class differ diff --git a/com.kdmanalytics.toif.assimilator/bin/com/kdmanalytics/toif/assimilator/TripleStatementWriter.class b/com.kdmanalytics.toif.assimilator/bin/com/kdmanalytics/toif/assimilator/TripleStatementWriter.class new file mode 100644 index 00000000..6bc13fc7 Binary files /dev/null and b/com.kdmanalytics.toif.assimilator/bin/com/kdmanalytics/toif/assimilator/TripleStatementWriter.class differ diff --git a/com.kdmanalytics.toif.assimilator/bin/com/kdmanalytics/toif/assimilator/UniqueID.class b/com.kdmanalytics.toif.assimilator/bin/com/kdmanalytics/toif/assimilator/UniqueID.class new file mode 100644 index 00000000..e9fc7cba Binary files /dev/null and b/com.kdmanalytics.toif.assimilator/bin/com/kdmanalytics/toif/assimilator/UniqueID.class differ diff --git a/com.kdmanalytics.toif.assimilator/bin/com/kdmanalytics/toif/assimilator/XMLNode.class b/com.kdmanalytics.toif.assimilator/bin/com/kdmanalytics/toif/assimilator/XMLNode.class new file mode 100644 index 00000000..e02db5b3 Binary files /dev/null and b/com.kdmanalytics.toif.assimilator/bin/com/kdmanalytics/toif/assimilator/XMLNode.class differ diff --git a/com.kdmanalytics.toif.assimilator/bin/com/kdmanalytics/toif/assimilator/config/cxx.cfg b/com.kdmanalytics.toif.assimilator/bin/com/kdmanalytics/toif/assimilator/config/cxx.cfg new file mode 100644 index 00000000..01fd647d --- /dev/null +++ b/com.kdmanalytics.toif.assimilator/bin/com/kdmanalytics/toif/assimilator/config/cxx.cfg @@ -0,0 +1,39 @@ +# Actions define the merge behaviour for various element KDM types. This specifies +# how two files are merged together. +# +# MERGE Merges the contents of like IDed nodes together +# COPY Copies the information in the node even if the ID is already represented +# IGNORE Does not specifically merge or copy data, but recurses down the tree and +# let the children specify for themselves. +# +# To match multiple elements you may use regular expressions. +# +# The default behaviour is specified by using catch all regex ".*". Ensure that this +# is the LAST element or it will mask any other regex entries. +# +# When identifying a merge type for an element, first an exact match is attempted, +# then regular expressions are evaluated in the order in which they appear in the +# file. +# +action,code/Package,MERGE +action,code/LanguageUnit,MERGE +action,code/SharedUnit,MERGE +action,code/CodeAssembly,MERGE +action,code/CompilationUnit,MERGE +action,code/CompilationUnit,MERGE +action,source/StorableUnit,MERGE +action,source/Directory,MERGE +action,code/MethodUnit,SINGLETON +action,code/CallableUnit,SINGLETON +action,action/BlockUnit,SINGLETON +action,.*Model,MERGE +action,kdm/ExtensionFamily,MERGE +action,data/DataContainer,MERGE + +# This regex matches everything else. Note that the default behaviour in the linker +# is currently to ignore, but since this could change it is probably a good idea to +# actively code this behaviour. +action,.*,IGNORE + +# When elements have no IDs, how should they be handled? +noid,COPY \ No newline at end of file diff --git a/com.kdmanalytics.toif.assimilator/bin/com/kdmanalytics/toif/assimilator/exceptions/AssimilatorArgumentException.class b/com.kdmanalytics.toif.assimilator/bin/com/kdmanalytics/toif/assimilator/exceptions/AssimilatorArgumentException.class new file mode 100644 index 00000000..39a292f5 Binary files /dev/null and b/com.kdmanalytics.toif.assimilator/bin/com/kdmanalytics/toif/assimilator/exceptions/AssimilatorArgumentException.class differ diff --git a/com.kdmanalytics.toif.assimilator/bin/com/kdmanalytics/toif/assimilator/toifRdfTypes/SeenStatement.class b/com.kdmanalytics.toif.assimilator/bin/com/kdmanalytics/toif/assimilator/toifRdfTypes/SeenStatement.class new file mode 100644 index 00000000..b24cd309 Binary files /dev/null and b/com.kdmanalytics.toif.assimilator/bin/com/kdmanalytics/toif/assimilator/toifRdfTypes/SeenStatement.class differ diff --git a/com.kdmanalytics.toif.assimilator/bin/com/kdmanalytics/toif/assimilator/toifRdfTypes/ToifRdfBnode.class b/com.kdmanalytics.toif.assimilator/bin/com/kdmanalytics/toif/assimilator/toifRdfTypes/ToifRdfBnode.class new file mode 100644 index 00000000..b46f7c9f Binary files /dev/null and b/com.kdmanalytics.toif.assimilator/bin/com/kdmanalytics/toif/assimilator/toifRdfTypes/ToifRdfBnode.class differ diff --git a/com.kdmanalytics.toif.assimilator/bin/com/kdmanalytics/toif/assimilator/toifRdfTypes/ToifRdfFile.class b/com.kdmanalytics.toif.assimilator/bin/com/kdmanalytics/toif/assimilator/toifRdfTypes/ToifRdfFile.class new file mode 100644 index 00000000..d94e35ac Binary files /dev/null and b/com.kdmanalytics.toif.assimilator/bin/com/kdmanalytics/toif/assimilator/toifRdfTypes/ToifRdfFile.class differ diff --git a/com.kdmanalytics.toif.assimilator/bin/com/kdmanalytics/toif/assimilator/toifRdfTypes/ToifRdfResource.class b/com.kdmanalytics.toif.assimilator/bin/com/kdmanalytics/toif/assimilator/toifRdfTypes/ToifRdfResource.class new file mode 100644 index 00000000..2cbe97d7 Binary files /dev/null and b/com.kdmanalytics.toif.assimilator/bin/com/kdmanalytics/toif/assimilator/toifRdfTypes/ToifRdfResource.class differ diff --git a/com.kdmanalytics.toif.assimilator/bin/com/kdmanalytics/toif/assimilator/toifRdfTypes/ToifRdfValue.class b/com.kdmanalytics.toif.assimilator/bin/com/kdmanalytics/toif/assimilator/toifRdfTypes/ToifRdfValue.class new file mode 100644 index 00000000..fe33aa2e Binary files /dev/null and b/com.kdmanalytics.toif.assimilator/bin/com/kdmanalytics/toif/assimilator/toifRdfTypes/ToifRdfValue.class differ diff --git a/com.kdmanalytics.toif.assimilator/bin/com/kdmanalytics/toif/assimilator/toifRdfTypes/ToifStatement.class b/com.kdmanalytics.toif.assimilator/bin/com/kdmanalytics/toif/assimilator/toifRdfTypes/ToifStatement.class new file mode 100644 index 00000000..1dee27fa Binary files /dev/null and b/com.kdmanalytics.toif.assimilator/bin/com/kdmanalytics/toif/assimilator/toifRdfTypes/ToifStatement.class differ diff --git a/com.kdmanalytics.toif.assimilator/bin/com/kdmanalytics/toif/mergers/StatementMapping.class b/com.kdmanalytics.toif.assimilator/bin/com/kdmanalytics/toif/mergers/StatementMapping.class new file mode 100644 index 00000000..0612fe2f Binary files /dev/null and b/com.kdmanalytics.toif.assimilator/bin/com/kdmanalytics/toif/mergers/StatementMapping.class differ diff --git a/com.kdmanalytics.toif.assimilator/bin/com/kdmanalytics/toif/mergers/ToifMerger.class b/com.kdmanalytics.toif.assimilator/bin/com/kdmanalytics/toif/mergers/ToifMerger.class new file mode 100644 index 00000000..83b0db7c Binary files /dev/null and b/com.kdmanalytics.toif.assimilator/bin/com/kdmanalytics/toif/mergers/ToifMerger.class differ diff --git a/com.kdmanalytics.toif.assimilator/bin/log4j.properties b/com.kdmanalytics.toif.assimilator/bin/log4j.properties new file mode 100644 index 00000000..6474c8fe --- /dev/null +++ b/com.kdmanalytics.toif.assimilator/bin/log4j.properties @@ -0,0 +1,7 @@ +#------------------------------------------------------------------------------- +# Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This program and the +# accompanying materials are made available under the terms of the Open Source +# Initiative OSI - Open Software License v3.0 which accompanies this +# distribution, and is available at http://www.opensource.org/licenses/osl-3.0.php/ +#------------------------------------------------------------------------------- +log4j.rootCategory=OFF diff --git a/com.kdmanalytics.toif.assimilator/build.properties b/com.kdmanalytics.toif.assimilator/build.properties new file mode 100644 index 00000000..99752de7 --- /dev/null +++ b/com.kdmanalytics.toif.assimilator/build.properties @@ -0,0 +1,5 @@ +source.. = src/ +output.. = bin/ +bin.includes = META-INF/,\ + . +src.includes = bin/ diff --git a/com.kdmanalytics.toif.assimilator/pom.xml b/com.kdmanalytics.toif.assimilator/pom.xml new file mode 100644 index 00000000..437f5459 --- /dev/null +++ b/com.kdmanalytics.toif.assimilator/pom.xml @@ -0,0 +1,21 @@ + + + + 4.0.0 + + + com.kdmanalytics.toif + plugins + 1.16.0-SNAPSHOT + + + com.kdmanalytics.toif.compile + com.kdmanalytics.toif.assimilator + + + eclipse-plugin + + TOIF Assimilator + \ No newline at end of file diff --git a/com.kdmanalytics.toif.assimilator/src/com/kdmanalytics/toif/assimilator/Activator.java b/com.kdmanalytics.toif.assimilator/src/com/kdmanalytics/toif/assimilator/Activator.java new file mode 100644 index 00000000..d2c1d993 --- /dev/null +++ b/com.kdmanalytics.toif.assimilator/src/com/kdmanalytics/toif/assimilator/Activator.java @@ -0,0 +1,36 @@ +/******************************************************************************* + * Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This program and the + * accompanying materials are made available under the terms of the Open Source + * Initiative OSI - Open Software License v3.0 which accompanies this + * distribution, and is available at http://www.opensource.org/licenses/osl-3.0.php/ + ******************************************************************************/ +package com.kdmanalytics.toif.assimilator; + +import org.osgi.framework.BundleActivator; +import org.osgi.framework.BundleContext; + +public class Activator implements BundleActivator { + + private static BundleContext context; + + static BundleContext getContext() { + return context; + } + + /* + * (non-Javadoc) + * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext) + */ + public void start(BundleContext bundleContext) throws Exception { + Activator.context = bundleContext; + } + + /* + * (non-Javadoc) + * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext) + */ + public void stop(BundleContext bundleContext) throws Exception { + Activator.context = null; + } + +} diff --git a/com.kdmanalytics.toif.assimilator/src/com/kdmanalytics/toif/assimilator/Assimilator.java b/com.kdmanalytics.toif.assimilator/src/com/kdmanalytics/toif/assimilator/Assimilator.java new file mode 100644 index 00000000..ea200760 --- /dev/null +++ b/com.kdmanalytics.toif.assimilator/src/com/kdmanalytics/toif/assimilator/Assimilator.java @@ -0,0 +1,2326 @@ +/******************************************************************************* + * Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This program and + * the accompanying materials are made available under the terms of the Open + * Source Initiative OSI - Open Software License v3.0 which accompanies this + * distribution, and is available at + * http://www.opensource.org/licenses/osl-3.0.php/ + ******************************************************************************/ + +package com.kdmanalytics.toif.assimilator; + +import static com.google.common.base.Preconditions.checkNotNull; + +import java.io.BufferedReader; +import java.io.DataInputStream; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.OutputStreamWriter; +import java.io.PipedInputStream; +import java.io.PipedOutputStream; +import java.io.PrintWriter; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.zip.ZipEntry; +import java.util.zip.ZipInputStream; +import java.util.zip.ZipOutputStream; + +import javax.xml.parsers.ParserConfigurationException; +import javax.xml.parsers.SAXParser; +import javax.xml.parsers.SAXParserFactory; + +import org.apache.commons.io.FileUtils; +import org.apache.commons.io.filefilter.IOFileFilter; +import org.apache.commons.io.filefilter.TrueFileFilter; +import org.apache.commons.lang3.StringEscapeUtils; +import org.apache.log4j.Logger; +import org.openrdf.model.Literal; +import org.openrdf.model.Resource; +import org.openrdf.model.Statement; +import org.openrdf.model.URI; +import org.openrdf.model.Value; +import org.openrdf.model.ValueFactory; +import org.openrdf.model.impl.StatementImpl; +import org.openrdf.query.MalformedQueryException; +import org.openrdf.query.QueryEvaluationException; +import org.openrdf.repository.Repository; +import org.openrdf.repository.RepositoryConnection; +import org.openrdf.repository.RepositoryException; +import org.openrdf.repository.RepositoryResult; +import org.openrdf.repository.sail.SailRepository; +import org.openrdf.sail.memory.MemoryStore; +import org.openrdf.sail.nativerdf.NativeStore; +import org.xml.sax.InputSource; +import org.xml.sax.SAXException; + +import com.google.common.io.Files; +import com.kdmanalytics.kdm.repositoryMerger.RepositoryMerger; +import com.kdmanalytics.kdm.repositoryMerger.linkconfig.LinkConfig; +import com.kdmanalytics.kdm.repositoryMerger.linkconfig.MergeConfig; +import com.kdmanalytics.toif.assimilator.FilePathTrie.Node; +import com.kdmanalytics.toif.assimilator.exceptions.AssimilatorArgumentException; +import com.kdmanalytics.toif.common.exception.ToifException; +import com.kdmanalytics.toif.mergers.ToifMerger; + +/** + * This class takes a number of tkdm and toif files and integrates them into one + * repository. Each domain is merged with its self first, then integrated with + * each other. + * + * @author adam + * + */ +public class Assimilator +{ + + public static void debug(Logger logger, Object message) + { + logger.debug(message); + } + + static public void deleteDirectory(File path) + { + if (path.exists()) + { + File[] files = path.listFiles(); + for (int i = 0; i < files.length; i++) + { + if (files[i].isDirectory()) + { + deleteDirectory(files[i]); + } + else + { + files[i].delete(); + } + } + } + return; + } + + /** + * Entry point for the assimilator. Takes an array of strings. These are the + * repository options -r , and the unparsed options + * (files) that need to be assimilated. + * + * @param args + * the repository option and location, and the files to be + * assimilated. TODO: remove main since we are now using RCP app + * and can be a security hole/ public static void main(String[] + * args) { Assimilator assimilator = new Assimilator(); // + * assimilate the files. assimilator.assimilate(args); + * + * } + * + * /** do we continue if exceptions are found. + */ + private final boolean force = true; + + /** + * KDM name space + */ + private static final String KDM_NS_HOST = "http://org.omg.kdm/"; + + /** + * the logger. + */ + private static Logger LOG = Logger.getLogger(Assimilator.class); + + /** + * the model namespace. + */ + private static final String MODEL_NS = "http://kdmanalytics.com/"; + + /** + * tkdm extension + */ + private static final String TKDM_EXTENSION = ".tkdm"; + + /** + * kdmo file extension. + */ + private static final String KDMO_EXTENSION = ".kdmo"; + + /** + * The kdm extension for the kdm xml file. + */ + private static final String KDM_EXTENSION = ".kdm"; + + /** + * The kdm extension for the kdm keep file. + */ + private static final String KDM_KEEP_EXTENSION = ".keep"; + + /** + * toif extension. + */ + private static final String TOIF_EXTENSION = ".toif.xml"; + + private static final boolean debug = false; + + /** + * the main repository for this assimilation. This repository contains both + * the tkdm and the toif data together. + */ + private Repository repository; + + private RepositoryConnection con; + + private ValueFactory factory; + + /** + * A map of all the known sourcefiles for this project. + */ + private final Map sourceFiles; + + private File outputLocation = null; + + private Long offset; + + private Long nextId = 0L; + + private Long smallestBigNumber = Long.MAX_VALUE; + + private Set toifPaths = new HashSet(); + + private HashMap lineNumbers = new HashMap(); + + private Map sourceRefStatements = new HashMap(); + + private Map kdmContains = new HashMap(); + + /** + * the repository option. -r, -m, or -k. [R]epository output, repository + * [M]igration, and [K]DM ouput respectively. + */ + private String rOption; + + private ZipOutputStream zos; + + private PrintWriter writer = null; + + private boolean createZip = false; + + // private FileOutputStream fos; + + /** + * constructor for the assimilator. + */ + public Assimilator() + { + sourceFiles = new HashMap(); + } + + /** + * @param createZip2 + */ + public Assimilator(boolean createZip) + { + this.createZip = createZip; + sourceFiles = new HashMap(); + } + + /** + * + * @param statement + * @throws RepositoryException + */ + public void addStatement(Statement statement) throws RepositoryException + { + if (outputLocation.isFile()) + { + addToFile(statement); + } + else if (repository != null) + { + addToRepository(statement); + } + + } + + /** + * add the statement to the specified kdm file. this is instead of adding to + * the repository. + * + * @param statement + * the statement to add to the kdm file. + */ + private void addToFile(Statement statement) + { + // BufferedWriter writer = new BufferedWriter(new + // FileWriter(outputLocation.getAbsolutePath(), true)); + Resource subject = statement.getSubject(); + String subjectString = subject.toString(); + if ("-m".equals(rOption)) + { + subjectString = subjectString.replace("http://kdmanalytics.com/", ""); + subjectString = subjectString.replace("http://toif/", ""); + } + + writer.write("<" + subjectString + "> "); + + URI predicate = statement.getPredicate(); + String predicateString = predicate.toString(); + if ("-m".equals(rOption)) + { + predicateString = predicateString.replace("http://org.omg.kdm/", ""); + predicateString = predicateString.replace("http://toif/", ""); + } + + writer.write("<" + predicateString + "> "); + + String object = statement.getObject().toString(); + if ("-m".equals(rOption)) + { + object = object.replace("http://kdmanalytics.com/", ""); + object = object.replace("http://toif/", ""); + } + if (!object.startsWith("\"")) + { + object = "<" + object + ">"; + } + writer.write(object + " "); + writer.write(" .\n"); + writer.flush(); + + } + + /** + * Ultimately add the statement to the repository. However, if the statement + * is a codeLocation then try to bind it to the source-ref in the kdm model. + * The binding will look like this: + * + * [KDM SourceRef] <---> [Common Node] <---> [TOIF CodeLocation] + * + * First we need to find the correct source file. We do this by: -Get all + * the sourcefiles in the kdm model -get their path statements -compare + * paths using Trie. -find best fit. + * + * We then find all sourceRefs with this sourcefile ID. + * + * Then, create the binding between this codeLocation and the sourceRef + * using the common node. + * + * @param statement + * @throws RepositoryException + */ + private void addToRepository(Statement statement) throws RepositoryException + { + if (con == null) + { + con = repository.getConnection(); + } + + if (debug) + { + System.err.println("repository: " + con.getRepository()); + } + + con.add(statement, (Resource) null); + } + + /** + * main entry point mainly to aid in testing. tytpial use would be via the + * RPC. + * + * @param args + */ + public static void main(String[] args) + { + Assimilator ass = new Assimilator(); + try + { + ass.assimilate(args); + } + catch (Exception e) + { + System.err.println("running in stand alone context, exception occured."); + e.printStackTrace(); + } + + } + + /** + * Assimilate the files into one repository. + * + * -k kdmoutputfile toiffiles. + * + * @param args + * the arguments passed to main. These include the repository + * location and tkdm/toif file locations. + * @throws ToifException + * @throws IOException + * + */ + public boolean assimilate(String[] args) throws ToifException, IOException + { + System.out.println("Running, this may take some time..."); + try + { + outputLocation = getOutputLocation(args); + + // get the tkdm files and the toif files. + final List kdmFiles = getFiles(args, KDM_EXTENSION, KDM_KEEP_EXTENSION); + final List tkdmFiles = getFiles(args, TKDM_EXTENSION, KDMO_EXTENSION); + final List toifFiles = getFiles(args, TOIF_EXTENSION); + + repository = createRepository(outputLocation); + + if (createZip) + { + createZipWriter(); + } + else + { + createFileWriter(); + } + + if ("-m".equals(rOption)) + { + + if (!kdmFiles.isEmpty()) + { + InputStream is = new FileInputStream(kdmFiles.get(0)); + + byte buf[] = new byte[1000]; + int count = is.read(buf); + is.close(); + + // If the file is empty, handle it special + if (count <= 0) + { + return false; + } + + // If it is a zip importer there is further processing that + // is done on the return to determine what type of data + // is contained within the zip file. + if (buf[0] == 'P' && buf[1] == 'K' && buf[2] == 3) + { + processKdmZip(kdmFiles); + } + else + { + processkdm(kdmFiles); + } + } + else + { + LOG.error("There are no input kdm files"); + } + + } + + if (debug) + { + System.err.println("repository is: " + repository); + } + + // if the migrate option has not been set. (future functionality) + if (!"-m".equals(rOption)) + { + // get the kdm file this writes directly to the repository. + processkdm(kdmFiles); + + /* + * run the tkdm merger and pipe its output to the + * writeStatementLine() method. + */ + final RepositoryMerger kdmMerger = processTkdmFiles(tkdmFiles); + setNextId(kdmMerger.getId()); + + } + else + { + + } + + String blacklistPath = getBlackListPath(args); + + /* + * run the toif merger and pipe its output to the + * writeStatementLine() method. + */ + nextId++; + processToifFiles(toifFiles, nextId, smallestBigNumber, blacklistPath); + + compareLocations(); + + } + catch (final AssimilatorArgumentException e) + { + final String msg = "Bad argument:"; + LOG.error(msg, e); + throw new IllegalArgumentException(msg, e); + } + catch (RepositoryException e) + { + e.printStackTrace(); + } + /* + * catch (IOException e) { e.printStackTrace(); } + */ + finally + { + try + { + + con.close(); + repository.shutDown(); + if (writer != null) + { + writer.close(); + } + outputLocation = null; + } + catch (RepositoryException e) + { + System.err.println("There was a problem closing the connection to the repository. " + e); + } + + System.out.println("\nComplete."); + + } + return true; + } + + /** + * process the kdm files. decides if its xml or triples. + * + * @param kdmFiles + * @throws ToifException + */ + private void processkdm(List kdmFiles) throws ToifException + { + if (kdmFiles.size() == 0) + { + return; + } + + File kdmFile = kdmFiles.get(0); + + FileInputStream is = null; + DataInputStream din = null; + BufferedReader br = null; + try + { + is = new FileInputStream(kdmFile); + din = new DataInputStream(is); + br = new BufferedReader(new InputStreamReader(din)); + + String firstLine = br.readLine(); + + if (firstLine.isEmpty()) + { + return; + } + else if (firstLine.startsWith(" kdmFiles) throws ToifException + { + FileInputStream fis = null; + File file = null; + try + { + file = kdmFiles.get(0); + + fis = new FileInputStream(file); + // Read from the ZipInputStream as you would normally from any other + // input stream + System.out.println("\n" + file.getAbsolutePath()); + streamStatementsToRepo(fis); + } + catch (FileNotFoundException e) + { + // TODO Auto-generated catch block + e.printStackTrace(); + } + catch (IOException e) + { + // TODO Auto-generated catch block + e.printStackTrace(); + } + finally + { + try + { + if (fis != null) + { + fis.close(); + } + } + catch (IOException e) + { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + + } + + /** + * + */ + private void createFileWriter() + { + try + { + writer = new PrintWriter(outputLocation); + + } + catch (FileNotFoundException e) + { + LOG.error("The file " + outputLocation + " has not been found."); + + } + + } + + /** + * try to find matching locations in the toif and the kdm namespaces. + * + * @return + * + * @throws RepositoryException + */ + private boolean compareLocations() throws RepositoryException + { + HashMap bestFitMap = new HashMap(); + + int statements = 0; + Map tries = new HashMap(); + // for all the toif statements that are a path + for (Statement toifStatement : toifPaths) + { + Resource bestFitResource = bestFitMap.get(toifStatement.getSubject().stringValue()); + if (bestFitResource != null) + { + createCommonNode(toifStatement.getSubject(), bestFitResource); + continue; + } + + statements++; + + float fraction = 100f / toifPaths.size(); + int percent = (int) Math.ceil(fraction * statements); + + if (percent > 100) + { + percent = 100; + } + + System.out.print("\rAssimilating TOIF and KDM Locations... " + percent + "%"); + + // given a toif statement + Resource kdmResourceFile = findBestFitSourceFile(tries, toifStatement); + + if (kdmResourceFile == null) + { + continue; + } + + int reductionAmount = 0; + + while (bestFitResource == null) + { + // we tried, dont want an endless loop. + if (reductionAmount == 100) + { + findBestKdmElementForToifStatement(toifStatement, kdmResourceFile, reductionAmount, true); + break; + } + + bestFitResource = findBestKdmElementForToifStatement(toifStatement, kdmResourceFile, reductionAmount, false); + + // if (bestFitResource == null) + // { + // findBestKdmElementForToifStatement(toifStatement, + // kdmResourceFile, reductionAmount * -1, false); + // } + + reductionAmount++; + } + + if (bestFitResource == null) + { + bestFitResource = kdmResourceFile; + } + + Resource toifSubject = toifStatement.getSubject(); + createCommonNode(toifSubject, bestFitResource); + + } + + return false; + + } + + /** + * create the common node which is a blank node. this is doubly linked to + * both the kdm blockunit and the toif code location. + * + * @param sourceFile + * @param blockUnit + * @throws RepositoryException + */ + private void createCommonNode(Resource toifSubject, Resource blockUnit) throws RepositoryException + { + + URI bnodeURI = factory.createURI("http://toif/", (offset++).toString()); + Literal typeLiteral = factory.createLiteral("CommonNode"); + + // create the blank common node. + addStatement(new StatementImpl(bnodeURI, factory.createURI(KDM_NS_HOST + "Type"), typeLiteral)); + + // link the toif to it + addStatement(new StatementImpl(toifSubject, factory.createURI(KDM_NS_HOST + "CommonView"), bnodeURI)); + // link the toif from it. + addStatement(new StatementImpl(bnodeURI, factory.createURI(KDM_NS_HOST + "ToifView"), toifSubject)); + + // link the kdm to it + addStatement(new StatementImpl(blockUnit, factory.createURI(KDM_NS_HOST + "CommonView"), bnodeURI)); + // link the kdm from it. + addStatement(new StatementImpl(bnodeURI, factory.createURI(KDM_NS_HOST + "KdmView"), blockUnit)); + + } + + /** + * create the disk repository which the files will be merged into. + * + * @param repositoryLocation + * + * @return the repository in its initialized state. + */ + Repository createRepository(File repositoryLocation) + { + Repository repository = null; + if (repositoryLocation.isDirectory()) + { + // create the disk repository. + repository = new SailRepository(new NativeStore(repositoryLocation)); + } + else + { + try + { + MemoryStore memoryStore = new MemoryStore(); + repository = new SailRepository(memoryStore); + } + catch (Exception e) + { + e.printStackTrace(); + } + + } + + try + { + // initialize the repository. + if (repository == null) + { + throw new RepositoryException("Repository is null"); + } + repository.initialize(); + Assimilator.debug(LOG, "Repository initialized in " + repositoryLocation.getAbsolutePath()); + + con = repository.getConnection(); + // con.clear((Resource)null); + factory = repository.getValueFactory(); + } + catch (final RepositoryException e) + { + LOG.error("Repository could not be initialized. " + e); + e.printStackTrace(); + } + + // return the repository. + return repository; + } + + /** + * addToFile + * + */ + private void createZipWriter() + { + FileOutputStream fos; + try + { + fos = new FileOutputStream(outputLocation); + zos = new ZipOutputStream(fos); + ZipEntry ze = new ZipEntry(outputLocation.getName()); + zos.putNextEntry(ze); + writer = new PrintWriter(new OutputStreamWriter(zos)); + + } + catch (FileNotFoundException e) + { + System.err.println("The file " + outputLocation + " has not been found."); + e.printStackTrace(); + } + catch (IOException e) + { + System.err.println("There has been a IO exception while creating the zip file."); + e.printStackTrace(); + } + } + + /** + * get the value of the object. + * + * @param elements + * the subject predicate and object + * @return the value of the object. + */ + private Value determineObjectValue(String[] elements) + { + + Value object = null; + + if (elements.length < 2) + return object; + + try + { + String objectString = trimForStatement(elements[2]); + if (elements[2].startsWith("<")) + { + if (!objectString.startsWith("http")) + { + objectString = "http://kdmanalytics.com/" + objectString; + } + object = factory.createURI(objectString); + } + else + { + object = factory.createLiteral(objectString); + } + } + catch (ArrayIndexOutOfBoundsException e) + { + System.err.println("index out of bouds " + e); + System.err.println(elements); + } + + return object; + } + + /** + * Creates a trie (note: trie not tree) of all the known source files. The + * toif path is matched against the tries. the tries return the longest path + * that they can for each kdm resource, the resource with the longest path + * is the resource which is returned. + * + * @param tries + * the map of tries for all the kdm resources. the tries each + * start with a file as the root and parent directories extending + * from that. + * @param st + * the toif statement. this is the statement which contains the + * path. + * @return returns the kdm resource with the best fit. + */ + private Resource findBestFitSourceFile(Map tries, final Statement st) + { + Resource bestFit = null; + int bestFitCount = 0; + + // get the OBJECT string value + String toifPath = st.getObject().stringValue(); + + // get rid of quotes and make a list. + toifPath = toifPath.replace("\"", ""); + List toifPathArray = Arrays.asList(toifPath.replace("\\", "/").split("/")); + + // we need the path array starting with the file. + Collections.reverse(toifPathArray); + + // get the toif file name. which is the first element now. + String toifFileName = toifPathArray.get(0); + toifPathArray.set(0, getSourceFile(toifFileName)); + + // work with all the kdm entries in the sourcefiles, reverse their + // contents and create a mapping of the file as key and the Trie as + // the value. Basically making the trie for each source file. + for (String kdmPath : sourceFiles.keySet()) + { + + // reverse the kdm path so that it starts with the file. + List kdmPathArray = Arrays.asList(kdmPath.replace("\\", "/").split("/")); + Collections.reverse(kdmPathArray); + + // there should be something in the path!!! + if (kdmPathArray.isEmpty()) + { + continue; + } + + // the filename. + String kdmFileName = kdmPathArray.get(0); + Node currentKdmNode = null; + + // get the kdm resource based on its path. + Resource kdmResource = sourceFiles.get(kdmPath); + + // if the filename doesn't exist, create a new trie for it. + if (!tries.containsKey(kdmResource)) + { + FilePathTrie filePathTrie = new FilePathTrie(kdmFileName); + tries.put(kdmResource, filePathTrie); + } + + // set the node as the sourcefile we are working with. + currentKdmNode = tries.get(kdmResource).getFile(); + + // for all the directories in this sourcefile's path, add them to + // the trie. + for (int i = 1; i < kdmPathArray.size(); i++) + { + // get the correct trie based on the resource. + FilePathTrie trie = tries.get(kdmResource); + // add the parent to the current kdm node. currentKdm Node gets + // replaced with the parent once this is done. + currentKdmNode = trie.addParentDirectory(currentKdmNode, kdmPathArray.get(i)); + } + } + + for (Resource file : tries.keySet()) + { + FilePathTrie trie = tries.get(file); + // get the longest kdm path that we can find from the tries. + List path = trie.getBestPath(toifPathArray); + + // if this path is longer than the previous longest then set the + // current resource (file) as the best fit. + if (path.size() >= bestFitCount) + { + bestFit = file; + bestFitCount = path.size(); + } + } + + // return the best fit. + return bestFit; + + } + + /** + * Findind the best fitting source reference. + * + * @param st + * @param bestFit + * @return the kdm element that best fits the toif resource + * @throws RepositoryException + * @throws MalformedQueryException + * @throws QueryEvaluationException + */ + private Resource findBestKdmElementForToifStatement(Statement st, Resource bestFit, int reductionAmount, boolean searchForParent) + { + + if (st == null || bestFit == null) + { + return null; + } + + String lineNumber = ""; + + // figure out the reference for the source ref. Extract the id. + String sourceFileRef = bestFit.stringValue().replace("http://kdmanalytics.com/", ""); + + Statement lineNumberStatement = lineNumbers.get(st.getSubject().stringValue()); + + lineNumber = lineNumberStatement.getObject().stringValue(); + + int tempLineNumber = Integer.parseInt(lineNumber) - reductionAmount; + + if (tempLineNumber <= 1) + { + tempLineNumber = 1; + } + + lineNumber = tempLineNumber + ""; + + // make the literal for the sourceRef. + String sourceRef = sourceFileRef + ";" + lineNumber; + + Statement statmentWithSourceRef = sourceRefStatements.get(sourceRef); + + if (searchForParent) + { + return getParent(sourceFileRef); + } + else if (statmentWithSourceRef == null) + { + return null; + } + else + { + Resource subject = statmentWithSourceRef.getSubject(); + return subject; + } + + } + + /** + * Get the blacklist string from the args. The string is the name of the top + * of the project. + * + * @param args + * arguments from the command line + * @return the directory name of the root of the project + */ + private String getBlackListPath(String[] args) + { + int indexOfblacklistPath = 0; + + for (int i = 0; i < args.length; i++) + { + if ("-p".equals(args[i])) + { + indexOfblacklistPath = i; + + String blacklist = args[indexOfblacklistPath + 1]; + blacklist = blacklist.trim(); + + return blacklist; + } + } + + return ""; + } + + /** + * get all the files from the argument list. + * + * @param args + * the arguments handed to main. + * @return the list of files in the argument array with the given extension. + * @throws ToifException + */ + List getFiles(String[] args, final String... extensions) throws ToifException + { + checkNotNull(args); + checkNotNull(extensions); + + // set up a file filter. + IOFileFilter fileFilter = new IOFileFilter() { + + @Override + public boolean accept(File arg0) + { + for (String extension : extensions) + { + if (arg0.getName().endsWith(extension)) + { + return true; + } + } + + return false; + } + + @Override + public boolean accept(File arg0, String arg1) + { + for (String extension : extensions) + { + if (arg1.endsWith(extension)) + { + return true; + } + } + + return false; + } + }; + + // the files of the specific extension + final List files = new ArrayList(); + + // int startIndex = 2; + // for (String string : args) + // { + // if ("-p".equals(string)) + // { + // startIndex = 4; + // } + // } + + // starting at the unparsed options, ie the files in the arguments. + for (int i = 2; i < args.length; i++) + { + + if ("-p".equals(args[i])) + { + i = i += 2; + } + + final String path = args[i]; + + final File file = new File(path); + + // if the file does not exist, bail. + if (!file.exists()) + { + final String msg = "File does not exist: " + file.getName(); + LOG.error(msg); + throw new ToifException(msg); + + } + + if (file.isDirectory()) + { + files.addAll(FileUtils.listFiles(file, fileFilter, TrueFileFilter.INSTANCE)); + } + else + { + + /* + * only add the file to the results list if the file has the + * extension and is a file. + */ + for (String extension : extensions) + { + if (file.getAbsolutePath().endsWith(extension)) + { + files.add(file); + Assimilator.debug(LOG, file.getName() + " added to the " + extension + " list"); + } + } + } + + } + + if (debug) + { + for (File file : files) + { + System.err.println(file.getName()); + } + } + // return the list of files. + return files; + } + + /** + * return the file that represents this repository location + * + * @param args + * the command line arguments + * @return the output location. + */ + File getOutputLocation(String[] args) throws AssimilatorArgumentException + { + checkNotNull(args); + + // the location of the repository, this will be a directory. + File location = null; + + int indexOfROption = 0; + + for (int i = 0; i < args.length; i++) + { + if ("-r".equals(args[i]) || "-k".equals(args[i])) + { + indexOfROption = i; + } + } + + rOption = args[indexOfROption]; + + if ("-m".equals(rOption)) + { + if (args.length < 3) + { + throw new AssimilatorArgumentException("There are not enough arguments."); + } + } + else + { + if (args.length < 3) + { + throw new AssimilatorArgumentException("There are not enough arguments."); + } + } + + // the repository location, following the '-r' option + final String locationParameter = args[indexOfROption + 1]; + + if ((!rOption.equals("-r")) && (!rOption.equals("-k")) && (!rOption.equals("-m"))) + { + throw new AssimilatorArgumentException("There should be an argument which should be the '-r' or the '-k' option."); + } + + // if the option is merge but location is null. + if ((locationParameter == null) && (!rOption.equals("-m"))) + { + throw new AssimilatorArgumentException("The second argument which should be the workbench repository is null."); + } + + // else if just the location is null. + else if (locationParameter == null) + { + throw new AssimilatorArgumentException("The argument after the repository option, which should be the output location, is null."); + } + + // check to make sure that there is an -r option + if ("-r".equals(rOption)) + { + // make sure the location of the repository is valid. + location = getValidRepositoryLocation(locationParameter); + } + else if ("-k".equals(rOption)) + { + location = getValidFileLocation(locationParameter); + } + else if ("-m".equals(rOption)) + { + location = getValidFileLocation(locationParameter); + } + + // return the location. + return location; + } + + /** + * get the parent of the kdm element. + * + * @param sourceFileRef + * element + * @return the parent of the kdm element. + */ + private Resource getParent(String sourceFileRef) + { + return (Resource) factory.createURI("http://kdmanalytics.com/" + sourceFileRef); + // String result = kdmContains.get(KdmElementWithSourceRef); + // + // if (result != null) + // { + // return (Resource) factory.createURI(result); + // } + // else + // { + // return null; + // } + // for (Statement containsStatement : kdmContains) + // { + // String containedObjectString = + // containsStatement.getObject().stringValue(); + // + // // if the contained element is the element with the source ref. + // if (containedObjectString.equals(KdmElementWithSourceRef)) + // { + // // return the element that contains the element with sourceRef. + // return (Resource) + // factory.createURI(containsStatement.getSubject().stringValue()); + // } + // } + // return null; + } + + /** + * The names need to be corrected to be able to find the source file. + * + * @param name + * @return + */ + private String getSourceFile(String name) + { + String newName = name.replaceAll("$.*class", ".java"); + newName = name.replace(".class", ".java"); + return newName; + } + + /** + * create the kdm repository merger + * + * @param out + * the print writer for the output. + * @return the repository merger + */ + RepositoryMerger getTkdmMerger(PrintWriter out, String assemblyName) + { + if (assemblyName == null) + { + assemblyName = "Assembly"; + } + + final InputStream is = Assimilator.class.getResourceAsStream("config/cxx.cfg"); + + final LinkConfig config = new LinkConfig(is); + + final MergeConfig mergeConfig = config.getMergeConfig(); + + final RepositoryMerger merger = new RepositoryMerger(mergeConfig, out, RepositoryMerger.NTRIPLES, assemblyName); + + return merger; + } + + /** + * get the merger to merge the toif data. + * + * @param printWriter + * the output print writer + * @param startID + * the id to start from after the kdm + * @param smallestBigNumber2 + * the smallest number when starting from the other end of the + * long scale. (for the bnodes) + * + * @return the toif merger instance. + */ + ToifMerger getToifMerger(PrintWriter printWriter, Long startID, Long smallestBigNumber2, String blacklistPath) + { + return new ToifMerger(printWriter, force, startID, smallestBigNumber2, blacklistPath); + } + + /** + * get a valid location for this kdm file. the method checks to see if the + * location can be used as a kdm file and then creates the file. + * + * @param location + * path of the output file. + * @return the output file + * @throws AssimilatorArgumentException + * @throws IOException + */ + private File getValidFileLocation(String location) throws AssimilatorArgumentException + { + if (location == null) + { + throw new AssimilatorArgumentException("Kdm file location is null"); + } + + final File file = new File(location); + // make the directory. + if (!file.exists()) + { + try + { + file.createNewFile(); + } + catch (IOException e) + { + e.printStackTrace(); + throw new AssimilatorArgumentException("Kdm file could not be created"); + + } + Assimilator.debug(LOG, "Kdm File has been created."); + } + + // if the file is a directory then it is good + if (file.isFile()) + { + return file; + } + else if (file.getName().toLowerCase().endsWith(".kdm")) + { + throw new AssimilatorArgumentException("This location is not a valid '.kdm' file"); + } + else + { + /* + * if the file is not a directory then it cant be used as a + * repository location. + */ + throw new AssimilatorArgumentException("This location is not a valid file"); + + } + } + + /** + * check to make sure that this is a valid repository location. + * + * @param location + * the location of the output repository. + * + * @return the output file. + * @throws AssimilatorArgumentException + */ + File getValidRepositoryLocation(String location) throws AssimilatorArgumentException + { + if (location == null) + { + throw new AssimilatorArgumentException("Repository location is null"); + } + + final File file = new File(location); + // make the direcotry + if (file.mkdirs()) + { + Assimilator.debug(LOG, "repository directory has been created."); + } + else + { + Assimilator.debug(LOG, "repository directory has already been created and will be used."); + } + + // if the file is a directory then it is good + if (file.isDirectory()) + { + return file; + } + else + { + /* + * if the file is not a directory then it cant be used as a + * repository location. + */ + throw new AssimilatorArgumentException("This location is not a valid directory"); + + } + + } + + /** + * Load the kdm file. parse the input file. + * + * @param xmlFile + * the input file + * @param out + * output stream + * @return the xml handler for the kdm data. + * @throws IOException + * @throws ToifInternalException + */ + public KdmXmlHandler load(File xmlFile, PipedOutputStream out) throws IOException, RepositoryException, ToifException + { + RepositoryConnection tempCon = null; + KdmXmlHandler kdmXmlHandler = null; + PrintWriter pw = null; + try + { + File tempFile = new File(System.getProperty("java.io.tmpdir") + File.separator + "KDMRepository"); + + deleteDirectory(tempFile); + + tempFile.deleteOnExit(); + Repository tempRepository = new SailRepository(new NativeStore(tempFile)); + tempRepository.initialize(); + + tempCon = tempRepository.getConnection(); + /** + * The factory used to drive the parsing process. + * + */ + SAXParserFactory factory = null; + // Use the default (non-validating) parser + factory = SAXParserFactory.newInstance(); + + SAXParser saxParser; + saxParser = factory.newSAXParser(); + + // Have to parse the file once to determine the maximum id; + KdmXmiIdHandler idHandler = new KdmXmiIdHandler(); + + // Need to set the stream to UTF-8 ti ensure that we correctly + // handle + // characters in Strings + InputStream inputStream = new FileInputStream(xmlFile); + InputStreamReader inputReader = new InputStreamReader(inputStream, "UTF-8"); + InputSource inputSource = new InputSource(inputReader); + inputSource.setEncoding("UTF-8"); + + saxParser.parse(inputSource, idHandler); + + tempCon.setAutoCommit(false); // Control commit for speed + + pw = new PrintWriter(out); + kdmXmlHandler = new KdmXmlHandler(pw, repository, idHandler.getMaxId()); + + // Parse the input + saxParser.parse(xmlFile, kdmXmlHandler); + + // Commit postLoad data + kdmXmlHandler.postLoad(); + + tempCon.commit(); + tempCon.clear(); + } + + catch (ParserConfigurationException | SAXException ex) + { + final String msg = "Parser exception encountered:"; + LOG.error(msg, ex); + throw new ToifException(msg, ex); + } + finally + { + if (pw != null) + { + pw.flush(); + pw.close(); + } + if (null != tempCon) + { + tempCon.close(); + } + + } + return kdmXmlHandler; + + } + + /** + * load the rdf file into repository. + * + * @param repository + * the repository + * @param is + * the input stream from file + * @throws IOException + * @throws RepositoryException + */ + public void load(Repository repository, InputStream is) throws IOException, RepositoryException + { + int count = 0; + final ValueFactory factory = repository.getValueFactory(); + final RepositoryConnection con = repository.getConnection(); + con.setAutoCommit(false); + + final BufferedReader in = new BufferedReader(new InputStreamReader(is)); + String line = in.readLine(); + URI lastSubject = null; + + while (line != null) + { + count++; + + if (line.length() <= 0) + { + line = in.readLine(); + continue; + } + + if (line.charAt(0) == '#') + { + line = in.readLine(); + continue; + } + + if (count == 1) + { + if (line.startsWith("KDM_Triple")) + { + line = in.readLine(); + continue; + } + } + + URI subject = null; + URI predicate = null; + Value object = null; + + try + { + final char bytes[] = line.toCharArray(); + + // Skip the initial < + int start = 1; + int i = 1; + + // If the line starts with a space (indent) then reuse the last + // subject, + // otherwise parse the subject. + if (bytes[0] == ' ') + { + subject = lastSubject; + } + else + { + // Parse the subject + while ((i < bytes.length) && (bytes[i] != '>')) + { + ++i; + } + if (i >= bytes.length) + { + LOG.error("Invalid subject URI on ntriples line " + count); + line = in.readLine(); + continue; + } + + subject = factory.createURI(MODEL_NS + new String(line.substring(start, i))); + + // Buffer the subject in case we need it next time + lastSubject = subject; + ++i; // Skip the > + } + + while ((i < bytes.length) && (bytes[i] != '<')) + { + ++i; + } + if (i >= bytes.length) + { + LOG.error("Invalid subject URI on ntriples line " + count); + line = in.readLine(); + continue; + } + ++i; // Skip the > + start = i; + + // Parse the predicate + while ((i < bytes.length) && (bytes[i] != '>')) + { + ++i; + } + if (i >= bytes.length) + { + LOG.error("Invalid predicate URI on ntriples line " + count); + line = in.readLine(); + continue; + } + + predicate = factory.createURI(KDM_NS_HOST + new String(line.substring(start, i))); + + ++i; // Skip the > + while ((i < bytes.length) && (bytes[i] != '<') && (bytes[i] != '\"')) + { + ++i; + } + if (i >= bytes.length) + { + LOG.error("Invalid predicate URI on ntriples line " + count); + line = in.readLine(); + continue; + } + + // Parse a URI + if (bytes[i] == '<') + { + ++i; // Skip the > + start = i; + while ((i < bytes.length) && (bytes[i] != '>')) + { + ++i; + } + if (i >= bytes.length) + { + LOG.error("Invalid object URI on ntriples line " + count); + line = in.readLine(); + continue; + } + + object = factory.createURI(MODEL_NS + new String(line.substring(start, i))); + + } + // Parse a literal + else + { + final int lastIndex = line.lastIndexOf('"'); + if ((lastIndex < 0) || (lastIndex <= i)) + { + LOG.error("Invalid literal object on ntriples line " + count); + line = in.readLine(); + continue; + } + String string = new String(line.substring(++i, lastIndex)); + string = string.replace("\\", "\\\\"); + object = factory.createLiteral(StringEscapeUtils.unescapeJava(string)); + + } + + // In non-lowmem mode everything gets loaded into the + // database + // KdmXmlHandler.addOrWrite(con, subject, predicate, object); + con.add(subject, predicate, object); + } + catch (final ArrayIndexOutOfBoundsException e) + { + LOG.error("Parse error on ntriples line " + count, e); + e.printStackTrace(); + } + line = in.readLine(); + } + + con.commit(); + con.close(); + + } + + /** + * Merge the tkdm files. with the kdm merger + * + * @param kdmMerger + * the kdm merger + * @param tkdmFiles + * the list of tkdm files collected from the commanline. + */ + public void mergeTkdm(RepositoryMerger kdmMerger, List tkdmFiles) + { + int fileNum = 0; + int listSize = tkdmFiles.size(); + + /* + * for each tkdm file collected, load it into the temporary repository + * and merge that repository. + */ + for (final File file : tkdmFiles) + { + fileNum++; + + float fraction = 100f / listSize; + int percent = (int) Math.ceil(fraction * fileNum); + + if (percent > 100) + { + percent = 100; + } + + System.out.print("\r" + file); + System.out.print("\nprocessing TKDM... " + percent + "%"); + + try + { + File temp = Files.createTempDir(); + + SailRepository tempRepository = new SailRepository(new NativeStore(temp)); + + tempRepository.initialize(); + + // load the data into the repository + FileInputStream istream = new FileInputStream(file); + load(tempRepository, istream); + istream.close(); + + // merge the repository. + kdmMerger.merge(file.getAbsolutePath(), tempRepository); + tempRepository.shutDown(); + FileUtils.deleteDirectory(temp); + } + catch (final RepositoryException e) + { + LOG.error("There was an exception when merging the tkdmFiles. " + e); + e.printStackTrace(); + } + catch (final FileNotFoundException e) + { + LOG.error("The Kdm file has not been found. " + e); + e.printStackTrace(); + } + catch (final IOException e) + { + LOG.error("There was an IO Exception when trying to merge the KDM files. " + e); + e.printStackTrace(); + } + } + + System.out.println(""); + } + + /** + * merge the toif files using the toif merger + * + * @param toifMerger + * the toif merger + * @param toifFiles + * the toif files collected from the command line. + * @param startID + * @return + */ + Long mergeToif(ToifMerger toifMerger, List toifFiles) + { + return toifMerger.merge(toifFiles); + } + + /** + * prints the contents of the repository. mainly for debug purposes. + * + * @param repository + * the repository to print. + */ + void printDB(Repository rep) + { + + try + { + RepositoryConnection connection = rep.getConnection(); + // get all statements. + final RepositoryResult statements = connection.getStatements(null, null, null, true); + + // for all the statements. + while (statements.hasNext()) + { + final Statement st = statements.next(); + // print statements. + System.out.println(st.toString()); + + } + + statements.close(); + } + catch (final RepositoryException e) + { + LOG.error("There was a repository error while printing the database. " + e); + e.printStackTrace(); + } + + } + + /** + * process the kdm files. + * + * @param kdmFiles + * the list of kdm files to process + * @throws FileNotFoundException + * @throws IOException + * @throws RepositoryException + */ + + class ThreadStatus + { + + protected Exception exception; + + ThreadStatus() + { + exception = null; + } + } + + private void processKdmXmlFile(final List kdmFiles) throws FileNotFoundException, IOException, RepositoryException, ToifException + { + if (debug) + { + System.err.println("processing kdm file..."); + } + + PipedInputStream in = new PipedInputStream(); + final PipedOutputStream out = new PipedOutputStream(in); + final ThreadStatus status = new ThreadStatus(); + + Thread t = new Thread(new Runnable() { + + @Override + public void run() + { + KdmXmlHandler handler = null; + try + { + if (kdmFiles.size() > 1) + { + final String msg = "There should only be one .kdm file."; + LOG.error(msg); + throw new ToifException(msg); + } + else if (kdmFiles.size() == 1) + { + File kdmFile = kdmFiles.get(0); // get the head of + // thelist. + handler = load(kdmFile, out); + } + out.flush(); + out.close(); + + if (handler == null) + { + return; + } + setNextId(handler.getNextId()); + setSmallestBigNumber(handler.getSmallestBigNumber()); + // increase + } + catch (IOException e) + { + final String msg = "IO exception whilst processing kdm file. " + ". Possibly an existing kdm file is in your input path!"; + + LOG.error(msg, e); + status.exception = new ToifException(msg, e); + } + catch (RepositoryException e) + { + final String msg = "Repository Exception whilst processing kdm file. " + ". Possibly an existing kdm file is in your input path!"; + + LOG.error(msg, e); + status.exception = new ToifException(msg, e); + } + catch (ToifException e) + { + // RJF final String msg = + // "Processing Exception whilst processing kdm file. " + // + ". Possibly that input file is invalid XML!"; + + // LOG.error(msg, e); + status.exception = e; + } + finally + { + if (out != null) + try + { + out.close(); + } + catch (IOException e) + { + // Just leave it alone + LOG.error("unable to close stream"); + } + } + } + }); + + // --------------------------------------------------------- + // Unable to change logic within the short time frame given so + // adding a means to catch unknown exceptions in thread + // ---------------------------------------------------------- + Thread.UncaughtExceptionHandler tueh = new Thread.UncaughtExceptionHandler() { + + public void uncaughtException(Thread th, Throwable ex) + { + LOG.error("Uncaught exception: " + ex); + status.exception = (Exception) ex; + } + }; + + t.setUncaughtExceptionHandler(tueh); + t.start(); + + streamStatementsToRepo(in); + try + { + t.join(); + + // Check if we enoutered exception during processing and + // proxy throw if we have one + if (status.exception != null) + { + // Leave alone if already a ToifException + if (status.exception instanceof ToifException) + throw (ToifException) status.exception; + else throw new ToifException(status.exception); + + } + } + catch (InterruptedException e) + { + LOG.error("Interrupted"); + throw new ToifException("Interrupted"); + } + } + + /** + * @param kdmFiles2 + * @throws IOException + * @throws ToifException + */ + private void processKdmZip(List kdmFiles2) throws IOException, ToifException + { + ZipInputStream zip = null; + File file = null; + try + { + file = kdmFiles2.get(0); + zip = new ZipInputStream(new FileInputStream(file)); + zip.getNextEntry(); + + // Read from the ZipInputStream as you would normally from any other + // input stream + System.out.println("\n" + file.getAbsolutePath()); + streamStatementsToRepo(zip); + } + + finally + { + try + { + if (zip != null) + { + zip.close(); + } + } + catch (IOException e) + { + // just leave it alone + if (file == null) + file = new File(""); // just to be sure + LOG.error("unable to close zip stream" + file.getAbsolutePath()); + } + } + } + + /** + * process the tkdm files + * + * @param tkdmFiles + * the list of tkdm files to process. + * @return + * @throws IOException + * @throws ToifException + */ + private RepositoryMerger processTkdmFiles(final List tkdmFiles) throws IOException, ToifException + { + final PipedInputStream in = new PipedInputStream(); + final PipedOutputStream out = new PipedOutputStream(in); + + String assemblyName = "Assembly"; + int possition = outputLocation.getName().lastIndexOf("."); + if (possition != -1) + { + assemblyName = outputLocation.getName().substring(0, possition); + } + + final RepositoryMerger kdmMerger = getTkdmMerger(new PrintWriter(out), assemblyName); + new Thread(new Runnable() { + + @Override + public void run() + { + mergeTkdm(kdmMerger, tkdmFiles); + kdmMerger.close(); + try + { + out.close(); + } + catch (IOException e) + { + e.printStackTrace(); + } + } + }).start(); + + streamStatementsToRepo(in); + return kdmMerger; + } + + /** + * process the toif files. + * + * @param toifFiles + * list of toif files to process. + * @param smallestBigNumber2 + * the smallest number from the end of the long scale. used for + * the bnodes at the end of the repository + * @param blacklistPath + * string that is the name of the directory of the project root. + * @return + * @throws IOException + * @throws ToifException + */ + private void processToifFiles(final List toifFiles, Long id, Long smallestBigNumber2, String blacklistPath) throws IOException, + ToifException + { + PipedInputStream toifIn = new PipedInputStream(); + final PipedOutputStream toifOut = new PipedOutputStream(toifIn); + + // final ToifMerger toifMerger = getToifMerger(new PrintWriter(toifOut), + // id, smallestBigNumber2, blacklistPath); + + PrintWriter w = new PrintWriter(toifOut); + final ToifMerger toifMerger = getToifMerger(w, id, smallestBigNumber2, blacklistPath); + new Thread(new Runnable() { + + @Override + public void run() + { + Long offset = mergeToif(toifMerger, toifFiles); + + setOffset(offset); + try + { + toifOut.close(); + } + catch (IOException e) + { + e.printStackTrace(); + } + } + + }).start(); + + streamStatementsToRepo(toifIn); + } + + /** + * stores the next id + * + * @param newId + * the new id + */ + private void setNextId(Long newId) + { + if (newId > nextId) + { + nextId = newId; + } + + } + + /** + * sets the offset + * + * @param offset + * the offset from the local id to be the global id. + */ + private void setOffset(Long offset) + { + this.offset = offset; + + } + + /** + * sets the smallest number near the end of the long scale. + * + * @param smallest + * the smallest number when counting down from the end of the + * long scale. + */ + private void setSmallestBigNumber(Long smallest) + { + if (smallest < smallestBigNumber) + { + smallestBigNumber = smallest; + } + + } + + /** + * trims the string for use with creating a url. + * + * @param string + * string to trim. + * @return + */ + private String trimForStatement(String string) + { + string = string.replace(" .", ""); + string = string.replaceAll("<|>", ""); + + if (string.startsWith("\"")) + { + string = new String(string.substring(1).intern()); + } + if (string.endsWith("\"")) + { + string = new String(string.substring(0, string.length() - 1).intern()); + } + return string; + } + + /********************************************************* + * Writes the stream of statements to the repository. + * + * @param in + * the stream of statements for the repository. + * @throws IOException + * @throws ToifException + **********************************************************/ + private void streamStatementsToRepo(InputStream in) throws IOException, ToifException + { + try + { + // Scanner scanner = new Scanner(in); + // scanner.useDelimiter(" \\.\r?\n"); + + BufferedReader br = new BufferedReader(new InputStreamReader(in)); + + Long count = 0L; + String line = null; + + Set containers = new HashSet(); + + // Read File Line By Line + // while (scanner.hasNext()) + while ((line = br.readLine()) != null) + { + + if ("".equals(line)) + { + continue; + } + + if (line.startsWith("#")) + { + writer.write(line + "\n"); + continue; + } + if (line.startsWith("KDM_Triple")) + { + writer.write(line + "\n"); + continue; + } + + // line = scanner.next(); + line = line.trim(); + // System.err.println(line); + + if ("-m".equals(rOption) && (count % 10000 == 0)) + { + System.out.print("\rprocessing KDM file... statement: " + count + " "); + } + count++; + + String[] elements = line.split(" ", 3); + String subjectString = trimForStatement(elements[0]); + + String number = subjectString.replaceAll("\\D+", ""); + + if (!number.isEmpty()) + { + Long id = Long.parseLong(number); + if (id > nextId) + { + nextId = id; + } + } + + if (!subjectString.startsWith("http")) + { + subjectString = "http://kdmanalytics.com/" + subjectString; + } + + Resource subject = factory.createURI(subjectString); + + // ** Add guard in case we do have element + if (elements.length < 2) + continue; + + String predicateString = trimForStatement(elements[1]); + + if (!predicateString.startsWith("http")) + { + predicateString = "http://org.omg.kdm/" + predicateString; + } + + URI predicate = factory.createURI(predicateString); + + Value object = determineObjectValue(elements); + + if (object == null) + { + continue; + } + + Statement statement = new StatementImpl(subject, predicate, object); + + addStatement(statement); + + // turn on storage if the type is correct. this is so that we + // dont store more than we need. + if ("http://org.omg.kdm/kdmType".equals(predicate.stringValue())) + { + if ("code/SharedUnit".equals(object.stringValue())) + { + containers.add(subjectString); + } + if ("code/CompilationUnit".equals(object.stringValue())) + { + containers.add(subjectString); + } + if ("code/CallableUnit".equals(object.stringValue())) + { + containers.add(subjectString); + } + if ("code/MethodUnit".equals(object.stringValue())) + { + containers.add(subjectString); + } + if ("code/ClassUnit".equals(object.stringValue())) + { + containers.add(subjectString); + } + } + + // capture the toif points of interest. + if ("http://toif/path".equals(predicate.stringValue())) + { + toifPaths.add(statement); + } + if ("http://toif/lineNumber".equals(predicate.stringValue())) + { + lineNumbers.put(statement.getSubject().stringValue(), statement); + } + + // have to capture the kdm points of interest + String stringValue = statement.getObject().stringValue(); + if ("http://org.omg.kdm/SourceRef".equals(predicate.stringValue())) + { + stringValue = stringValue.replace(";;||java", ""); + sourceRefStatements.put(stringValue, statement); + } + if ("http://org.omg.kdm/contains".equals(predicate.stringValue()) && containers.contains(subjectString)) + { + kdmContains.put(object.stringValue(), subject.stringValue()); + } + // attempt to add the statement to the sourcefiles (this checks + // to see if it is indeed a sourcefile). + if ("http://org.omg.kdm/path".equals(statement.getPredicate().stringValue())) + { + sourceFiles.put(stringValue, statement.getSubject()); + } + + } + + // Close file to free resource + if (br != null) + br.close(); + + } + catch (RepositoryException e) + { + final String msg = "Repository exception while writing the statement to the repository."; + LOG.error(msg, e); + throw new ToifException(msg, e); + } + } +} diff --git a/com.kdmanalytics.toif.assimilator/src/com/kdmanalytics/toif/assimilator/AttributeUtilities.java b/com.kdmanalytics.toif.assimilator/src/com/kdmanalytics/toif/assimilator/AttributeUtilities.java new file mode 100644 index 00000000..5049f288 --- /dev/null +++ b/com.kdmanalytics.toif.assimilator/src/com/kdmanalytics/toif/assimilator/AttributeUtilities.java @@ -0,0 +1,94 @@ +/******************************************************************************* + * Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This program and the + * accompanying materials are made available under the terms of the Open Source + * Initiative OSI - Open Software License v3.0 which accompanies this + * distribution, and is available at http://www.opensource.org/licenses/osl-3.0.php/ + ******************************************************************************/ +package com.kdmanalytics.toif.assimilator; + +import java.util.HashSet; + +import org.openrdf.model.Literal; +import org.openrdf.model.URI; +import org.openrdf.model.Value; + +public class AttributeUtilities +{ + + static HashSet notAttributes = initLookup(); + + static HashSet references = initReferenceLookup(); + + /** + * The elements in this set are KDM/RDF pre-defined elements and should not + * be listed as attributes. + * + * @return + */ + private static HashSet initLookup() + { + HashSet lookup = new HashSet(); + + lookup.add("name"); + lookup.add("size"); + lookup.add("kind"); + lookup.add("pos"); + lookup.add("contains"); + lookup.add("snippet"); + lookup.add("language"); + lookup.add("kdmType"); + lookup.add("path"); + lookup.add("text"); + lookup.add("__index"); + lookup.add("__item"); + lookup.add("external"); + + // Internally used by navigator + // lookup.add("lastUID"); + // lookup.add("UID"); + + // Names used to indicate references + lookup.addAll(initReferenceLookup()); + return lookup; + } + + /** + * + * @return + */ + private static HashSet initReferenceLookup() + { + HashSet lookup = new HashSet(); + // Names used to indicate references + lookup.add("stereotype"); + lookup.add("__group"); + lookup.add("implementation"); + lookup.add("__type"); + lookup.add("__groupedCode"); + lookup.add("__groupedBuild"); + lookup.add("__groupedComponent"); + lookup.add("__KDM_RELATION"); + lookup.add("type"); + lookup.add("to"); + lookup.add("from"); + lookup.add("file"); + return lookup; + } + + public static boolean isReference(String value) + { + return references.contains(value); + } + + public static boolean isAttribute(String value) + { + return !notAttributes.contains(value); + } + + public static boolean isAttribute(URI tag, Value value) + { + if (!(value instanceof Literal)) + return false; + return !notAttributes.contains(tag.getLocalName()); + } +} diff --git a/com.kdmanalytics.toif.assimilator/src/com/kdmanalytics/toif/assimilator/DelayedRelation.java b/com.kdmanalytics.toif.assimilator/src/com/kdmanalytics/toif/assimilator/DelayedRelation.java new file mode 100644 index 00000000..ae4dc548 --- /dev/null +++ b/com.kdmanalytics.toif.assimilator/src/com/kdmanalytics/toif/assimilator/DelayedRelation.java @@ -0,0 +1,117 @@ +/******************************************************************************* + * Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This program and the + * accompanying materials are made available under the terms of the Open Source + * Initiative OSI - Open Software License v3.0 which accompanies this + * distribution, and is available at http://www.opensource.org/licenses/osl-3.0.php/ + ******************************************************************************/ +package com.kdmanalytics.toif.assimilator; + +import java.io.PrintWriter; +import java.util.Map; +import java.util.StringTokenizer; + +import org.apache.log4j.Logger; +import org.openrdf.model.URI; +import org.openrdf.model.ValueFactory; +import org.openrdf.repository.Repository; +import org.openrdf.repository.RepositoryConnection; +import org.openrdf.repository.RepositoryException; + +class DelayedRelation +{ + + private static final Logger LOG = Logger.getLogger(DelayedRelation.class); + + URI subject = null; + + URI predicate = null; + + URI object = null; + + String src = null; + + String snk = null; + + private boolean debug = false; + + public DelayedRelation(URI subject, URI predicate, String snk) + { + this.subject = subject; + this.predicate = predicate; + this.snk = snk; + } + + /** + * + * @param repository + * @param con + * @param nodeNames + * @throws RepositoryException + */ + public void commit(PrintWriter out, Repository repository, RepositoryConnection con, XMLNode root, Map nodeNames) throws RepositoryException + { + if (debug) + { + System.err.println("============================================"); + System.err.println("delayed relation commit..."); + System.err.println("connection: " + con); + System.err.println("subject: " + subject); + System.err.println("object: " + object); + System.err.println("src: " + src); + System.err.println("snk: " + snk); + System.err.println("============================================"); + } + + if (subject == null && src == null) + { + LOG.error("Cannot commit delayed relation " + this); + return; + } + if (object == null && snk == null) + { + LOG.error("Cannot commit delayed relation " + this); + return; + } + if (subject == null) + { + LOG.error("Cannot commit delayed relation (null source) " + this); + return; + } + if (object == null) + { + for (StringTokenizer st = new StringTokenizer(snk); st.hasMoreTokens();) + { + String token = st.nextToken(); + String target = nodeNames.get(token); + if (target == null) + { + // Is this using the gross node identification method? If so + // then + // try to find the target node. + if (root != null) + target = root.getURIByPath(token); + if (target == null) + { + LOG.error("Cannot commit delayed relation " + this); + continue; + } + } + ValueFactory f = repository.getValueFactory(); + object = f.createURI(target); + + if (debug) + { + System.err.println("adding statement... subject:" + subject + " predicate: " + predicate + " object: " + object); + System.err.println("repository: " + con.getRepository()); + } + + TripleStatementWriter.addOrWrite(out, con, subject, predicate, object); + } + } + } + + public String toString() + { + return "DelayedRelation: " + subject + "(" + src + ")," + predicate + "," + object + "(" + snk + ")"; + } +} diff --git a/com.kdmanalytics.toif.assimilator/src/com/kdmanalytics/toif/assimilator/FilePathTree.java b/com.kdmanalytics.toif.assimilator/src/com/kdmanalytics/toif/assimilator/FilePathTree.java new file mode 100644 index 00000000..e6d34cd9 --- /dev/null +++ b/com.kdmanalytics.toif.assimilator/src/com/kdmanalytics/toif/assimilator/FilePathTree.java @@ -0,0 +1,306 @@ +/** + * + */ + +package com.kdmanalytics.toif.assimilator; + +import static com.google.common.base.Preconditions.checkNotNull; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +/** + * @author adam + * + */ +public class FilePathTree +{ + + /** + * The root node. this will always be the file name. + */ + private Node file; + + /** + * Create a new tree with the fileName as the roots information. + * + * @param fileName + * the name to give the root. + */ + public FilePathTree(String fileName) + { + checkNotNull(fileName); + this.file = new Node(fileName); + + } + + /** + * match files based on a best path fit. + * + * @param path + * @return + */ + public List getBestPath(List path) + { + List resultPath = new ArrayList(); + Node node = null; + + // null paths get an empty list + if (path == null) + { + return resultPath; + } + // empty paths also get an empty list. + else if (path.isEmpty()) + { + return resultPath; + } + else + { + // the name of the file (the root of this tree). + String rootFile = file.getName(); + + // if the file names dont match, then return an empty list. + if (!path.get(0).equals(rootFile)) + { + return resultPath; + } + // if the files do match then set the first node as the file, + // because we're gonna start here! + else + { + node = file; + resultPath.add(rootFile); + } + } + + // for each of the directories in the path that we are trying to find. + // notice that we are starting from 1. this is the first directory. + for (int i = 1; i < path.size(); i++) + { + String directory = path.get(i); + + // if the file has a parent that matches this directory, add it to + // the results and use it as the next file to search from. + if (node.hasParent(directory)) + { + // move to the next directory. + node = node.getParent(directory); + // add it to the results. + resultPath.add(directory); + } + // if there is no match for the next directory, return with what we + // have. + else + { + return resultPath; + } + + } + + return resultPath; + } + + /** + * @return the root + */ + public Node getFile() + { + return file; + } + + /** + * Add a parent-directory to the directory. Remember that we are working + * from the file, up the directories. + * + * @param dir + * The directory that we want to add the parent to. + * @param parentDirectory + * The parent of dir that we want to add to the path. + * @return The parent, as a node, which we've just added to the path. + */ + public Node addParentDirectory(Node dir, String parentDirectory) + { + Node parent = new Node(parentDirectory); + dir.addParentDirectory(parent); + return parent; + } + + /** + * The node for each of the directories/file in the tree. + * + * @author adam + * + */ + public class Node + { + + /** + * the name of this node. This will most likely be the directory name. + */ + private String name; + + /** + * A set of the nodes children. + */ + private List parents = new ArrayList(); + + /** + * Create a new node which represents a directory/file. + * + * @param name + * the name of the directory or file. + */ + public Node(String name) + { + this.name = name; + } + + /** + * Add a parent to this directory. It sounds count-intuitive that this + * directory might have many parents. However, we must remember that it + * is not a directory but a directory-name. This means that there may be + * more then one directory with the same name, but they are contained in + * different directories. + * + * @param node + */ + public void addParentDirectory(Node node) + { + if (!hasParent(node.getName())) + { + parents.add(node); + } + } + + /** + * check to see if this node has a perent with the given name. + * + * @param parentName + * the name to search for in the set of parents. + * @return true if a parent is found with this name. + */ + public boolean hasParent(String parentName) + { + return parentsContains(parentName); + } + + /** + * @param parentName + * @return + */ + private boolean parentsContains(String parentName) + { + for (Node node : parents) + { + if (parentName.equals(node.getName())) + { + return true; + } + } + return false; + } + + /** + * get the parent from this file's parents which has the same name as + * parentName + * + * @param parentName + * the name of the parent that we are trying to find. + * @return the matching parent node. null if none is found. + */ + public Node getParent(String parentName) + { + Iterator nodes = parents.iterator(); + + while (nodes.hasNext()) + { + FilePathTree.Node node = (FilePathTree.Node) nodes.next(); + + if (parentName.equals(node.getName())) + { + return node; + } + + } + + return null; + } + + /** + * Get the name of this node. + * + * @return the name The string name of this node. + */ + public String getName() + { + return name; + } + + /** + * set the name of this node. + * + * @param name + * the name to set + */ + public void setName(String name) + { + this.name = name; + } + + public int hashCode() + { + return name.hashCode(); + } + + /* + * (non-Javadoc) + * + * @see java.lang.Object#equals(java.lang.Object) + */ + @Override + public boolean equals(Object obj) + { + if (this == obj) + { + return true; + } + if (obj == null) + { + return false; + } + if (!(obj instanceof Node) && !(obj instanceof String)) + { + return false; + } + + String name2 = null; + if (obj instanceof Node) + { + Node other = (Node) obj; + + name2 = other.name; + } + + if (obj instanceof String) + { + name2 = (String) obj; + } + + if (name == null) + { + if (name2 != null) + { + return false; + } + } + else if (!name.equals(name2)) + { + return false; + } + return true; + } + + } +} diff --git a/com.kdmanalytics.toif.assimilator/src/com/kdmanalytics/toif/assimilator/FilePathTrie.java b/com.kdmanalytics.toif.assimilator/src/com/kdmanalytics/toif/assimilator/FilePathTrie.java new file mode 100644 index 00000000..1c28bf91 --- /dev/null +++ b/com.kdmanalytics.toif.assimilator/src/com/kdmanalytics/toif/assimilator/FilePathTrie.java @@ -0,0 +1,314 @@ +/** + * + */ + +package com.kdmanalytics.toif.assimilator; + +import static com.google.common.base.Preconditions.checkNotNull; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +/** + * Trie representing the file paths. + * + * @author adam + * + */ +public class FilePathTrie +{ + + /** + * The root node. this will always be the file name. + */ + private Node file; + + /** + * Create a new tree with the fileName as the roots information. + * + * @param fileName + * the name to give the root. + */ + public FilePathTrie(String fileName) + { + checkNotNull(fileName); + this.file = new Node(fileName); + + } + + /** + * find the best fitting path + * + * @param path + * the path for which to find the best fit for. + * @return the resulting best fit path. + */ + public List getBestPath(List path) + { + List resultPath = new ArrayList(); + Node node = null; + + // null paths get an empty list + if (path == null) + { + return resultPath; + } + // empty paths also get an empty list. + else if (path.isEmpty()) + { + return resultPath; + } + else + { + // the name of the file (the root of this tree). + String rootFile = file.getName(); + + // if the file names dont match, then return an empty list. + if (!path.get(0).equals(rootFile)) + { + return resultPath; + } + // if the files do match then set the first node as the file, + // because we're gonna start here! + else + { + node = file; + resultPath.add(rootFile); + } + } + + // for each of the directories in the path that we are trying to find. + // notice that we are starting from 1. this is the first directory. + for (int i = 1; i < path.size(); i++) + { + String directory = path.get(i); + + // if the file has a parent that matches this directory, add it to + // the results and use it as the next file to search from. + if (node.hasParent(directory)) + { + // move to the next directory. + node = node.getParent(directory); + // add it to the results. + resultPath.add(directory); + } + // if there is no match for the next directory, return with what we + // have. + else + { + return resultPath; + } + + } + + return resultPath; + } + + /** + * returns the root file. + * + * @return the root + */ + public Node getFile() + { + return file; + } + + /** + * Add a parent-directory to the directory. Remember that we are working + * from the file, up the directories. + * + * @param dir + * The directory that we want to add the parent to. + * @param parentDirectory + * The parent of dir that we want to add to the path. + * @return The parent, as a node, which we've just added to the path. + */ + public Node addParentDirectory(Node dir, String parentDirectory) + { + Node parent = new Node(parentDirectory); + dir.addParentDirectory(parent); + return parent; + } + + /** + * The node for each of the directories/file in the tree. + * + * @author adam + * + */ + public class Node + { + + /** + * the name of this node. This will most likely be the directory name. + */ + private String name; + + /** + * A set of the nodes children. + */ + private List parents = new ArrayList(); + + /** + * Create a new node which represents a directory/file. + * + * @param name + * the name of the directory or file. + */ + public Node(String name) + { + this.name = name; + } + + /** + * Add a parent to this directory. It sounds count-intuitive that this + * directory might have many parents. However, we must remember that it + * is not a directory but a directory-name. This means that there may be + * more then one directory with the same name, but they are contained in + * different directories. + * + * @param node + */ + public void addParentDirectory(Node node) + { + if (!hasParent(node.getName())) + { + parents.add(node); + } + } + + /** + * check to see if this node has a perent with the given name. + * + * @param parentName + * the name to search for in the set of parents. + * @return true if a parent is found with this name. + */ + public boolean hasParent(String parentName) + { + return parentsContains(parentName); + } + + /** + * is there a node within this node with the name ... + * + * @param parentName + * the name to try to find. + * @return returns true if a node with the same name as parent name. + */ + private boolean parentsContains(String parentName) + { + for (Node node : parents) + { + if (parentName.equals(node.getName())) + { + return true; + } + } + return false; + } + + /** + * get the parent from this file's parents which has the same name as + * parentName + * + * @param parentName + * the name of the parent that we are trying to find. + * @return the matching parent node. null if none is found. + */ + public Node getParent(String parentName) + { + Iterator nodes = parents.iterator(); + + while (nodes.hasNext()) + { + FilePathTrie.Node node = (FilePathTrie.Node) nodes.next(); + + if (parentName.equals(node.getName())) + { + return node; + } + + } + + return null; + } + + /** + * Get the name of this node. + * + * @return the name The string name of this node. + */ + public String getName() + { + return name; + } + + /** + * set the name of this node. + * + * @param name + * the name to set + */ + public void setName(String name) + { + this.name = name; + } + + public int hashCode() + { + return name.hashCode(); + } + + /* + * (non-Javadoc) + * + * @see java.lang.Object#equals(java.lang.Object) + */ + @Override + public boolean equals(Object obj) + { + if (this == obj) + { + return true; + } + if (obj == null) + { + return false; + } + if (!(obj instanceof Node) && !(obj instanceof String)) + { + return false; + } + + String name2 = null; + if (obj instanceof Node) + { + Node other = (Node) obj; + + name2 = other.name; + } + + if (obj instanceof String) + { + name2 = (String) obj; + } + + if (name == null) + { + if (name2 != null) + { + return false; + } + } + else if (!name.equals(name2)) + { + return false; + } + return true; + } + + } +} diff --git a/com.kdmanalytics.toif.assimilator/src/com/kdmanalytics/toif/assimilator/KdmXmiIdHandler.java b/com.kdmanalytics.toif.assimilator/src/com/kdmanalytics/toif/assimilator/KdmXmiIdHandler.java new file mode 100644 index 00000000..1fefed51 --- /dev/null +++ b/com.kdmanalytics.toif.assimilator/src/com/kdmanalytics/toif/assimilator/KdmXmiIdHandler.java @@ -0,0 +1,55 @@ +/** + * KDM Analytics Inc (2014) + * + * @Author Adam Nunn + * @Date Mar 24, 2014 + */ + +package com.kdmanalytics.toif.assimilator; + +import org.xml.sax.Attributes; +import org.xml.sax.SAXException; +import org.xml.sax.helpers.DefaultHandler; + +/** + * Records the maximum xmi:id encountered while parsing a KDM file + * + * @author Kyle Girard + */ +public class KdmXmiIdHandler extends DefaultHandler { + + /** The current maximum xmi:id. */ + private long maxId = 0; + + /** + * If this element has an xmi:id, if it has an id check against the current + * maximum id and record a new max if required. + * + * @throws SAXException if the id is malformed + */ + @Override + public void startElement(final String namespaceURI, + final String sName, + final String qName, + final Attributes attrs) throws SAXException { + XMLNode node = new XMLNode(namespaceURI, sName, qName, attrs); + String stringId = node.getAttribute("xmi:id"); + if (stringId != null) { + try { + long id = Long.parseLong(stringId); + maxId = Math.max(id, maxId); + } catch (NumberFormatException e) { + throw new SAXException(e); + } + } + } + + /** + * Return the maximum xmi:id. Note this value only valid once parsing has completed + * + * @return + */ + public long getMaxId() { + return maxId; + } +} diff --git a/com.kdmanalytics.toif.assimilator/src/com/kdmanalytics/toif/assimilator/KdmXmlHandler.java b/com.kdmanalytics.toif.assimilator/src/com/kdmanalytics/toif/assimilator/KdmXmlHandler.java new file mode 100644 index 00000000..cf66e6a7 --- /dev/null +++ b/com.kdmanalytics.toif.assimilator/src/com/kdmanalytics/toif/assimilator/KdmXmlHandler.java @@ -0,0 +1,426 @@ +/******************************************************************************* + * Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This program and the accompanying + * materials are made available under the terms of the Open Source Initiative OSI - Open Software + * License v3.0 which accompanies this distribution, and is available at + * http://www.opensource.org/licenses/osl-3.0.php/ + ******************************************************************************/ + +package com.kdmanalytics.toif.assimilator; + +import java.io.PrintWriter; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.Stack; + +import org.apache.log4j.Logger; +import org.openrdf.model.Literal; +import org.openrdf.model.URI; +import org.openrdf.model.ValueFactory; +import org.openrdf.repository.Repository; +import org.openrdf.repository.RepositoryConnection; +import org.openrdf.repository.RepositoryException; +import org.xml.sax.Attributes; +import org.xml.sax.SAXException; +import org.xml.sax.helpers.DefaultHandler; + +/** + * + * @author Adam Nunn + * + */ +public class KdmXmlHandler extends DefaultHandler { + + private static final String kdmNSHost = "org.omg.kdm"; + + private static final String kdmNS = "http://" + kdmNSHost + "/"; + + /** Logger for the KdmXmlHandler class. */ + private static final Logger LOG = Logger.getLogger(KdmXmlHandler.class); + + private Repository repository = null; + + private RepositoryConnection con = null; + + private XMLNode root = null; + + private final Map nodeNames = new HashMap(); + + private final List postLoad = new ArrayList(); + + private final Stack nodes = new Stack(); + + private final boolean storeHierarchy = false; + + private final boolean debug = false; + + //private Long nextId = 0L; + private long initialId; + private long nextId; + + private long smallestBigNumber = Long.MAX_VALUE; + + private PrintWriter out; + + public KdmXmlHandler(Repository repository) { + this.repository = repository; + } + + /** + * Construct KdmXmlHandler + * + * @param initialMaxId the maximum id in the file to be parsed. Used as an + * initial subject id for those elements that are + * missing xmi:id's + */ + public KdmXmlHandler(PrintWriter out, Repository repository, long initialMaxId) { + this.out = out; + this.repository = repository; + nextId = initialMaxId + 1; + initialId = nextId; + } + + + /** + * Add the specified child to the specified parent + * + * @param parent + * @param child + * @throws RepositoryException + */ + protected void addChild(XMLNode parent, XMLNode child) throws RepositoryException { + // I need the nested nodes to remember as well, for finding XMI path + // information. + // Only do this if we need to. + if (storeHierarchy) { + parent.add(child); + } + + // Do not output attributes as children. They are being output as + // direct rdf tuplets. + // Since the node has not already been commited, the attribute is + // added here. + + if ("attribute".equals(child.getName())) { + ValueFactory f = repository.getValueFactory(); + URI key = f.createURI(kdmNS, child.getAttribute("tag")); + Literal value = f.createLiteral(child.getAttribute("value")); + TripleStatementWriter.addOrWrite(out, con, f.createURI(parent.getURIString()), key, value); + return; + } + + // Standard contained node + + ValueFactory f = repository.getValueFactory(); + URI predicate = f.createURI(kdmNS, "contains"); + + TripleStatementWriter.addOrWrite(out, con, f.createURI(parent.getURIString()), predicate, + f.createURI(child.getURIString())); + doCommit(); + + } + + /** + * Write the XMLNode into the RDF database + * + * @param source + * @throws RepositoryException + */ + protected void commitNode(XMLNode source) throws RepositoryException { + // Attributes are handled differently to conserve space + if ("attribute".equals(source.getName())) { return; } + + // This is a standard node, not an attribute. + setRDFAttribute(source, "kdmType", source.getKDMType()); + + Map attrs = source.getAttributes(); + if (attrs != null) { + for (Iterator it = attrs.keySet().iterator(); it.hasNext();) { + String key = it.next(); + // Ignore the special xmi values + if (key.contains(":")) { + continue; + } + String value = attrs.get(key); + + setRDFAttribute(source, key, value); + } + } + + // Add the references + Set referenceTypes = source.getReferenceTypes(); + if (referenceTypes != null) { + for (Iterator it = referenceTypes.iterator(); it.hasNext();) { + String key = it.next(); + List references = source.getReferences(key); + for (Iterator rit = references.iterator(); rit.hasNext();) { + String ref = rit.next(); + ValueFactory f = repository.getValueFactory(); + URI subject = f.createURI(source.getURIString()); + URI predicate = f.createURI(kdmNS, key); + + postLoad.add(new DelayedRelation(subject, predicate, ref)); + } + } + // con.commit(); + } + } + + /** + * do the commit. + * + * @throws RepositoryException + */ + private void doCommit() throws RepositoryException { + LOG.debug("commiting..."); + con.commit(); + } + + /** + * Element ended. Pop the XMLNode off of the stack. + * + */ + @Override + public void endElement(String namespaceURI, String sName, String qName) throws SAXException { + XMLNode node = nodes.pop(); + + // Some nodes are represented by a special compressed format, + // add these to the repository in a special way. + // These nodes (and their children) are prevented from writing + // in the conventional way in the "startElement" method. + // + // file;startline:startpos-endline:endpos;language;path|snippet|language + if ("source/SourceRef".equals(node.getKDMType())) { + List regions = node.children; + StringBuilder sb = new StringBuilder(); + for (XMLNode region : regions) { + String type = region.getKDMType(); + if (!"source/SourceRegion".equals(type)) { + continue; + } + List file = region.getReferences("file"); + String startLine = region.getAttribute("startLine"); + String startPos = region.getAttribute("startPos"); + String endLine = region.getAttribute("endLine"); + String endPos = region.getAttribute("endPos"); + String language = region.getAttribute("language"); + String path = region.getAttribute("path"); + if (file != null && file.size() > 0) { + sb.append(file.get(0)); + } + sb.append(";"); + if (startLine != null) { + sb.append(startLine); + if (startPos != null) { + sb.append(":").append(startPos); + } + if (endLine != null) { + sb.append("-").append(endLine); + if (endPos != null) { + sb.append(":").append(endPos); + } + } + } + sb.append(";"); + if (language != null) { + sb.append(language); + } + sb.append(";"); + if (path != null) { + sb.append(path); + } + } + String snippet = node.getAttribute("snippet"); + String language = node.getAttribute("language"); + sb.append("|"); + if (snippet != null) { + sb.append(snippet.replaceAll(",", ",").replaceAll("\\|", "&pipe;")); + } + sb.append("|"); + if (language != null) { + sb.append(language); + } + + if (!nodes.isEmpty()) { + XMLNode parent = nodes.peek(); + try { + setRDFAttribute(parent, "SourceRef", sb.toString()); + } catch (RepositoryException e) { + e.printStackTrace(); + } + } + } + } + + /** + * get the next id + * + * @return the next id + */ + public Long getNextId() { + return nextId; + } + + /** + * get the smallest available number at the end of the long scale. + * + * @return the smallest number available at the end of the long scale. + */ + public long getSmallestBigNumber() { + return smallestBigNumber; + } + + /** + * Commit postload data + * + */ + public void postLoad() throws RepositoryException { + try { + con = repository.getConnection(); + + // Commit postLoad data + for (Iterator it = postLoad.iterator(); it.hasNext();) { + DelayedRelation rel = it.next(); + + rel.commit(out, repository, con, root, nodeNames); + doCommit(); + } + } finally { + con.commit(); + con.close(); + } + + } + + /** + * Add the specified RDF tuple + * + * @param key + * attribute key + * @param value + * attribute value + */ + public void setRDFAttribute(XMLNode source, String name, String value) throws RepositoryException { + + ValueFactory f = repository.getValueFactory(); + Literal literal = f.createLiteral(value); + URI predicate = f.createURI(kdmNS, name); + + if (con == null) { + con = repository.getConnection(); + } + + if (debug) { + System.err.println("=========================================================="); + System.err.println("the connection is: " + con); + System.err.println("the source is: " + source); + System.err.println("the predicate is: " + predicate); + System.err.println("the literal is: " + literal); + System.err.println("=========================================================="); + } + + TripleStatementWriter.addOrWrite(out, con, f.createURI(source.getURIString()), predicate, literal); + doCommit(); + } + + /** + * Beginning of the document. + * + */ + @Override + public void startDocument() throws SAXException { + } + + /** + * New element found. + * + */ + @Override + public void startElement(String namespaceURI, String sName, String qName, Attributes attrs) + throws SAXException { + + XMLNode node = new XMLNode(namespaceURI, sName, qName, attrs); + String stringId = node.getAttribute("xmi:id"); + + + if (stringId == null) { + node.setId(++nextId); + } else { + try { + long id = Long.parseLong(stringId); + if (id > initialId) { + throw new SAXException("ID Overlap:" + id); + } + } catch (NumberFormatException e){ + throw new SAXException(e); + } + } + +// else { +// try { +// long id = Long.parseLong(stringId); +// if (id > nextId) { +// nextId = id; +// } else if (id == nextId) { +// ++nextId; +// } +// } catch (NumberFormatException e) { +// throw new SAXException(e); +// } +// } + + if ("source/SourceRef".equals(node.getKDMType()) + || "source/SourceRegion".equals(node.getKDMType())) { + // These elements are represented in the repository in + // a special "compressed" format and should not be output + // using the conventional methods. + if (!nodes.isEmpty()) { + XMLNode parent = nodes.lastElement(); + parent.add(node); + } + nodes.push(node); + return; + } + + // KDM Type needs to be output before any more information about the + // node. + try { + commitNode(node); + } catch (RepositoryException ex) { + throw new SAXException(ex); + } + + // Process the node + XMLNode parent = null; + if (!nodes.isEmpty()) { + parent = nodes.lastElement(); + } + nodes.push(node); + + try { + if (parent != null) { + addChild(parent, node); + } + } catch (RepositoryException ex) { + throw new SAXException(ex); + } + + // Remember IDs for postload and non xmi:id files (barf) + if (stringId != null) { + String uri = node.getURIString(); + nodeNames.put(stringId, uri); + } + } + + /** + * End of the document. Write all postLoad elements + * + */ + public void stopDocument() throws SAXException { + //Nothing to do + } + +} diff --git a/com.kdmanalytics.toif.assimilator/src/com/kdmanalytics/toif/assimilator/TripleStatementWriter.java b/com.kdmanalytics.toif.assimilator/src/com/kdmanalytics/toif/assimilator/TripleStatementWriter.java new file mode 100644 index 00000000..a18eadcb --- /dev/null +++ b/com.kdmanalytics.toif.assimilator/src/com/kdmanalytics/toif/assimilator/TripleStatementWriter.java @@ -0,0 +1,62 @@ +/******************************************************************************* + * Copyright (c) 2014 KDM Analytics, Inc. All rights reserved. This program and the accompanying + * materials are made available under the terms of the Open Source Initiative OSI - Open Software + * License v3.0 which accompanies this distribution, and is available at + * http://www.opensource.org/licenses/osl-3.0.php/ + ******************************************************************************/ + + +package com.kdmanalytics.toif.assimilator; + +import java.io.PrintWriter; + +import org.openrdf.model.Literal; +import org.openrdf.model.Resource; +import org.openrdf.model.URI; +import org.openrdf.model.Value; +import org.openrdf.model.ValueFactory; +import org.openrdf.repository.RepositoryConnection; +import org.openrdf.repository.RepositoryException; + +import com.kdmanalytics.kdm.repositoryMerger.RepositoryMerger; +import com.kdmanalytics.kdm.repositoryMerger.StatementWriter; + + +/** + * Triple statement writer utility + * + * @author Kyle Girard + * @Date Mar 20, 2014 + * + */ +public final class TripleStatementWriter { + + /** + * @param repositoryConnection + * @param arg0 + * @param arg1 + * @param arg2 + * @param arg3 + * @throws RepositoryException + */ + public static void addOrWrite(PrintWriter writer, RepositoryConnection repositoryConnection, + Resource arg0, URI arg1, Value arg2, Resource... arg3) throws RepositoryException { + if (writer == null) { + repositoryConnection.add(arg0, arg1, arg2, arg3); + } else { + ValueFactory f = repositoryConnection.getValueFactory(); + + if (arg2 instanceof Literal) { + StatementWriter sw = new StatementWriter(writer, RepositoryMerger.NTRIPLES); + sw.print(f.createURI(arg0.stringValue()), f.createURI(arg1.stringValue()), + f.createLiteral(arg2.stringValue())); + } else { + StatementWriter sw = new StatementWriter(writer, RepositoryMerger.NTRIPLES); + sw.print(f.createURI(arg0.stringValue()), f.createURI(arg1.stringValue()), + f.createURI(arg2.stringValue())); + } + + } + } + +} diff --git a/com.kdmanalytics.toif.assimilator/src/com/kdmanalytics/toif/assimilator/XMLNode.java b/com.kdmanalytics.toif.assimilator/src/com/kdmanalytics/toif/assimilator/XMLNode.java new file mode 100644 index 00000000..5a59d0b2 --- /dev/null +++ b/com.kdmanalytics.toif.assimilator/src/com/kdmanalytics/toif/assimilator/XMLNode.java @@ -0,0 +1,651 @@ +/******************************************************************************* + * Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This program and + * the accompanying materials are made available under the terms of the Open + * Source Initiative OSI - Open Software License v3.0 which accompanies this + * distribution, and is available at + * http://www.opensource.org/licenses/osl-3.0.php/ + ******************************************************************************/ + +package com.kdmanalytics.toif.assimilator; + +import static com.google.common.base.Preconditions.checkNotNull; + +import java.io.PrintWriter; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import org.apache.commons.lang3.StringEscapeUtils; +import org.apache.log4j.Logger; +import org.xml.sax.Attributes; + +public class XMLNode +{ + + private static final Logger LOG = Logger.getLogger(XMLNode.class); + + /** + * Init size for hashmaps, done for optimization reasons + * + */ + private static final int HASHMAP_SIZE = 30; + + public static final String modelNSHost = "kdmanalytics.com"; + + public static final String modelNS = "http://" + modelNSHost + "/"; + + /** + * simple name + */ + private String sName; + + /** + * Contains + * + */ + List children = null; + + /** + * XML Attributes that indicate literal values + * + */ + private Map attributes = null; + + /** + * Multiple references + * + */ + Map> references = null; + + private String id = null; + + /** + * Map of sName to xmi:types + * + */ + static Map kdmTypes = new HashMap(HASHMAP_SIZE); + + static Set stringFields = new HashSet(); + + { + kdmTypes.put("kdm:Segment", "kdm/Segment"); + kdmTypes.put("itemUnit", "code/ItemUnit"); + kdmTypes.put("indexUnit", "code/IndexUnit"); + kdmTypes.put("entryFlow", "action/EntryFlow"); + kdmTypes.put("attribute", "kdm/Attribute"); + kdmTypes.put("source", "source/SourceRef"); + kdmTypes.put("region", "source/SourceRegion"); + kdmTypes.put("parameterUnit", "code/ParameterUnit"); + kdmTypes.put("audit", "kdm/Audit"); + kdmTypes.put("abstraction", "action/ActionElement"); + kdmTypes.put("extensionFamily", "kdm/ExtensionFamily"); + kdmTypes.put("stereotype", "kdm/Stereotype"); + kdmTypes.put("tag", "kdm/TagDefinition"); + kdmTypes.put("dataElement", "data/DataEvent"); + kdmTypes.put("platformElement", "platform/PlatformElement"); + + stringFields.add("name"); + stringFields.add("snippet"); + } + + public XMLNode() + { + id = "" + UniqueID.get(); + } + + /** + * Parse the node information. Note that the "Attributes" here are XML + * Attributes, not KDM attributes. + * + * @param ns + * @param sName + * @param qName + * @param attrs + */ + public XMLNode(String ns, String sName, String qName, Attributes attrs) + { + + children = new ArrayList(); + this.sName = sName; + if ("".equals(sName)) + this.sName = qName; // Not namespace aware + + int size = attrs.getLength(); + for (int i = 0; i < size; i++) + { + String key = attrs.getLocalName(i); // Attr name + if ("".equals(key)) + key = attrs.getQName(i); + + // Special cases + // Stereotype/tag "type" is an attribute, not a reference + if ("stereotype".equals(this.sName) && "type".equals(key)) + addAttribute(key, attrs.getValue(key)); + else if ("tag".equals(this.sName) && "type".equals(key)) + addAttribute(key, attrs.getValue(key)); + + // Some attributes are really references + else if (AttributeUtilities.isReference(key)) + addReference(key, attrs.getValue(key)); + + // Unescape the fields which likely contain escaped HTML + else if (stringFields.contains(key)) + { + String value = attrs.getValue(key); + try + { + // value = StringEscapeUtils.unescapeHtml4(value); + // value = StringEscapeUtils.unescapeXml(value); + value = StringEscapeUtils.unescapeHtml3(value); + } + catch (StringIndexOutOfBoundsException e) + { + // String was most likely '&' which causes commons.lang3 to + // throw... ignore it + if (!value.contains("&")) + { + throw e; + } + } + addAttribute(key, value); + } + // Normal attribute + else + { + addAttribute(key, attrs.getValue(key)); + } + } + + // Use the xmiLid if it exists + id = getAttribute("xmi:id"); + if (id == null) + id = "" + UniqueID.get(); + } + + /** + * Return the index of the specified child. + * + */ + public int indexOf(XMLNode node) + { + return children.indexOf(node); + } + + /** + * Return the index of the specified child, only counting nodes of the same + * kind ahead of it. + * + */ + public int indexOfByType(XMLNode node) + { + if (node == null) + return -1; + + int count = 0; + String type = node.getName(); + + for (Iterator it = children.iterator(); it.hasNext();) + { + XMLNode nextNode = it.next(); + if (nextNode.equals(node)) + return count; + // If a node of the same type is found then increment the counter. + if (nextNode.getName().equals(type)) + count++; + } + return -1; + } + + /** + * Return the number of contained children + * + * @return + */ + public int size() + { + return children.size(); + } + + /** + * Add the reference to the appropriate list + * + * @param key + * @param value + */ + private void addReference(String key, String value) + { + if (references == null) + references = new HashMap>(HASHMAP_SIZE); + if (!references.containsKey(key)) + references.put(key, new ArrayList()); + List list = references.get(key); + list.add(value); + } + + /** + * Get a list of the various reference types we found. + * + * @return + */ + public Set getReferenceTypes() + { + if (references == null) + return null; + return references.keySet(); + } + + /** + * Return the list of references of the specified type + * + * @param type + * @return + */ + public List getReferences(String type) + { + if (references == null) + return null; + return references.get(type); + } + + /** + * Add the specified attribute to the list of attributes + * + * @param key + * @param value + */ + private void addAttribute(String key, String value) + { + if (attributes == null) + attributes = new HashMap(HASHMAP_SIZE); + attributes.put(key, value); + } + + /** + * set the id. + * + * @param id + * the id to set. + */ + public void setId(Long id) + { + this.id = id.toString(); + } + + /** + * get the simple name + * + * @return the simple name + */ + public String getName() + { + return sName; + } + + /** + * check if the simple name matches name + * + * @param name + * the name to check + * @return true if simple name matches name + */ + public boolean isType(String name) + { + if (sName == name) + return true; + if (sName == null) + return false; + return sName.equals(name); + } + + /** + * get the type. + * + * @return the simple name + */ + public String getType() + { + return sName; + } + + /** + * get the attributes + * + * @return the attributes. + */ + public Map getAttributes() + { + return attributes; + } + + /** + * get attribute based on key + * + * @param key + * the key of the attribute whos value you want + * @return the value of the attribute. + */ + public String getAttribute(String key) + { + if (attributes == null) + return null; + return attributes.get(key); + } + + /** + * does the attribute have the value ... + * + * @param key + * the attribute key + * @param value + * the attribute value. + * @return true if the attribute is contained. + */ + public boolean hasAttribute(String key, String value) + { + if (attributes == null) + return false; + String myValue = attributes.get(key); + return myValue.equals(value); + } + + /** + * Assemble the URI string for the node + * + * @return + */ + public String getURIString() + { + return modelNS + id; + } + + /** + * Return the detected KDM type + * + * @return + */ + protected String getKDMType() + { + String type = getAttribute("xmi:type"); + if (type == null) + type = getAttribute("xsi:type"); + if (type != null) + return type.replace(':', '/'); + + type = kdmTypes.get(sName); + if (type != null) + return type; + + return "unknown"; + } + + /** + * return as string. + */ + public String toString() + { + return getStartString() + getEndString(); + } + + /** + * Return the starting string. This is often used when we are echoing + * straight to output and do not want to store the data. + * + * @return + */ + public String getStartString() + { + StringBuilder sb = new StringBuilder(); + sb.append("<"); + sb.append(sName); + if (attributes != null) + { + for (Iterator it = attributes.keySet().iterator(); it.hasNext();) + { + String key = it.next(); + String value = attributes.get(key); + sb.append(" " + key + "=\"" + value + "\""); + } + } + sb.append(">"); + return sb.toString(); + } + + /** + * Return the ending string. This is often used when we are echoing straight + * to output and do not want to store the data. + * + * @return + */ + public String getEndString() + { + StringBuilder sb = new StringBuilder(); + sb.append(""); + return sb.toString(); + } + + /** + * add a child + * + * @param child + * the node to add + */ + public void add(XMLNode child) + { + children.add(child); + } + + public int hashCode() + { + return getURIString().hashCode(); + } + + public boolean equals(Object o) + { + if (!(o instanceof XMLNode)) + return false; + if (o.hashCode() == hashCode()) + return true; + return false; + } + + /** + * print the children. + * + * @param out + * the writer for output. + */ + public void printChildrenRDF(PrintWriter out) + { + for (Iterator it = children.iterator(); it.hasNext();) + { + XMLNode child = it.next(); + out.println(""); + } + } + + /** + * Using the XMI path string, find the referenced node and return its URI. + * + * @param token + * @return + */ + public String getURIByPath(String iPath) + { + // System.err.println(" * " + iPath); + // Strip the preceding slashes. + String path = iPath; + while (path.startsWith("/")) + path = path.substring(1); + + String token = null; + int index = path.indexOf("/"); + if (index >= 0) + { + token = path.substring(0, index); + path = path.substring(index + 1); + } + else + { + token = path; + path = null; + } + + index = token.indexOf("."); + String type = null; + // form: name. + if (index >= 0) + { + type = token.substring(0, index); + String displacement = token.substring(index + 1); + try + { + // index = Integer.parseInt(displacement); + index = parseIntChecked(displacement); + } + catch (NumberFormatException ex) + { + LOG.error("Cannot parse fragment from (" + iPath + ")"); + LOG.error(ex.getLocalizedMessage(), ex); + return null; + } + } + // form: // or /0/ + else + { + if (token.equals("*")) + index = 0; + else + { + try + { + index = Integer.parseInt(token); + LOG.warn("Cannot find node with id/path " + iPath); + } + catch (NumberFormatException ex) + { + } + index = 0; + } + } + + int count = -1; + for (Iterator it = children.iterator(); it.hasNext();) + { + XMLNode node = it.next(); + if (type == null) + count++; + else if (type.equals("@" + node.getType())) + count++; + if (count == index) + { + if (path == null) + return node.getURIString(); + return node.getURIByPath(path); + } + } + LOG.error("could not get element by URI path " + iPath); + return null; + } + + /** + * Parses the string argument as a signed decimal integer. Faster than + * Integer.parseInt since it assumes radix 10 + * + * @param intString + * a String containing the int representation to be parsed + * + * @return the integer value represented by the argument in decimal. + */ + public static int parseIntChecked(final String intString) + { + // Ensure that we have + checkNotNull(intString, "A null string cannot be parsed"); + + // Check for a sign. + int num = 0; + int sign = -1; + final int len = intString.length(); + final char ch = intString.charAt(0); + if (ch == '-') + { + if (len == 1) + { + throw new NumberFormatException("Missing digits: " + intString); + } + sign = 1; + } + else + { + final int d = ch - '0'; + if ((d < 0) || (d > 9)) + { + throw new NumberFormatException("Malformed: " + intString); + } + num = -d; + } + + // Build the number. + final int max = (sign == -1) ? -Integer.MAX_VALUE : Integer.MIN_VALUE; + final int multmax = max / 10; + int i = 1; + while (i < len) + { + final int d = intString.charAt(i++) - '0'; + if ((d < 0) || (d > 9)) + { + throw new NumberFormatException("Malformed: " + intString); + } + if (num < multmax) + { + throw new NumberFormatException("Over/underflow: " + intString); + } + num *= 10; + if (num < (max + d)) + { + throw new NumberFormatException("Over/underflow: " + intString); + } + num -= d; + } + + return sign * num; + } +} + +/** + * A class used to generate unique IDs. This is required on import into the RDF + * database, and is VERY nice to have in the XML output as opposed to the nasty + * position dependent naming conventions that EMF appears to use otherwise. + * + * Not that I use EMF really anymore. + * + */ + +class UniqueID +{ + + /** + * This is the initial id number. All IDs are assigned sequentially from + * here. + * + * Set the initial value to a known number for debugging (so numbers are + * consistent. + * + */ + static long current = System.currentTimeMillis(); + + /** + * Get the next ID number in sequence. + * + * @return + */ + static public synchronized long get() + { + return current++; + } +} diff --git a/com.kdmanalytics.toif.assimilator/src/com/kdmanalytics/toif/assimilator/config/cxx.cfg b/com.kdmanalytics.toif.assimilator/src/com/kdmanalytics/toif/assimilator/config/cxx.cfg new file mode 100644 index 00000000..01fd647d --- /dev/null +++ b/com.kdmanalytics.toif.assimilator/src/com/kdmanalytics/toif/assimilator/config/cxx.cfg @@ -0,0 +1,39 @@ +# Actions define the merge behaviour for various element KDM types. This specifies +# how two files are merged together. +# +# MERGE Merges the contents of like IDed nodes together +# COPY Copies the information in the node even if the ID is already represented +# IGNORE Does not specifically merge or copy data, but recurses down the tree and +# let the children specify for themselves. +# +# To match multiple elements you may use regular expressions. +# +# The default behaviour is specified by using catch all regex ".*". Ensure that this +# is the LAST element or it will mask any other regex entries. +# +# When identifying a merge type for an element, first an exact match is attempted, +# then regular expressions are evaluated in the order in which they appear in the +# file. +# +action,code/Package,MERGE +action,code/LanguageUnit,MERGE +action,code/SharedUnit,MERGE +action,code/CodeAssembly,MERGE +action,code/CompilationUnit,MERGE +action,code/CompilationUnit,MERGE +action,source/StorableUnit,MERGE +action,source/Directory,MERGE +action,code/MethodUnit,SINGLETON +action,code/CallableUnit,SINGLETON +action,action/BlockUnit,SINGLETON +action,.*Model,MERGE +action,kdm/ExtensionFamily,MERGE +action,data/DataContainer,MERGE + +# This regex matches everything else. Note that the default behaviour in the linker +# is currently to ignore, but since this could change it is probably a good idea to +# actively code this behaviour. +action,.*,IGNORE + +# When elements have no IDs, how should they be handled? +noid,COPY \ No newline at end of file diff --git a/com.kdmanalytics.toif.assimilator/src/com/kdmanalytics/toif/assimilator/exceptions/AssimilatorArgumentException.java b/com.kdmanalytics.toif.assimilator/src/com/kdmanalytics/toif/assimilator/exceptions/AssimilatorArgumentException.java new file mode 100644 index 00000000..7b13b3e2 --- /dev/null +++ b/com.kdmanalytics.toif.assimilator/src/com/kdmanalytics/toif/assimilator/exceptions/AssimilatorArgumentException.java @@ -0,0 +1,50 @@ +/******************************************************************************* + * Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This program and the + * accompanying materials are made available under the terms of the Open Source + * Initiative OSI - Open Software License v3.0 which accompanies this + * distribution, and is available at http://www.opensource.org/licenses/osl-3.0.php/ + ******************************************************************************/ +package com.kdmanalytics.toif.assimilator.exceptions; + +/** + * an exception for when the arguments given to the running process are bad. + * + * @author adam + * + */ +public class AssimilatorArgumentException extends Exception +{ + + private static final long serialVersionUID = 1L; + + String message = null; + + /** + * constructor with a message. + * + * @param message + * the exception message. + */ + public AssimilatorArgumentException(String message) + { + super(message); + this.message = message; + } + + /** + * constructor no arguments. makes an unknown exception. + */ + public AssimilatorArgumentException() + { + this.message = "unknown"; + } + + /** + * return the message for this exception. + */ + public String getMessage() + { + return message; + } + +} diff --git a/com.kdmanalytics.toif.assimilator/src/com/kdmanalytics/toif/assimilator/toifRdfTypes/SeenStatement.java b/com.kdmanalytics.toif.assimilator/src/com/kdmanalytics/toif/assimilator/toifRdfTypes/SeenStatement.java new file mode 100644 index 00000000..eb38a5dc --- /dev/null +++ b/com.kdmanalytics.toif.assimilator/src/com/kdmanalytics/toif/assimilator/toifRdfTypes/SeenStatement.java @@ -0,0 +1,88 @@ +/** + * KDM Analytics Inc (2012) + * + * @Author Adam Nunn + * @Date Jul 10, 2012 + */ + +package com.kdmanalytics.toif.assimilator.toifRdfTypes; + +/** + * Class to store values about the statements. these values are used in the + * equality to determine if the statement has been seen. + * + * @author adam + * + */ +public class SeenStatement +{ + + private String subjectURI; + + private String predicateURI; + + private String objectURI; + + /** + * create a new statement. + * + * @param subjectURI + * the subject of the statement + * @param predicateURI + * the predicate of the statement + * @param objectURI + * the object of the statement. + */ + public SeenStatement(String subjectURI, String predicateURI, String objectURI) + { + this.subjectURI = subjectURI; + this.predicateURI = predicateURI; + this.objectURI = objectURI; + } + + @Override + public int hashCode() + { + final int prime = 31; + int result = 1; + result = prime * result + ((objectURI == null) ? 0 : objectURI.hashCode()); + result = prime * result + ((predicateURI == null) ? 0 : predicateURI.hashCode()); + result = prime * result + ((subjectURI == null) ? 0 : subjectURI.hashCode()); + return result; + } + + @Override + public boolean equals(Object obj) + { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + SeenStatement other = (SeenStatement) obj; + if (objectURI == null) + { + if (other.objectURI != null) + return false; + } + else if (!objectURI.equals(other.objectURI)) + return false; + if (predicateURI == null) + { + if (other.predicateURI != null) + return false; + } + else if (!predicateURI.equals(other.predicateURI)) + return false; + if (subjectURI == null) + { + if (other.subjectURI != null) + return false; + } + else if (!subjectURI.equals(other.subjectURI)) + return false; + return true; + } + +} diff --git a/com.kdmanalytics.toif.assimilator/src/com/kdmanalytics/toif/assimilator/toifRdfTypes/ToifRdfBnode.java b/com.kdmanalytics.toif.assimilator/src/com/kdmanalytics/toif/assimilator/toifRdfTypes/ToifRdfBnode.java new file mode 100644 index 00000000..9b97c903 --- /dev/null +++ b/com.kdmanalytics.toif.assimilator/src/com/kdmanalytics/toif/assimilator/toifRdfTypes/ToifRdfBnode.java @@ -0,0 +1,59 @@ +/** + * + */ + +package com.kdmanalytics.toif.assimilator.toifRdfTypes; + +import java.io.File; +import java.util.ArrayList; +import java.util.List; + +import org.openrdf.model.BNode; + +/** + * class representing an anonymous bnode. + * + * @author adam + * + */ +public class ToifRdfBnode extends ToifRdfResource +{ + + private BNode object; + + /** + * create a toif bnode object. + * + * @param createBNode + * the rdf bnode + * @param currentFile + * the current file. + */ + public ToifRdfBnode(BNode bnode, File currentFile) + { + + this.file = currentFile; + this.object = bnode; + } + + /** + * get the bnode. + * + * @return the object + */ + public BNode getObject() + { + return object; + } + + /** + * get the details for this object. + */ + @Override + public List getDetails() + { + List list = new ArrayList(); + list.add(object.toString()); + return list; + } +} diff --git a/com.kdmanalytics.toif.assimilator/src/com/kdmanalytics/toif/assimilator/toifRdfTypes/ToifRdfFile.java b/com.kdmanalytics.toif.assimilator/src/com/kdmanalytics/toif/assimilator/toifRdfTypes/ToifRdfFile.java new file mode 100644 index 00000000..e1aa9b35 --- /dev/null +++ b/com.kdmanalytics.toif.assimilator/src/com/kdmanalytics/toif/assimilator/toifRdfTypes/ToifRdfFile.java @@ -0,0 +1,198 @@ +/** + * + */ + +package com.kdmanalytics.toif.assimilator.toifRdfTypes; + +import java.io.File; +import java.util.ArrayList; +import java.util.List; + +import org.w3c.dom.Element; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; + +/** + * Class representing a toif rdf file/directory. + * + * @author adam + * + */ +public class ToifRdfFile extends ToifRdfResource +{ + + /** + * directory structure of the file + */ + private String directoryStructure = ""; + + /** + * the next file/directory in the path + */ + private ToifRdfFile nextFile; + + /** + * create a new rdf file/directory + * + * @param subjectElement + * @param currentFile + */ + public ToifRdfFile(Element resourceElement, File currentFile) + { + super(resourceElement, currentFile); + } + + /** + * get the details for this node + * + * @return the details + */ + public List getDetails() + { + String dirCopy = directoryStructure; + + // trim the last directory off so that the path is the same as the name + // of the directory (not going down to the child.) + if ("toif:Directory".equals(getType()) && !dirCopy.equals("")) + { + + // correct any windows mojo that might occur. + final int lastIndexOf = dirCopy.lastIndexOf("/") == -1 ? dirCopy.lastIndexOf("\\") : dirCopy.lastIndexOf("/"); + + dirCopy = dirCopy.substring(0, lastIndexOf); + } + + List result = new ArrayList(details); + result.add(dirCopy); + return result; + } + + /** + * sets the child of this element. + * + * @param toifFile + */ + public void setNextNode(ToifRdfFile toifFile) + { + nextFile = toifFile; + String name = getFileName(toifFile); + + if (name != null) + { + propagateFile(name); + } + } + + private void propagateFile(String name) + { + // sandwich the name between a root and the existing directory. + directoryStructure = "/" + name.concat(directoryStructure); + + if (nextFile != null) + { + nextFile.propagateFile(name); + } + } + + /** + * get the file name for the file + * + * @param toifNode + * the node for which to get the name + * @return the file name + */ + public String getFileName(ToifRdfFile toifNode) + { + + Element element = toifNode.getElement(); + NodeList list = element.getChildNodes(); + String name = null; + + for (int i = 0; i < list.getLength(); i++) + { + Node child = list.item(i); + + if ("name".equals(child.getNodeName())) + { + name = child.getAttributes().getNamedItem("name").getTextContent(); + break; + } + + } + + if (name == null) + { + return null; + } + + return name; + + } + + /** + * get the directory structure. + * + * @param projectRoot + * the root name of the project + * @return the directoryStructure the directory structure of the file. + * (shortened if the project root has been set.) + */ + public String getDirectoryStructure(String projectRoot) + { + String dirCopy = directoryStructure; + + // trim the last directory off so that the path is the same as the name + // of the directory (not going down to the child.) + if ("toif:Directory".equals(getType()) && !dirCopy.equals("")) + { + + // correct any windows mojo that might occur. + final int lastIndexOf = dirCopy.lastIndexOf("/") == -1 ? dirCopy.lastIndexOf("\\") : dirCopy.lastIndexOf("/"); + + dirCopy = dirCopy.substring(0, lastIndexOf); + } + + if (projectRoot != null && !projectRoot.isEmpty()) + { + int start = dirCopy.indexOf(projectRoot); + dirCopy = dirCopy.substring(start); + } + + String path = dirCopy; + String modPath = path.replaceAll("\\$[^\\.]*", ""); + modPath = modPath.replace(".class",".java"); + //return dirCopy; + return modPath; + } + + /** + * set the directory structure. + * + * @param name + */ + public void setDirectoryStructure(String name) + { + directoryStructure = "/" + name; + } + + /** + * returns the name of this "file". + * + * @return returns the name of this file. + */ + public String getName() + { + for (String detail : getDetails()) + { + if (detail.startsWith("name=")) + { + String name = detail.replace("name=", ""); + name = name.replace("\"", ""); + return name; + } + } + + return ""; + } + +} diff --git a/com.kdmanalytics.toif.assimilator/src/com/kdmanalytics/toif/assimilator/toifRdfTypes/ToifRdfResource.java b/com.kdmanalytics.toif.assimilator/src/com/kdmanalytics/toif/assimilator/toifRdfTypes/ToifRdfResource.java new file mode 100644 index 00000000..9e4e9b87 --- /dev/null +++ b/com.kdmanalytics.toif.assimilator/src/com/kdmanalytics/toif/assimilator/toifRdfTypes/ToifRdfResource.java @@ -0,0 +1,307 @@ +/** + * + */ + +package com.kdmanalytics.toif.assimilator.toifRdfTypes; + +import java.io.File; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +import org.openrdf.model.ValueFactory; +import org.w3c.dom.Element; +import org.w3c.dom.NamedNodeMap; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; + +/** + * represents the toif resource. + * + * @author adam + * + */ +public class ToifRdfResource +{ + + /** + * the rdf element + */ + protected Element element; + + /** + * current file + */ + protected File file; + + /** + * resource id + */ + protected String id; + + /** + * list of details about this element. used for unique identification. + */ + protected List details = new ArrayList(); + + /** + * the type of resource. + */ + private String toifType; + + public ToifRdfResource() + { + } + + /** + * create a new resource + * + * @param element + * the rdf element this resource is based on. + * @param currentFile + * the current file this element is in. + */ + public ToifRdfResource(Element element, File currentFile) + { + this.element = element; + file = currentFile; + setDetails(extractElementDetails(element)); + } + + public String getType() + { + return toifType; + } + + /* + * (non-Javadoc) + * + * @see java.lang.Object#hashCode() + */ + @Override + public int hashCode() + { + final int prime = 31; + int result = 1; + result = prime * result + ((details == null) ? 0 : details.hashCode()); + return result; + } + + /* + * (non-Javadoc) + * + * @see java.lang.Object#equals(java.lang.Object) + */ + @Override + public boolean equals(Object obj) + { + if (this == obj) + { + return true; + } + if (obj == null) + { + return false; + } + if (!(obj instanceof ToifRdfResource)) + { + return false; + } + ToifRdfResource other = (ToifRdfResource) obj; + if (getDetails() == null) + { + if (other.getDetails() != null) + { + return false; + } + } + else if (!getDetails().equals(other.getDetails())) + { + return false; + } + return true; + } + + /** + * get the details for this node + * + * @return the details + */ + public List getDetails() + { + List result = details; + // result.add(directoryStructure); + return result; + } + + /** + * set the details for this node. + * + * @param details + * the details to set + */ + public void setDetails(List details) + { + this.details = details; + } + + /** + * @return the element + */ + public Element getElement() + { + return element; + } + + /** + * gets the local id for this resource + * + * @return the local id. + */ + public Long getLocalId() + { + if (element == null) + { + return 0L; + } + // String id = element.getAttribute("id"); + return Long.parseLong(id); + } + + /** + * the file for this resource. + * + * @return the file + */ + public File getFile() + { + return file; + } + + /** + * set the element for this resource. + * + * @param element + * the element to set + */ + public void setElement(Element element) + { + this.element = element; + } + + /** + * set the file for this resource. + * + * @param file + * the file to set + */ + public void setFile(File file) + { + this.file = file; + } + + /** + * extract all the interesting data from this node. Put it in a list and + * sort it so that other lists with the same data can be equal to it. + * + * @param node + * the node that we are trying to extract the details from + * @return return the sorted list of details. + */ + protected List extractElementDetails(Element node) + { + if (node == null) + { + return null; + } + + final List results = new ArrayList(); + + final NodeList children = node.getChildNodes(); + + String type = node.getAttribute("xsi:type"); + id = node.getAttribute("id"); + + if ((type.equals("toif:Finding")) || (type.equals("toif:Statement"))) + { + + // use the file path as an attribute to make it unique. + String absolutePath = file.getAbsolutePath(); + + absolutePath = absolutePath.replace("\\", "/"); + + String[] split = absolutePath.split("/"); + + String ident = split[split.length - 2] + "/" + split[split.length - 1]; + + node.setAttribute("file", ident); + results.add(node.getAttribute("file")); + + results.add("id=" + id); + } + + if (type.equals("toif:TOIFSegment")) + { + results.add(node.getAttribute("parent")); + results.add("id=" + id); + } + + if ("toif:WeaknessDescription".equals(type)) + { + results.add(node.getAttribute("text")); + } + + // for all the children of this node, add them to the results. + for (int i = 0; i < children.getLength(); i++) + { + final Node child = children.item(i); + + final String nodeName = child.getNodeName(); + + final NamedNodeMap attributes = child.getAttributes(); + + if ("description".equals(nodeName)) + { + results.add((attributes.getNamedItem("text").toString())); + } + if ("checksum".equals(nodeName)) + { + continue; + } + else + { + if (attributes != null) + { + results.add((attributes.getNamedItem(nodeName) + "")); + } + + } + + } + + toifType = type; + + results.add(type); + + Collections.sort(results); + + return results; + + } + + /** + * the element to string. + * + * @param factory + * the chosen value factory + * @return the string value. + */ + public String getStringValue(ValueFactory factory) + { + if (getElement() == null) + { + return "testing testing testing"; + } + return factory.createLiteral(getElement().toString()).toString(); + } +} diff --git a/com.kdmanalytics.toif.assimilator/src/com/kdmanalytics/toif/assimilator/toifRdfTypes/ToifRdfValue.java b/com.kdmanalytics.toif.assimilator/src/com/kdmanalytics/toif/assimilator/toifRdfTypes/ToifRdfValue.java new file mode 100644 index 00000000..26481362 --- /dev/null +++ b/com.kdmanalytics.toif.assimilator/src/com/kdmanalytics/toif/assimilator/toifRdfTypes/ToifRdfValue.java @@ -0,0 +1,95 @@ +/** + * + */ + +package com.kdmanalytics.toif.assimilator.toifRdfTypes; + +import java.io.File; + +import org.w3c.dom.Element; + +/** + * represents an rdf value for toif. + * + * @author adam + * + */ +public class ToifRdfValue extends ToifRdfResource +{ + + private String value; + + public ToifRdfValue() + { + } + + @Override + public int hashCode() + { + final int prime = 31; + int result = super.hashCode(); + result = prime * result + ((value == null) ? 0 : value.hashCode()); + return result; + } + + @Override + public boolean equals(Object obj) + { + if (this == obj) + return true; + if (!super.equals(obj)) + return false; + if (getClass() != obj.getClass()) + return false; + ToifRdfValue other = (ToifRdfValue) obj; + if (value == null) + { + if (other.value != null) + return false; + } + else if (!value.equals(other.value)) + return false; + return true; + } + + /** + * create a new value + * + * @param element + * the rdf element that this value will be based from + * @param currentFile + * the current file this element is in. + */ + public ToifRdfValue(Element element, File currentFile) + { + super(element, currentFile); + } + + /** + * create a new value + * + * @param value + * the value ot set + * @param element + * the rdf element this value will be based on + * @param currentFile + * the file the element is in. + */ + public ToifRdfValue(String value, Element element, File currentFile) + { + super(element, currentFile); + + this.value = value; + } + + /** + * get the value. + * + * @return the value. + */ + public String getValue() + { + return value; + } + +} diff --git a/com.kdmanalytics.toif.assimilator/src/com/kdmanalytics/toif/assimilator/toifRdfTypes/ToifStatement.java b/com.kdmanalytics.toif.assimilator/src/com/kdmanalytics/toif/assimilator/toifRdfTypes/ToifStatement.java new file mode 100644 index 00000000..e750d429 --- /dev/null +++ b/com.kdmanalytics.toif.assimilator/src/com/kdmanalytics/toif/assimilator/toifRdfTypes/ToifStatement.java @@ -0,0 +1,112 @@ +/** + * + */ + +package com.kdmanalytics.toif.assimilator.toifRdfTypes; + +import org.openrdf.model.URI; + +/** + * representing the rdf statements + * + * @author adam + * + */ +public class ToifStatement +{ + + private ToifRdfResource subject; + + private URI predicate; + + private ToifRdfResource object; + + /** + * create a new statement + * + * @param subjectResource + * the subject + * @param predicateURI + * the predicate + * @param objectResource + * the object + */ + public ToifStatement(ToifRdfResource subjectResource, URI predicateURI, ToifRdfResource objectResource) + { + this.subject = subjectResource; + this.predicate = predicateURI; + this.object = objectResource; + } + + /** + * get the subject + * + * @return the subject + */ + public ToifRdfResource getSubject() + { + return subject; + } + + /** + * set the subject + * + * @param subject + * the subject to set + */ + public void setSubject(ToifRdfResource subject) + { + this.subject = subject; + } + + /** + * get the predicate + * + * @return the predicate + */ + public URI getPredicate() + { + return predicate; + } + + /** + * set the predicate + * + * @param predicate + * the predicate to set + */ + public void setPredicate(URI predicate) + { + this.predicate = predicate; + } + + /** + * get the object + * + * @return the object + */ + public ToifRdfResource getObject() + { + return object; + } + + /** + * set the object + * + * @param object + * the object to set + */ + public void setObject(ToifRdfResource object) + { + this.object = object; + } + + /** + * return this statement as a string. + */ + public String toString() + { + return subject.getElement().getAttribute("id") + " " + predicate.stringValue() + " " + object.getElement().getAttribute("id"); + } + +} diff --git a/com.kdmanalytics.toif.assimilator/src/com/kdmanalytics/toif/mergers/StatementMapping.java b/com.kdmanalytics.toif.assimilator/src/com/kdmanalytics/toif/mergers/StatementMapping.java new file mode 100644 index 00000000..467591ba --- /dev/null +++ b/com.kdmanalytics.toif.assimilator/src/com/kdmanalytics/toif/mergers/StatementMapping.java @@ -0,0 +1,78 @@ + +package com.kdmanalytics.toif.mergers; + +import java.util.HashMap; + +/** + * + * Statements that have the same codeLocation are the same statements. this + * class carries a mapping of these local statements to global codeLocations. + * + * @author Adam Nunn + * + */ +public class StatementMapping +{ + + HashMap localStatementToLocalCodeLocation = new HashMap(); + + HashMap localCodeLocationToGlobalCodeLocation = new HashMap(); + + HashMap globalCodeLocationToGlobalStatement = new HashMap(); + + /** + * get the global statement for this local resource + * + * @param statementLocal + * the local resource id + * @return the global resource id + */ + public Long getGlobalStatement(Long statementLocal) + { + Long clLocal = localStatementToLocalCodeLocation.get(statementLocal); + + Long clGlobal = localCodeLocationToGlobalCodeLocation.get(clLocal); + + Long SGlobal = globalCodeLocationToGlobalStatement.get(clGlobal); + + return SGlobal; + } + + /** + * call this every time that a codelocation is mapped to a global. + * + * @param clLocal + * the local id of the codelocation + * @param clGlobal + * the global id of the code location. + */ + public void setNewCodeLocation(Long clLocal, Long clGlobal) + { + localCodeLocationToGlobalCodeLocation.put(clLocal, clGlobal); + } + + /** + * call this every time that a statement resource is made. + * + * @param sLocal + * the local id of the statement + * @param clLocal + * the local id of the code location for the statement. + */ + public void setNewLocalStatement(Long sLocal, Long clLocal) + { + localStatementToLocalCodeLocation.put(sLocal, clLocal); + } + + /** + * called when a statement is made global + * + * @param clGlobal + * @param sGlobal + */ + public void setNewGlobalStatement(Long clGlobal, Long sGlobal) + { + globalCodeLocationToGlobalStatement.put(clGlobal, sGlobal); + } + +} diff --git a/com.kdmanalytics.toif.assimilator/src/com/kdmanalytics/toif/mergers/ToifMerger.java b/com.kdmanalytics.toif.assimilator/src/com/kdmanalytics/toif/mergers/ToifMerger.java new file mode 100644 index 00000000..218b118b --- /dev/null +++ b/com.kdmanalytics.toif.assimilator/src/com/kdmanalytics/toif/mergers/ToifMerger.java @@ -0,0 +1,1351 @@ +/******************************************************************************* + * Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This program and + * the accompanying materials are made available under the terms of the Open + * Source Initiative OSI - Open Software License v3.0 which accompanies this + * distribution, and is available at + * http://www.opensource.org/licenses/osl-3.0.php/ + ******************************************************************************/ + +package com.kdmanalytics.toif.mergers; + +import java.io.File; +import java.io.IOException; +import java.io.PrintWriter; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Set; + +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.ParserConfigurationException; +import javax.xml.transform.Result; +import javax.xml.transform.Source; +import javax.xml.transform.Transformer; +import javax.xml.transform.TransformerConfigurationException; +import javax.xml.transform.TransformerException; +import javax.xml.transform.TransformerFactory; +import javax.xml.transform.TransformerFactoryConfigurationError; +import javax.xml.transform.dom.DOMSource; +import javax.xml.transform.stream.StreamResult; +import javax.xml.xpath.XPath; +import javax.xml.xpath.XPathConstants; +import javax.xml.xpath.XPathExpression; +import javax.xml.xpath.XPathExpressionException; +import javax.xml.xpath.XPathFactory; + +import org.apache.log4j.Logger; +import org.openrdf.model.Resource; +import org.openrdf.model.Statement; +import org.openrdf.model.URI; +import org.openrdf.model.Value; +import org.openrdf.model.ValueFactory; +import org.openrdf.repository.Repository; +import org.openrdf.repository.RepositoryConnection; +import org.openrdf.repository.RepositoryException; +import org.openrdf.repository.RepositoryResult; +import org.openrdf.repository.sail.SailRepository; +import org.openrdf.rio.RDFHandlerException; +import org.openrdf.rio.ntriples.NTriplesWriter; +import org.openrdf.sail.memory.MemoryStore; +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.dom.NamedNodeMap; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; +import org.xml.sax.SAXException; + +import com.kdmanalytics.toif.assimilator.TripleStatementWriter; +import com.kdmanalytics.toif.assimilator.toifRdfTypes.SeenStatement; +import com.kdmanalytics.toif.assimilator.toifRdfTypes.ToifRdfBnode; +import com.kdmanalytics.toif.assimilator.toifRdfTypes.ToifRdfFile; +import com.kdmanalytics.toif.assimilator.toifRdfTypes.ToifRdfResource; +import com.kdmanalytics.toif.assimilator.toifRdfTypes.ToifRdfValue; +import com.kdmanalytics.toif.assimilator.toifRdfTypes.ToifStatement; + +/** + * Class used to merge the toif data together. Merging integrates multiple + * equivalent elements into one single element. + * + * @author adam + * + */ +public class ToifMerger +{ + + private static final String HTTP_TOIF = "http://toif/"; + + private static final boolean DEBUG = false; + + /** + * The logger for this class. + */ + private static Logger LOG = Logger.getLogger(ToifMerger.class); + + private File currentFile; + + private Document doc; + + /** + * factory to create new objects for the repository. + */ + private ValueFactory factory; + + /** + * whether to continue the merge when a file fails. + */ + private final boolean force; + + /** + * This is a map of ids and their values as a string. This should enable us + * to find equivalent elements an use their ids. + */ + private final HashMap globalResources; + + private HashMap localResources; + + /** + * The offset makes sure that the next file's IDs continue where the + * previous file left off. It is incremented every time a new toif element + * is created. + */ + private Long offset; + + /** + * the repository in which to output the completed statements. + */ + private final Repository repository; + + /** + * list of all the statements before being deposited. + */ + private List statements; + + /** + * the method of output. + */ + private final PrintWriter output; + + /** + * the connection to the repository. + */ + private RepositoryConnection con; + + private String currentToolName; + + private final HashMap segments; + + private Element currentSegment; + + private int noName; + + /** + * the lowest available number in the long scale when counting from the end. + * this is used for bnodes. + */ + private Long smallestBigNumber = Long.MAX_VALUE; + + /** + * the statements that have been seen. + */ + private Set seenStatements = new HashSet(); + + /** + * the map of the path elements that are to be removed. + */ + private String blacklist; + + /** + * mapping of the local statement to a global statement + */ + private StatementMapping statementMapping; + + /** + * creates a new toif merger. outputs to the output-printwriter as a stream. + * + * @param output + * the output printwriter for the output stream. + * @param force + * force the continuation of the parse, even if there is a + * failure on one of the files. + * @param startID + * @param smallestBigNumber2 + */ + public ToifMerger(PrintWriter output, boolean force, Long startID, Long smallestBigNumber2, String blacklistPath) + { + statementMapping = new StatementMapping(); + blacklist = blacklistPath; + + // farce the parse to continue even on a failed file? + this.force = force; + + this.output = output; + this.smallestBigNumber = smallestBigNumber2; + + // initialize the elements map and the types map. + globalResources = new HashMap(); + + segments = new HashMap(); + + // make sure that the offset is set + offset = startID; + + repository = new SailRepository(new MemoryStore()); + + } + + /** + * get the repository + * + * @return returns the repository. + */ + public Repository getRepository() + { + return repository; + } + + /** + * create a complext fact and add it to the repository. + * + * @param fact + * the fact we are using to create the statements + * @param doc + * the doc that the fact belongs to . + * @param predicate + * the initial prediacte for the first statement, this is + * probably the type. + * @param statement1 + * the attribute name for the first element + * @param statement2 + * the attribute name for the second element + * @param statement3 + * the attribute name for the third element + */ + private void createComplexFact(Element fact, Document doc, String predicate, String statement1, String statement2, String statement3) + { + + /* + * create the initial statement. this is the one that sets up the blank + * node as the main subject of the fact. + */ + ToifRdfResource subject = createResource(statement1, doc, fact); + createElementFacts(subject); + + URI predicateURI = factory.createURI(HTTP_TOIF + predicate); + + ToifRdfBnode bnode = new ToifRdfBnode(factory.createBNode(), currentFile); + + ToifStatement toifStatement1 = new ToifStatement(subject, predicateURI, bnode); + statements.add(toifStatement1); + + // create statement2 + ToifRdfResource object1 = createResource(statement2, doc, fact); + createElementFacts(object1); + URI predicateURI2 = factory.createURI(HTTP_TOIF + trimNumber(statement2)); + + ToifStatement toifStatement2 = new ToifStatement(bnode, predicateURI2, object1); + statements.add(toifStatement2); + + // create statement3 + ToifRdfResource object2 = createResource(statement3, doc, fact); + createElementFacts(object2); + URI predicateURI3 = factory.createURI(HTTP_TOIF + trimNumber(statement3)); + + ToifStatement toifStatement3 = new ToifStatement(bnode, predicateURI3, object2); + statements.add(toifStatement3); + } + + /** + * I consider facts with references to more then 2 elements complex. These + * need to use a blank node. + * + * @param doc + * the document that contains this fact. + * @param fact + * the fact that we wish to analyse. + */ + private void createComplexFacts(Document doc, Element fact) + { + final Node predicateNode = fact.getAttributeNode("xsi:type"); + String predicate = null; + + if (predicateNode != null) + { + predicate = predicateNode.getTextContent(); + predicate = trimNumber(predicate); + } + else + { + return; + } + + if ("toif:OrganizationIsPartOfOrganizationAsRole".equals(predicate)) + { + createComplexFact(fact, doc, predicate, "organization1", "organization2", "role"); + + } + if ("toif:PersonIsEmployedByOrganizationAsRole".equals(predicate)) + { + createComplexFact(fact, doc, predicate, "person", "organization", "role"); + + } + if ("toif:PersonIsInvolvedInProjectAsRole".equals(predicate)) + { + createComplexFact(fact, doc, predicate, "person", "project", "role"); + + } + if ("toif:OrganizationIsInvolvedInProjectAsRole".equals(predicate)) + { + createComplexFact(fact, doc, predicate, "organization", "project", "role"); + + } + + } + + /** + * create all the facts regarding this resource + * + * @param subjectResource + * the resource for which to create facts about. + * @return the local resource. + */ + private ToifRdfResource createElementFacts(ToifRdfResource resource) + { + + if (resource == null) + { + return null; + } + + Long localId = resource.getLocalId(); + + if (localResources.containsKey(localId)) + { + + return localResources.get(localId); + } + else + { + localResources.put(localId, resource); + } + + Element resourceElement = resource.getElement(); + + // get the makings to construct a type statement. + // ToifRdfResource resource = resource; + URI predicateURI = factory.createURI(HTTP_TOIF + "type"); + String typeAttribute = resourceElement.getAttribute("xsi:type"); + ToifRdfValue objectResource = new ToifRdfValue(typeAttribute, resourceElement, currentFile); + + // this element has type... + ToifStatement type = new ToifStatement(resource, predicateURI, objectResource); + + // do the segment contains this element. + statements.add(new ToifStatement(new ToifRdfResource(currentSegment, currentFile), factory.createURI(HTTP_TOIF + "contains"), resource)); + + // ///////////////////// Now to make the children/////////////////// + NodeList children = resourceElement.getChildNodes(); + + if ("toif:Date".equals(typeAttribute)) + { + String value = resourceElement.getAttribute("date"); + ToifRdfValue statementValue = new ToifRdfValue(value, resourceElement, currentFile); + URI typeURI = factory.createURI(HTTP_TOIF + "date"); + ToifStatement statement = new ToifStatement(resource, typeURI, statementValue); + statements.add(statement); + } + + if ("toif:WeaknessDescription".equals(typeAttribute)) + { + String value = resourceElement.getAttribute("text"); + ToifRdfValue statementValue = new ToifRdfValue(value, resourceElement, currentFile); + URI typeURI = factory.createURI(HTTP_TOIF + "description"); + ToifStatement statement = new ToifStatement(resource, typeURI, statementValue); + statements.add(statement); + } + + // for each of the children of the node + for (int i = 0; i < children.getLength(); i++) + { + Node child = children.item(i); + + String nodeName = child.getNodeName(); + + if ("#text".equals(nodeName)) + { + continue; + } + + NamedNodeMap childAtributes = child.getAttributes(); + String value = null; + + if ("description".equals(nodeName)) + { + value = childAtributes.getNamedItem("text").getTextContent(); + } + else if ("toif:Date".equals(typeAttribute)) + { + value = resourceElement.getAttribute("date"); + } + else + { + + Node namedItem = childAtributes.getNamedItem(nodeName); + if (namedItem == null) + { + System.err.println("No named element found: " + nodeName + " " + noName++); + value = "none"; + } + else if (namedItem.getTextContent() == null) + { + System.err.println("No named element found: " + nodeName + " " + noName++); + value = "none"; + + } + else + { + value = namedItem.getTextContent(); + } + } + + URI typeURI = factory.createURI(HTTP_TOIF + nodeName); + ToifRdfValue statementValue = new ToifRdfValue(value, resourceElement, currentFile); + ToifStatement statement = new ToifStatement(resource, typeURI, statementValue); + statements.add(statement); + } + + statements.add(type); + + return resource; + + } + + /** + * create a fact that only has 2 elements in its attributes. + * + * @param subject + * the subject attribute name + * @param predicate + * the predicate attribute name + * @param object + * the object attribute name + * @param doc + * the facts document + * @param element + * the fact. + */ + private void createFact(String subject, String predicate, String object, Document doc, Element element) + { + // ///////////////////// subject ///////////////////////////////// + + // get the id value + ToifRdfResource subjectResource = createResource(subject, doc, element); + + // //////////////////////// predicate /////////////////////////////// + final URI predicateURI = factory.createURI(HTTP_TOIF + predicate); + + // //////////////////////// object ////////////////////////////////// + // this follows a similar approach to the subject above. + ToifRdfResource objectResource = createResource(object, doc, element); + + // Add a path to the code location. + if ("http://toif/toif:CodeLocationReferencesFile".equals(predicateURI.stringValue())) + { + if (objectResource instanceof ToifRdfFile) + { + ToifRdfFile file = (ToifRdfFile) objectResource; + + List details = subjectResource.getDetails(); + + String directoryStructure = file.getDirectoryStructure(blacklist); + + details.add("path=" + directoryStructure); + subjectResource.setDetails(details); + + } + } + + if ("http://toif/toif:StatementHasCodeLocation".equals(predicateURI.stringValue())) + { + statementMapping.setNewLocalStatement(subjectResource.getLocalId(), objectResource.getLocalId()); + } + + /* + * if the resource is to do with the files and directories, set the + * object's next-node as the subject. this allows newly found + * directories to be propagated back through all the files and + * directories. creating paths for each one. + * + * next node is the objects child. dir nextnode file. + * + * remember: subject - predicate -object file containedin dir + */ + if ((subjectResource instanceof ToifRdfFile) && (objectResource instanceof ToifRdfFile) && (predicate.contains("IsContainedIn"))) + { + + ((ToifRdfFile) objectResource).setNextNode((ToifRdfFile) subjectResource); + + // just some debug. + if (DEBUG) + { + System.err.println(objectResource.getLocalId() + ": " + ((ToifRdfFile) objectResource).getDirectoryStructure(null) + + " -> setting next node -> " + subjectResource.getLocalId() + ": " + + ((ToifRdfFile) subjectResource).getDirectoryStructure(null)); + } + } + + // put statement in the statements list + ToifStatement toifStatement = new ToifStatement(subjectResource, predicateURI, objectResource); + statements.add(toifStatement); + + } + + /** + * create the regular facts. + * + * @param doc + * the ducument the fact is in + * @param element + * the fact. + */ + private void createFacts(Document doc, Element element) + { + + final String predicate = element.getAttributeNode("xsi:type").getTextContent(); + + // for each of the fact types. + if ("toif:TOIFSegmentIsCreatedAtDate".equals(predicate)) + { + createFact("segment", predicate, "date", doc, element); + } + if ("toif:TOIFSegmentIsRelatedToProject".equals(predicate)) + { + createFact("segment", predicate, "project", doc, element); + } + if ("toif:FileIsContainedInDirectory".equals(predicate)) + { + createFact("file", predicate, "directory", doc, element); + } + if ("toif:DirectoryIsContainedInDirectory".equals(predicate)) + { + createFact("directory1", predicate, "directory2", doc, element); + } + if ("toif:FindingIsDescribedByWeaknessDescription".equals(predicate)) + { + createFact("finding", predicate, "description", doc, element); + } + if ("toif:FindingHasCWEIdentifier".equals(predicate)) + { + createFact("finding", predicate, "cwe", doc, element); + } + if ("toif:FindingHasSFPIdentifier".equals(predicate)) + { + createFact("finding", predicate, "sfp", doc, element); + } + if ("toif:FindingHasClusterIdentifier".equals(predicate)) + { + createFact("finding", predicate, "cluster", doc, element); + } + if ("toif:CodeLocationReferencesFile".equals(predicate)) + { + createFact("codeLocation", predicate, "file", doc, element); + } + if ("toif:FindingHasCodeLocation".equals(predicate)) + { + createFact("finding", predicate, "location", doc, element); + } + if ("toif:StatementIsInvolvedInFinding".equals(predicate)) + { + createFact("statement", predicate, "finding", doc, element); + } + if ("toif:StatementIsSinkInFinding".equals(predicate)) + { + createFact("statement", predicate, "finding", doc, element); + } + if ("toif:StatementHasCodeLocation".equals(predicate)) + { + createFact("statement", predicate, "location", doc, element); + } + if ("toif:StatementIsProceededByStatement".equals(predicate)) + { + createFact("statement1", predicate, "statement2", doc, element); + } + if ("toif:DataElementIsInvolvedInFinding".equals(predicate)) + { + createFact("data", predicate, "finding", doc, element); + } + if ("toif:FindingIsDescribedByWeaknessDescription".equals(predicate)) + { + createFact("finding", predicate, "description", doc, element); + } + + // general housekeeping + if ("toif:TOIFSegmentIsProducedByOrganization".equals(predicate)) + { + createFact("segment", predicate, "organization", doc, element); + } + if ("toif:TOIFSegmentIsSupervisedByPerson".equals(predicate)) + { + createFact("segment", predicate, "person", doc, element); + } + if ("toif:GeneratorIsSuppliedByVendor".equals(predicate)) + { + createFact("generator", predicate, "vendor", doc, element); + } + if ("toif:AdaptorSupportsGenerator".equals(predicate)) + { + createFact("adaptor", predicate, "vendor", doc, element); + } + if ("toif:TOIFSegmentIsRelatedToProject".equals(predicate)) + { + createFact("segment", predicate, "project", doc, element); + } + if ("toif:TOIFSegmentIsGeneratedByGenerator".equals(predicate)) + { + createFact("segment", predicate, "generator", doc, element); + } + if ("toif:TOIFSegmentIsProcessedByAdaptor".equals(predicate)) + { + createFact("segment", predicate, "adaptor", doc, element); + } + if ("toif:TOIFSegmentIsOwnedByOrganization".equals(predicate)) + { + createFact("segment", predicate, "organization", doc, element); + } + if ("toif:AdaptorIsSuppliedByVendor".equals(predicate)) + { + createFact("adaptor", predicate, "vendor", doc, element); + } + if ("toif:TOIFSegmentIsGeneratedByPerson".equals(predicate)) + { + createFact("segment", predicate, "person", doc, element); + } + + } + + /** + * Create the resource that is referenced by the fact. this also creates the + * child elements for this resource. + * + * @param resourceAttributeName + * the name of the attribute as it appears in the fact. + * @param doc + * the document that these elements belong to + * @param element + * the fact. + * @return + */ + private ToifRdfResource createResource(String resourceAttributeName, Document doc, Element element) + { + // get the id value. + String subjectId = element.getAttribute(resourceAttributeName); + // get the element that has this value for its id. + Element subjectElement = getElementById(doc, subjectId); + + // element is probably the segment if it cannot be obtained by its id. + if (subjectElement == null) + { + subjectElement = generateSegment(doc); + currentSegment = subjectElement; + } + + /* + * the resource will either be a toifRdfFile or ToifRdfResource. The + * resources will be stored the same way either way. + */ + ToifRdfResource subjectResource = null; + + /* + * if the subject is some form of file, use the toifRdfFile. this is so + * that we can create a directory structure for it later. + */ + if (resourceAttributeName.contains("file") || resourceAttributeName.contains("directory")) + { + subjectResource = new ToifRdfFile(subjectElement, currentFile); + } + // otherwise, create a straight-up ToifRdfResource. + else + { + subjectResource = new ToifRdfResource(subjectElement, currentFile); + } + + /* + * create the elements that are children of this resource. this also + * returns the actual subject-resource object that we should be using. + * IE the one that is already in the localResources. + */ + subjectResource = createElementFacts(subjectResource); + + return subjectResource; + } + + /** + * Deposit the resources into the repository. + */ + private void depositResources() + { + try + { + con = repository.getConnection(); + + /* + * write all the local resources and statements to the repository. + * make sure that you use global resources if possible. + */ + for (ToifStatement statement : statements) + { + // subject + ToifRdfResource subject = statement.getSubject(); + + // predicate. + URI predicate = statement.getPredicate(); + + // object + ToifRdfResource object = statement.getObject(); + + // Add a path to the code location. + if ("http://toif/toif:CodeLocationReferencesFile".equals(predicate.stringValue())) + { + if (object instanceof ToifRdfFile) + { + ToifRdfFile file = (ToifRdfFile) object; + writeFact(subject, factory.createURI(HTTP_TOIF + "path"), + new ToifRdfValue(file.getDirectoryStructure(blacklist), object.getElement(), currentFile)); + } + else + { + System.err.println("This should have not happened."); + } + } + + // write statement + writeFact(subject, predicate, object); + } + // export the toif repositoty as a stream. + con.export(new NTriplesWriter(output), (Resource) null); + + con.clear((Resource) null); + + con.close(); + } + catch (RepositoryException e) + { + e.printStackTrace(); + } + catch (RDFHandlerException e) + { + e.printStackTrace(); + } + + } + + /** + * Filter the elements out of the parent element. + * + * @param parent + * the node containing the elements that you wish to filter + * @param filter + * the tag that you wish to filter. + */ + private void filterElements(Node parent, String filter) + { + final NodeList children = parent.getChildNodes(); + + for (int i = 0; i < children.getLength(); i++) + { + final Node child = children.item(i); + + // only interested in elements + if (child.getNodeType() == Node.ELEMENT_NODE) + { + + // remove elements whose tag name = filter + // otherwise check its children for filtering with a recursive + // call + if (child.getNodeName().equals(filter)) + { + parent.removeChild(child); + } + else + { + filterElements(child, filter); + } + } + } + } + + /** + * Get the Segment from the document and its description. These get placed + * in the hashmap of all the collected elements. + * + * @param doc + * the document from which to get the segment. + */ + private Element generateSegment(Document doc) + { + + // don't want to affect the original doc at this stage. + final Document clonedDoc = (Document) doc.cloneNode(true); + + // get the root element. + Element segment = clonedDoc.getDocumentElement(); + + filterElements(segment, "fact"); + + segment.setAttribute("id", Long.toString(0)); + // segment.setAttribute("parent", currentParent); + + String fileName = currentFile.getName(); + fileName = fileName.replace(".toif.xml", ""); + String[] nameArray = fileName.split("[.]"); + currentToolName = nameArray[nameArray.length - 1]; + + segment.setAttribute("parent", currentToolName); + + clonedDoc.normalize(); + + ToifRdfResource resource = new ToifRdfResource(segment, currentFile); + + if (!segments.containsKey(currentToolName)) + { + segments.put(currentToolName, resource); + } + + resource = segments.get(currentToolName); + + makeGlobal(resource); + + return resource.getElement(); + + } + + /** + * return the dom document for this file + * + * @param file + * the file to be parsed + * @return the dom document + * @throws ParserConfigurationException + * @throws SAXException + * @throws IOException + */ + private Document getDocument(File file) throws ParserConfigurationException, SAXException, IOException + { + final DocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance(); + final DocumentBuilder docBuilder = docFactory.newDocumentBuilder(); + final Document doc = docBuilder.parse(file); + + doc.getDocumentElement().normalize(); + return doc; + } + + /** + * Get the element with the required id from the node. + * + * @param node + * The node which contains the elements with ids. + * @param id + * the id value to search for. + * @return the element with the required id value. + */ + private Element getElementById(Node node, String id) + { + try + { + final XPathFactory xPathfactory = XPathFactory.newInstance(); + final XPath xpath = xPathfactory.newXPath(); + + final XPathExpression xPathexpression = xpath.compile("//*[@id = '" + id + "']"); + + final Element result = (Element) xPathexpression.evaluate(node, XPathConstants.NODE); + + return result; + } + catch (final XPathExpressionException ex) + { + ex.printStackTrace(); + return null; + } + } + + /** + * makeGlobal must check to make sure that if the element is already in the + * global resources map, that it is the existing element that is returned. + * + * @param subject + * @return + */ + private Long makeGlobal(ToifRdfResource resource) + { + + // if the resource has already been seen (its in the globalResources). + // Use it! + if (globalResources.containsKey(resource)) + { + // System.err.println("contained: "+resource.getDetails()); + return globalResources.get(resource); + } + // otherwise make it a global resource. + else + { + // System.err.println("added: " + resource.getDetails()); + long globalId = resource.getLocalId() + offset; + + globalResources.put(resource, globalId); + // return globalResources.get(resource); + return globalId; + } + } + + /** + * Attempt to merge the toif files. + * + * @param toifFiles + * The List of toif files to merge. + * @param startID + * @return + */ + public Long merge(List toifFiles) + { + + int fileNum = 0; + int listSize = toifFiles.size(); + try + { + repository.initialize(); + con = repository.getConnection(); + factory = repository.getValueFactory(); + } + catch (final RepositoryException e) + { + LOG.error("There was a repository exception when trying to merge the TOIF data. Cannot continue!"); + e.printStackTrace(); + } + + // for each file in the list of toif files, parse it. + for (final File file : toifFiles) + { + + fileNum++; + + float fraction = 100f / listSize; + int percent = (int) Math.ceil(fraction * fileNum); + + if (percent > 100) + { + percent = 100; + } + + System.out.print("\r" + file); + System.out.print("\nprocessing TOIF... " + percent + "%"); + + currentFile = file; + + String fileName = currentFile.getName(); + fileName = fileName.replace(".toif.xml", ""); + String[] nameArray = fileName.split("[.]"); + currentToolName = nameArray[nameArray.length - 1]; + //currentToolName = currentFile.getParent(); + + // initialize the local structures that only relate to this file. + statements = new ArrayList(); + + localResources = new HashMap(); + + try + { + // parse the file. + parseFile(file); + } + /* + * catch possible exceptions. try to continue the parse if force has + * been set. + */ + catch (final ParserConfigurationException e) + { + if (force) + { + e.printStackTrace(); + LOG.error("File: " + file.getAbsolutePath() + + " has encountered a parserConfigurationException but the other files will be attempted"); + continue; + } + else + { + LOG.error("File: " + file.getAbsolutePath() + + " has encountered a parserConfigurationException no further files will be processd."); + return null; + } + } + catch (final SAXException e) + { + if (force) + { + e.printStackTrace(); + LOG.error("File: " + file.getAbsolutePath() + " has encountered a SAXException but the other files will be attempted"); + continue; + } + else + { + e.printStackTrace(); + LOG.error("File: " + file.getAbsolutePath() + " has encountered a SAXException no further files will be processd."); + return null; + } + } + catch (final IOException e) + { + if (force) + { + e.printStackTrace(); + LOG.error("File: " + file.getAbsolutePath() + " has encountered a IOException but the other files will be attempted"); + continue; + } + else + { + e.printStackTrace(); + LOG.error("File: " + file.getAbsolutePath() + " has encountered a IOException no further files will be processd."); + return null; + } + } + + ArrayList keys = new ArrayList(globalResources.values()); + if (keys.isEmpty()) + { + continue; + } + Collections.sort(keys); + Collections.reverse(keys); + offset = keys.get(0) + 1; + depositResources(); + + if (DEBUG) + { + System.err.println("End of file: " + file); + + } + // end of file. + } + System.out.println(""); + + try + { + con.close(); + } + catch (RepositoryException e) + { + System.err.println("Repository exception during merge. " + e); + } + + return offset; + // after files + } + + /** + * parse each file and extract the elements from it. + * + * @param file + * the file which is to be parsed. + * @throws IOException + * @throws SAXException + * @throws ParserConfigurationException + */ + private void parseFile(File file) throws ParserConfigurationException, SAXException, IOException + { + if (DEBUG) + { + System.err + .println("-----------------------------------------------------------------------------------------------------------------------------------"); + System.err.println("Parsing: " + file.getAbsolutePath()); + System.err.println("Offset: " + offset); + System.err.println("Current Segment: " + new ToifRdfResource(currentSegment, currentFile).getDetails()); + System.err.println("Current File: " + currentFile.getName()); + System.err.println("Current Tool Name: " + currentToolName + "\n"); + } + + doc = getDocument(file); + + // just get all the elements. + final NodeList nodeList = doc.getElementsByTagName("*"); + + /* + * for each of the elements in the document, find the facts relating to + * the relationships between the other entities. ie: + * "toif:FileIsContainedInDirectory". + */ + for (int i = 0; i < nodeList.getLength(); i++) + { + // element is a subinterface of node. + final Element element = (Element) nodeList.item(i); + + /* + * figure out if this is a fact that relates multiple entities. + * These kinds of facts have 4 attributes. It would be nice if the + * spec differentiated between these two kinds of elements. + */ + final int attributesLength = element.getAttributes().getLength(); + + /* + * if the attribute length is not 4 then just continue until we find + * one. + */ + if (attributesLength > 4) + { + createComplexFacts(doc, element); + } + + /* + * if the attribute length is 4 then we can just use the xsi:type as + * the predicate. + */ + if (attributesLength == 4) + { + createFacts(doc, element); + } + + } + } + + /** + * prints the contents of the repository. mainly for debug purposes. + * + * @param repository + * the repository to print. + */ + void printDB() + { + RepositoryConnection con; + + try + { + con = repository.getConnection(); + // get all statements. + final RepositoryResult statements = con.getStatements(null, null, null, true); + + // for all the statements. + while (statements.hasNext()) + { + final Statement st = statements.next(); + // print statements. + System.err.println(st.toString()); + } + + statements.close(); + } + catch (final RepositoryException e) + { + e.printStackTrace(); + LOG.error("There was a repository error while printing the database. " + e); + } + + } + + /** + * print the document (useful for debug) + * + * @param doc + * the XML document to print + * @throws TransformerFactoryConfigurationError + */ + @SuppressWarnings("unused") + private void printXML(Document doc) throws TransformerFactoryConfigurationError + { + final Source source = new DOMSource(doc); + final Result dest = new StreamResult(System.err); + final TransformerFactory tFactory = TransformerFactory.newInstance(); + Transformer tFormer; + try + { + tFormer = tFactory.newTransformer(); + tFormer.transform(source, dest); + } + catch (final TransformerConfigurationException e) + { + e.printStackTrace(); + } + catch (final TransformerException e) + { + e.printStackTrace(); + } + } + + /** + * trim the number off the string if it is there + * + * @param string + * the string to trim + * @return the trimmed string + */ + private String trimNumber(String string) + { + String end = string.substring(string.length() - 1); + + try + { + Integer.parseInt(end); + return string.substring(0, string.length() - 1); + } + catch (NumberFormatException e) + { + return string; + } + } + + /** + * write the statement to the repository. + * + * @param subject + * the subject of the statement + * @param predicateURI + * the predicate of the statement + * @param object + * the object of the statement. + */ + private void writeFact(ToifRdfResource subject, URI predicateURI, ToifRdfResource object) + { + + if (subject instanceof ToifRdfFile) + { + + ToifRdfFile file = (ToifRdfFile) subject; + + if (subject.getType().equals("toif:Directory")) + { + if (!file.getDirectoryStructure(null).contains(blacklist)) + { + return; + } + } + + } + + if (object instanceof ToifRdfFile) + { + ToifRdfFile file = (ToifRdfFile) object; + + final String directoryStructure = file.getDirectoryStructure(null); + if (!directoryStructure.contains(blacklist)) + { + return; + } + + } + + try + { + Long subjectId = (long) 0; + + if ("toif:Statement".equals(subject.getType())) + { + final Long globalStatement = statementMapping.getGlobalStatement(subject.getLocalId()); + if (globalStatement != null) + { + subjectId = globalStatement; + } + else + { + subjectId = makeGlobal(subject); + } + } + else + { + subjectId = makeGlobal(subject); + + } + + URI subjectURI = factory.createURI(HTTP_TOIF + subjectId); + if ((object instanceof ToifRdfBnode)) + { + + Long objectId = makeGlobal(object); + + URI objectURI = factory.createURI(HTTP_TOIF + (smallestBigNumber - objectId)); + + // returns true if the statement has been seen. + boolean seen = seenStatement(subjectURI.stringValue(), predicateURI.stringValue(), objectURI.stringValue()); + + // if it has not been seen. + if (!seen) + { + TripleStatementWriter.addOrWrite(output, con, subjectURI, predicateURI, objectURI); + } + + } + else if (object instanceof ToifRdfValue) + { + Value valueURI = factory.createLiteral(((ToifRdfValue) object).getValue()); + boolean seen = seenStatement(subjectURI.stringValue(), predicateURI.stringValue(), valueURI.stringValue()); + if (!seen) + { + TripleStatementWriter.addOrWrite(output, con, subjectURI, predicateURI, valueURI); + } + + } + + else if ((subject instanceof ToifRdfBnode)) + { + subjectId = makeGlobal(subject); + subjectURI = factory.createURI(HTTP_TOIF + (smallestBigNumber - subjectId)); + Long objectId = makeGlobal(object); + URI objectURI = factory.createURI(HTTP_TOIF + objectId); + + boolean seen = seenStatement(subjectURI.stringValue(), predicateURI.stringValue(), objectURI.stringValue()); + + if (!seen) + { + + TripleStatementWriter.addOrWrite(output, con, subjectURI, predicateURI, objectURI); + } + + } + else + { + Long objectId = makeGlobal(object); + + if ("toif:CodeLocation".equals(object.getType())) + { + statementMapping.setNewCodeLocation(object.getLocalId(), objectId); + } + + if ("toif:CodeLocation".equals(object.getType()) && "toif:Statement".equals(subject.getType())) + { + statementMapping.setNewGlobalStatement(objectId, subjectId); + } + + URI objectURI = factory.createURI(HTTP_TOIF + objectId); + + boolean seen = seenStatement(subjectURI.stringValue(), predicateURI.stringValue(), objectURI.stringValue()); + + if (!seen) + { + TripleStatementWriter.addOrWrite(output, con, subjectURI, predicateURI, objectURI); + } + + } + + } + catch (final RepositoryException e) + { + System.err.println("Repository exception while writing the fact to the repository. " + e); + } + + } + + /** + * checks to see if this statement + * + * @param subject + * @param predicate + * @param object + * @return + */ + private boolean seenStatement(String subject, String predicate, String object) + { + SeenStatement seenStatement = new SeenStatement(subject, predicate, object); + + // returns true if the statement has been seen + final boolean seen = !seenStatements.add(seenStatement); + return seen; + } +} diff --git a/com.kdmanalytics.toif.assimilator/src/log4j.properties b/com.kdmanalytics.toif.assimilator/src/log4j.properties new file mode 100644 index 00000000..6474c8fe --- /dev/null +++ b/com.kdmanalytics.toif.assimilator/src/log4j.properties @@ -0,0 +1,7 @@ +#------------------------------------------------------------------------------- +# Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This program and the +# accompanying materials are made available under the terms of the Open Source +# Initiative OSI - Open Software License v3.0 which accompanies this +# distribution, and is available at http://www.opensource.org/licenses/osl-3.0.php/ +#------------------------------------------------------------------------------- +log4j.rootCategory=OFF diff --git a/com.kdmanalytics.toif.assimilator/target/MANIFEST.MF b/com.kdmanalytics.toif.assimilator/target/MANIFEST.MF new file mode 100644 index 00000000..0bdf15de --- /dev/null +++ b/com.kdmanalytics.toif.assimilator/target/MANIFEST.MF @@ -0,0 +1,25 @@ +Manifest-Version: 1.0 +Export-Package: com.kdmanalytics.toif.assimilator; uses:="com.kdmanaly + tics.toif.mergers, org.apache.log4j, org.eclipse.ui.plugin, org.os + gi.framework, org.openrdf.repository, com.kdmanalytics.kdm.reposito + ryMerger, org.openrdf.model",com.kdmanalytics.toif.assimilator.confi + g,com.kdmanalytics.toif.assimilator.exceptions,com.kdmanalytics.toif. + assimilator.toifRdfTypes;uses:="org.w3c.dom,org.openrdf.model",com.kd + manalytics.toif.mergers;uses:="org.openrdf.model,org.w3c.dom" +Require-Bundle: org.apache.xerces;bundle-version="[2.11.0,3.0.0)",org. + apache.log4j;bundle-version="[1.2.15,1.3.0)",org.apache.commons.lang3 + ;bundle-version="[3.1.0,4.0.0)",org.apache.commons.io;bundle-version= + "[2.4.0,3.0.0)",org.openrdf.sesame;bundle-version="[2.4.0,2.5.0)",org + .eclipse.core.runtime;bundle-version="[3.7.0,4.0.0)",com.kdmanalytics + .kdm.repositoryMerger;bundle-version="[1.0.0,2.0.0)",com.google.guava + ;bundle-version="[14.0.1,15.0.0)",com.kdmanalytics.toif.common;bundle + -version="[1.14.0,2.0.0)" +Bundle-Vendor: KDM Analytics Inc. +Bundle-ActivationPolicy: lazy +Bundle-Version: 1.15.5 +Bundle-Name: TOIF Assimilator +Bundle-Activator: com.kdmanalytics.toif.assimilator.Activator +Bundle-ManifestVersion: 2 +Bundle-SymbolicName: com.kdmanalytics.toif.assimilator;singleton:=true +Bundle-RequiredExecutionEnvironment: JavaSE-1.7 + diff --git a/com.kdmanalytics.toif.assimilator/target/classes/com/kdmanalytics/toif/assimilator/Activator.class b/com.kdmanalytics.toif.assimilator/target/classes/com/kdmanalytics/toif/assimilator/Activator.class new file mode 100644 index 00000000..518e5ac0 Binary files /dev/null and b/com.kdmanalytics.toif.assimilator/target/classes/com/kdmanalytics/toif/assimilator/Activator.class differ diff --git a/com.kdmanalytics.toif.assimilator/target/classes/com/kdmanalytics/toif/assimilator/Assimilator$1.class b/com.kdmanalytics.toif.assimilator/target/classes/com/kdmanalytics/toif/assimilator/Assimilator$1.class new file mode 100644 index 00000000..38e7edb9 Binary files /dev/null and b/com.kdmanalytics.toif.assimilator/target/classes/com/kdmanalytics/toif/assimilator/Assimilator$1.class differ diff --git a/com.kdmanalytics.toif.assimilator/target/classes/com/kdmanalytics/toif/assimilator/Assimilator$2.class b/com.kdmanalytics.toif.assimilator/target/classes/com/kdmanalytics/toif/assimilator/Assimilator$2.class new file mode 100644 index 00000000..fc48da7a Binary files /dev/null and b/com.kdmanalytics.toif.assimilator/target/classes/com/kdmanalytics/toif/assimilator/Assimilator$2.class differ diff --git a/com.kdmanalytics.toif.assimilator/target/classes/com/kdmanalytics/toif/assimilator/Assimilator$3.class b/com.kdmanalytics.toif.assimilator/target/classes/com/kdmanalytics/toif/assimilator/Assimilator$3.class new file mode 100644 index 00000000..8a848c3c Binary files /dev/null and b/com.kdmanalytics.toif.assimilator/target/classes/com/kdmanalytics/toif/assimilator/Assimilator$3.class differ diff --git a/com.kdmanalytics.toif.assimilator/target/classes/com/kdmanalytics/toif/assimilator/Assimilator$4.class b/com.kdmanalytics.toif.assimilator/target/classes/com/kdmanalytics/toif/assimilator/Assimilator$4.class new file mode 100644 index 00000000..8b102803 Binary files /dev/null and b/com.kdmanalytics.toif.assimilator/target/classes/com/kdmanalytics/toif/assimilator/Assimilator$4.class differ diff --git a/com.kdmanalytics.toif.assimilator/target/classes/com/kdmanalytics/toif/assimilator/Assimilator$5.class b/com.kdmanalytics.toif.assimilator/target/classes/com/kdmanalytics/toif/assimilator/Assimilator$5.class new file mode 100644 index 00000000..ad0173e8 Binary files /dev/null and b/com.kdmanalytics.toif.assimilator/target/classes/com/kdmanalytics/toif/assimilator/Assimilator$5.class differ diff --git a/com.kdmanalytics.toif.assimilator/target/classes/com/kdmanalytics/toif/assimilator/Assimilator$ThreadStatus.class b/com.kdmanalytics.toif.assimilator/target/classes/com/kdmanalytics/toif/assimilator/Assimilator$ThreadStatus.class new file mode 100644 index 00000000..38471789 Binary files /dev/null and b/com.kdmanalytics.toif.assimilator/target/classes/com/kdmanalytics/toif/assimilator/Assimilator$ThreadStatus.class differ diff --git a/com.kdmanalytics.toif.assimilator/target/classes/com/kdmanalytics/toif/assimilator/Assimilator.class b/com.kdmanalytics.toif.assimilator/target/classes/com/kdmanalytics/toif/assimilator/Assimilator.class new file mode 100644 index 00000000..2d1cbcd4 Binary files /dev/null and b/com.kdmanalytics.toif.assimilator/target/classes/com/kdmanalytics/toif/assimilator/Assimilator.class differ diff --git a/com.kdmanalytics.toif.assimilator/target/classes/com/kdmanalytics/toif/assimilator/AttributeUtilities.class b/com.kdmanalytics.toif.assimilator/target/classes/com/kdmanalytics/toif/assimilator/AttributeUtilities.class new file mode 100644 index 00000000..074999cf Binary files /dev/null and b/com.kdmanalytics.toif.assimilator/target/classes/com/kdmanalytics/toif/assimilator/AttributeUtilities.class differ diff --git a/com.kdmanalytics.toif.assimilator/target/classes/com/kdmanalytics/toif/assimilator/DelayedRelation.class b/com.kdmanalytics.toif.assimilator/target/classes/com/kdmanalytics/toif/assimilator/DelayedRelation.class new file mode 100644 index 00000000..1d082c66 Binary files /dev/null and b/com.kdmanalytics.toif.assimilator/target/classes/com/kdmanalytics/toif/assimilator/DelayedRelation.class differ diff --git a/com.kdmanalytics.toif.assimilator/target/classes/com/kdmanalytics/toif/assimilator/FilePathTree$Node.class b/com.kdmanalytics.toif.assimilator/target/classes/com/kdmanalytics/toif/assimilator/FilePathTree$Node.class new file mode 100644 index 00000000..0d4e0465 Binary files /dev/null and b/com.kdmanalytics.toif.assimilator/target/classes/com/kdmanalytics/toif/assimilator/FilePathTree$Node.class differ diff --git a/com.kdmanalytics.toif.assimilator/target/classes/com/kdmanalytics/toif/assimilator/FilePathTree.class b/com.kdmanalytics.toif.assimilator/target/classes/com/kdmanalytics/toif/assimilator/FilePathTree.class new file mode 100644 index 00000000..42ffb03d Binary files /dev/null and b/com.kdmanalytics.toif.assimilator/target/classes/com/kdmanalytics/toif/assimilator/FilePathTree.class differ diff --git a/com.kdmanalytics.toif.assimilator/target/classes/com/kdmanalytics/toif/assimilator/FilePathTrie$Node.class b/com.kdmanalytics.toif.assimilator/target/classes/com/kdmanalytics/toif/assimilator/FilePathTrie$Node.class new file mode 100644 index 00000000..f0e24a34 Binary files /dev/null and b/com.kdmanalytics.toif.assimilator/target/classes/com/kdmanalytics/toif/assimilator/FilePathTrie$Node.class differ diff --git a/com.kdmanalytics.toif.assimilator/target/classes/com/kdmanalytics/toif/assimilator/FilePathTrie.class b/com.kdmanalytics.toif.assimilator/target/classes/com/kdmanalytics/toif/assimilator/FilePathTrie.class new file mode 100644 index 00000000..bd4330ff Binary files /dev/null and b/com.kdmanalytics.toif.assimilator/target/classes/com/kdmanalytics/toif/assimilator/FilePathTrie.class differ diff --git a/com.kdmanalytics.toif.assimilator/target/classes/com/kdmanalytics/toif/assimilator/KdmXmiIdHandler.class b/com.kdmanalytics.toif.assimilator/target/classes/com/kdmanalytics/toif/assimilator/KdmXmiIdHandler.class new file mode 100644 index 00000000..8c6b8227 Binary files /dev/null and b/com.kdmanalytics.toif.assimilator/target/classes/com/kdmanalytics/toif/assimilator/KdmXmiIdHandler.class differ diff --git a/com.kdmanalytics.toif.assimilator/target/classes/com/kdmanalytics/toif/assimilator/KdmXmlHandler.class b/com.kdmanalytics.toif.assimilator/target/classes/com/kdmanalytics/toif/assimilator/KdmXmlHandler.class new file mode 100644 index 00000000..c4a2d0f4 Binary files /dev/null and b/com.kdmanalytics.toif.assimilator/target/classes/com/kdmanalytics/toif/assimilator/KdmXmlHandler.class differ diff --git a/com.kdmanalytics.toif.assimilator/target/classes/com/kdmanalytics/toif/assimilator/TripleStatementWriter.class b/com.kdmanalytics.toif.assimilator/target/classes/com/kdmanalytics/toif/assimilator/TripleStatementWriter.class new file mode 100644 index 00000000..6bc13fc7 Binary files /dev/null and b/com.kdmanalytics.toif.assimilator/target/classes/com/kdmanalytics/toif/assimilator/TripleStatementWriter.class differ diff --git a/com.kdmanalytics.toif.assimilator/target/classes/com/kdmanalytics/toif/assimilator/UniqueID.class b/com.kdmanalytics.toif.assimilator/target/classes/com/kdmanalytics/toif/assimilator/UniqueID.class new file mode 100644 index 00000000..e9fc7cba Binary files /dev/null and b/com.kdmanalytics.toif.assimilator/target/classes/com/kdmanalytics/toif/assimilator/UniqueID.class differ diff --git a/com.kdmanalytics.toif.assimilator/target/classes/com/kdmanalytics/toif/assimilator/XMLNode.class b/com.kdmanalytics.toif.assimilator/target/classes/com/kdmanalytics/toif/assimilator/XMLNode.class new file mode 100644 index 00000000..e9758a0f Binary files /dev/null and b/com.kdmanalytics.toif.assimilator/target/classes/com/kdmanalytics/toif/assimilator/XMLNode.class differ diff --git a/com.kdmanalytics.toif.assimilator/target/classes/com/kdmanalytics/toif/assimilator/config/cxx.cfg b/com.kdmanalytics.toif.assimilator/target/classes/com/kdmanalytics/toif/assimilator/config/cxx.cfg new file mode 100644 index 00000000..01fd647d --- /dev/null +++ b/com.kdmanalytics.toif.assimilator/target/classes/com/kdmanalytics/toif/assimilator/config/cxx.cfg @@ -0,0 +1,39 @@ +# Actions define the merge behaviour for various element KDM types. This specifies +# how two files are merged together. +# +# MERGE Merges the contents of like IDed nodes together +# COPY Copies the information in the node even if the ID is already represented +# IGNORE Does not specifically merge or copy data, but recurses down the tree and +# let the children specify for themselves. +# +# To match multiple elements you may use regular expressions. +# +# The default behaviour is specified by using catch all regex ".*". Ensure that this +# is the LAST element or it will mask any other regex entries. +# +# When identifying a merge type for an element, first an exact match is attempted, +# then regular expressions are evaluated in the order in which they appear in the +# file. +# +action,code/Package,MERGE +action,code/LanguageUnit,MERGE +action,code/SharedUnit,MERGE +action,code/CodeAssembly,MERGE +action,code/CompilationUnit,MERGE +action,code/CompilationUnit,MERGE +action,source/StorableUnit,MERGE +action,source/Directory,MERGE +action,code/MethodUnit,SINGLETON +action,code/CallableUnit,SINGLETON +action,action/BlockUnit,SINGLETON +action,.*Model,MERGE +action,kdm/ExtensionFamily,MERGE +action,data/DataContainer,MERGE + +# This regex matches everything else. Note that the default behaviour in the linker +# is currently to ignore, but since this could change it is probably a good idea to +# actively code this behaviour. +action,.*,IGNORE + +# When elements have no IDs, how should they be handled? +noid,COPY \ No newline at end of file diff --git a/com.kdmanalytics.toif.assimilator/target/classes/com/kdmanalytics/toif/assimilator/exceptions/AssimilatorArgumentException.class b/com.kdmanalytics.toif.assimilator/target/classes/com/kdmanalytics/toif/assimilator/exceptions/AssimilatorArgumentException.class new file mode 100644 index 00000000..39a292f5 Binary files /dev/null and b/com.kdmanalytics.toif.assimilator/target/classes/com/kdmanalytics/toif/assimilator/exceptions/AssimilatorArgumentException.class differ diff --git a/com.kdmanalytics.toif.assimilator/target/classes/com/kdmanalytics/toif/assimilator/toifRdfTypes/SeenStatement.class b/com.kdmanalytics.toif.assimilator/target/classes/com/kdmanalytics/toif/assimilator/toifRdfTypes/SeenStatement.class new file mode 100644 index 00000000..1ac2d05e Binary files /dev/null and b/com.kdmanalytics.toif.assimilator/target/classes/com/kdmanalytics/toif/assimilator/toifRdfTypes/SeenStatement.class differ diff --git a/com.kdmanalytics.toif.assimilator/target/classes/com/kdmanalytics/toif/assimilator/toifRdfTypes/ToifRdfBnode.class b/com.kdmanalytics.toif.assimilator/target/classes/com/kdmanalytics/toif/assimilator/toifRdfTypes/ToifRdfBnode.class new file mode 100644 index 00000000..b46f7c9f Binary files /dev/null and b/com.kdmanalytics.toif.assimilator/target/classes/com/kdmanalytics/toif/assimilator/toifRdfTypes/ToifRdfBnode.class differ diff --git a/com.kdmanalytics.toif.assimilator/target/classes/com/kdmanalytics/toif/assimilator/toifRdfTypes/ToifRdfFile.class b/com.kdmanalytics.toif.assimilator/target/classes/com/kdmanalytics/toif/assimilator/toifRdfTypes/ToifRdfFile.class new file mode 100644 index 00000000..d94e35ac Binary files /dev/null and b/com.kdmanalytics.toif.assimilator/target/classes/com/kdmanalytics/toif/assimilator/toifRdfTypes/ToifRdfFile.class differ diff --git a/com.kdmanalytics.toif.assimilator/target/classes/com/kdmanalytics/toif/assimilator/toifRdfTypes/ToifRdfResource.class b/com.kdmanalytics.toif.assimilator/target/classes/com/kdmanalytics/toif/assimilator/toifRdfTypes/ToifRdfResource.class new file mode 100644 index 00000000..cbc2c823 Binary files /dev/null and b/com.kdmanalytics.toif.assimilator/target/classes/com/kdmanalytics/toif/assimilator/toifRdfTypes/ToifRdfResource.class differ diff --git a/com.kdmanalytics.toif.assimilator/target/classes/com/kdmanalytics/toif/assimilator/toifRdfTypes/ToifRdfValue.class b/com.kdmanalytics.toif.assimilator/target/classes/com/kdmanalytics/toif/assimilator/toifRdfTypes/ToifRdfValue.class new file mode 100644 index 00000000..f224d79a Binary files /dev/null and b/com.kdmanalytics.toif.assimilator/target/classes/com/kdmanalytics/toif/assimilator/toifRdfTypes/ToifRdfValue.class differ diff --git a/com.kdmanalytics.toif.assimilator/target/classes/com/kdmanalytics/toif/assimilator/toifRdfTypes/ToifStatement.class b/com.kdmanalytics.toif.assimilator/target/classes/com/kdmanalytics/toif/assimilator/toifRdfTypes/ToifStatement.class new file mode 100644 index 00000000..1dee27fa Binary files /dev/null and b/com.kdmanalytics.toif.assimilator/target/classes/com/kdmanalytics/toif/assimilator/toifRdfTypes/ToifStatement.class differ diff --git a/com.kdmanalytics.toif.assimilator/target/classes/com/kdmanalytics/toif/mergers/StatementMapping.class b/com.kdmanalytics.toif.assimilator/target/classes/com/kdmanalytics/toif/mergers/StatementMapping.class new file mode 100644 index 00000000..0612fe2f Binary files /dev/null and b/com.kdmanalytics.toif.assimilator/target/classes/com/kdmanalytics/toif/mergers/StatementMapping.class differ diff --git a/com.kdmanalytics.toif.assimilator/target/classes/com/kdmanalytics/toif/mergers/ToifMerger.class b/com.kdmanalytics.toif.assimilator/target/classes/com/kdmanalytics/toif/mergers/ToifMerger.class new file mode 100644 index 00000000..9945fd62 Binary files /dev/null and b/com.kdmanalytics.toif.assimilator/target/classes/com/kdmanalytics/toif/mergers/ToifMerger.class differ diff --git a/com.kdmanalytics.toif.assimilator/target/classes/log4j.properties b/com.kdmanalytics.toif.assimilator/target/classes/log4j.properties new file mode 100644 index 00000000..6474c8fe --- /dev/null +++ b/com.kdmanalytics.toif.assimilator/target/classes/log4j.properties @@ -0,0 +1,7 @@ +#------------------------------------------------------------------------------- +# Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This program and the +# accompanying materials are made available under the terms of the Open Source +# Initiative OSI - Open Software License v3.0 which accompanies this +# distribution, and is available at http://www.opensource.org/licenses/osl-3.0.php/ +#------------------------------------------------------------------------------- +log4j.rootCategory=OFF diff --git a/com.kdmanalytics.toif.assimilator/target/com.kdmanalytics.toif.assimilator-1.15.5.jar b/com.kdmanalytics.toif.assimilator/target/com.kdmanalytics.toif.assimilator-1.15.5.jar new file mode 100644 index 00000000..7e3a05c7 Binary files /dev/null and b/com.kdmanalytics.toif.assimilator/target/com.kdmanalytics.toif.assimilator-1.15.5.jar differ diff --git a/com.kdmanalytics.toif.assimilator/target/local-artifacts.properties b/com.kdmanalytics.toif.assimilator/target/local-artifacts.properties new file mode 100644 index 00000000..7b14ac13 --- /dev/null +++ b/com.kdmanalytics.toif.assimilator/target/local-artifacts.properties @@ -0,0 +1,4 @@ +#Thu May 29 09:56:09 EDT 2014 +artifact.attached.p2metadata=/home/adam/git/toif/plugins/com.kdmanalytics.toif.assimilator/target/p2content.xml +artifact.main=/home/adam/git/toif/plugins/com.kdmanalytics.toif.assimilator/target/com.kdmanalytics.toif.assimilator-1.15.5.jar +artifact.attached.p2artifacts=/home/adam/git/toif/plugins/com.kdmanalytics.toif.assimilator/target/p2artifacts.xml diff --git a/com.kdmanalytics.toif.assimilator/target/maven-archiver/pom.properties b/com.kdmanalytics.toif.assimilator/target/maven-archiver/pom.properties new file mode 100644 index 00000000..554f9a9d --- /dev/null +++ b/com.kdmanalytics.toif.assimilator/target/maven-archiver/pom.properties @@ -0,0 +1,5 @@ +#Generated by Maven +#Thu May 29 09:56:09 EDT 2014 +version=1.15.5 +groupId=com.kdmanalytics.toif.compile +artifactId=com.kdmanalytics.toif.assimilator diff --git a/com.kdmanalytics.toif.assimilator/target/p2artifacts.xml b/com.kdmanalytics.toif.assimilator/target/p2artifacts.xml new file mode 100644 index 00000000..3b7edfe3 --- /dev/null +++ b/com.kdmanalytics.toif.assimilator/target/p2artifacts.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/com.kdmanalytics.toif.assimilator/target/p2content.xml b/com.kdmanalytics.toif.assimilator/target/p2content.xml new file mode 100644 index 00000000..a747a742 --- /dev/null +++ b/com.kdmanalytics.toif.assimilator/target/p2content.xml @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Bundle-SymbolicName: com.kdmanalytics.toif.assimilator;singleton:=true Bundle-Version: 1.15.5 + + + + + diff --git a/com.kdmanalytics.toif.ccr/.classpath b/com.kdmanalytics.toif.ccr/.classpath new file mode 100644 index 00000000..ad32c83a --- /dev/null +++ b/com.kdmanalytics.toif.ccr/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/com.kdmanalytics.toif.ccr/.project b/com.kdmanalytics.toif.ccr/.project new file mode 100644 index 00000000..9da639ee --- /dev/null +++ b/com.kdmanalytics.toif.ccr/.project @@ -0,0 +1,28 @@ + + + com.kdmanalytics.toif.ccr + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + + org.eclipse.pde.PluginNature + org.eclipse.jdt.core.javanature + + diff --git a/com.kdmanalytics.toif.ccr/.settings/org.eclipse.jdt.core.prefs b/com.kdmanalytics.toif.ccr/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 00000000..fd7710eb --- /dev/null +++ b/com.kdmanalytics.toif.ccr/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,8 @@ +#Sun Apr 01 11:13:07 EDT 2012 +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 +org.eclipse.jdt.core.compiler.compliance=1.6 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.6 diff --git a/com.kdmanalytics.toif.ccr/META-INF/MANIFEST.MF b/com.kdmanalytics.toif.ccr/META-INF/MANIFEST.MF new file mode 100644 index 00000000..905aea38 --- /dev/null +++ b/com.kdmanalytics.toif.ccr/META-INF/MANIFEST.MF @@ -0,0 +1,14 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: TOIF Code Coverage report +Bundle-SymbolicName: com.kdmanalytics.toif.ccr;singleton:=true +Bundle-Version: 1.16.0.qualifier +Bundle-Activator: com.kdmanalytics.toif.ccr.Activator +Bundle-Vendor: KDM Analytics Inc. +Require-Bundle: org.eclipse.ui;bundle-version="[3.7.0,4.2.0)", + org.eclipse.core.runtime;bundle-version="[3.7.0,4.2.0)", + org.openrdf.sesame;bundle-version="[2.4.0,2.5.0)", + org.apache.log4j;bundle-version="[1.2.0,1.3.0)" +Bundle-RequiredExecutionEnvironment: JavaSE-1.6 +Bundle-ActivationPolicy: lazy +Export-Package: com.kdmanalytics.toif.ccr diff --git a/com.kdmanalytics.toif.ccr/bin/com/kdmanalytics/toif/ccr/Activator.class b/com.kdmanalytics.toif.ccr/bin/com/kdmanalytics/toif/ccr/Activator.class new file mode 100644 index 00000000..7633a465 Binary files /dev/null and b/com.kdmanalytics.toif.ccr/bin/com/kdmanalytics/toif/ccr/Activator.class differ diff --git a/com.kdmanalytics.toif.ccr/bin/com/kdmanalytics/toif/ccr/CoverageClaimGenerator.class b/com.kdmanalytics.toif.ccr/bin/com/kdmanalytics/toif/ccr/CoverageClaimGenerator.class new file mode 100644 index 00000000..a436e1dd Binary files /dev/null and b/com.kdmanalytics.toif.ccr/bin/com/kdmanalytics/toif/ccr/CoverageClaimGenerator.class differ diff --git a/com.kdmanalytics.toif.ccr/bin/com/kdmanalytics/toif/ccr/CweToName.class b/com.kdmanalytics.toif.ccr/bin/com/kdmanalytics/toif/ccr/CweToName.class new file mode 100644 index 00000000..6b3d1eb6 Binary files /dev/null and b/com.kdmanalytics.toif.ccr/bin/com/kdmanalytics/toif/ccr/CweToName.class differ diff --git a/com.kdmanalytics.toif.ccr/bin/config/CweIdToName b/com.kdmanalytics.toif.ccr/bin/config/CweIdToName new file mode 100644 index 00000000..1ba83074 --- /dev/null +++ b/com.kdmanalytics.toif.ccr/bin/config/CweIdToName @@ -0,0 +1,886 @@ +1=Location +2=Environment +3=Technology-specific Environment Issues +4=J2EE Environment Issues +5=J2EE Misconfiguration: Data Transmission Without Encryption +6=J2EE Misconfiguration: Insufficient Session-ID Length +7=J2EE Misconfiguration: Missing Custom Error Page +8=J2EE Misconfiguration: Entity Bean Declared Remote +9=J2EE Misconfiguration: Weak Access Permissions for EJB Methods +10=ASP.NET Environment Issues +11=ASP.NET Misconfiguration: Creating Debug Binary +12=ASP.NET Misconfiguration: Missing Custom Error Page +13=ASP.NET Misconfiguration: Password in Configuration File +14=Compiler Removal of Code to Clear Buffers +15=External Control of System or Configuration Setting +16=Configuration +17=Code +18=Source Code +19=Data Handling +20=Improper Input Validation +21=Pathname Traversal and Equivalence Errors +22=Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') +23=Relative Path Traversal +24=Path Traversal: '../filedir' +25=Path Traversal: '/../filedir' +26=Path Traversal: '/dir/../filename' +27=Path Traversal: 'dir/../../filename' +28=Path Traversal: '..\filedir' +29=Path Traversal: '\..\filename' +30=Path Traversal: '\dir\..\filename' +31=Path Traversal: 'dir\..\..\filename' +32=Path Traversal: '...' (Triple Dot) +33=Path Traversal: '....' (Multiple Dot) +34=Path Traversal: '....//' +35=Path Traversal: '.../...//' +36=Absolute Path Traversal +37=Path Traversal: '/absolute/pathname/here' +38=Path Traversal: '\absolute\pathname\here' +39=Path Traversal: 'C:dirname' +40=Path Traversal: '\\UNC\share\name\' (Windows UNC Share) +41=Improper Resolution of Path Equivalence +42=Path Equivalence: 'filename.' (Trailing Dot) +43=Path Equivalence: 'filename....' (Multiple Trailing Dot) +44=Path Equivalence: 'file.name' (Internal Dot) +45=Path Equivalence: 'file...name' (Multiple Internal Dot) +46=Path Equivalence: 'filename ' (Trailing Space) +47=Path Equivalence: ' filename' (Leading Space) +48=Path Equivalence: 'file name' (Internal Whitespace) +49=Path Equivalence: 'filename/' (Trailing Slash) +50=Path Equivalence: '//multiple/leading/slash' +51=Path Equivalence: '/multiple//internal/slash' +52=Path Equivalence: '/multiple/trailing/slash//' +53=Path Equivalence: '\multiple\\internal\backslash' +54=Path Equivalence: 'filedir\' (Trailing Backslash) +55=Path Equivalence: '/./' (Single Dot Directory) +56=Path Equivalence: 'filedir*' (Wildcard) +57=Path Equivalence: 'fakedir/../realdir/filename' +58=Path Equivalence: Windows 8.3 Filename +59=Improper Link Resolution Before File Access ('Link Following') +60=UNIX Path Link Problems +61=UNIX Symbolic Link (Symlink) Following +62=UNIX Hard Link +63=Windows Path Link Problems +64=Windows Shortcut Following (.LNK) +65=Windows Hard Link +66=Improper Handling of File Names that Identify Virtual Resources +67=Improper Handling of Windows Device Names +68=Windows Virtual File Problems +69=Improper Handling of Windows ::DATA Alternate Data Stream +70=Mac Virtual File Problems +71=Apple '.DS_Store' +72=Improper Handling of Apple HFS+ Alternate Data Stream Path +73=External Control of File Name or Path +74=Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection') +75=Failure to Sanitize Special Elements into a Different Plane (Special Element Injection) +76=Improper Neutralization of Equivalent Special Elements +77=Improper Neutralization of Special Elements used in a Command ('Command Injection') +78=Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection') +79=Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') +80=Improper Neutralization of Script-Related HTML Tags in a Web Page (Basic XSS) +81=Improper Neutralization of Script in an Error Message Web Page +82=Improper Neutralization of Script in Attributes of IMG Tags in a Web Page +83=Improper Neutralization of Script in Attributes in a Web Page +84=Improper Neutralization of Encoded URI Schemes in a Web Page +85=Doubled Character XSS Manipulations +86=Improper Neutralization of Invalid Characters in Identifiers in Web Pages +87=Improper Neutralization of Alternate XSS Syntax +88=Argument Injection or Modification +89=Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection') +90=Improper Neutralization of Special Elements used in an LDAP Query ('LDAP Injection') +91=XML Injection (aka Blind XPath Injection) +92=DEPRECATED: Improper Sanitization of Custom Special Characters +93=Improper Neutralization of CRLF Sequences ('CRLF Injection') +94=Improper Control of Generation of Code ('Code Injection') +95=Improper Neutralization of Directives in Dynamically Evaluated Code ('Eval Injection') +96=Improper Neutralization of Directives in Statically Saved Code ('Static Code Injection') +97=Improper Neutralization of Server-Side Includes (SSI) Within a Web Page +98=Improper Control of Filename for Include/Require Statement in PHP Program ('PHP File Inclusion') +99=Improper Control of Resource Identifiers ('Resource Injection') +100=Technology-Specific Input Validation Problems +101=Struts Validation Problems +102=Struts: Duplicate Validation Forms +103=Struts: Incomplete validate() Method Definition +104=Struts: Form Bean Does Not Extend Validation Class +105=Struts: Form Field Without Validator +106=Struts: Plug-in Framework not in Use +107=Struts: Unused Validation Form +108=Struts: Unvalidated Action Form +109=Struts: Validator Turned Off +110=Struts: Validator Without Form Field +111=Direct Use of Unsafe JNI +112=Missing XML Validation +113=Improper Neutralization of CRLF Sequences in HTTP Headers ('HTTP Response Splitting') +114=Process Control +115=Misinterpretation of Input +116=Improper Encoding or Escaping of Output +117=Improper Output Neutralization for Logs +118=Improper Access of Indexable Resource ('Range Error') +119=Improper Restriction of Operations within the Bounds of a Memory Buffer +120=Buffer Copy without Checking Size of Input ('Classic Buffer Overflow') +121=Stack-based Buffer Overflow +122=Heap-based Buffer Overflow +123=Write-what-where Condition +124=Buffer Underwrite ('Buffer Underflow') +125=Out-of-bounds Read +126=Buffer Over-read +127=Buffer Under-read +128=Wrap-around Error +129=Improper Validation of Array Index +130=Improper Handling of Length Parameter Inconsistency +131=Incorrect Calculation of Buffer Size +132=DEPRECATED (Duplicate): Miscalculated Null Termination +133=String Errors +134=Uncontrolled Format String +135=Incorrect Calculation of Multi-Byte String Length +136=Type Errors +137=Representation Errors +138=Improper Neutralization of Special Elements +139=DEPRECATED: General Special Element Problems +140=Improper Neutralization of Delimiters +141=Improper Neutralization of Parameter/Argument Delimiters +142=Improper Neutralization of Value Delimiters +143=Improper Neutralization of Record Delimiters +144=Improper Neutralization of Line Delimiters +145=Improper Neutralization of Section Delimiters +146=Improper Neutralization of Expression/Command Delimiters +147=Improper Neutralization of Input Terminators +148=Improper Neutralization of Input Leaders +149=Improper Neutralization of Quoting Syntax +150=Improper Neutralization of Escape, Meta, or Control Sequences +151=Improper Neutralization of Comment Delimiters +152=Improper Neutralization of Macro Symbols +153=Improper Neutralization of Substitution Characters +154=Improper Neutralization of Variable Name Delimiters +155=Improper Neutralization of Wildcards or Matching Symbols +156=Improper Neutralization of Whitespace +157=Failure to Sanitize Paired Delimiters +158=Improper Neutralization of Null Byte or NUL Character +159=Failure to Sanitize Special Element +160=Improper Neutralization of Leading Special Elements +161=Improper Neutralization of Multiple Leading Special Elements +162=Improper Neutralization of Trailing Special Elements +163=Improper Neutralization of Multiple Trailing Special Elements +164=Improper Neutralization of Internal Special Elements +165=Improper Neutralization of Multiple Internal Special Elements +166=Improper Handling of Missing Special Element +167=Improper Handling of Additional Special Element +168=Improper Handling of Inconsistent Special Elements +169=Technology-Specific Special Elements +170=Improper Null Termination +171=Cleansing, Canonicalization, and Comparison Errors +172=Encoding Error +173=Improper Handling of Alternate Encoding +174=Double Decoding of the Same Data +175=Improper Handling of Mixed Encoding +176=Improper Handling of Unicode Encoding +177=Improper Handling of URL Encoding (Hex Encoding) +178=Improper Handling of Case Sensitivity +179=Incorrect Behavior Order: Early Validation +180=Incorrect Behavior Order: Validate Before Canonicalize +181=Incorrect Behavior Order: Validate Before Filter +182=Collapse of Data into Unsafe Value +183=Permissive Whitelist +184=Incomplete Blacklist +185=Incorrect Regular Expression +186=Overly Restrictive Regular Expression +187=Partial Comparison +188=Reliance on Data/Memory Layout +189=Numeric Errors +190=Integer Overflow or Wraparound +191=Integer Underflow (Wrap or Wraparound) +192=Integer Coercion Error +193=Off-by-one Error +194=Unexpected Sign Extension +195=Signed to Unsigned Conversion Error +196=Unsigned to Signed Conversion Error +197=Numeric Truncation Error +198=Use of Incorrect Byte Ordering +199=Information Management Errors +200=Information Exposure +201=Information Exposure Through Sent Data +202=Exposure of Sensitive Data Through Data Queries +203=Information Exposure Through Discrepancy +204=Response Discrepancy Information Exposure +205=Information Exposure Through Behavioral Discrepancy +206=Information Exposure of Internal State Through Behavioral Inconsistency +207=Information Exposure Through an External Behavioral Inconsistency +208=Information Exposure Through Timing Discrepancy +209=Information Exposure Through an Error Message +210=Information Exposure Through Generated Error Message +211=Information Exposure Through External Error Message +212=Improper Cross-boundary Removal of Sensitive Data +213=Intentional Information Exposure +214=Information Exposure Through Process Environment +215=Information Exposure Through Debug Information +216=Containment Errors (Container Errors) +217=DEPRECATED: Failure to Protect Stored Data from Modification +218=DEPRECATED (Duplicate): Failure to provide confidentiality for stored data +219=Sensitive Data Under Web Root +220=Sensitive Data Under FTP Root +221=Information Loss or Omission +222=Truncation of Security-relevant Information +223=Omission of Security-relevant Information +224=Obscured Security-relevant Information by Alternate Name +225=DEPRECATED (Duplicate): General Information Management Problems +226=Sensitive Information Uncleared Before Release +227=Improper Fulfillment of API Contract ('API Abuse') +228=Improper Handling of Syntactically Invalid Structure +229=Improper Handling of Values +230=Improper Handling of Missing Values +231=Improper Handling of Extra Values +232=Improper Handling of Undefined Values +233=Parameter Problems +234=Failure to Handle Missing Parameter +235=Improper Handling of Extra Parameters +236=Improper Handling of Undefined Parameters +237=Improper Handling of Structural Elements +238=Improper Handling of Incomplete Structural Elements +239=Failure to Handle Incomplete Element +240=Improper Handling of Inconsistent Structural Elements +241=Improper Handling of Unexpected Data Type +242=Use of Inherently Dangerous Function +243=Creation of chroot Jail Without Changing Working Directory +244=Improper Clearing of Heap Memory Before Release ('Heap Inspection') +245=J2EE Bad Practices: Direct Management of Connections +246=J2EE Bad Practices: Direct Use of Sockets +247=Reliance on DNS Lookups in a Security Decision +248=Uncaught Exception +249=DEPRECATED: Often Misused: Path Manipulation +250=Execution with Unnecessary Privileges +251=Often Misused: String Management +252=Unchecked Return Value +253=Incorrect Check of Function Return Value +254=Security Features +255=Credentials Management +256=Plaintext Storage of a Password +257=Storing Passwords in a Recoverable Format +258=Empty Password in Configuration File +259=Use of Hard-coded Password +260=Password in Configuration File +261=Weak Cryptography for Passwords +262=Not Using Password Aging +263=Password Aging with Long Expiration +264=Permissions, Privileges, and Access Controls +265=Privilege / Sandbox Issues +266=Incorrect Privilege Assignment +267=Privilege Defined With Unsafe Actions +268=Privilege Chaining +269=Improper Privilege Management +270=Privilege Context Switching Error +271=Privilege Dropping / Lowering Errors +272=Least Privilege Violation +273=Improper Check for Dropped Privileges +274=Improper Handling of Insufficient Privileges +275=Permission Issues +276=Incorrect Default Permissions +277=Insecure Inherited Permissions +278=Insecure Preserved Inherited Permissions +279=Incorrect Execution-Assigned Permissions +280=Improper Handling of Insufficient Permissions or Privileges +281=Improper Preservation of Permissions +282=Improper Ownership Management +283=Unverified Ownership +284=Improper Access Control +285=Improper Authorization +286=Incorrect User Management +287=Improper Authentication +288=Authentication Bypass Using an Alternate Path or Channel +289=Authentication Bypass by Alternate Name +290=Authentication Bypass by Spoofing +291=Trusting Self-reported IP Address +292=Trusting Self-reported DNS Name +293=Using Referer Field for Authentication +294=Authentication Bypass by Capture-replay +295=Certificate Issues +296=Improper Following of Chain of Trust for Certificate Validation +297=Improper Validation of Host-specific Certificate Data +298=Improper Validation of Certificate Expiration +299=Improper Check for Certificate Revocation +300=Channel Accessible by Non-Endpoint ('Man-in-the-Middle') +301=Reflection Attack in an Authentication Protocol +302=Authentication Bypass by Assumed-Immutable Data +303=Incorrect Implementation of Authentication Algorithm +304=Missing Critical Step in Authentication +305=Authentication Bypass by Primary Weakness +306=Missing Authentication for Critical Function +307=Improper Restriction of Excessive Authentication Attempts +308=Use of Single-factor Authentication +309=Use of Password System for Primary Authentication +310=Cryptographic Issues +311=Missing Encryption of Sensitive Data +312=Cleartext Storage of Sensitive Information +313=Plaintext Storage in a File or on Disk +314=Plaintext Storage in the Registry +315=Plaintext Storage in a Cookie +316=Plaintext Storage in Memory +317=Plaintext Storage in GUI +318=Plaintext Storage in Executable +319=Cleartext Transmission of Sensitive Information +320=Key Management Errors +321=Use of Hard-coded Cryptographic Key +322=Key Exchange without Entity Authentication +323=Reusing a Nonce, Key Pair in Encryption +324=Use of a Key Past its Expiration Date +325=Missing Required Cryptographic Step +326=Inadequate Encryption Strength +327=Use of a Broken or Risky Cryptographic Algorithm +328=Reversible One-Way Hash +329=Not Using a Random IV with CBC Mode +330=Use of Insufficiently Random Values +331=Insufficient Entropy +332=Insufficient Entropy in PRNG +333=Improper Handling of Insufficient Entropy in TRNG +334=Small Space of Random Values +335=PRNG Seed Error +336=Same Seed in PRNG +337=Predictable Seed in PRNG +338=Use of Cryptographically Weak PRNG +339=Small Seed Space in PRNG +340=Predictability Problems +341=Predictable from Observable State +342=Predictable Exact Value from Previous Values +343=Predictable Value Range from Previous Values +344=Use of Invariant Value in Dynamically Changing Context +345=Insufficient Verification of Data Authenticity +346=Origin Validation Error +347=Improper Verification of Cryptographic Signature +348=Use of Less Trusted Source +349=Acceptance of Extraneous Untrusted Data With Trusted Data +350=Improperly Trusted Reverse DNS +351=Insufficient Type Distinction +352=Cross-Site Request Forgery (CSRF) +353=Missing Support for Integrity Check +354=Improper Validation of Integrity Check Value +355=User Interface Security Issues +356=Product UI does not Warn User of Unsafe Actions +357=Insufficient UI Warning of Dangerous Operations +358=Improperly Implemented Security Check for Standard +359=Privacy Violation +360=Trust of System Event Data +361=Time and State +362=Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition') +363=Race Condition Enabling Link Following +364=Signal Handler Race Condition +365=Race Condition in Switch +366=Race Condition within a Thread +367=Time-of-check Time-of-use (TOCTOU) Race Condition +368=Context Switching Race Condition +369=Divide By Zero +370=Missing Check for Certificate Revocation after Initial Check +371=State Issues +372=Incomplete Internal State Distinction +373=DEPRECATED: State Synchronization Error +374=Passing Mutable Objects to an Untrusted Method +375=Returning a Mutable Object to an Untrusted Caller +376=Temporary File Issues +377=Insecure Temporary File +378=Creation of Temporary File With Insecure Permissions +379=Creation of Temporary File in Directory with Incorrect Permissions +380=Technology-Specific Time and State Issues +381=J2EE Time and State Issues +382=J2EE Bad Practices: Use of System.exit() +383=J2EE Bad Practices: Direct Use of Threads +384=Session Fixation +385=Covert Timing Channel +386=Symbolic Name not Mapping to Correct Object +387=Signal Errors +388=Error Handling +389=Error Conditions, Return Values, Status Codes +390=Detection of Error Condition Without Action +391=Unchecked Error Condition +392=Missing Report of Error Condition +393=Return of Wrong Status Code +394=Unexpected Status Code or Return Value +395=Use of NullPointerException Catch to Detect NULL Pointer Dereference +396=Declaration of Catch for Generic Exception +397=Declaration of Throws for Generic Exception +398=Indicator of Poor Code Quality +399=Resource Management Errors +400=Uncontrolled Resource Consumption ('Resource Exhaustion') +401=Improper Release of Memory Before Removing Last Reference ('Memory Leak') +402=Transmission of Private Resources into a New Sphere ('Resource Leak') +403=Exposure of File Descriptor to Unintended Control Sphere +404=Improper Resource Shutdown or Release +405=Asymmetric Resource Consumption (Amplification) +406=Insufficient Control of Network Message Volume (Network Amplification) +407=Algorithmic Complexity +408=Incorrect Behavior Order: Early Amplification +409=Improper Handling of Highly Compressed Data (Data Amplification) +410=Insufficient Resource Pool +411=Resource Locking Problems +412=Unrestricted Externally Accessible Lock +413=Improper Resource Locking +414=Missing Lock Check +415=Double Free +416=Use After Free +417=Channel and Path Errors +418=Channel Errors +419=Unprotected Primary Channel +420=Unprotected Alternate Channel +421=Race Condition During Access to Alternate Channel +422=Unprotected Windows Messaging Channel ('Shatter') +423=DEPRECATED (Duplicate): Proxied Trusted Channel +424=Improper Protection of Alternate Path +425=Direct Request ('Forced Browsing') +426=Untrusted Search Path +427=Uncontrolled Search Path Element +428=Unquoted Search Path or Element +429=Handler Errors +430=Deployment of Wrong Handler +431=Missing Handler +432=Dangerous Signal Handler not Disabled During Sensitive Operations +433=Unparsed Raw Web Content Delivery +434=Unrestricted Upload of File with Dangerous Type +435=Interaction Error +436=Interpretation Conflict +437=Incomplete Model of Endpoint Features +438=Behavioral Problems +439=Behavioral Change in New Version or Environment +440=Expected Behavior Violation +441=Unintended Proxy/Intermediary +442=Web Problems +443=DEPRECATED (Duplicate): HTTP response splitting +444=Inconsistent Interpretation of HTTP Requests ('HTTP Request Smuggling') +445=User Interface Errors +446=UI Discrepancy for Security Feature +447=Unimplemented or Unsupported Feature in UI +448=Obsolete Feature in UI +449=The UI Performs the Wrong Action +450=Multiple Interpretations of UI Input +451=UI Misrepresentation of Critical Information +452=Initialization and Cleanup Errors +453=Insecure Default Variable Initialization +454=External Initialization of Trusted Variables or Data Stores +455=Non-exit on Failed Initialization +456=Missing Initialization +457=Use of Uninitialized Variable +458=DEPRECATED: Incorrect Initialization +459=Incomplete Cleanup +460=Improper Cleanup on Thrown Exception +461=Data Structure Issues +462=Duplicate Key in Associative List (Alist) +463=Deletion of Data Structure Sentinel +464=Addition of Data Structure Sentinel +465=Pointer Issues +466=Return of Pointer Value Outside of Expected Range +467=Use of sizeof() on a Pointer Type +468=Incorrect Pointer Scaling +469=Use of Pointer Subtraction to Determine Size +470=Use of Externally-Controlled Input to Select Classes or Code ('Unsafe Reflection') +471=Modification of Assumed-Immutable Data (MAID) +472=External Control of Assumed-Immutable Web Parameter +473=PHP External Variable Modification +474=Use of Function with Inconsistent Implementations +475=Undefined Behavior for Input to API +476=NULL Pointer Dereference +477=Use of Obsolete Functions +478=Missing Default Case in Switch Statement +479=Signal Handler Use of a Non-reentrant Function +480=Use of Incorrect Operator +481=Assigning instead of Comparing +482=Comparing instead of Assigning +483=Incorrect Block Delimitation +484=Omitted Break Statement in Switch +485=Insufficient Encapsulation +486=Comparison of Classes by Name +487=Reliance on Package-level Scope +488=Exposure of Data Element to Wrong Session +489=Leftover Debug Code +490=Mobile Code Issues +491=Public cloneable() Method Without Final ('Object Hijack') +492=Use of Inner Class Containing Sensitive Data +493=Critical Public Variable Without Final Modifier +494=Download of Code Without Integrity Check +495=Private Array-Typed Field Returned From A Public Method +496=Public Data Assigned to Private Array-Typed Field +497=Exposure of System Data to an Unauthorized Control Sphere +498=Cloneable Class Containing Sensitive Information +499=Serializable Class Containing Sensitive Data +500=Public Static Field Not Marked Final +501=Trust Boundary Violation +502=Deserialization of Untrusted Data +503=Byte/Object Code +504=Motivation/Intent +505=Intentionally Introduced Weakness +506=Embedded Malicious Code +507=Trojan Horse +508=Non-Replicating Malicious Code +509=Replicating Malicious Code (Virus or Worm) +510=Trapdoor +511=Logic/Time Bomb +512=Spyware +513=Intentionally Introduced Nonmalicious Weakness +514=Covert Channel +515=Covert Storage Channel +516=DEPRECATED (Duplicate): Covert Timing Channel +517=Other Intentional, Nonmalicious Weakness +518=Inadvertently Introduced Weakness +519=.NET Environment Issues +520=.NET Misconfiguration: Use of Impersonation +521=Weak Password Requirements +522=Insufficiently Protected Credentials +523=Unprotected Transport of Credentials +524=Information Exposure Through Caching +525=Information Exposure Through Browser Caching +526=Information Exposure Through Environmental Variables +527=Exposure of CVS Repository to an Unauthorized Control Sphere +528=Exposure of Core Dump File to an Unauthorized Control Sphere +529=Exposure of Access Control List Files to an Unauthorized Control Sphere +530=Exposure of Backup File to an Unauthorized Control Sphere +531=Information Exposure Through Test Code +532=Information Exposure Through Log Files +533=Information Exposure Through Server Log Files +534=Information Exposure Through Debug Log Files +535=Information Exposure Through Shell Error Message +536=Information Exposure Through Servlet Runtime Error Message +537=Information Exposure Through Java Runtime Error Message +538=File and Directory Information Exposure +539=Information Exposure Through Persistent Cookies +540=Information Exposure Through Source Code +541=Information Exposure Through Include Source Code +542=Information Exposure Through Cleanup Log Files +543=Use of Singleton Pattern Without Synchronization in a Multithreaded Context +544=Missing Standardized Error Handling Mechanism +545=Use of Dynamic Class Loading +546=Suspicious Comment +547=Use of Hard-coded, Security-relevant Constants +548=Information Exposure Through Directory Listing +549=Missing Password Field Masking +550=Information Exposure Through Server Error Message +551=Incorrect Behavior Order: Authorization Before Parsing and Canonicalization +552=Files or Directories Accessible to External Parties +553=Command Shell in Externally Accessible Directory +554=ASP.NET Misconfiguration: Not Using Input Validation Framework +555=J2EE Misconfiguration: Plaintext Password in Configuration File +556=ASP.NET Misconfiguration: Use of Identity Impersonation +557=Concurrency Issues +558=Use of getlogin() in Multithreaded Application +559=Often Misused: Arguments and Parameters +560=Use of umask() with chmod-style Argument +561=Dead Code +562=Return of Stack Variable Address +563=Unused Variable +564=SQL Injection: Hibernate +565=Reliance on Cookies without Validation and Integrity Checking +566=Authorization Bypass Through User-Controlled SQL Primary Key +567=Unsynchronized Access to Shared Data in a Multithreaded Context +568=finalize() Method Without super.finalize() +569=Expression Issues +570=Expression is Always False +571=Expression is Always True +572=Call to Thread run() instead of start() +573=Improper Following of Specification by Caller +574=EJB Bad Practices: Use of Synchronization Primitives +575=EJB Bad Practices: Use of AWT Swing +576=EJB Bad Practices: Use of Java I/O +577=EJB Bad Practices: Use of Sockets +578=EJB Bad Practices: Use of Class Loader +579=J2EE Bad Practices: Non-serializable Object Stored in Session +580=clone() Method Without super.clone() +581=Object Model Violation: Just One of Equals and Hashcode Defined +582=Array Declared Public, Final, and Static +583=finalize() Method Declared Public +584=Return Inside Finally Block +585=Empty Synchronized Block +586=Explicit Call to Finalize() +587=Assignment of a Fixed Address to a Pointer +588=Attempt to Access Child of a Non-structure Pointer +589=Call to Non-ubiquitous API +590=Free of Memory not on the Heap +591=Sensitive Data Storage in Improperly Locked Memory +592=Authentication Bypass Issues +593=Authentication Bypass: OpenSSL CTX Object Modified after SSL Objects are Created +594=J2EE Framework: Saving Unserializable Objects to Disk +595=Comparison of Object References Instead of Object Contents +596=Incorrect Semantic Object Comparison +597=Use of Wrong Operator in String Comparison +598=Information Exposure Through Query Strings in GET Request +599=Trust of OpenSSL Certificate Without Validation +600=Uncaught Exception in Servlet +601=URL Redirection to Untrusted Site ('Open Redirect') +602=Client-Side Enforcement of Server-Side Security +603=Use of Client-Side Authentication +604=Deprecated Entries +605=Multiple Binds to the Same Port +606=Unchecked Input for Loop Condition +607=Public Static Final Field References Mutable Object +608=Struts: Non-private Field in ActionForm Class +609=Double-Checked Locking +610=Externally Controlled Reference to a Resource in Another Sphere +611=Information Exposure Through XML External Entity Reference +612=Information Exposure Through Indexing of Private Data +613=Insufficient Session Expiration +614=Sensitive Cookie in HTTPS Session Without 'Secure' Attribute +615=Information Exposure Through Comments +616=Incomplete Identification of Uploaded File Variables (PHP) +617=Reachable Assertion +618=Exposed Unsafe ActiveX Method +619=Dangling Database Cursor ('Cursor Injection') +620=Unverified Password Change +621=Variable Extraction Error +622=Unvalidated Function Hook Arguments +623=Unsafe ActiveX Control Marked Safe For Scripting +624=Executable Regular Expression Error +625=Permissive Regular Expression +626=Null Byte Interaction Error (Poison Null Byte) +627=Dynamic Variable Evaluation +628=Function Call with Incorrectly Specified Arguments +629=Weaknesses in OWASP Top Ten (2007) +630=Weaknesses Examined by SAMATE +631=Resource-specific Weaknesses +632=Weaknesses that Affect Files or Directories +633=Weaknesses that Affect Memory +634=Weaknesses that Affect System Processes +635=Weaknesses Used by NVD +636=Not Failing Securely ('Failing Open') +637=Unnecessary Complexity in Protection Mechanism (Not Using 'Economy of Mechanism') +638=Not Using Complete Mediation +639=Authorization Bypass Through User-Controlled Key +640=Weak Password Recovery Mechanism for Forgotten Password +641=Improper Restriction of Names for Files and Other Resources +642=External Control of Critical State Data +643=Improper Neutralization of Data within XPath Expressions ('XPath Injection') +644=Improper Neutralization of HTTP Headers for Scripting Syntax +645=Overly Restrictive Account Lockout Mechanism +646=Reliance on File Name or Extension of Externally-Supplied File +647=Use of Non-Canonical URL Paths for Authorization Decisions +648=Incorrect Use of Privileged APIs +649=Reliance on Obfuscation or Encryption of Security-Relevant Inputs without Integrity Checking +650=Trusting HTTP Permission Methods on the Server Side +651=Information Exposure Through WSDL File +652=Improper Neutralization of Data within XQuery Expressions ('XQuery Injection') +653=Insufficient Compartmentalization +654=Reliance on a Single Factor in a Security Decision +655=Insufficient Psychological Acceptability +656=Reliance on Security Through Obscurity +657=Violation of Secure Design Principles +658=Weaknesses in Software Written in C +659=Weaknesses in Software Written in C++ +660=Weaknesses in Software Written in Java +661=Weaknesses in Software Written in PHP +662=Improper Synchronization +663=Use of a Non-reentrant Function in a Concurrent Context +664=Improper Control of a Resource Through its Lifetime +665=Improper Initialization +666=Operation on Resource in Wrong Phase of Lifetime +667=Improper Locking +668=Exposure of Resource to Wrong Sphere +669=Incorrect Resource Transfer Between Spheres +670=Always-Incorrect Control Flow Implementation +671=Lack of Administrator Control over Security +672=Operation on a Resource after Expiration or Release +673=External Influence of Sphere Definition +674=Uncontrolled Recursion +675=Duplicate Operations on Resource +676=Use of Potentially Dangerous Function +677=Weakness Base Elements +678=Composites +679=Chain Elements +680=Integer Overflow to Buffer Overflow +681=Incorrect Conversion between Numeric Types +682=Incorrect Calculation +683=Function Call With Incorrect Order of Arguments +684=Incorrect Provision of Specified Functionality +685=Function Call With Incorrect Number of Arguments +686=Function Call With Incorrect Argument Type +687=Function Call With Incorrectly Specified Argument Value +688=Function Call With Incorrect Variable or Reference as Argument +689=Permission Race Condition During Resource Copy +690=Unchecked Return Value to NULL Pointer Dereference +691=Insufficient Control Flow Management +692=Incomplete Blacklist to Cross-Site Scripting +693=Protection Mechanism Failure +694=Use of Multiple Resources with Duplicate Identifier +695=Use of Low-Level Functionality +696=Incorrect Behavior Order +697=Insufficient Comparison +698=Redirect Without Exit +699=Development Concepts +700=Seven Pernicious Kingdoms +701=Weaknesses Introduced During Design +702=Weaknesses Introduced During Implementation +703=Improper Check or Handling of Exceptional Conditions +704=Incorrect Type Conversion or Cast +705=Incorrect Control Flow Scoping +706=Use of Incorrectly-Resolved Name or Reference +707=Improper Enforcement of Message or Data Structure +708=Incorrect Ownership Assignment +709=Named Chains +710=Coding Standards Violation +711=Weaknesses in OWASP Top Ten (2004) +712=OWASP Top Ten 2007 Category A1 - Cross Site Scripting (XSS) +713=OWASP Top Ten 2007 Category A2 - Injection Flaws +714=OWASP Top Ten 2007 Category A3 - Malicious File Execution +715=OWASP Top Ten 2007 Category A4 - Insecure Direct Object Reference +716=OWASP Top Ten 2007 Category A5 - Cross Site Request Forgery (CSRF) +717=OWASP Top Ten 2007 Category A6 - Information Leakage and Improper Error Handling +718=OWASP Top Ten 2007 Category A7 - Broken Authentication and Session Management +719=OWASP Top Ten 2007 Category A8 - Insecure Cryptographic Storage +720=OWASP Top Ten 2007 Category A9 - Insecure Communications +721=OWASP Top Ten 2007 Category A10 - Failure to Restrict URL Access +722=OWASP Top Ten 2004 Category A1 - Unvalidated Input +723=OWASP Top Ten 2004 Category A2 - Broken Access Control +724=OWASP Top Ten 2004 Category A3 - Broken Authentication and Session Management +725=OWASP Top Ten 2004 Category A4 - Cross-Site Scripting (XSS) Flaws +726=OWASP Top Ten 2004 Category A5 - Buffer Overflows +727=OWASP Top Ten 2004 Category A6 - Injection Flaws +728=OWASP Top Ten 2004 Category A7 - Improper Error Handling +729=OWASP Top Ten 2004 Category A8 - Insecure Storage +730=OWASP Top Ten 2004 Category A9 - Denial of Service +731=OWASP Top Ten 2004 Category A10 - Insecure Configuration Management +732=Incorrect Permission Assignment for Critical Resource +733=Compiler Optimization Removal or Modification of Security-critical Code +734=Weaknesses Addressed by the CERT C Secure Coding Standard +735=CERT C Secure Coding Section 01 - Preprocessor (PRE) +736=CERT C Secure Coding Section 02 - Declarations and Initialization (DCL) +737=CERT C Secure Coding Section 03 - Expressions (EXP) +738=CERT C Secure Coding Section 04 - Integers (INT) +739=CERT C Secure Coding Section 05 - Floating Point (FLP) +740=CERT C Secure Coding Section 06 - Arrays (ARR) +741=CERT C Secure Coding Section 07 - Characters and Strings (STR) +742=CERT C Secure Coding Section 08 - Memory Management (MEM) +743=CERT C Secure Coding Section 09 - Input Output (FIO) +744=CERT C Secure Coding Section 10 - Environment (ENV) +745=CERT C Secure Coding Section 11 - Signals (SIG) +746=CERT C Secure Coding Section 12 - Error Handling (ERR) +747=CERT C Secure Coding Section 49 - Miscellaneous (MSC) +748=CERT C Secure Coding Section 50 - POSIX (POS) +749=Exposed Dangerous Method or Function +750=Weaknesses in the 2009 CWE/SANS Top 25 Most Dangerous Programming Errors +751=Insecure Interaction Between Components +752=Risky Resource Management +753=Porous Defenses +754=Improper Check for Unusual or Exceptional Conditions +755=Improper Handling of Exceptional Conditions +756=Missing Custom Error Page +757=Selection of Less-Secure Algorithm During Negotiation ('Algorithm Downgrade') +758=Reliance on Undefined, Unspecified, or Implementation-Defined Behavior +759=Use of a One-Way Hash without a Salt +760=Use of a One-Way Hash with a Predictable Salt +761=Free of Pointer not at Start of Buffer +762=Mismatched Memory Management Routines +763=Release of Invalid Pointer or Reference +764=Multiple Locks of a Critical Resource +765=Multiple Unlocks of a Critical Resource +766=Critical Variable Declared Public +767=Access to Critical Private Variable via Public Method +768=Incorrect Short Circuit Evaluation +769=File Descriptor Exhaustion +770=Allocation of Resources Without Limits or Throttling +771=Missing Reference to Active Allocated Resource +772=Missing Release of Resource after Effective Lifetime +773=Missing Reference to Active File Descriptor or Handle +774=Allocation of File Descriptors or Handles Without Limits or Throttling +775=Missing Release of File Descriptor or Handle after Effective Lifetime +776=Unrestricted Recursive Entity References in DTDs ('XML Bomb') +777=Regular Expression without Anchors +778=Insufficient Logging +779=Logging of Excessive Data +780=Use of RSA Algorithm without OAEP +781=Improper Address Validation in IOCTL with METHOD_NEITHER I/O Control Code +782=Exposed IOCTL with Insufficient Access Control +783=Operator Precedence Logic Error +784=Reliance on Cookies without Validation and Integrity Checking in a Security Decision +785=Use of Path Manipulation Function without Maximum-sized Buffer +786=Access of Memory Location Before Start of Buffer +787=Out-of-bounds Write +788=Access of Memory Location After End of Buffer +789=Uncontrolled Memory Allocation +790=Improper Filtering of Special Elements +791=Incomplete Filtering of Special Elements +792=Incomplete Filtering of One or More Instances of Special Elements +793=Only Filtering One Instance of a Special Element +794=Incomplete Filtering of Multiple Instances of Special Elements +795=Only Filtering Special Elements at a Specified Location +796=Only Filtering Special Elements Relative to a Marker +797=Only Filtering Special Elements at an Absolute Position +798=Use of Hard-coded Credentials +799=Improper Control of Interaction Frequency +800=Weaknesses in the 2010 CWE/SANS Top 25 Most Dangerous Programming Errors +801=Insecure Interaction Between Components +802=Risky Resource Management +803=Porous Defenses +804=Guessable CAPTCHA +805=Buffer Access with Incorrect Length Value +806=Buffer Access Using Size of Source Buffer +807=Reliance on Untrusted Inputs in a Security Decision +808=Weaknesses On the Cusp +809=Weaknesses in OWASP Top Ten (2010) +810=OWASP Top Ten 2010 Category A1 - Injection +811=OWASP Top Ten 2010 Category A2 - Cross-Site Scripting (XSS) +812=OWASP Top Ten 2010 Category A3 - Broken Authentication and Session Management +813=OWASP Top Ten 2010 Category A4 - Insecure Direct Object References +814=OWASP Top Ten 2010 Category A5 - Cross-Site Request Forgery(CSRF) +815=OWASP Top Ten 2010 Category A6 - Security Misconfiguration +816=OWASP Top Ten 2010 Category A7 - Insecure Cryptographic Storage +817=OWASP Top Ten 2010 Category A8 - Failure to Restrict URL Access +818=OWASP Top Ten 2010 Category A9 - Insufficient Transport Layer Protection +819=OWASP Top Ten 2010 Category A10 - Unvalidated Redirects and Forwards +820=Missing Synchronization +821=Incorrect Synchronization +822=Untrusted Pointer Dereference +823=Use of Out-of-range Pointer Offset +824=Access of Uninitialized Pointer +825=Expired Pointer Dereference +826=Premature Release of Resource During Expected Lifetime +827=Improper Control of Document Type Definition +828=Signal Handler with Functionality that is not Asynchronous-Safe +829=Inclusion of Functionality from Untrusted Control Sphere +830=Inclusion of Web Functionality from an Untrusted Source +831=Signal Handler Function Associated with Multiple Signals +832=Unlock of a Resource that is not Locked +833=Deadlock +834=Excessive Iteration +835=Loop with Unreachable Exit Condition ('Infinite Loop') +836=Use of Password Hash Instead of Password for Authentication +837=Improper Enforcement of a Single, Unique Action +838=Inappropriate Encoding for Output Context +839=Numeric Range Comparison Without Minimum Check +840=Business Logic Errors +841=Improper Enforcement of Behavioral Workflow +842=Placement of User into Incorrect Group +843=Access of Resource Using Incompatible Type ('Type Confusion') +844=Weaknesses Addressed by the CERT Java Secure Coding Standard +845=CERT Java Secure Coding Section 00 - Input Validation and Data Sanitization (IDS) +846=CERT Java Secure Coding Section 01 - Declarations and Initialization (DCL) +847=CERT Java Secure Coding Section 02 - Expressions (EXP) +848=CERT Java Secure Coding Section 03 - Numeric Types and Operations (NUM) +849=CERT Java Secure Coding Section 04 - Object Orientation (OBJ) +850=CERT Java Secure Coding Section 05 - Methods (MET) +851=CERT Java Secure Coding Section 06 - Exceptional Behavior (ERR) +852=CERT Java Secure Coding Section 07 - Visibility and Atomicity (VNA) +853=CERT Java Secure Coding Section 08 - Locking (LCK) +854=CERT Java Secure Coding Section 09 - Thread APIs (THI) +855=CERT Java Secure Coding Section 10 - Thread Pools (TPS) +856=CERT Java Secure Coding Section 11 - Thread-Safety Miscellaneous (TSM) +857=CERT Java Secure Coding Section 12 - Input Output (FIO) +858=CERT Java Secure Coding Section 13 - Serialization (SER) +859=CERT Java Secure Coding Section 14 - Platform Security (SEC) +860=CERT Java Secure Coding Section 15 - Runtime Environment (ENV) +861=CERT Java Secure Coding Section 49 - Miscellaneous (MSC) +862=Missing Authorization +863=Incorrect Authorization +864=Insecure Interaction Between Components +865=Risky Resource Management +866=Porous Defenses +867=Weaknesses On the Cusp +868=Weaknesses Addressed by the CERT C++ Secure Coding Standard +869=CERT C++ Secure Coding Section 01 - Preprocessor (PRE) +870=CERT C++ Secure Coding Section 02 - Declarations and Initialization (DCL) +871=CERT C++ Secure Coding Section 03 - Expressions (EXP) +872=CERT C++ Secure Coding Section 04 - Integers (INT) +873=CERT C++ Secure Coding Section 05 - Floating Point Arithmetic (FLP) +874=CERT C++ Secure Coding Section 06 - Arrays and the STL (ARR) +875=CERT C++ Secure Coding Section 07 - Characters and Strings (STR) +876=CERT C++ Secure Coding Section 08 - Memory Management (MEM) +877=CERT C++ Secure Coding Section 09 - Input Output (FIO) +878=CERT C++ Secure Coding Section 10 - Environment (ENV) +879=CERT C++ Secure Coding Section 11 - Signals (SIG) +880=CERT C++ Secure Coding Section 12 - Exceptions and Error Handling (ERR) +881=CERT C++ Secure Coding Section 13 - Object Oriented Programming (OOP) +882=CERT C++ Secure Coding Section 14 - Concurrency (CON) +883=CERT C++ Secure Coding Section 49 - Miscellaneous (MSC) +900=Weaknesses in the 2011 CWE/SANS Top 25 Most Dangerous Software Errors +1000=Research Concepts +2000=Comprehensive CWE Dictionary diff --git a/com.kdmanalytics.toif.ccr/bin/generated/CWECoverageClaimType$Claims$Claim$RuleSet$Rule.class b/com.kdmanalytics.toif.ccr/bin/generated/CWECoverageClaimType$Claims$Claim$RuleSet$Rule.class new file mode 100644 index 00000000..83cf56e4 Binary files /dev/null and b/com.kdmanalytics.toif.ccr/bin/generated/CWECoverageClaimType$Claims$Claim$RuleSet$Rule.class differ diff --git a/com.kdmanalytics.toif.ccr/bin/generated/CWECoverageClaimType$Claims$Claim$RuleSet.class b/com.kdmanalytics.toif.ccr/bin/generated/CWECoverageClaimType$Claims$Claim$RuleSet.class new file mode 100644 index 00000000..78c0cf99 Binary files /dev/null and b/com.kdmanalytics.toif.ccr/bin/generated/CWECoverageClaimType$Claims$Claim$RuleSet.class differ diff --git a/com.kdmanalytics.toif.ccr/bin/generated/CWECoverageClaimType$Claims$Claim.class b/com.kdmanalytics.toif.ccr/bin/generated/CWECoverageClaimType$Claims$Claim.class new file mode 100644 index 00000000..ad79cd38 Binary files /dev/null and b/com.kdmanalytics.toif.ccr/bin/generated/CWECoverageClaimType$Claims$Claim.class differ diff --git a/com.kdmanalytics.toif.ccr/bin/generated/CWECoverageClaimType$Claims.class b/com.kdmanalytics.toif.ccr/bin/generated/CWECoverageClaimType$Claims.class new file mode 100644 index 00000000..b002acdc Binary files /dev/null and b/com.kdmanalytics.toif.ccr/bin/generated/CWECoverageClaimType$Claims.class differ diff --git a/com.kdmanalytics.toif.ccr/bin/generated/CWECoverageClaimType.class b/com.kdmanalytics.toif.ccr/bin/generated/CWECoverageClaimType.class new file mode 100644 index 00000000..7173ea11 Binary files /dev/null and b/com.kdmanalytics.toif.ccr/bin/generated/CWECoverageClaimType.class differ diff --git a/com.kdmanalytics.toif.ccr/bin/generated/CWECoverageClaims.class b/com.kdmanalytics.toif.ccr/bin/generated/CWECoverageClaims.class new file mode 100644 index 00000000..bbdb0a6d Binary files /dev/null and b/com.kdmanalytics.toif.ccr/bin/generated/CWECoverageClaims.class differ diff --git a/com.kdmanalytics.toif.ccr/bin/generated/CWE_Coverage_Claims_Schema_v0.3.xsd b/com.kdmanalytics.toif.ccr/bin/generated/CWE_Coverage_Claims_Schema_v0.3.xsd new file mode 100644 index 00000000..9aaecfab --- /dev/null +++ b/com.kdmanalytics.toif.ccr/bin/generated/CWE_Coverage_Claims_Schema_v0.3.xsd @@ -0,0 +1,217 @@ + + + + + + + + + + + + + + + + + + + + vendor comments for overall claim + + + + + + each CWE can be covered by one or more + "rules" + + + + + + + + + comment for each rule allows + vendors to explain what they look for in more + detail + + + + + + vendor may or may not have ID's + + + + + + + + + + + + + Strength/accuracy of the covered rules to + the CWE entry. + + + + + unique identifier of the CWE being covered + + + + + + name of the CWE being covered (included + for better readability) + + + + + + + + + + Optional comments for the entire set of claims. + + + + + + + all claims are made against a specific version of + CWE + + + + + all claims are specific to a specific vendor + + + + + all claims are specific to a specific named tool set + + + + + + all claims are specific to a specific tool set version + + + + + + a URI that contains more details, or a human-friendly version of + this coverage claim + + + + + claims are made as of a date (NOT IN THE FUTURE!) + + + + + + all claims are made against a specific type of + language + + + + + + + + + + + + all claims are made against a specific language + + + + + + Archetype_Type contains values for the Archetype of the system + described by the vignette + + + + + The CWE entry exactly covers the same weakness(es) as the + given rule set. + + + + + The CWE entry covers more concepts than the given rule set, + but there are not any more precise matches available. For example, a rule + set might detect resource consumption for a resource that is not + specifically covered by CWE. + + + + + The CWE entry is more specific than the weakness reported by + the given rule set, but the entry's parent(s) are not appropriate matches. + This might indicate a difference in perspective between CWE and the + capability providing the coverage mapping. It could also include a single + rule that covers multiple CWE entries (which might imply that there would be + multiple claims for a single rule/ruleset). + + + + + The CWE entry is only a partial match with the weakness + reported by the given rule set, but the entry is the closest available + match. + + + + + The CWE entry is not covered by any rule set. The provider is + not required to include information about uncovered CWEs. + + + + + There is no CWE entry available that closely matches the + weakness reported by the given rule set, but the provider believes that a + CWE entry should exist for the reported weakness. The associated CWE_ID + should be 0. + + + + + The rule/ruleset is not applicable to CWE, i.e., it is not + necessarily about a weakness. This could include rulesets related to coding + style conformance, informational messages about the scan, etc. The + associated CWE_ID should be -1. The provider is not required to include + information about non-applicable rules. + + + + + The match accuracy is unknown. Typically this would be used by + a third party who is creating a coverage claim and does not have insight + into the technology. + + + + + No other CWE match accuracy type is + applicable. + + + + + diff --git a/com.kdmanalytics.toif.ccr/bin/generated/MatchAccuracyType.class b/com.kdmanalytics.toif.ccr/bin/generated/MatchAccuracyType.class new file mode 100644 index 00000000..4b2b23db Binary files /dev/null and b/com.kdmanalytics.toif.ccr/bin/generated/MatchAccuracyType.class differ diff --git a/com.kdmanalytics.toif.ccr/bin/generated/ObjectFactory.class b/com.kdmanalytics.toif.ccr/bin/generated/ObjectFactory.class new file mode 100644 index 00000000..cc403324 Binary files /dev/null and b/com.kdmanalytics.toif.ccr/bin/generated/ObjectFactory.class differ diff --git a/com.kdmanalytics.toif.ccr/build.properties b/com.kdmanalytics.toif.ccr/build.properties new file mode 100644 index 00000000..e9863e28 --- /dev/null +++ b/com.kdmanalytics.toif.ccr/build.properties @@ -0,0 +1,5 @@ +source.. = src/ +output.. = bin/ +bin.includes = META-INF/,\ + .,\ + plugin.xml diff --git a/com.kdmanalytics.toif.ccr/outputDir/namespaces.dat b/com.kdmanalytics.toif.ccr/outputDir/namespaces.dat new file mode 100644 index 00000000..b1ec9998 --- /dev/null +++ b/com.kdmanalytics.toif.ccr/outputDir/namespaces.dat @@ -0,0 +1 @@ +nnf \ No newline at end of file diff --git a/com.kdmanalytics.toif.ccr/outputDir/triples-posc.alloc b/com.kdmanalytics.toif.ccr/outputDir/triples-posc.alloc new file mode 100644 index 00000000..e69de29b diff --git a/com.kdmanalytics.toif.ccr/outputDir/triples-posc.dat b/com.kdmanalytics.toif.ccr/outputDir/triples-posc.dat new file mode 100644 index 00000000..be88d339 Binary files /dev/null and b/com.kdmanalytics.toif.ccr/outputDir/triples-posc.dat differ diff --git a/com.kdmanalytics.toif.ccr/outputDir/triples-spoc.alloc b/com.kdmanalytics.toif.ccr/outputDir/triples-spoc.alloc new file mode 100644 index 00000000..e69de29b diff --git a/com.kdmanalytics.toif.ccr/outputDir/triples-spoc.dat b/com.kdmanalytics.toif.ccr/outputDir/triples-spoc.dat new file mode 100644 index 00000000..be88d339 Binary files /dev/null and b/com.kdmanalytics.toif.ccr/outputDir/triples-spoc.dat differ diff --git a/com.kdmanalytics.toif.ccr/outputDir/triples.prop b/com.kdmanalytics.toif.ccr/outputDir/triples.prop new file mode 100644 index 00000000..646207ce --- /dev/null +++ b/com.kdmanalytics.toif.ccr/outputDir/triples.prop @@ -0,0 +1,4 @@ +#triple indexes meta-data, DO NOT EDIT! +#Sun Apr 01 11:56:00 EDT 2012 +version=10 +triple-indexes=spoc,posc diff --git a/com.kdmanalytics.toif.ccr/outputDir/txn-status b/com.kdmanalytics.toif.ccr/outputDir/txn-status new file mode 100644 index 00000000..db3df79d --- /dev/null +++ b/com.kdmanalytics.toif.ccr/outputDir/txn-status @@ -0,0 +1 @@ +NONE \ No newline at end of file diff --git a/com.kdmanalytics.toif.ccr/outputDir/values.dat b/com.kdmanalytics.toif.ccr/outputDir/values.dat new file mode 100644 index 00000000..dacabf9c --- /dev/null +++ b/com.kdmanalytics.toif.ccr/outputDir/values.dat @@ -0,0 +1 @@ +ndf \ No newline at end of file diff --git a/com.kdmanalytics.toif.ccr/outputDir/values.hash b/com.kdmanalytics.toif.ccr/outputDir/values.hash new file mode 100644 index 00000000..64c96186 Binary files /dev/null and b/com.kdmanalytics.toif.ccr/outputDir/values.hash differ diff --git a/com.kdmanalytics.toif.ccr/outputDir/values.id b/com.kdmanalytics.toif.ccr/outputDir/values.id new file mode 100644 index 00000000..7b5347da Binary files /dev/null and b/com.kdmanalytics.toif.ccr/outputDir/values.id differ diff --git a/com.kdmanalytics.toif.ccr/plugin.xml b/com.kdmanalytics.toif.ccr/plugin.xml new file mode 100644 index 00000000..5535690d --- /dev/null +++ b/com.kdmanalytics.toif.ccr/plugin.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/com.kdmanalytics.toif.ccr/pom.xml b/com.kdmanalytics.toif.ccr/pom.xml new file mode 100644 index 00000000..5439c390 --- /dev/null +++ b/com.kdmanalytics.toif.ccr/pom.xml @@ -0,0 +1,21 @@ + + + + 4.0.0 + + + com.kdmanalytics.toif + plugins + 1.16.0-SNAPSHOT + + + com.kdmanalytics.kdm.wb.plugins + com.kdmanalytics.toif.ccr + + + eclipse-plugin + + Ccr + diff --git a/com.kdmanalytics.toif.ccr/pom.xml~ b/com.kdmanalytics.toif.ccr/pom.xml~ new file mode 100644 index 00000000..a74d94bb --- /dev/null +++ b/com.kdmanalytics.toif.ccr/pom.xml~ @@ -0,0 +1,21 @@ + + + + 4.0.0 + + + com.kdmanalytics.toif + plugins + 1.0.0-SNAPSHOT + + + com.kdmanalytics.kdm.wb.plugins + com.kdmanalytics.toif.ccr + + + eclipse-plugin + + Ccr + diff --git a/com.kdmanalytics.toif.ccr/src/com/kdmanalytics/toif/ccr/Activator.java b/com.kdmanalytics.toif.ccr/src/com/kdmanalytics/toif/ccr/Activator.java new file mode 100644 index 00000000..805cee94 --- /dev/null +++ b/com.kdmanalytics.toif.ccr/src/com/kdmanalytics/toif/ccr/Activator.java @@ -0,0 +1,56 @@ +/******************************************************************************* + * Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This program and the + * accompanying materials are made available under the terms of the Open Source + * Initiative OSI - Open Software License v3.0 which accompanies this + * distribution, and is available at http://www.opensource.org/licenses/osl-3.0.php/ + ******************************************************************************/ +package com.kdmanalytics.toif.ccr; + +import org.eclipse.ui.plugin.AbstractUIPlugin; +import org.osgi.framework.BundleContext; + +/** + * The activator class controls the plug-in life cycle + */ +public class Activator extends AbstractUIPlugin { + + // The plug-in ID + public static final String PLUGIN_ID = "com.kdmanalytics.toif.ccr"; //$NON-NLS-1$ + + // The shared instance + private static Activator plugin; + + /** + * The constructor + */ + public Activator() { + } + + /* + * (non-Javadoc) + * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) + */ + public void start(BundleContext context) throws Exception { + super.start(context); + plugin = this; + } + + /* + * (non-Javadoc) + * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) + */ + public void stop(BundleContext context) throws Exception { + plugin = null; + super.stop(context); + } + + /** + * Returns the shared instance + * + * @return the shared instance + */ + public static Activator getDefault() { + return plugin; + } + +} diff --git a/com.kdmanalytics.toif.ccr/src/com/kdmanalytics/toif/ccr/CoverageClaimGenerator.java b/com.kdmanalytics.toif.ccr/src/com/kdmanalytics/toif/ccr/CoverageClaimGenerator.java new file mode 100644 index 00000000..08ae8133 --- /dev/null +++ b/com.kdmanalytics.toif.ccr/src/com/kdmanalytics/toif/ccr/CoverageClaimGenerator.java @@ -0,0 +1,802 @@ +/** + * KDM Analytics Inc - (2012) + * + * @Author Adam Nunn + * @Date Apr 1, 2012 + */ + +package com.kdmanalytics.toif.ccr; + +import generated.CWECoverageClaimType; +import generated.CWECoverageClaimType.Claims; +import generated.CWECoverageClaimType.Claims.Claim; +import generated.CWECoverageClaimType.Claims.Claim.RuleSet; +import generated.CWECoverageClaimType.Claims.Claim.RuleSet.Rule; +import generated.CWECoverageClaims; +import generated.MatchAccuracyType; +import generated.ObjectFactory; + +import java.io.File; +import java.io.FileWriter; +import java.io.IOException; +import java.text.DateFormat; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Date; +import java.util.GregorianCalendar; +import java.util.HashMap; +import java.util.List; + +import javax.xml.bind.JAXBContext; +import javax.xml.bind.JAXBException; +import javax.xml.bind.Marshaller; +import javax.xml.datatype.DatatypeConfigurationException; +import javax.xml.datatype.DatatypeConstants; +import javax.xml.datatype.DatatypeFactory; +import javax.xml.datatype.XMLGregorianCalendar; + +import org.openrdf.model.Value; +import org.openrdf.query.BindingSet; +import org.openrdf.query.MalformedQueryException; +import org.openrdf.query.QueryEvaluationException; +import org.openrdf.query.QueryLanguage; +import org.openrdf.query.TupleQuery; +import org.openrdf.query.TupleQueryResult; +import org.openrdf.repository.Repository; +import org.openrdf.repository.RepositoryConnection; +import org.openrdf.repository.RepositoryException; +import org.openrdf.repository.sail.SailRepository; +import org.openrdf.sail.nativerdf.NativeStore; + +/** + * + * generate the ccr report. + * + * @author adam + * + */ +public class CoverageClaimGenerator { + + private List generatorNames = new ArrayList(); + + /** + * get the output file. + * + * @param args + * the command line args + * @return + */ + static File getOutputFileFromArguments(String[] args) { + return new File(args[args.length - 1]); + } + + /** + * get the connection to the repository. + * + * @return + */ + static RepositoryConnection getRepositoryConnection(Repository rep) { + RepositoryConnection connection = null; + + try { + connection = rep.getConnection(); + } catch (RepositoryException e) { + System.err.println("Could not obtain repository connection!"); + System.exit(1); + } + + return connection; + } + + /** + * get the repository from the command line args + * + * @param args + * the command line args + * @return + */ + static Repository getRepositoryFromArguments(String[] args) { + File dataDir = new File(args[args.length - 2]); + + Repository rep = new SailRepository(new NativeStore(dataDir)); + + try { + rep.initialize(); + } catch (RepositoryException e) { + System.err.println("Repository could not be initialized!"); + System.exit(1); + } + + return rep; + } + + /** + * any vendor-specific rule identifiers, numbers or names that correspond to the associated CWE ID + * + * @param objFactory + * @param segment + * @param repository + * @return + */ + private static Collection getRules(ObjectFactory objFactory, Value cwe, + Repository repository) { + HashMap ruleSet = new HashMap(); + RepositoryConnection con = null; + try { + con = getRepositoryConnection(repository); + + String adaptorQuery = "SELECT ?descriptionText WHERE {" + + "?finding <" + cwe + "> . " + + "?finding ?description . " + + "?description ?descriptionText . }"; + + TupleQuery adaptorTupleQuery = con.prepareTupleQuery(QueryLanguage.SPARQL, adaptorQuery); + + TupleQueryResult queryResult = adaptorTupleQuery.evaluate(); + + while (queryResult.hasNext()) { + BindingSet adaptorSet = queryResult.next(); + Value name = adaptorSet.getValue("descriptionText"); + + String nameString = name.stringValue(); + + String[] descArray = nameString.split(":"); + + String ident = descArray[0]; + String description = descArray[1]; + + if (!ruleSet.containsKey(ident)) { + Rule rule = objFactory.createCWECoverageClaimTypeClaimsClaimRuleSetRule(); + ruleSet.put(ident, rule); + } + + Rule rule = ruleSet.get(ident); + rule.setRuleID(ident); + rule.setRuleName(ident); + rule.setRuleComments(description); + + } + + queryResult.close(); + } catch (RepositoryException e) { + e.printStackTrace(); + } catch (MalformedQueryException e) { + e.printStackTrace(); + } catch (QueryEvaluationException e) { + e.printStackTrace(); + } finally { + try { + if (con != null) { + con.close(); + } + } catch (RepositoryException e) { + e.printStackTrace(); + } + } + return ruleSet.values(); + + } + + /** + * main entry point + * + * @param args + */ + public static void main(String[] args) { + + new CoverageClaimGenerator(args); + + } + + /** + * make sure that the arguments are correct. + * + * @param args + * command line arguments. + * @return + */ + static Boolean verifyArguments(String[] args) { + if (args.length < 2) { return false; } + + return true; + } + + /** + * create a new generator + * + * @param args + * command line args + */ + public CoverageClaimGenerator(String[] args) { + Boolean argVerified = verifyArguments(args); + + if (!argVerified) { + System.err.println("Incorrect arguments!"); + System.exit(1); + } + + Repository repository = getRepositoryFromArguments(args); + + File outputFile = getOutputFileFromArguments(args); + + JAXBContext jc = getJaxContext(); + + CWECoverageClaims claims = parseRepository(jc, repository); + + // write to TSV or marshall to XML. + if (isWriteToTSV(args)) { + writeToTSV(claims, outputFile); + } else { + marshalClaims(jc, claims, outputFile); + } + + } + + /** + * start the Coverege generator without using the main method. + * + * @param rep + * the repository to use to get the findings. + * @param out + * the output file to write to. + * @param writeToTsv + * whether to write to tsv or xml. TRUE writes to tsv file, FALSE writes to xml. + */ + public CoverageClaimGenerator(Repository rep, File out, boolean writeToTsv) { + Repository repository = rep; + + File outputFile = out; + + JAXBContext jc = getJaxContext(); + + CWECoverageClaims claims = parseRepository(jc, repository); + + // write to TSV or marshall to XML. + if (writeToTsv) { + writeToTSV(claims, outputFile); + } else { + marshalClaims(jc, claims, outputFile); + } + } + + /** + * claims are groups of claim. a claim is essentially a cwe. + * + * @param objFactory + * @param segment + * @param repository + * @return + */ + private Collection createClaims(ObjectFactory objFactory, Value segment, + Repository repository) { + HashMap claims = new HashMap(); + + RepositoryConnection con = null; + + try { + con = getRepositoryConnection(repository); + + String adaptorQuery = "SELECT ?cwe ?cweName WHERE { " + "<" + segment + + "> ?cwe ." + "?cwe \"toif:CWEIdentifier\" . " + + "?cwe ?cweName . }"; + + TupleQuery adaptorTupleQuery = con.prepareTupleQuery(QueryLanguage.SPARQL, adaptorQuery); + + TupleQueryResult queryResult = adaptorTupleQuery.evaluate(); + + while (queryResult.hasNext()) { + BindingSet adaptorSet = queryResult.next(); + Value name = adaptorSet.getValue("cweName"); + Value cwe = adaptorSet.getValue("cwe"); + + String cweIdString = name.stringValue(); + if (!claims.containsKey(cweIdString)) { + Claim claim = objFactory.createCWECoverageClaimTypeClaimsClaim(); + String cweId = cweIdString.replace("CWE-", ""); + claim.setCWEID(cweId); + // use this to set any additional comments. + claim.setCWEClaimComments(""); + + String cweName = getCweName(cweId); + + claim.setCWEName(cweName); + claim.setMatchAccuracy(MatchAccuracyType.UNKNOWN); + + claims.put(cweIdString, claim); + } + + Claim claim = claims.get(cweIdString); + RuleSet ruleSet = objFactory.createCWECoverageClaimTypeClaimsClaimRuleSet(); + ruleSet.getRule().addAll(getRules(objFactory, cwe, repository)); + claim.setRuleSet(ruleSet); + + } + + queryResult.close(); + } catch (RepositoryException e) { + e.printStackTrace(); + } catch (MalformedQueryException e) { + e.printStackTrace(); + } catch (QueryEvaluationException e) { + e.printStackTrace(); + } finally { + try { + if (con != null) { + con.close(); + } + } catch (RepositoryException e) { + e.printStackTrace(); + } + } + + return claims.values(); + } + + /** + * coverage claim are a group of claims from a tool + * + * @param objFactory + * @param repository + * @return + */ + private List createCoverageClaims(ObjectFactory objFactory, + Repository repository) { + List results = new ArrayList(); + + RepositoryConnection con = null; + try { + con = getRepositoryConnection(repository); + + String adaptorQuery = "SELECT ?generatorName ?segment ?version WHERE { ?y ?x . ?segment ?y . ?segment ?generator . " + + "?generator ?generatorName . " + + "?generator ?version}"; + + TupleQuery adaptorTupleQuery = con.prepareTupleQuery(QueryLanguage.SPARQL, adaptorQuery); + + TupleQueryResult queryResult = adaptorTupleQuery.evaluate(); + + while (queryResult.hasNext()) { + BindingSet adaptorSet = queryResult.next(); + Value generatorName = adaptorSet.getValue("generatorName"); + Value segment = adaptorSet.getValue("segment"); + Value version = adaptorSet.getValue("version"); + + if (generatorNames.contains(generatorName.stringValue())) { + continue; + } else { + generatorNames.add(generatorName.stringValue()); + } + + CWECoverageClaimType coverageClaim = objFactory.createCWECoverageClaimType(); + + coverageClaim.setVendorName("KDM Analytics Inc"); + coverageClaim.setToolsetName(generatorName.stringValue()); + coverageClaim.setToolsetVersion(version.stringValue()); + String fileName = getAFileFromSegment(segment, repository); + + String langType = getLanguageType(fileName); + coverageClaim.setLanguageType(langType); + + String lang = getLanguage(fileName); + coverageClaim.setLanguage(lang); + + XMLGregorianCalendar date = getDate(segment, repository); + + coverageClaim.setDateOfClaim(date); + + Claims claims = objFactory.createCWECoverageClaimTypeClaims(); + + Collection claimList = createClaims(objFactory, segment, repository); + + claims.getClaim().addAll(claimList); + coverageClaim.setClaims(claims); + + results.add(coverageClaim); + + } + + queryResult.close(); + } catch (RepositoryException e) { + e.printStackTrace(); + } catch (MalformedQueryException e) { + e.printStackTrace(); + } catch (QueryEvaluationException e) { + e.printStackTrace(); + } finally { + try { + if (con != null) { + con.close(); + } + } catch (RepositoryException e) { + e.printStackTrace(); + } + } + return results; + } + + /** + * find a file in the segment. + * + * @param segment + * @param repository + * @return + */ + private String getAFileFromSegment(Value segment, Repository repository) { + + RepositoryConnection con = null; + try { + con = getRepositoryConnection(repository); + + String adaptorQuery = "SELECT ?fileName WHERE { <" + segment + + "> ?file . " + "?file \"toif:File\" ." + + "?file ?fileName . }"; + + TupleQuery adaptorTupleQuery = con.prepareTupleQuery(QueryLanguage.SPARQL, adaptorQuery); + + TupleQueryResult queryResult = adaptorTupleQuery.evaluate(); + + while (queryResult.hasNext()) { + BindingSet adaptorSet = queryResult.next(); + Value name = adaptorSet.getValue("fileName"); + + return name.stringValue(); + } + + queryResult.close(); + } catch (RepositoryException e) { + e.printStackTrace(); + } catch (MalformedQueryException e) { + e.printStackTrace(); + } catch (QueryEvaluationException e) { + e.printStackTrace(); + } finally { + try { + if (con != null) { + con.close(); + } + } catch (RepositoryException e) { + e.printStackTrace(); + } + } + return null; + } + + /** + * get the cwe name from the id. + * + * @param cweId + * @return + */ + private String getCweName(String cweId) { + CweToName cweToNameUtil = new CweToName(); + return cweToNameUtil.getCweName(cweId); + } + + /** + * get the date from the segment. + * + * @param segment + * toif segment in the repository + * @param repository + * the toif repository + * @return + */ + private XMLGregorianCalendar getDate(Value segment, Repository repository) { + RepositoryConnection con = null; + try { + con = getRepositoryConnection(repository); + + String adaptorQuery = "SELECT ?dateValue WHERE { <" + segment + + "> ?date . " + "?date ?dateValue . }"; + + TupleQuery adaptorTupleQuery = con.prepareTupleQuery(QueryLanguage.SPARQL, adaptorQuery); + + TupleQueryResult queryResult = adaptorTupleQuery.evaluate(); + + while (queryResult.hasNext()) { + BindingSet adaptorSet = queryResult.next(); + Value dateValue = adaptorSet.getValue("dateValue"); + + try { + GregorianCalendar gregorianCalendar = new GregorianCalendar(); + + DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + + Date date = formatter.parse(dateValue.stringValue()); + gregorianCalendar.setTime(date); + + XMLGregorianCalendar xmlGrogerianCalendar = DatatypeFactory.newInstance() + .newXMLGregorianCalendar(gregorianCalendar); + + xmlGrogerianCalendar.setTimezone(DatatypeConstants.FIELD_UNDEFINED); + xmlGrogerianCalendar.setTime(DatatypeConstants.FIELD_UNDEFINED, + DatatypeConstants.FIELD_UNDEFINED, DatatypeConstants.FIELD_UNDEFINED); + + return xmlGrogerianCalendar; + } catch (DatatypeConfigurationException e) { + e.printStackTrace(); + } catch (ParseException e) { + e.printStackTrace(); + } + + } + + queryResult.close(); + } catch (RepositoryException e) { + e.printStackTrace(); + } catch (MalformedQueryException e) { + e.printStackTrace(); + } catch (QueryEvaluationException e) { + e.printStackTrace(); + } finally { + try { + if (con != null) { + con.close(); + } + } catch (RepositoryException e) { + e.printStackTrace(); + } + } + + return null; + + } + + /** + * get the jaxb context. + * + * @return + * + */ + private JAXBContext getJaxContext() { + JAXBContext jc = null; + + try { + jc = JAXBContext.newInstance("generated"); + } catch (JAXBException e) { + e.printStackTrace(); + } + return jc; + } + + /** + * get the language of the file. + * + * @param fileName + * the file to get the language from. + * @return + */ + private String getLanguage(String fileName) { + if (fileName.endsWith(".C")) { + return "C"; + } else if (fileName.endsWith(".Java")) { + return "Java"; + } else if (fileName.endsWith(".CPP")) { + return "C++"; + } else if (fileName.endsWith(".Class")) { return "Java"; } + if (fileName.endsWith(".c")) { + return "C"; + } else if (fileName.endsWith(".java")) { + return "Java"; + } else if (fileName.endsWith(".cpp")) { + return "C++"; + } else if (fileName.endsWith(".class")) { + return "Java"; + } else if (fileName.endsWith(".h")) { + return "C"; + } else { + return "??"; + } + } + + /** + * get the language type from the file name. + * + * @param stringValue + * the language type + * @return + */ + private String getLanguageType(String fileName) { + if (fileName.endsWith(".c")) { + return "Source Code"; + } else if (fileName.endsWith(".java")) { + return "Source Code"; + } else if (fileName.endsWith(".cpp")) { + return "Source Code"; + } else if (fileName.endsWith(".class")) { return "Byte Code"; } + if (fileName.endsWith(".C")) { + return "Source Code"; + } else if (fileName.endsWith(".Java")) { + return "Source Code"; + } else if (fileName.endsWith(".CPP")) { + return "Source Code"; + } else if (fileName.endsWith(".Class")) { + return "Byte Code"; + } else if (fileName.endsWith(".h")) { + return "Source Code"; + } else { + return "??"; + } + } + + /** + * are we writing to tsv? + * + * @param args + * command line args. + * @return + */ + private boolean isWriteToTSV(String[] args) { + if (args[0].equals("-tsv")) { + return true; + } else { + return false; + } + } + + /** + * marshall the claims to the output. + * + * @param jc + * jaxc ontext + * @param claims + * claims to output + * @param outputFile + * the file to write to. + */ + private void marshalClaims(JAXBContext jc, CWECoverageClaims claims, File outputFile) { + + try { + Marshaller m = jc.createMarshaller(); + m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE); + m.marshal(claims, outputFile); + } catch (JAXBException e) { + e.printStackTrace(); + } + + } + + /** + * parse the repository + * + * @param jc + * jax context + * @param repository + * the repository to parse. + * @return + */ + private CWECoverageClaims parseRepository(JAXBContext jc, Repository repository) { + + ObjectFactory objFactory = new ObjectFactory(); + + // root element of the + CWECoverageClaims CWECoverageClaimRoot = objFactory.createCWECoverageClaims(); + + List claims = CWECoverageClaimRoot.getCWECoverageClaim(); + + List coverageClaims = createCoverageClaims(objFactory, repository); + + claims.addAll(coverageClaims); + + return CWECoverageClaimRoot; + + } + + /** + * write each individual claim. + * + * @param writer + * the writer to output + * @param cweCoverageClaimType + * the claim type. + * @throws IOException + */ + private void writeIndividualClaimsToWriter(FileWriter writer, + CWECoverageClaimType cweCoverageClaimType) throws IOException { + List individualClaims = cweCoverageClaimType.getClaims().getClaim(); + + for (Claim claim : individualClaims) { + writer.append("\tCWE ID: " + claim.getCWEID()); + writer.append("\n"); + writer.append("\tCWE Name: " + claim.getCWEName()); + writer.append("\n"); + writer.append("\tMatch Accuracy: " + claim.getMatchAccuracy()); + writer.append("\n"); + + writeRuleSetDetailToTSV(writer, claim); + } + } + + /** + * write the cwe-coverage-claim to output + * + * @param writer + * the output writer + * @param overallClaims + * the cwe-coverage-claim. + * @throws IOException + */ + private void writeOverallCoverageClaimsToWriter(FileWriter writer, + List overallClaims) throws IOException { + for (CWECoverageClaimType cweCoverageClaimType : overallClaims) { + writer.append("CWE Version: " + cweCoverageClaimType.getCWEVersion()); + writer.append('\n'); + writer.append("Vendor Name: " + cweCoverageClaimType.getVendorName()); + writer.append('\n'); + writer.append("Toolset Name: " + cweCoverageClaimType.getToolsetName()); + writer.append('\n'); + writer.append("Toolset Version: " + cweCoverageClaimType.getToolsetVersion()); + writer.append('\n'); + writer.append("Claim Date: " + cweCoverageClaimType.getDateOfClaim()); + writer.append('\n'); + writer.append("Language Type: " + cweCoverageClaimType.getLanguageType()); + writer.append('\n'); + writer.append("Language: " + cweCoverageClaimType.getLanguage()); + writer.append('\n'); + + writeIndividualClaimsToWriter(writer, cweCoverageClaimType); + } + } + + /** + * write the rule set to file + * + * @param writer + * the output writer + * @param claim + * the claim + * @throws IOException + */ + private void writeRuleSetDetailToTSV(FileWriter writer, Claim claim) throws IOException { + List rules = claim.getRuleSet().getRule(); + + for (Rule rule : rules) { + writer.append("\t\tRule ID: " + rule.getRuleID()); + writer.append("\n"); + writer.append("\t\tRule Name: " + rule.getRuleName()); + writer.append("\n"); + writer.append("\t\tRule Comments: " + rule.getRuleComments()); + writer.append("\n"); + + writer.append("\n\n"); + } + + } + + /** + * write to tsv. + * + * @param claims + * @param outputFile + */ + private void writeToTSV(CWECoverageClaims claims, File outputFile) { + FileWriter writer = null; + + try { + writer = new FileWriter(outputFile); + + // write the header. + writer.append("Overall Coverage Claim"); + writer.append('\t'); + writer.append("Individual CWE Claims"); + writer.append('\t'); + writer.append("Rule Set Detail"); + writer.append('\n'); + + List overallClaims = claims.getCWECoverageClaim(); + + writeOverallCoverageClaimsToWriter(writer, overallClaims); + + writer.flush(); + writer.close(); + + } catch (IOException e) { + System.err.println("There was an exit whilst writing to the TSV file."); + System.exit(1); + } + + } + +} diff --git a/com.kdmanalytics.toif.ccr/src/com/kdmanalytics/toif/ccr/CweToName.java b/com.kdmanalytics.toif.ccr/src/com/kdmanalytics/toif/ccr/CweToName.java new file mode 100644 index 00000000..34380de9 --- /dev/null +++ b/com.kdmanalytics.toif.ccr/src/com/kdmanalytics/toif/ccr/CweToName.java @@ -0,0 +1,55 @@ +/******************************************************************************* + * Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This program and + * the accompanying materials are made available under the terms of the Open + * Source Initiative OSI - Open Software License v3.0 which accompanies this + * distribution, and is available at + * http://www.opensource.org/licenses/osl-3.0.php/ + ******************************************************************************/ + +package com.kdmanalytics.toif.ccr; + +import java.io.IOException; + +/** + * get the cwe name from the id. + * + * @author "Adam Nunn " + * + */ +public class CweToName +{ + + public CweToName() + { + + } + + /** + * returns the name of the CWE based on its ID number + * + * @param cweId + * the ID of the CWE. This is just a string of its numerical + * part. IE: if the CWE was "CWE-120" the value used here would + * be "120". + * @return returns the name of the CWE-Id as a string. IE: providing "120" + * would produce, "Null pointer dereference". + */ + public String getCweName(String cweId) + { + + java.util.Properties props = new java.util.Properties(); + + try + { + props.load(getClass().getResourceAsStream("/config/CweIdToName")); + return props.getProperty(cweId); + } + catch (IOException e) + { + System.err.println("There was an error while accessing the CWE properties file. " + e); + } + + return null; + } + +} diff --git a/com.kdmanalytics.toif.ccr/src/config/CweIdToName b/com.kdmanalytics.toif.ccr/src/config/CweIdToName new file mode 100644 index 00000000..1ba83074 --- /dev/null +++ b/com.kdmanalytics.toif.ccr/src/config/CweIdToName @@ -0,0 +1,886 @@ +1=Location +2=Environment +3=Technology-specific Environment Issues +4=J2EE Environment Issues +5=J2EE Misconfiguration: Data Transmission Without Encryption +6=J2EE Misconfiguration: Insufficient Session-ID Length +7=J2EE Misconfiguration: Missing Custom Error Page +8=J2EE Misconfiguration: Entity Bean Declared Remote +9=J2EE Misconfiguration: Weak Access Permissions for EJB Methods +10=ASP.NET Environment Issues +11=ASP.NET Misconfiguration: Creating Debug Binary +12=ASP.NET Misconfiguration: Missing Custom Error Page +13=ASP.NET Misconfiguration: Password in Configuration File +14=Compiler Removal of Code to Clear Buffers +15=External Control of System or Configuration Setting +16=Configuration +17=Code +18=Source Code +19=Data Handling +20=Improper Input Validation +21=Pathname Traversal and Equivalence Errors +22=Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') +23=Relative Path Traversal +24=Path Traversal: '../filedir' +25=Path Traversal: '/../filedir' +26=Path Traversal: '/dir/../filename' +27=Path Traversal: 'dir/../../filename' +28=Path Traversal: '..\filedir' +29=Path Traversal: '\..\filename' +30=Path Traversal: '\dir\..\filename' +31=Path Traversal: 'dir\..\..\filename' +32=Path Traversal: '...' (Triple Dot) +33=Path Traversal: '....' (Multiple Dot) +34=Path Traversal: '....//' +35=Path Traversal: '.../...//' +36=Absolute Path Traversal +37=Path Traversal: '/absolute/pathname/here' +38=Path Traversal: '\absolute\pathname\here' +39=Path Traversal: 'C:dirname' +40=Path Traversal: '\\UNC\share\name\' (Windows UNC Share) +41=Improper Resolution of Path Equivalence +42=Path Equivalence: 'filename.' (Trailing Dot) +43=Path Equivalence: 'filename....' (Multiple Trailing Dot) +44=Path Equivalence: 'file.name' (Internal Dot) +45=Path Equivalence: 'file...name' (Multiple Internal Dot) +46=Path Equivalence: 'filename ' (Trailing Space) +47=Path Equivalence: ' filename' (Leading Space) +48=Path Equivalence: 'file name' (Internal Whitespace) +49=Path Equivalence: 'filename/' (Trailing Slash) +50=Path Equivalence: '//multiple/leading/slash' +51=Path Equivalence: '/multiple//internal/slash' +52=Path Equivalence: '/multiple/trailing/slash//' +53=Path Equivalence: '\multiple\\internal\backslash' +54=Path Equivalence: 'filedir\' (Trailing Backslash) +55=Path Equivalence: '/./' (Single Dot Directory) +56=Path Equivalence: 'filedir*' (Wildcard) +57=Path Equivalence: 'fakedir/../realdir/filename' +58=Path Equivalence: Windows 8.3 Filename +59=Improper Link Resolution Before File Access ('Link Following') +60=UNIX Path Link Problems +61=UNIX Symbolic Link (Symlink) Following +62=UNIX Hard Link +63=Windows Path Link Problems +64=Windows Shortcut Following (.LNK) +65=Windows Hard Link +66=Improper Handling of File Names that Identify Virtual Resources +67=Improper Handling of Windows Device Names +68=Windows Virtual File Problems +69=Improper Handling of Windows ::DATA Alternate Data Stream +70=Mac Virtual File Problems +71=Apple '.DS_Store' +72=Improper Handling of Apple HFS+ Alternate Data Stream Path +73=External Control of File Name or Path +74=Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection') +75=Failure to Sanitize Special Elements into a Different Plane (Special Element Injection) +76=Improper Neutralization of Equivalent Special Elements +77=Improper Neutralization of Special Elements used in a Command ('Command Injection') +78=Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection') +79=Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') +80=Improper Neutralization of Script-Related HTML Tags in a Web Page (Basic XSS) +81=Improper Neutralization of Script in an Error Message Web Page +82=Improper Neutralization of Script in Attributes of IMG Tags in a Web Page +83=Improper Neutralization of Script in Attributes in a Web Page +84=Improper Neutralization of Encoded URI Schemes in a Web Page +85=Doubled Character XSS Manipulations +86=Improper Neutralization of Invalid Characters in Identifiers in Web Pages +87=Improper Neutralization of Alternate XSS Syntax +88=Argument Injection or Modification +89=Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection') +90=Improper Neutralization of Special Elements used in an LDAP Query ('LDAP Injection') +91=XML Injection (aka Blind XPath Injection) +92=DEPRECATED: Improper Sanitization of Custom Special Characters +93=Improper Neutralization of CRLF Sequences ('CRLF Injection') +94=Improper Control of Generation of Code ('Code Injection') +95=Improper Neutralization of Directives in Dynamically Evaluated Code ('Eval Injection') +96=Improper Neutralization of Directives in Statically Saved Code ('Static Code Injection') +97=Improper Neutralization of Server-Side Includes (SSI) Within a Web Page +98=Improper Control of Filename for Include/Require Statement in PHP Program ('PHP File Inclusion') +99=Improper Control of Resource Identifiers ('Resource Injection') +100=Technology-Specific Input Validation Problems +101=Struts Validation Problems +102=Struts: Duplicate Validation Forms +103=Struts: Incomplete validate() Method Definition +104=Struts: Form Bean Does Not Extend Validation Class +105=Struts: Form Field Without Validator +106=Struts: Plug-in Framework not in Use +107=Struts: Unused Validation Form +108=Struts: Unvalidated Action Form +109=Struts: Validator Turned Off +110=Struts: Validator Without Form Field +111=Direct Use of Unsafe JNI +112=Missing XML Validation +113=Improper Neutralization of CRLF Sequences in HTTP Headers ('HTTP Response Splitting') +114=Process Control +115=Misinterpretation of Input +116=Improper Encoding or Escaping of Output +117=Improper Output Neutralization for Logs +118=Improper Access of Indexable Resource ('Range Error') +119=Improper Restriction of Operations within the Bounds of a Memory Buffer +120=Buffer Copy without Checking Size of Input ('Classic Buffer Overflow') +121=Stack-based Buffer Overflow +122=Heap-based Buffer Overflow +123=Write-what-where Condition +124=Buffer Underwrite ('Buffer Underflow') +125=Out-of-bounds Read +126=Buffer Over-read +127=Buffer Under-read +128=Wrap-around Error +129=Improper Validation of Array Index +130=Improper Handling of Length Parameter Inconsistency +131=Incorrect Calculation of Buffer Size +132=DEPRECATED (Duplicate): Miscalculated Null Termination +133=String Errors +134=Uncontrolled Format String +135=Incorrect Calculation of Multi-Byte String Length +136=Type Errors +137=Representation Errors +138=Improper Neutralization of Special Elements +139=DEPRECATED: General Special Element Problems +140=Improper Neutralization of Delimiters +141=Improper Neutralization of Parameter/Argument Delimiters +142=Improper Neutralization of Value Delimiters +143=Improper Neutralization of Record Delimiters +144=Improper Neutralization of Line Delimiters +145=Improper Neutralization of Section Delimiters +146=Improper Neutralization of Expression/Command Delimiters +147=Improper Neutralization of Input Terminators +148=Improper Neutralization of Input Leaders +149=Improper Neutralization of Quoting Syntax +150=Improper Neutralization of Escape, Meta, or Control Sequences +151=Improper Neutralization of Comment Delimiters +152=Improper Neutralization of Macro Symbols +153=Improper Neutralization of Substitution Characters +154=Improper Neutralization of Variable Name Delimiters +155=Improper Neutralization of Wildcards or Matching Symbols +156=Improper Neutralization of Whitespace +157=Failure to Sanitize Paired Delimiters +158=Improper Neutralization of Null Byte or NUL Character +159=Failure to Sanitize Special Element +160=Improper Neutralization of Leading Special Elements +161=Improper Neutralization of Multiple Leading Special Elements +162=Improper Neutralization of Trailing Special Elements +163=Improper Neutralization of Multiple Trailing Special Elements +164=Improper Neutralization of Internal Special Elements +165=Improper Neutralization of Multiple Internal Special Elements +166=Improper Handling of Missing Special Element +167=Improper Handling of Additional Special Element +168=Improper Handling of Inconsistent Special Elements +169=Technology-Specific Special Elements +170=Improper Null Termination +171=Cleansing, Canonicalization, and Comparison Errors +172=Encoding Error +173=Improper Handling of Alternate Encoding +174=Double Decoding of the Same Data +175=Improper Handling of Mixed Encoding +176=Improper Handling of Unicode Encoding +177=Improper Handling of URL Encoding (Hex Encoding) +178=Improper Handling of Case Sensitivity +179=Incorrect Behavior Order: Early Validation +180=Incorrect Behavior Order: Validate Before Canonicalize +181=Incorrect Behavior Order: Validate Before Filter +182=Collapse of Data into Unsafe Value +183=Permissive Whitelist +184=Incomplete Blacklist +185=Incorrect Regular Expression +186=Overly Restrictive Regular Expression +187=Partial Comparison +188=Reliance on Data/Memory Layout +189=Numeric Errors +190=Integer Overflow or Wraparound +191=Integer Underflow (Wrap or Wraparound) +192=Integer Coercion Error +193=Off-by-one Error +194=Unexpected Sign Extension +195=Signed to Unsigned Conversion Error +196=Unsigned to Signed Conversion Error +197=Numeric Truncation Error +198=Use of Incorrect Byte Ordering +199=Information Management Errors +200=Information Exposure +201=Information Exposure Through Sent Data +202=Exposure of Sensitive Data Through Data Queries +203=Information Exposure Through Discrepancy +204=Response Discrepancy Information Exposure +205=Information Exposure Through Behavioral Discrepancy +206=Information Exposure of Internal State Through Behavioral Inconsistency +207=Information Exposure Through an External Behavioral Inconsistency +208=Information Exposure Through Timing Discrepancy +209=Information Exposure Through an Error Message +210=Information Exposure Through Generated Error Message +211=Information Exposure Through External Error Message +212=Improper Cross-boundary Removal of Sensitive Data +213=Intentional Information Exposure +214=Information Exposure Through Process Environment +215=Information Exposure Through Debug Information +216=Containment Errors (Container Errors) +217=DEPRECATED: Failure to Protect Stored Data from Modification +218=DEPRECATED (Duplicate): Failure to provide confidentiality for stored data +219=Sensitive Data Under Web Root +220=Sensitive Data Under FTP Root +221=Information Loss or Omission +222=Truncation of Security-relevant Information +223=Omission of Security-relevant Information +224=Obscured Security-relevant Information by Alternate Name +225=DEPRECATED (Duplicate): General Information Management Problems +226=Sensitive Information Uncleared Before Release +227=Improper Fulfillment of API Contract ('API Abuse') +228=Improper Handling of Syntactically Invalid Structure +229=Improper Handling of Values +230=Improper Handling of Missing Values +231=Improper Handling of Extra Values +232=Improper Handling of Undefined Values +233=Parameter Problems +234=Failure to Handle Missing Parameter +235=Improper Handling of Extra Parameters +236=Improper Handling of Undefined Parameters +237=Improper Handling of Structural Elements +238=Improper Handling of Incomplete Structural Elements +239=Failure to Handle Incomplete Element +240=Improper Handling of Inconsistent Structural Elements +241=Improper Handling of Unexpected Data Type +242=Use of Inherently Dangerous Function +243=Creation of chroot Jail Without Changing Working Directory +244=Improper Clearing of Heap Memory Before Release ('Heap Inspection') +245=J2EE Bad Practices: Direct Management of Connections +246=J2EE Bad Practices: Direct Use of Sockets +247=Reliance on DNS Lookups in a Security Decision +248=Uncaught Exception +249=DEPRECATED: Often Misused: Path Manipulation +250=Execution with Unnecessary Privileges +251=Often Misused: String Management +252=Unchecked Return Value +253=Incorrect Check of Function Return Value +254=Security Features +255=Credentials Management +256=Plaintext Storage of a Password +257=Storing Passwords in a Recoverable Format +258=Empty Password in Configuration File +259=Use of Hard-coded Password +260=Password in Configuration File +261=Weak Cryptography for Passwords +262=Not Using Password Aging +263=Password Aging with Long Expiration +264=Permissions, Privileges, and Access Controls +265=Privilege / Sandbox Issues +266=Incorrect Privilege Assignment +267=Privilege Defined With Unsafe Actions +268=Privilege Chaining +269=Improper Privilege Management +270=Privilege Context Switching Error +271=Privilege Dropping / Lowering Errors +272=Least Privilege Violation +273=Improper Check for Dropped Privileges +274=Improper Handling of Insufficient Privileges +275=Permission Issues +276=Incorrect Default Permissions +277=Insecure Inherited Permissions +278=Insecure Preserved Inherited Permissions +279=Incorrect Execution-Assigned Permissions +280=Improper Handling of Insufficient Permissions or Privileges +281=Improper Preservation of Permissions +282=Improper Ownership Management +283=Unverified Ownership +284=Improper Access Control +285=Improper Authorization +286=Incorrect User Management +287=Improper Authentication +288=Authentication Bypass Using an Alternate Path or Channel +289=Authentication Bypass by Alternate Name +290=Authentication Bypass by Spoofing +291=Trusting Self-reported IP Address +292=Trusting Self-reported DNS Name +293=Using Referer Field for Authentication +294=Authentication Bypass by Capture-replay +295=Certificate Issues +296=Improper Following of Chain of Trust for Certificate Validation +297=Improper Validation of Host-specific Certificate Data +298=Improper Validation of Certificate Expiration +299=Improper Check for Certificate Revocation +300=Channel Accessible by Non-Endpoint ('Man-in-the-Middle') +301=Reflection Attack in an Authentication Protocol +302=Authentication Bypass by Assumed-Immutable Data +303=Incorrect Implementation of Authentication Algorithm +304=Missing Critical Step in Authentication +305=Authentication Bypass by Primary Weakness +306=Missing Authentication for Critical Function +307=Improper Restriction of Excessive Authentication Attempts +308=Use of Single-factor Authentication +309=Use of Password System for Primary Authentication +310=Cryptographic Issues +311=Missing Encryption of Sensitive Data +312=Cleartext Storage of Sensitive Information +313=Plaintext Storage in a File or on Disk +314=Plaintext Storage in the Registry +315=Plaintext Storage in a Cookie +316=Plaintext Storage in Memory +317=Plaintext Storage in GUI +318=Plaintext Storage in Executable +319=Cleartext Transmission of Sensitive Information +320=Key Management Errors +321=Use of Hard-coded Cryptographic Key +322=Key Exchange without Entity Authentication +323=Reusing a Nonce, Key Pair in Encryption +324=Use of a Key Past its Expiration Date +325=Missing Required Cryptographic Step +326=Inadequate Encryption Strength +327=Use of a Broken or Risky Cryptographic Algorithm +328=Reversible One-Way Hash +329=Not Using a Random IV with CBC Mode +330=Use of Insufficiently Random Values +331=Insufficient Entropy +332=Insufficient Entropy in PRNG +333=Improper Handling of Insufficient Entropy in TRNG +334=Small Space of Random Values +335=PRNG Seed Error +336=Same Seed in PRNG +337=Predictable Seed in PRNG +338=Use of Cryptographically Weak PRNG +339=Small Seed Space in PRNG +340=Predictability Problems +341=Predictable from Observable State +342=Predictable Exact Value from Previous Values +343=Predictable Value Range from Previous Values +344=Use of Invariant Value in Dynamically Changing Context +345=Insufficient Verification of Data Authenticity +346=Origin Validation Error +347=Improper Verification of Cryptographic Signature +348=Use of Less Trusted Source +349=Acceptance of Extraneous Untrusted Data With Trusted Data +350=Improperly Trusted Reverse DNS +351=Insufficient Type Distinction +352=Cross-Site Request Forgery (CSRF) +353=Missing Support for Integrity Check +354=Improper Validation of Integrity Check Value +355=User Interface Security Issues +356=Product UI does not Warn User of Unsafe Actions +357=Insufficient UI Warning of Dangerous Operations +358=Improperly Implemented Security Check for Standard +359=Privacy Violation +360=Trust of System Event Data +361=Time and State +362=Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition') +363=Race Condition Enabling Link Following +364=Signal Handler Race Condition +365=Race Condition in Switch +366=Race Condition within a Thread +367=Time-of-check Time-of-use (TOCTOU) Race Condition +368=Context Switching Race Condition +369=Divide By Zero +370=Missing Check for Certificate Revocation after Initial Check +371=State Issues +372=Incomplete Internal State Distinction +373=DEPRECATED: State Synchronization Error +374=Passing Mutable Objects to an Untrusted Method +375=Returning a Mutable Object to an Untrusted Caller +376=Temporary File Issues +377=Insecure Temporary File +378=Creation of Temporary File With Insecure Permissions +379=Creation of Temporary File in Directory with Incorrect Permissions +380=Technology-Specific Time and State Issues +381=J2EE Time and State Issues +382=J2EE Bad Practices: Use of System.exit() +383=J2EE Bad Practices: Direct Use of Threads +384=Session Fixation +385=Covert Timing Channel +386=Symbolic Name not Mapping to Correct Object +387=Signal Errors +388=Error Handling +389=Error Conditions, Return Values, Status Codes +390=Detection of Error Condition Without Action +391=Unchecked Error Condition +392=Missing Report of Error Condition +393=Return of Wrong Status Code +394=Unexpected Status Code or Return Value +395=Use of NullPointerException Catch to Detect NULL Pointer Dereference +396=Declaration of Catch for Generic Exception +397=Declaration of Throws for Generic Exception +398=Indicator of Poor Code Quality +399=Resource Management Errors +400=Uncontrolled Resource Consumption ('Resource Exhaustion') +401=Improper Release of Memory Before Removing Last Reference ('Memory Leak') +402=Transmission of Private Resources into a New Sphere ('Resource Leak') +403=Exposure of File Descriptor to Unintended Control Sphere +404=Improper Resource Shutdown or Release +405=Asymmetric Resource Consumption (Amplification) +406=Insufficient Control of Network Message Volume (Network Amplification) +407=Algorithmic Complexity +408=Incorrect Behavior Order: Early Amplification +409=Improper Handling of Highly Compressed Data (Data Amplification) +410=Insufficient Resource Pool +411=Resource Locking Problems +412=Unrestricted Externally Accessible Lock +413=Improper Resource Locking +414=Missing Lock Check +415=Double Free +416=Use After Free +417=Channel and Path Errors +418=Channel Errors +419=Unprotected Primary Channel +420=Unprotected Alternate Channel +421=Race Condition During Access to Alternate Channel +422=Unprotected Windows Messaging Channel ('Shatter') +423=DEPRECATED (Duplicate): Proxied Trusted Channel +424=Improper Protection of Alternate Path +425=Direct Request ('Forced Browsing') +426=Untrusted Search Path +427=Uncontrolled Search Path Element +428=Unquoted Search Path or Element +429=Handler Errors +430=Deployment of Wrong Handler +431=Missing Handler +432=Dangerous Signal Handler not Disabled During Sensitive Operations +433=Unparsed Raw Web Content Delivery +434=Unrestricted Upload of File with Dangerous Type +435=Interaction Error +436=Interpretation Conflict +437=Incomplete Model of Endpoint Features +438=Behavioral Problems +439=Behavioral Change in New Version or Environment +440=Expected Behavior Violation +441=Unintended Proxy/Intermediary +442=Web Problems +443=DEPRECATED (Duplicate): HTTP response splitting +444=Inconsistent Interpretation of HTTP Requests ('HTTP Request Smuggling') +445=User Interface Errors +446=UI Discrepancy for Security Feature +447=Unimplemented or Unsupported Feature in UI +448=Obsolete Feature in UI +449=The UI Performs the Wrong Action +450=Multiple Interpretations of UI Input +451=UI Misrepresentation of Critical Information +452=Initialization and Cleanup Errors +453=Insecure Default Variable Initialization +454=External Initialization of Trusted Variables or Data Stores +455=Non-exit on Failed Initialization +456=Missing Initialization +457=Use of Uninitialized Variable +458=DEPRECATED: Incorrect Initialization +459=Incomplete Cleanup +460=Improper Cleanup on Thrown Exception +461=Data Structure Issues +462=Duplicate Key in Associative List (Alist) +463=Deletion of Data Structure Sentinel +464=Addition of Data Structure Sentinel +465=Pointer Issues +466=Return of Pointer Value Outside of Expected Range +467=Use of sizeof() on a Pointer Type +468=Incorrect Pointer Scaling +469=Use of Pointer Subtraction to Determine Size +470=Use of Externally-Controlled Input to Select Classes or Code ('Unsafe Reflection') +471=Modification of Assumed-Immutable Data (MAID) +472=External Control of Assumed-Immutable Web Parameter +473=PHP External Variable Modification +474=Use of Function with Inconsistent Implementations +475=Undefined Behavior for Input to API +476=NULL Pointer Dereference +477=Use of Obsolete Functions +478=Missing Default Case in Switch Statement +479=Signal Handler Use of a Non-reentrant Function +480=Use of Incorrect Operator +481=Assigning instead of Comparing +482=Comparing instead of Assigning +483=Incorrect Block Delimitation +484=Omitted Break Statement in Switch +485=Insufficient Encapsulation +486=Comparison of Classes by Name +487=Reliance on Package-level Scope +488=Exposure of Data Element to Wrong Session +489=Leftover Debug Code +490=Mobile Code Issues +491=Public cloneable() Method Without Final ('Object Hijack') +492=Use of Inner Class Containing Sensitive Data +493=Critical Public Variable Without Final Modifier +494=Download of Code Without Integrity Check +495=Private Array-Typed Field Returned From A Public Method +496=Public Data Assigned to Private Array-Typed Field +497=Exposure of System Data to an Unauthorized Control Sphere +498=Cloneable Class Containing Sensitive Information +499=Serializable Class Containing Sensitive Data +500=Public Static Field Not Marked Final +501=Trust Boundary Violation +502=Deserialization of Untrusted Data +503=Byte/Object Code +504=Motivation/Intent +505=Intentionally Introduced Weakness +506=Embedded Malicious Code +507=Trojan Horse +508=Non-Replicating Malicious Code +509=Replicating Malicious Code (Virus or Worm) +510=Trapdoor +511=Logic/Time Bomb +512=Spyware +513=Intentionally Introduced Nonmalicious Weakness +514=Covert Channel +515=Covert Storage Channel +516=DEPRECATED (Duplicate): Covert Timing Channel +517=Other Intentional, Nonmalicious Weakness +518=Inadvertently Introduced Weakness +519=.NET Environment Issues +520=.NET Misconfiguration: Use of Impersonation +521=Weak Password Requirements +522=Insufficiently Protected Credentials +523=Unprotected Transport of Credentials +524=Information Exposure Through Caching +525=Information Exposure Through Browser Caching +526=Information Exposure Through Environmental Variables +527=Exposure of CVS Repository to an Unauthorized Control Sphere +528=Exposure of Core Dump File to an Unauthorized Control Sphere +529=Exposure of Access Control List Files to an Unauthorized Control Sphere +530=Exposure of Backup File to an Unauthorized Control Sphere +531=Information Exposure Through Test Code +532=Information Exposure Through Log Files +533=Information Exposure Through Server Log Files +534=Information Exposure Through Debug Log Files +535=Information Exposure Through Shell Error Message +536=Information Exposure Through Servlet Runtime Error Message +537=Information Exposure Through Java Runtime Error Message +538=File and Directory Information Exposure +539=Information Exposure Through Persistent Cookies +540=Information Exposure Through Source Code +541=Information Exposure Through Include Source Code +542=Information Exposure Through Cleanup Log Files +543=Use of Singleton Pattern Without Synchronization in a Multithreaded Context +544=Missing Standardized Error Handling Mechanism +545=Use of Dynamic Class Loading +546=Suspicious Comment +547=Use of Hard-coded, Security-relevant Constants +548=Information Exposure Through Directory Listing +549=Missing Password Field Masking +550=Information Exposure Through Server Error Message +551=Incorrect Behavior Order: Authorization Before Parsing and Canonicalization +552=Files or Directories Accessible to External Parties +553=Command Shell in Externally Accessible Directory +554=ASP.NET Misconfiguration: Not Using Input Validation Framework +555=J2EE Misconfiguration: Plaintext Password in Configuration File +556=ASP.NET Misconfiguration: Use of Identity Impersonation +557=Concurrency Issues +558=Use of getlogin() in Multithreaded Application +559=Often Misused: Arguments and Parameters +560=Use of umask() with chmod-style Argument +561=Dead Code +562=Return of Stack Variable Address +563=Unused Variable +564=SQL Injection: Hibernate +565=Reliance on Cookies without Validation and Integrity Checking +566=Authorization Bypass Through User-Controlled SQL Primary Key +567=Unsynchronized Access to Shared Data in a Multithreaded Context +568=finalize() Method Without super.finalize() +569=Expression Issues +570=Expression is Always False +571=Expression is Always True +572=Call to Thread run() instead of start() +573=Improper Following of Specification by Caller +574=EJB Bad Practices: Use of Synchronization Primitives +575=EJB Bad Practices: Use of AWT Swing +576=EJB Bad Practices: Use of Java I/O +577=EJB Bad Practices: Use of Sockets +578=EJB Bad Practices: Use of Class Loader +579=J2EE Bad Practices: Non-serializable Object Stored in Session +580=clone() Method Without super.clone() +581=Object Model Violation: Just One of Equals and Hashcode Defined +582=Array Declared Public, Final, and Static +583=finalize() Method Declared Public +584=Return Inside Finally Block +585=Empty Synchronized Block +586=Explicit Call to Finalize() +587=Assignment of a Fixed Address to a Pointer +588=Attempt to Access Child of a Non-structure Pointer +589=Call to Non-ubiquitous API +590=Free of Memory not on the Heap +591=Sensitive Data Storage in Improperly Locked Memory +592=Authentication Bypass Issues +593=Authentication Bypass: OpenSSL CTX Object Modified after SSL Objects are Created +594=J2EE Framework: Saving Unserializable Objects to Disk +595=Comparison of Object References Instead of Object Contents +596=Incorrect Semantic Object Comparison +597=Use of Wrong Operator in String Comparison +598=Information Exposure Through Query Strings in GET Request +599=Trust of OpenSSL Certificate Without Validation +600=Uncaught Exception in Servlet +601=URL Redirection to Untrusted Site ('Open Redirect') +602=Client-Side Enforcement of Server-Side Security +603=Use of Client-Side Authentication +604=Deprecated Entries +605=Multiple Binds to the Same Port +606=Unchecked Input for Loop Condition +607=Public Static Final Field References Mutable Object +608=Struts: Non-private Field in ActionForm Class +609=Double-Checked Locking +610=Externally Controlled Reference to a Resource in Another Sphere +611=Information Exposure Through XML External Entity Reference +612=Information Exposure Through Indexing of Private Data +613=Insufficient Session Expiration +614=Sensitive Cookie in HTTPS Session Without 'Secure' Attribute +615=Information Exposure Through Comments +616=Incomplete Identification of Uploaded File Variables (PHP) +617=Reachable Assertion +618=Exposed Unsafe ActiveX Method +619=Dangling Database Cursor ('Cursor Injection') +620=Unverified Password Change +621=Variable Extraction Error +622=Unvalidated Function Hook Arguments +623=Unsafe ActiveX Control Marked Safe For Scripting +624=Executable Regular Expression Error +625=Permissive Regular Expression +626=Null Byte Interaction Error (Poison Null Byte) +627=Dynamic Variable Evaluation +628=Function Call with Incorrectly Specified Arguments +629=Weaknesses in OWASP Top Ten (2007) +630=Weaknesses Examined by SAMATE +631=Resource-specific Weaknesses +632=Weaknesses that Affect Files or Directories +633=Weaknesses that Affect Memory +634=Weaknesses that Affect System Processes +635=Weaknesses Used by NVD +636=Not Failing Securely ('Failing Open') +637=Unnecessary Complexity in Protection Mechanism (Not Using 'Economy of Mechanism') +638=Not Using Complete Mediation +639=Authorization Bypass Through User-Controlled Key +640=Weak Password Recovery Mechanism for Forgotten Password +641=Improper Restriction of Names for Files and Other Resources +642=External Control of Critical State Data +643=Improper Neutralization of Data within XPath Expressions ('XPath Injection') +644=Improper Neutralization of HTTP Headers for Scripting Syntax +645=Overly Restrictive Account Lockout Mechanism +646=Reliance on File Name or Extension of Externally-Supplied File +647=Use of Non-Canonical URL Paths for Authorization Decisions +648=Incorrect Use of Privileged APIs +649=Reliance on Obfuscation or Encryption of Security-Relevant Inputs without Integrity Checking +650=Trusting HTTP Permission Methods on the Server Side +651=Information Exposure Through WSDL File +652=Improper Neutralization of Data within XQuery Expressions ('XQuery Injection') +653=Insufficient Compartmentalization +654=Reliance on a Single Factor in a Security Decision +655=Insufficient Psychological Acceptability +656=Reliance on Security Through Obscurity +657=Violation of Secure Design Principles +658=Weaknesses in Software Written in C +659=Weaknesses in Software Written in C++ +660=Weaknesses in Software Written in Java +661=Weaknesses in Software Written in PHP +662=Improper Synchronization +663=Use of a Non-reentrant Function in a Concurrent Context +664=Improper Control of a Resource Through its Lifetime +665=Improper Initialization +666=Operation on Resource in Wrong Phase of Lifetime +667=Improper Locking +668=Exposure of Resource to Wrong Sphere +669=Incorrect Resource Transfer Between Spheres +670=Always-Incorrect Control Flow Implementation +671=Lack of Administrator Control over Security +672=Operation on a Resource after Expiration or Release +673=External Influence of Sphere Definition +674=Uncontrolled Recursion +675=Duplicate Operations on Resource +676=Use of Potentially Dangerous Function +677=Weakness Base Elements +678=Composites +679=Chain Elements +680=Integer Overflow to Buffer Overflow +681=Incorrect Conversion between Numeric Types +682=Incorrect Calculation +683=Function Call With Incorrect Order of Arguments +684=Incorrect Provision of Specified Functionality +685=Function Call With Incorrect Number of Arguments +686=Function Call With Incorrect Argument Type +687=Function Call With Incorrectly Specified Argument Value +688=Function Call With Incorrect Variable or Reference as Argument +689=Permission Race Condition During Resource Copy +690=Unchecked Return Value to NULL Pointer Dereference +691=Insufficient Control Flow Management +692=Incomplete Blacklist to Cross-Site Scripting +693=Protection Mechanism Failure +694=Use of Multiple Resources with Duplicate Identifier +695=Use of Low-Level Functionality +696=Incorrect Behavior Order +697=Insufficient Comparison +698=Redirect Without Exit +699=Development Concepts +700=Seven Pernicious Kingdoms +701=Weaknesses Introduced During Design +702=Weaknesses Introduced During Implementation +703=Improper Check or Handling of Exceptional Conditions +704=Incorrect Type Conversion or Cast +705=Incorrect Control Flow Scoping +706=Use of Incorrectly-Resolved Name or Reference +707=Improper Enforcement of Message or Data Structure +708=Incorrect Ownership Assignment +709=Named Chains +710=Coding Standards Violation +711=Weaknesses in OWASP Top Ten (2004) +712=OWASP Top Ten 2007 Category A1 - Cross Site Scripting (XSS) +713=OWASP Top Ten 2007 Category A2 - Injection Flaws +714=OWASP Top Ten 2007 Category A3 - Malicious File Execution +715=OWASP Top Ten 2007 Category A4 - Insecure Direct Object Reference +716=OWASP Top Ten 2007 Category A5 - Cross Site Request Forgery (CSRF) +717=OWASP Top Ten 2007 Category A6 - Information Leakage and Improper Error Handling +718=OWASP Top Ten 2007 Category A7 - Broken Authentication and Session Management +719=OWASP Top Ten 2007 Category A8 - Insecure Cryptographic Storage +720=OWASP Top Ten 2007 Category A9 - Insecure Communications +721=OWASP Top Ten 2007 Category A10 - Failure to Restrict URL Access +722=OWASP Top Ten 2004 Category A1 - Unvalidated Input +723=OWASP Top Ten 2004 Category A2 - Broken Access Control +724=OWASP Top Ten 2004 Category A3 - Broken Authentication and Session Management +725=OWASP Top Ten 2004 Category A4 - Cross-Site Scripting (XSS) Flaws +726=OWASP Top Ten 2004 Category A5 - Buffer Overflows +727=OWASP Top Ten 2004 Category A6 - Injection Flaws +728=OWASP Top Ten 2004 Category A7 - Improper Error Handling +729=OWASP Top Ten 2004 Category A8 - Insecure Storage +730=OWASP Top Ten 2004 Category A9 - Denial of Service +731=OWASP Top Ten 2004 Category A10 - Insecure Configuration Management +732=Incorrect Permission Assignment for Critical Resource +733=Compiler Optimization Removal or Modification of Security-critical Code +734=Weaknesses Addressed by the CERT C Secure Coding Standard +735=CERT C Secure Coding Section 01 - Preprocessor (PRE) +736=CERT C Secure Coding Section 02 - Declarations and Initialization (DCL) +737=CERT C Secure Coding Section 03 - Expressions (EXP) +738=CERT C Secure Coding Section 04 - Integers (INT) +739=CERT C Secure Coding Section 05 - Floating Point (FLP) +740=CERT C Secure Coding Section 06 - Arrays (ARR) +741=CERT C Secure Coding Section 07 - Characters and Strings (STR) +742=CERT C Secure Coding Section 08 - Memory Management (MEM) +743=CERT C Secure Coding Section 09 - Input Output (FIO) +744=CERT C Secure Coding Section 10 - Environment (ENV) +745=CERT C Secure Coding Section 11 - Signals (SIG) +746=CERT C Secure Coding Section 12 - Error Handling (ERR) +747=CERT C Secure Coding Section 49 - Miscellaneous (MSC) +748=CERT C Secure Coding Section 50 - POSIX (POS) +749=Exposed Dangerous Method or Function +750=Weaknesses in the 2009 CWE/SANS Top 25 Most Dangerous Programming Errors +751=Insecure Interaction Between Components +752=Risky Resource Management +753=Porous Defenses +754=Improper Check for Unusual or Exceptional Conditions +755=Improper Handling of Exceptional Conditions +756=Missing Custom Error Page +757=Selection of Less-Secure Algorithm During Negotiation ('Algorithm Downgrade') +758=Reliance on Undefined, Unspecified, or Implementation-Defined Behavior +759=Use of a One-Way Hash without a Salt +760=Use of a One-Way Hash with a Predictable Salt +761=Free of Pointer not at Start of Buffer +762=Mismatched Memory Management Routines +763=Release of Invalid Pointer or Reference +764=Multiple Locks of a Critical Resource +765=Multiple Unlocks of a Critical Resource +766=Critical Variable Declared Public +767=Access to Critical Private Variable via Public Method +768=Incorrect Short Circuit Evaluation +769=File Descriptor Exhaustion +770=Allocation of Resources Without Limits or Throttling +771=Missing Reference to Active Allocated Resource +772=Missing Release of Resource after Effective Lifetime +773=Missing Reference to Active File Descriptor or Handle +774=Allocation of File Descriptors or Handles Without Limits or Throttling +775=Missing Release of File Descriptor or Handle after Effective Lifetime +776=Unrestricted Recursive Entity References in DTDs ('XML Bomb') +777=Regular Expression without Anchors +778=Insufficient Logging +779=Logging of Excessive Data +780=Use of RSA Algorithm without OAEP +781=Improper Address Validation in IOCTL with METHOD_NEITHER I/O Control Code +782=Exposed IOCTL with Insufficient Access Control +783=Operator Precedence Logic Error +784=Reliance on Cookies without Validation and Integrity Checking in a Security Decision +785=Use of Path Manipulation Function without Maximum-sized Buffer +786=Access of Memory Location Before Start of Buffer +787=Out-of-bounds Write +788=Access of Memory Location After End of Buffer +789=Uncontrolled Memory Allocation +790=Improper Filtering of Special Elements +791=Incomplete Filtering of Special Elements +792=Incomplete Filtering of One or More Instances of Special Elements +793=Only Filtering One Instance of a Special Element +794=Incomplete Filtering of Multiple Instances of Special Elements +795=Only Filtering Special Elements at a Specified Location +796=Only Filtering Special Elements Relative to a Marker +797=Only Filtering Special Elements at an Absolute Position +798=Use of Hard-coded Credentials +799=Improper Control of Interaction Frequency +800=Weaknesses in the 2010 CWE/SANS Top 25 Most Dangerous Programming Errors +801=Insecure Interaction Between Components +802=Risky Resource Management +803=Porous Defenses +804=Guessable CAPTCHA +805=Buffer Access with Incorrect Length Value +806=Buffer Access Using Size of Source Buffer +807=Reliance on Untrusted Inputs in a Security Decision +808=Weaknesses On the Cusp +809=Weaknesses in OWASP Top Ten (2010) +810=OWASP Top Ten 2010 Category A1 - Injection +811=OWASP Top Ten 2010 Category A2 - Cross-Site Scripting (XSS) +812=OWASP Top Ten 2010 Category A3 - Broken Authentication and Session Management +813=OWASP Top Ten 2010 Category A4 - Insecure Direct Object References +814=OWASP Top Ten 2010 Category A5 - Cross-Site Request Forgery(CSRF) +815=OWASP Top Ten 2010 Category A6 - Security Misconfiguration +816=OWASP Top Ten 2010 Category A7 - Insecure Cryptographic Storage +817=OWASP Top Ten 2010 Category A8 - Failure to Restrict URL Access +818=OWASP Top Ten 2010 Category A9 - Insufficient Transport Layer Protection +819=OWASP Top Ten 2010 Category A10 - Unvalidated Redirects and Forwards +820=Missing Synchronization +821=Incorrect Synchronization +822=Untrusted Pointer Dereference +823=Use of Out-of-range Pointer Offset +824=Access of Uninitialized Pointer +825=Expired Pointer Dereference +826=Premature Release of Resource During Expected Lifetime +827=Improper Control of Document Type Definition +828=Signal Handler with Functionality that is not Asynchronous-Safe +829=Inclusion of Functionality from Untrusted Control Sphere +830=Inclusion of Web Functionality from an Untrusted Source +831=Signal Handler Function Associated with Multiple Signals +832=Unlock of a Resource that is not Locked +833=Deadlock +834=Excessive Iteration +835=Loop with Unreachable Exit Condition ('Infinite Loop') +836=Use of Password Hash Instead of Password for Authentication +837=Improper Enforcement of a Single, Unique Action +838=Inappropriate Encoding for Output Context +839=Numeric Range Comparison Without Minimum Check +840=Business Logic Errors +841=Improper Enforcement of Behavioral Workflow +842=Placement of User into Incorrect Group +843=Access of Resource Using Incompatible Type ('Type Confusion') +844=Weaknesses Addressed by the CERT Java Secure Coding Standard +845=CERT Java Secure Coding Section 00 - Input Validation and Data Sanitization (IDS) +846=CERT Java Secure Coding Section 01 - Declarations and Initialization (DCL) +847=CERT Java Secure Coding Section 02 - Expressions (EXP) +848=CERT Java Secure Coding Section 03 - Numeric Types and Operations (NUM) +849=CERT Java Secure Coding Section 04 - Object Orientation (OBJ) +850=CERT Java Secure Coding Section 05 - Methods (MET) +851=CERT Java Secure Coding Section 06 - Exceptional Behavior (ERR) +852=CERT Java Secure Coding Section 07 - Visibility and Atomicity (VNA) +853=CERT Java Secure Coding Section 08 - Locking (LCK) +854=CERT Java Secure Coding Section 09 - Thread APIs (THI) +855=CERT Java Secure Coding Section 10 - Thread Pools (TPS) +856=CERT Java Secure Coding Section 11 - Thread-Safety Miscellaneous (TSM) +857=CERT Java Secure Coding Section 12 - Input Output (FIO) +858=CERT Java Secure Coding Section 13 - Serialization (SER) +859=CERT Java Secure Coding Section 14 - Platform Security (SEC) +860=CERT Java Secure Coding Section 15 - Runtime Environment (ENV) +861=CERT Java Secure Coding Section 49 - Miscellaneous (MSC) +862=Missing Authorization +863=Incorrect Authorization +864=Insecure Interaction Between Components +865=Risky Resource Management +866=Porous Defenses +867=Weaknesses On the Cusp +868=Weaknesses Addressed by the CERT C++ Secure Coding Standard +869=CERT C++ Secure Coding Section 01 - Preprocessor (PRE) +870=CERT C++ Secure Coding Section 02 - Declarations and Initialization (DCL) +871=CERT C++ Secure Coding Section 03 - Expressions (EXP) +872=CERT C++ Secure Coding Section 04 - Integers (INT) +873=CERT C++ Secure Coding Section 05 - Floating Point Arithmetic (FLP) +874=CERT C++ Secure Coding Section 06 - Arrays and the STL (ARR) +875=CERT C++ Secure Coding Section 07 - Characters and Strings (STR) +876=CERT C++ Secure Coding Section 08 - Memory Management (MEM) +877=CERT C++ Secure Coding Section 09 - Input Output (FIO) +878=CERT C++ Secure Coding Section 10 - Environment (ENV) +879=CERT C++ Secure Coding Section 11 - Signals (SIG) +880=CERT C++ Secure Coding Section 12 - Exceptions and Error Handling (ERR) +881=CERT C++ Secure Coding Section 13 - Object Oriented Programming (OOP) +882=CERT C++ Secure Coding Section 14 - Concurrency (CON) +883=CERT C++ Secure Coding Section 49 - Miscellaneous (MSC) +900=Weaknesses in the 2011 CWE/SANS Top 25 Most Dangerous Software Errors +1000=Research Concepts +2000=Comprehensive CWE Dictionary diff --git a/com.kdmanalytics.toif.ccr/src/generated/CWECoverageClaimType.java b/com.kdmanalytics.toif.ccr/src/generated/CWECoverageClaimType.java new file mode 100644 index 00000000..d6c2abc4 --- /dev/null +++ b/com.kdmanalytics.toif.ccr/src/generated/CWECoverageClaimType.java @@ -0,0 +1,845 @@ +/******************************************************************************* + * Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This program and the + * accompanying materials are made available under the terms of the Open Source + * Initiative OSI - Open Software License v3.0 which accompanies this + * distribution, and is available at http://www.opensource.org/licenses/osl-3.0.php/ + ******************************************************************************/ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2012.03.30 at 02:17:16 PM EDT +// + + +package generated; + +import java.util.ArrayList; +import java.util.List; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlSchemaType; +import javax.xml.bind.annotation.XmlType; +import javax.xml.datatype.XMLGregorianCalendar; + + +/** + *

Java class for CWE_Coverage_ClaimType complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="CWE_Coverage_ClaimType">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="Claims">
+ *           <complexType>
+ *             <complexContent>
+ *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                 <sequence>
+ *                   <element name="Claim" maxOccurs="unbounded">
+ *                     <complexType>
+ *                       <complexContent>
+ *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                           <sequence>
+ *                             <element name="CWE_Claim_Comments" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *                             <element name="Rule_Set" minOccurs="0">
+ *                               <complexType>
+ *                                 <complexContent>
+ *                                   <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                                     <sequence>
+ *                                       <element name="Rule" maxOccurs="unbounded">
+ *                                         <complexType>
+ *                                           <complexContent>
+ *                                             <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                                               <sequence>
+ *                                                 <element name="Rule_Comments" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *                                               </sequence>
+ *                                               <attribute name="Rule_ID" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                                               <attribute name="Rule_Name" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                                             </restriction>
+ *                                           </complexContent>
+ *                                         </complexType>
+ *                                       </element>
+ *                                     </sequence>
+ *                                   </restriction>
+ *                                 </complexContent>
+ *                               </complexType>
+ *                             </element>
+ *                           </sequence>
+ *                           <attribute name="Match_Accuracy" use="required" type="{}Match_Accuracy_Type" />
+ *                           <attribute name="CWE_ID" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                           <attribute name="CWE_Name" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                         </restriction>
+ *                       </complexContent>
+ *                     </complexType>
+ *                   </element>
+ *                 </sequence>
+ *               </restriction>
+ *             </complexContent>
+ *           </complexType>
+ *         </element>
+ *         <element name="Comments" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *       </sequence>
+ *       <attribute name="CWE_Version" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="Vendor_Name" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="Toolset_Name" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="Toolset_Version" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="Info_URL" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
+ *       <attribute name="Date_of_Claim" type="{http://www.w3.org/2001/XMLSchema}date" />
+ *       <attribute name="Language_Type">
+ *         <simpleType>
+ *           <restriction base="{http://www.w3.org/2001/XMLSchema}string">
+ *             <enumeration value="Source Code"/>
+ *             <enumeration value="Byte Code"/>
+ *             <enumeration value="Binary Code"/>
+ *           </restriction>
+ *         </simpleType>
+ *       </attribute>
+ *       <attribute name="Language" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "CWE_Coverage_ClaimType", propOrder = { + "claims", + "comments" +}) +public class CWECoverageClaimType { + + /** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+     * <complexType>
+     *   <complexContent>
+     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *       <sequence>
+     *         <element name="Claim" maxOccurs="unbounded">
+     *           <complexType>
+     *             <complexContent>
+     *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *                 <sequence>
+     *                   <element name="CWE_Claim_Comments" type="{http://www.w3.org/2001/XMLSchema}string"/>
+     *                   <element name="Rule_Set" minOccurs="0">
+     *                     <complexType>
+     *                       <complexContent>
+     *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *                           <sequence>
+     *                             <element name="Rule" maxOccurs="unbounded">
+     *                               <complexType>
+     *                                 <complexContent>
+     *                                   <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *                                     <sequence>
+     *                                       <element name="Rule_Comments" type="{http://www.w3.org/2001/XMLSchema}string"/>
+     *                                     </sequence>
+     *                                     <attribute name="Rule_ID" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *                                     <attribute name="Rule_Name" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *                                   </restriction>
+     *                                 </complexContent>
+     *                               </complexType>
+     *                             </element>
+     *                           </sequence>
+     *                         </restriction>
+     *                       </complexContent>
+     *                     </complexType>
+     *                   </element>
+     *                 </sequence>
+     *                 <attribute name="Match_Accuracy" use="required" type="{}Match_Accuracy_Type" />
+     *                 <attribute name="CWE_ID" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *                 <attribute name="CWE_Name" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *               </restriction>
+     *             </complexContent>
+     *           </complexType>
+     *         </element>
+     *       </sequence>
+     *     </restriction>
+     *   </complexContent>
+     * </complexType>
+     * 
+ * + * + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = { + "claim" + }) + public static class Claims { + + /** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+         * <complexType>
+         *   <complexContent>
+         *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+         *       <sequence>
+         *         <element name="CWE_Claim_Comments" type="{http://www.w3.org/2001/XMLSchema}string"/>
+         *         <element name="Rule_Set" minOccurs="0">
+         *           <complexType>
+         *             <complexContent>
+         *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+         *                 <sequence>
+         *                   <element name="Rule" maxOccurs="unbounded">
+         *                     <complexType>
+         *                       <complexContent>
+         *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+         *                           <sequence>
+         *                             <element name="Rule_Comments" type="{http://www.w3.org/2001/XMLSchema}string"/>
+         *                           </sequence>
+         *                           <attribute name="Rule_ID" type="{http://www.w3.org/2001/XMLSchema}string" />
+         *                           <attribute name="Rule_Name" type="{http://www.w3.org/2001/XMLSchema}string" />
+         *                         </restriction>
+         *                       </complexContent>
+         *                     </complexType>
+         *                   </element>
+         *                 </sequence>
+         *               </restriction>
+         *             </complexContent>
+         *           </complexType>
+         *         </element>
+         *       </sequence>
+         *       <attribute name="Match_Accuracy" use="required" type="{}Match_Accuracy_Type" />
+         *       <attribute name="CWE_ID" type="{http://www.w3.org/2001/XMLSchema}string" />
+         *       <attribute name="CWE_Name" type="{http://www.w3.org/2001/XMLSchema}string" />
+         *     </restriction>
+         *   </complexContent>
+         * </complexType>
+         * 
+ * + * + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = { + "cweClaimComments", + "ruleSet" + }) + public static class Claim { + + /** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+             * <complexType>
+             *   <complexContent>
+             *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+             *       <sequence>
+             *         <element name="Rule" maxOccurs="unbounded">
+             *           <complexType>
+             *             <complexContent>
+             *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+             *                 <sequence>
+             *                   <element name="Rule_Comments" type="{http://www.w3.org/2001/XMLSchema}string"/>
+             *                 </sequence>
+             *                 <attribute name="Rule_ID" type="{http://www.w3.org/2001/XMLSchema}string" />
+             *                 <attribute name="Rule_Name" type="{http://www.w3.org/2001/XMLSchema}string" />
+             *               </restriction>
+             *             </complexContent>
+             *           </complexType>
+             *         </element>
+             *       </sequence>
+             *     </restriction>
+             *   </complexContent>
+             * </complexType>
+             * 
+ * + * + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = { + "rule" + }) + public static class RuleSet { + + /** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+                 * <complexType>
+                 *   <complexContent>
+                 *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+                 *       <sequence>
+                 *         <element name="Rule_Comments" type="{http://www.w3.org/2001/XMLSchema}string"/>
+                 *       </sequence>
+                 *       <attribute name="Rule_ID" type="{http://www.w3.org/2001/XMLSchema}string" />
+                 *       <attribute name="Rule_Name" type="{http://www.w3.org/2001/XMLSchema}string" />
+                 *     </restriction>
+                 *   </complexContent>
+                 * </complexType>
+                 * 
+ * + * + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = { + "ruleComments" + }) + public static class Rule { + + @XmlElement(name = "Rule_Comments", required = true) + protected String ruleComments; + @XmlAttribute(name = "Rule_ID") + protected String ruleID; + @XmlAttribute(name = "Rule_Name") + protected String ruleName; + + /** + * Gets the value of the ruleComments property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getRuleComments() { + return ruleComments; + } + + /** + * Gets the value of the ruleID property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getRuleID() { + return ruleID; + } + + /** + * Gets the value of the ruleName property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getRuleName() { + return ruleName; + } + + /** + * Sets the value of the ruleComments property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setRuleComments(String value) { + this.ruleComments = value; + } + + /** + * Sets the value of the ruleID property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setRuleID(String value) { + this.ruleID = value; + } + + /** + * Sets the value of the ruleName property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setRuleName(String value) { + this.ruleName = value; + } + + } + + @XmlElement(name = "Rule", required = true) + protected List rule; + + + /** + * Gets the value of the rule property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the rule property. + * + *

+ * For example, to add a new item, do as follows: + *

+                 *    getRule().add(newItem);
+                 * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link CWECoverageClaimType.Claims.Claim.RuleSet.Rule } + * + * + */ + public List getRule() { + if (rule == null) { + rule = new ArrayList(); + } + return this.rule; + } + + } + @XmlElement(name = "CWE_Claim_Comments", required = true) + protected String cweClaimComments; + @XmlElement(name = "Rule_Set") + protected CWECoverageClaimType.Claims.Claim.RuleSet ruleSet; + @XmlAttribute(name = "Match_Accuracy", required = true) + protected MatchAccuracyType matchAccuracy; + @XmlAttribute(name = "CWE_ID") + protected String cweid; + + @XmlAttribute(name = "CWE_Name") + protected String cweName; + + /** + * Gets the value of the cweClaimComments property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getCWEClaimComments() { + return cweClaimComments; + } + + /** + * Gets the value of the cweid property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getCWEID() { + return cweid; + } + + /** + * Gets the value of the cweName property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getCWEName() { + return cweName; + } + + /** + * Gets the value of the matchAccuracy property. + * + * @return + * possible object is + * {@link MatchAccuracyType } + * + */ + public MatchAccuracyType getMatchAccuracy() { + return matchAccuracy; + } + + /** + * Gets the value of the ruleSet property. + * + * @return + * possible object is + * {@link CWECoverageClaimType.Claims.Claim.RuleSet } + * + */ + public CWECoverageClaimType.Claims.Claim.RuleSet getRuleSet() { + return ruleSet; + } + + /** + * Sets the value of the cweClaimComments property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setCWEClaimComments(String value) { + this.cweClaimComments = value; + } + + /** + * Sets the value of the cweid property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setCWEID(String value) { + this.cweid = value; + } + + /** + * Sets the value of the cweName property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setCWEName(String value) { + this.cweName = value; + } + + /** + * Sets the value of the matchAccuracy property. + * + * @param value + * allowed object is + * {@link MatchAccuracyType } + * + */ + public void setMatchAccuracy(MatchAccuracyType value) { + this.matchAccuracy = value; + } + + + /** + * Sets the value of the ruleSet property. + * + * @param value + * allowed object is + * {@link CWECoverageClaimType.Claims.Claim.RuleSet } + * + */ + public void setRuleSet(CWECoverageClaimType.Claims.Claim.RuleSet value) { + this.ruleSet = value; + } + + } + + @XmlElement(name = "Claim", required = true) + protected List claim; + + + /** + * Gets the value of the claim property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the claim property. + * + *

+ * For example, to add a new item, do as follows: + *

+         *    getClaim().add(newItem);
+         * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link CWECoverageClaimType.Claims.Claim } + * + * + */ + public List getClaim() { + if (claim == null) { + claim = new ArrayList(); + } + return this.claim; + } + + } + @XmlElement(name = "Claims", required = true) + protected CWECoverageClaimType.Claims claims; + @XmlElement(name = "Comments") + protected String comments; + @XmlAttribute(name = "CWE_Version") + protected String cweVersion; + @XmlAttribute(name = "Vendor_Name") + protected String vendorName; + @XmlAttribute(name = "Toolset_Name") + protected String toolsetName; + @XmlAttribute(name = "Toolset_Version") + protected String toolsetVersion; + @XmlAttribute(name = "Info_URL") + @XmlSchemaType(name = "anyURI") + protected String infoURL; + @XmlAttribute(name = "Date_of_Claim") + @XmlSchemaType(name = "date") + protected XMLGregorianCalendar dateOfClaim; + @XmlAttribute(name = "Language_Type") + protected String languageType; + + @XmlAttribute(name = "Language") + protected String language; + + /** + * Gets the value of the claims property. + * + * @return + * possible object is + * {@link CWECoverageClaimType.Claims } + * + */ + public CWECoverageClaimType.Claims getClaims() { + return claims; + } + + /** + * Gets the value of the comments property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getComments() { + return comments; + } + + /** + * Gets the value of the cweVersion property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getCWEVersion() { + return cweVersion; + } + + /** + * Gets the value of the dateOfClaim property. + * + * @return + * possible object is + * {@link XMLGregorianCalendar } + * + */ + public XMLGregorianCalendar getDateOfClaim() { + return dateOfClaim; + } + + /** + * Gets the value of the infoURL property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getInfoURL() { + return infoURL; + } + + /** + * Gets the value of the language property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getLanguage() { + return language; + } + + /** + * Gets the value of the languageType property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getLanguageType() { + return languageType; + } + + /** + * Gets the value of the toolsetName property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getToolsetName() { + return toolsetName; + } + + /** + * Gets the value of the toolsetVersion property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getToolsetVersion() { + return toolsetVersion; + } + + /** + * Gets the value of the vendorName property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getVendorName() { + return vendorName; + } + + /** + * Sets the value of the claims property. + * + * @param value + * allowed object is + * {@link CWECoverageClaimType.Claims } + * + */ + public void setClaims(CWECoverageClaimType.Claims value) { + this.claims = value; + } + + /** + * Sets the value of the comments property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setComments(String value) { + this.comments = value; + } + + /** + * Sets the value of the cweVersion property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setCWEVersion(String value) { + this.cweVersion = value; + } + + /** + * Sets the value of the dateOfClaim property. + * + * @param value + * allowed object is + * {@link XMLGregorianCalendar } + * + */ + public void setDateOfClaim(XMLGregorianCalendar value) { + this.dateOfClaim = value; + } + + /** + * Sets the value of the infoURL property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setInfoURL(String value) { + this.infoURL = value; + } + + /** + * Sets the value of the language property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setLanguage(String value) { + this.language = value; + } + + /** + * Sets the value of the languageType property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setLanguageType(String value) { + this.languageType = value; + } + + /** + * Sets the value of the toolsetName property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setToolsetName(String value) { + this.toolsetName = value; + } + + /** + * Sets the value of the toolsetVersion property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setToolsetVersion(String value) { + this.toolsetVersion = value; + } + + + /** + * Sets the value of the vendorName property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setVendorName(String value) { + this.vendorName = value; + } + + +} diff --git a/com.kdmanalytics.toif.ccr/src/generated/CWECoverageClaims.java b/com.kdmanalytics.toif.ccr/src/generated/CWECoverageClaims.java new file mode 100644 index 00000000..a53ab7d9 --- /dev/null +++ b/com.kdmanalytics.toif.ccr/src/generated/CWECoverageClaims.java @@ -0,0 +1,84 @@ +/******************************************************************************* + * Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This program and the + * accompanying materials are made available under the terms of the Open Source + * Initiative OSI - Open Software License v3.0 which accompanies this + * distribution, and is available at http://www.opensource.org/licenses/osl-3.0.php/ + ******************************************************************************/ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2012.03.30 at 02:17:16 PM EDT +// + + +package generated; + +import java.util.ArrayList; +import java.util.List; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="CWE_Coverage_Claim" type="{}CWE_Coverage_ClaimType" maxOccurs="unbounded"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "", propOrder = { + "cweCoverageClaim" +}) +@XmlRootElement(name = "CWE_Coverage_Claims") +public class CWECoverageClaims { + + @XmlElement(name = "CWE_Coverage_Claim", required = true) + protected List cweCoverageClaim; + + /** + * Gets the value of the cweCoverageClaim property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the cweCoverageClaim property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getCWECoverageClaim().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link CWECoverageClaimType } + * + * + */ + public List getCWECoverageClaim() { + if (cweCoverageClaim == null) { + cweCoverageClaim = new ArrayList(); + } + return this.cweCoverageClaim; + } + +} diff --git a/com.kdmanalytics.toif.ccr/src/generated/CWE_Coverage_Claims_Schema_v0.3.xsd b/com.kdmanalytics.toif.ccr/src/generated/CWE_Coverage_Claims_Schema_v0.3.xsd new file mode 100644 index 00000000..9aaecfab --- /dev/null +++ b/com.kdmanalytics.toif.ccr/src/generated/CWE_Coverage_Claims_Schema_v0.3.xsd @@ -0,0 +1,217 @@ + + + + + + + + + + + + + + + + + + + + vendor comments for overall claim + + + + + + each CWE can be covered by one or more + "rules" + + + + + + + + + comment for each rule allows + vendors to explain what they look for in more + detail + + + + + + vendor may or may not have ID's + + + + + + + + + + + + + Strength/accuracy of the covered rules to + the CWE entry. + + + + + unique identifier of the CWE being covered + + + + + + name of the CWE being covered (included + for better readability) + + + + + + + + + + Optional comments for the entire set of claims. + + + + + + + all claims are made against a specific version of + CWE + + + + + all claims are specific to a specific vendor + + + + + all claims are specific to a specific named tool set + + + + + + all claims are specific to a specific tool set version + + + + + + a URI that contains more details, or a human-friendly version of + this coverage claim + + + + + claims are made as of a date (NOT IN THE FUTURE!) + + + + + + all claims are made against a specific type of + language + + + + + + + + + + + + all claims are made against a specific language + + + + + + Archetype_Type contains values for the Archetype of the system + described by the vignette + + + + + The CWE entry exactly covers the same weakness(es) as the + given rule set. + + + + + The CWE entry covers more concepts than the given rule set, + but there are not any more precise matches available. For example, a rule + set might detect resource consumption for a resource that is not + specifically covered by CWE. + + + + + The CWE entry is more specific than the weakness reported by + the given rule set, but the entry's parent(s) are not appropriate matches. + This might indicate a difference in perspective between CWE and the + capability providing the coverage mapping. It could also include a single + rule that covers multiple CWE entries (which might imply that there would be + multiple claims for a single rule/ruleset). + + + + + The CWE entry is only a partial match with the weakness + reported by the given rule set, but the entry is the closest available + match. + + + + + The CWE entry is not covered by any rule set. The provider is + not required to include information about uncovered CWEs. + + + + + There is no CWE entry available that closely matches the + weakness reported by the given rule set, but the provider believes that a + CWE entry should exist for the reported weakness. The associated CWE_ID + should be 0. + + + + + The rule/ruleset is not applicable to CWE, i.e., it is not + necessarily about a weakness. This could include rulesets related to coding + style conformance, informational messages about the scan, etc. The + associated CWE_ID should be -1. The provider is not required to include + information about non-applicable rules. + + + + + The match accuracy is unknown. Typically this would be used by + a third party who is creating a coverage claim and does not have insight + into the technology. + + + + + No other CWE match accuracy type is + applicable. + + + + + diff --git a/com.kdmanalytics.toif.ccr/src/generated/MatchAccuracyType.java b/com.kdmanalytics.toif.ccr/src/generated/MatchAccuracyType.java new file mode 100644 index 00000000..83d4c8ba --- /dev/null +++ b/com.kdmanalytics.toif.ccr/src/generated/MatchAccuracyType.java @@ -0,0 +1,152 @@ +/******************************************************************************* + * Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This program and the + * accompanying materials are made available under the terms of the Open Source + * Initiative OSI - Open Software License v3.0 which accompanies this + * distribution, and is available at http://www.opensource.org/licenses/osl-3.0.php/ + ******************************************************************************/ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2012.03.30 at 02:17:16 PM EDT +// + + +package generated; + +import javax.xml.bind.annotation.XmlEnum; +import javax.xml.bind.annotation.XmlEnumValue; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for Match_Accuracy_Type. + * + *

The following schema fragment specifies the expected content contained within this class. + *

+ *

+ * <simpleType name="Match_Accuracy_Type">
+ *   <restriction base="{http://www.w3.org/2001/XMLSchema}string">
+ *     <enumeration value="Exact"/>
+ *     <enumeration value="CWE-more-abstract"/>
+ *     <enumeration value="CWE-more-specific"/>
+ *     <enumeration value="CWE-partial"/>
+ *     <enumeration value="Not-Covered"/>
+ *     <enumeration value="No-CWE-available"/>
+ *     <enumeration value="Not-CWE-applicable"/>
+ *     <enumeration value="Unknown"/>
+ *     <enumeration value="Other"/>
+ *   </restriction>
+ * </simpleType>
+ * 
+ * + */ +@XmlType(name = "Match_Accuracy_Type") +@XmlEnum +public enum MatchAccuracyType { + + + /** + * The CWE entry exactly covers the same weakness(es) as the + * given rule set. + * + */ + @XmlEnumValue("Exact") + EXACT("Exact"), + + /** + * The CWE entry covers more concepts than the given rule set, + * but there are not any more precise matches available. For example, a rule + * set might detect resource consumption for a resource that is not + * specifically covered by CWE. + * + */ + @XmlEnumValue("CWE-more-abstract") + CWE_MORE_ABSTRACT("CWE-more-abstract"), + + /** + * The CWE entry is more specific than the weakness reported by + * the given rule set, but the entry's parent(s) are not appropriate matches. + * This might indicate a difference in perspective between CWE and the + * capability providing the coverage mapping. It could also include a single + * rule that covers multiple CWE entries (which might imply that there would be + * multiple claims for a single rule/ruleset). + * + */ + @XmlEnumValue("CWE-more-specific") + CWE_MORE_SPECIFIC("CWE-more-specific"), + + /** + * The CWE entry is only a partial match with the weakness + * reported by the given rule set, but the entry is the closest available + * match. + * + */ + @XmlEnumValue("CWE-partial") + CWE_PARTIAL("CWE-partial"), + + /** + * The CWE entry is not covered by any rule set. The provider is + * not required to include information about uncovered CWEs. + * + */ + @XmlEnumValue("Not-Covered") + NOT_COVERED("Not-Covered"), + + /** + * There is no CWE entry available that closely matches the + * weakness reported by the given rule set, but the provider believes that a + * CWE entry should exist for the reported weakness. The associated CWE_ID + * should be 0. + * + */ + @XmlEnumValue("No-CWE-available") + NO_CWE_AVAILABLE("No-CWE-available"), + + /** + * The rule/ruleset is not applicable to CWE, i.e., it is not + * necessarily about a weakness. This could include rulesets related to coding + * style conformance, informational messages about the scan, etc. The + * associated CWE_ID should be -1. The provider is not required to include + * information about non-applicable rules. + * + */ + @XmlEnumValue("Not-CWE-applicable") + NOT_CWE_APPLICABLE("Not-CWE-applicable"), + + /** + * The match accuracy is unknown. Typically this would be used by + * a third party who is creating a coverage claim and does not have insight + * into the technology. + * + */ + @XmlEnumValue("Unknown") + UNKNOWN("Unknown"), + + /** + * No other CWE match accuracy type is + * applicable. + * + */ + @XmlEnumValue("Other") + OTHER("Other"); + private final String value; + + MatchAccuracyType(String v) { + value = v; + } + + public String value() { + return value; + } + + public static MatchAccuracyType fromValue(String v) { + for (MatchAccuracyType c: MatchAccuracyType.values()) { + if (c.value.equals(v)) { + return c; + } + } + throw new IllegalArgumentException(v); + } + +} diff --git a/com.kdmanalytics.toif.ccr/src/generated/ObjectFactory.java b/com.kdmanalytics.toif.ccr/src/generated/ObjectFactory.java new file mode 100644 index 00000000..808134bf --- /dev/null +++ b/com.kdmanalytics.toif.ccr/src/generated/ObjectFactory.java @@ -0,0 +1,93 @@ +/******************************************************************************* + * Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This program and the + * accompanying materials are made available under the terms of the Open Source + * Initiative OSI - Open Software License v3.0 which accompanies this + * distribution, and is available at http://www.opensource.org/licenses/osl-3.0.php/ + ******************************************************************************/ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2012.03.30 at 02:17:16 PM EDT +// + + +package generated; + +import javax.xml.bind.annotation.XmlRegistry; + + +/** + * This object contains factory methods for each + * Java content interface and Java element interface + * generated in the generated package. + *

An ObjectFactory allows you to programatically + * construct new instances of the Java representation + * for XML content. The Java representation of XML + * content can consist of schema derived interfaces + * and classes representing the binding of schema + * type definitions, element declarations and model + * groups. Factory methods for each of these are + * provided in this class. + * + */ +@XmlRegistry +public class ObjectFactory { + + + /** + * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: generated + * + */ + public ObjectFactory() { + } + + /** + * Create an instance of {@link CWECoverageClaims } + * + */ + public CWECoverageClaims createCWECoverageClaims() { + return new CWECoverageClaims(); + } + + /** + * Create an instance of {@link CWECoverageClaimType.Claims.Claim.RuleSet.Rule } + * + */ + public CWECoverageClaimType.Claims.Claim.RuleSet.Rule createCWECoverageClaimTypeClaimsClaimRuleSetRule() { + return new CWECoverageClaimType.Claims.Claim.RuleSet.Rule(); + } + + /** + * Create an instance of {@link CWECoverageClaimType.Claims.Claim.RuleSet } + * + */ + public CWECoverageClaimType.Claims.Claim.RuleSet createCWECoverageClaimTypeClaimsClaimRuleSet() { + return new CWECoverageClaimType.Claims.Claim.RuleSet(); + } + + /** + * Create an instance of {@link CWECoverageClaimType.Claims.Claim } + * + */ + public CWECoverageClaimType.Claims.Claim createCWECoverageClaimTypeClaimsClaim() { + return new CWECoverageClaimType.Claims.Claim(); + } + + /** + * Create an instance of {@link CWECoverageClaimType } + * + */ + public CWECoverageClaimType createCWECoverageClaimType() { + return new CWECoverageClaimType(); + } + + /** + * Create an instance of {@link CWECoverageClaimType.Claims } + * + */ + public CWECoverageClaimType.Claims createCWECoverageClaimTypeClaims() { + return new CWECoverageClaimType.Claims(); + } + +} diff --git a/com.kdmanalytics.toif.ccr/target/MANIFEST.MF b/com.kdmanalytics.toif.ccr/target/MANIFEST.MF new file mode 100644 index 00000000..ce1ccb9d --- /dev/null +++ b/com.kdmanalytics.toif.ccr/target/MANIFEST.MF @@ -0,0 +1,15 @@ +Manifest-Version: 1.0 +Export-Package: com.kdmanalytics.toif.ccr +Require-Bundle: org.eclipse.ui;bundle-version="[3.7.0,4.2.0)",org.ecli + pse.core.runtime;bundle-version="[3.7.0,4.2.0)",org.openrdf.sesame;bu + ndle-version="[2.4.0,2.5.0)",org.apache.log4j;bundle-version="[1.2.0, + 1.3.0)" +Bundle-Vendor: KDM Analytics Inc. +Bundle-ActivationPolicy: lazy +Bundle-Version: 1.15.5 +Bundle-Name: TOIF Code Coverage report +Bundle-Activator: com.kdmanalytics.toif.ccr.Activator +Bundle-ManifestVersion: 2 +Bundle-SymbolicName: com.kdmanalytics.toif.ccr;singleton:=true +Bundle-RequiredExecutionEnvironment: JavaSE-1.6 + diff --git a/com.kdmanalytics.toif.ccr/target/classes/com/kdmanalytics/toif/ccr/Activator.class b/com.kdmanalytics.toif.ccr/target/classes/com/kdmanalytics/toif/ccr/Activator.class new file mode 100644 index 00000000..7633a465 Binary files /dev/null and b/com.kdmanalytics.toif.ccr/target/classes/com/kdmanalytics/toif/ccr/Activator.class differ diff --git a/com.kdmanalytics.toif.ccr/target/classes/com/kdmanalytics/toif/ccr/CoverageClaimGenerator.class b/com.kdmanalytics.toif.ccr/target/classes/com/kdmanalytics/toif/ccr/CoverageClaimGenerator.class new file mode 100644 index 00000000..1d98c4b4 Binary files /dev/null and b/com.kdmanalytics.toif.ccr/target/classes/com/kdmanalytics/toif/ccr/CoverageClaimGenerator.class differ diff --git a/com.kdmanalytics.toif.ccr/target/classes/com/kdmanalytics/toif/ccr/CweToName.class b/com.kdmanalytics.toif.ccr/target/classes/com/kdmanalytics/toif/ccr/CweToName.class new file mode 100644 index 00000000..6b3d1eb6 Binary files /dev/null and b/com.kdmanalytics.toif.ccr/target/classes/com/kdmanalytics/toif/ccr/CweToName.class differ diff --git a/com.kdmanalytics.toif.ccr/target/classes/config/CweIdToName b/com.kdmanalytics.toif.ccr/target/classes/config/CweIdToName new file mode 100644 index 00000000..1ba83074 --- /dev/null +++ b/com.kdmanalytics.toif.ccr/target/classes/config/CweIdToName @@ -0,0 +1,886 @@ +1=Location +2=Environment +3=Technology-specific Environment Issues +4=J2EE Environment Issues +5=J2EE Misconfiguration: Data Transmission Without Encryption +6=J2EE Misconfiguration: Insufficient Session-ID Length +7=J2EE Misconfiguration: Missing Custom Error Page +8=J2EE Misconfiguration: Entity Bean Declared Remote +9=J2EE Misconfiguration: Weak Access Permissions for EJB Methods +10=ASP.NET Environment Issues +11=ASP.NET Misconfiguration: Creating Debug Binary +12=ASP.NET Misconfiguration: Missing Custom Error Page +13=ASP.NET Misconfiguration: Password in Configuration File +14=Compiler Removal of Code to Clear Buffers +15=External Control of System or Configuration Setting +16=Configuration +17=Code +18=Source Code +19=Data Handling +20=Improper Input Validation +21=Pathname Traversal and Equivalence Errors +22=Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') +23=Relative Path Traversal +24=Path Traversal: '../filedir' +25=Path Traversal: '/../filedir' +26=Path Traversal: '/dir/../filename' +27=Path Traversal: 'dir/../../filename' +28=Path Traversal: '..\filedir' +29=Path Traversal: '\..\filename' +30=Path Traversal: '\dir\..\filename' +31=Path Traversal: 'dir\..\..\filename' +32=Path Traversal: '...' (Triple Dot) +33=Path Traversal: '....' (Multiple Dot) +34=Path Traversal: '....//' +35=Path Traversal: '.../...//' +36=Absolute Path Traversal +37=Path Traversal: '/absolute/pathname/here' +38=Path Traversal: '\absolute\pathname\here' +39=Path Traversal: 'C:dirname' +40=Path Traversal: '\\UNC\share\name\' (Windows UNC Share) +41=Improper Resolution of Path Equivalence +42=Path Equivalence: 'filename.' (Trailing Dot) +43=Path Equivalence: 'filename....' (Multiple Trailing Dot) +44=Path Equivalence: 'file.name' (Internal Dot) +45=Path Equivalence: 'file...name' (Multiple Internal Dot) +46=Path Equivalence: 'filename ' (Trailing Space) +47=Path Equivalence: ' filename' (Leading Space) +48=Path Equivalence: 'file name' (Internal Whitespace) +49=Path Equivalence: 'filename/' (Trailing Slash) +50=Path Equivalence: '//multiple/leading/slash' +51=Path Equivalence: '/multiple//internal/slash' +52=Path Equivalence: '/multiple/trailing/slash//' +53=Path Equivalence: '\multiple\\internal\backslash' +54=Path Equivalence: 'filedir\' (Trailing Backslash) +55=Path Equivalence: '/./' (Single Dot Directory) +56=Path Equivalence: 'filedir*' (Wildcard) +57=Path Equivalence: 'fakedir/../realdir/filename' +58=Path Equivalence: Windows 8.3 Filename +59=Improper Link Resolution Before File Access ('Link Following') +60=UNIX Path Link Problems +61=UNIX Symbolic Link (Symlink) Following +62=UNIX Hard Link +63=Windows Path Link Problems +64=Windows Shortcut Following (.LNK) +65=Windows Hard Link +66=Improper Handling of File Names that Identify Virtual Resources +67=Improper Handling of Windows Device Names +68=Windows Virtual File Problems +69=Improper Handling of Windows ::DATA Alternate Data Stream +70=Mac Virtual File Problems +71=Apple '.DS_Store' +72=Improper Handling of Apple HFS+ Alternate Data Stream Path +73=External Control of File Name or Path +74=Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection') +75=Failure to Sanitize Special Elements into a Different Plane (Special Element Injection) +76=Improper Neutralization of Equivalent Special Elements +77=Improper Neutralization of Special Elements used in a Command ('Command Injection') +78=Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection') +79=Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') +80=Improper Neutralization of Script-Related HTML Tags in a Web Page (Basic XSS) +81=Improper Neutralization of Script in an Error Message Web Page +82=Improper Neutralization of Script in Attributes of IMG Tags in a Web Page +83=Improper Neutralization of Script in Attributes in a Web Page +84=Improper Neutralization of Encoded URI Schemes in a Web Page +85=Doubled Character XSS Manipulations +86=Improper Neutralization of Invalid Characters in Identifiers in Web Pages +87=Improper Neutralization of Alternate XSS Syntax +88=Argument Injection or Modification +89=Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection') +90=Improper Neutralization of Special Elements used in an LDAP Query ('LDAP Injection') +91=XML Injection (aka Blind XPath Injection) +92=DEPRECATED: Improper Sanitization of Custom Special Characters +93=Improper Neutralization of CRLF Sequences ('CRLF Injection') +94=Improper Control of Generation of Code ('Code Injection') +95=Improper Neutralization of Directives in Dynamically Evaluated Code ('Eval Injection') +96=Improper Neutralization of Directives in Statically Saved Code ('Static Code Injection') +97=Improper Neutralization of Server-Side Includes (SSI) Within a Web Page +98=Improper Control of Filename for Include/Require Statement in PHP Program ('PHP File Inclusion') +99=Improper Control of Resource Identifiers ('Resource Injection') +100=Technology-Specific Input Validation Problems +101=Struts Validation Problems +102=Struts: Duplicate Validation Forms +103=Struts: Incomplete validate() Method Definition +104=Struts: Form Bean Does Not Extend Validation Class +105=Struts: Form Field Without Validator +106=Struts: Plug-in Framework not in Use +107=Struts: Unused Validation Form +108=Struts: Unvalidated Action Form +109=Struts: Validator Turned Off +110=Struts: Validator Without Form Field +111=Direct Use of Unsafe JNI +112=Missing XML Validation +113=Improper Neutralization of CRLF Sequences in HTTP Headers ('HTTP Response Splitting') +114=Process Control +115=Misinterpretation of Input +116=Improper Encoding or Escaping of Output +117=Improper Output Neutralization for Logs +118=Improper Access of Indexable Resource ('Range Error') +119=Improper Restriction of Operations within the Bounds of a Memory Buffer +120=Buffer Copy without Checking Size of Input ('Classic Buffer Overflow') +121=Stack-based Buffer Overflow +122=Heap-based Buffer Overflow +123=Write-what-where Condition +124=Buffer Underwrite ('Buffer Underflow') +125=Out-of-bounds Read +126=Buffer Over-read +127=Buffer Under-read +128=Wrap-around Error +129=Improper Validation of Array Index +130=Improper Handling of Length Parameter Inconsistency +131=Incorrect Calculation of Buffer Size +132=DEPRECATED (Duplicate): Miscalculated Null Termination +133=String Errors +134=Uncontrolled Format String +135=Incorrect Calculation of Multi-Byte String Length +136=Type Errors +137=Representation Errors +138=Improper Neutralization of Special Elements +139=DEPRECATED: General Special Element Problems +140=Improper Neutralization of Delimiters +141=Improper Neutralization of Parameter/Argument Delimiters +142=Improper Neutralization of Value Delimiters +143=Improper Neutralization of Record Delimiters +144=Improper Neutralization of Line Delimiters +145=Improper Neutralization of Section Delimiters +146=Improper Neutralization of Expression/Command Delimiters +147=Improper Neutralization of Input Terminators +148=Improper Neutralization of Input Leaders +149=Improper Neutralization of Quoting Syntax +150=Improper Neutralization of Escape, Meta, or Control Sequences +151=Improper Neutralization of Comment Delimiters +152=Improper Neutralization of Macro Symbols +153=Improper Neutralization of Substitution Characters +154=Improper Neutralization of Variable Name Delimiters +155=Improper Neutralization of Wildcards or Matching Symbols +156=Improper Neutralization of Whitespace +157=Failure to Sanitize Paired Delimiters +158=Improper Neutralization of Null Byte or NUL Character +159=Failure to Sanitize Special Element +160=Improper Neutralization of Leading Special Elements +161=Improper Neutralization of Multiple Leading Special Elements +162=Improper Neutralization of Trailing Special Elements +163=Improper Neutralization of Multiple Trailing Special Elements +164=Improper Neutralization of Internal Special Elements +165=Improper Neutralization of Multiple Internal Special Elements +166=Improper Handling of Missing Special Element +167=Improper Handling of Additional Special Element +168=Improper Handling of Inconsistent Special Elements +169=Technology-Specific Special Elements +170=Improper Null Termination +171=Cleansing, Canonicalization, and Comparison Errors +172=Encoding Error +173=Improper Handling of Alternate Encoding +174=Double Decoding of the Same Data +175=Improper Handling of Mixed Encoding +176=Improper Handling of Unicode Encoding +177=Improper Handling of URL Encoding (Hex Encoding) +178=Improper Handling of Case Sensitivity +179=Incorrect Behavior Order: Early Validation +180=Incorrect Behavior Order: Validate Before Canonicalize +181=Incorrect Behavior Order: Validate Before Filter +182=Collapse of Data into Unsafe Value +183=Permissive Whitelist +184=Incomplete Blacklist +185=Incorrect Regular Expression +186=Overly Restrictive Regular Expression +187=Partial Comparison +188=Reliance on Data/Memory Layout +189=Numeric Errors +190=Integer Overflow or Wraparound +191=Integer Underflow (Wrap or Wraparound) +192=Integer Coercion Error +193=Off-by-one Error +194=Unexpected Sign Extension +195=Signed to Unsigned Conversion Error +196=Unsigned to Signed Conversion Error +197=Numeric Truncation Error +198=Use of Incorrect Byte Ordering +199=Information Management Errors +200=Information Exposure +201=Information Exposure Through Sent Data +202=Exposure of Sensitive Data Through Data Queries +203=Information Exposure Through Discrepancy +204=Response Discrepancy Information Exposure +205=Information Exposure Through Behavioral Discrepancy +206=Information Exposure of Internal State Through Behavioral Inconsistency +207=Information Exposure Through an External Behavioral Inconsistency +208=Information Exposure Through Timing Discrepancy +209=Information Exposure Through an Error Message +210=Information Exposure Through Generated Error Message +211=Information Exposure Through External Error Message +212=Improper Cross-boundary Removal of Sensitive Data +213=Intentional Information Exposure +214=Information Exposure Through Process Environment +215=Information Exposure Through Debug Information +216=Containment Errors (Container Errors) +217=DEPRECATED: Failure to Protect Stored Data from Modification +218=DEPRECATED (Duplicate): Failure to provide confidentiality for stored data +219=Sensitive Data Under Web Root +220=Sensitive Data Under FTP Root +221=Information Loss or Omission +222=Truncation of Security-relevant Information +223=Omission of Security-relevant Information +224=Obscured Security-relevant Information by Alternate Name +225=DEPRECATED (Duplicate): General Information Management Problems +226=Sensitive Information Uncleared Before Release +227=Improper Fulfillment of API Contract ('API Abuse') +228=Improper Handling of Syntactically Invalid Structure +229=Improper Handling of Values +230=Improper Handling of Missing Values +231=Improper Handling of Extra Values +232=Improper Handling of Undefined Values +233=Parameter Problems +234=Failure to Handle Missing Parameter +235=Improper Handling of Extra Parameters +236=Improper Handling of Undefined Parameters +237=Improper Handling of Structural Elements +238=Improper Handling of Incomplete Structural Elements +239=Failure to Handle Incomplete Element +240=Improper Handling of Inconsistent Structural Elements +241=Improper Handling of Unexpected Data Type +242=Use of Inherently Dangerous Function +243=Creation of chroot Jail Without Changing Working Directory +244=Improper Clearing of Heap Memory Before Release ('Heap Inspection') +245=J2EE Bad Practices: Direct Management of Connections +246=J2EE Bad Practices: Direct Use of Sockets +247=Reliance on DNS Lookups in a Security Decision +248=Uncaught Exception +249=DEPRECATED: Often Misused: Path Manipulation +250=Execution with Unnecessary Privileges +251=Often Misused: String Management +252=Unchecked Return Value +253=Incorrect Check of Function Return Value +254=Security Features +255=Credentials Management +256=Plaintext Storage of a Password +257=Storing Passwords in a Recoverable Format +258=Empty Password in Configuration File +259=Use of Hard-coded Password +260=Password in Configuration File +261=Weak Cryptography for Passwords +262=Not Using Password Aging +263=Password Aging with Long Expiration +264=Permissions, Privileges, and Access Controls +265=Privilege / Sandbox Issues +266=Incorrect Privilege Assignment +267=Privilege Defined With Unsafe Actions +268=Privilege Chaining +269=Improper Privilege Management +270=Privilege Context Switching Error +271=Privilege Dropping / Lowering Errors +272=Least Privilege Violation +273=Improper Check for Dropped Privileges +274=Improper Handling of Insufficient Privileges +275=Permission Issues +276=Incorrect Default Permissions +277=Insecure Inherited Permissions +278=Insecure Preserved Inherited Permissions +279=Incorrect Execution-Assigned Permissions +280=Improper Handling of Insufficient Permissions or Privileges +281=Improper Preservation of Permissions +282=Improper Ownership Management +283=Unverified Ownership +284=Improper Access Control +285=Improper Authorization +286=Incorrect User Management +287=Improper Authentication +288=Authentication Bypass Using an Alternate Path or Channel +289=Authentication Bypass by Alternate Name +290=Authentication Bypass by Spoofing +291=Trusting Self-reported IP Address +292=Trusting Self-reported DNS Name +293=Using Referer Field for Authentication +294=Authentication Bypass by Capture-replay +295=Certificate Issues +296=Improper Following of Chain of Trust for Certificate Validation +297=Improper Validation of Host-specific Certificate Data +298=Improper Validation of Certificate Expiration +299=Improper Check for Certificate Revocation +300=Channel Accessible by Non-Endpoint ('Man-in-the-Middle') +301=Reflection Attack in an Authentication Protocol +302=Authentication Bypass by Assumed-Immutable Data +303=Incorrect Implementation of Authentication Algorithm +304=Missing Critical Step in Authentication +305=Authentication Bypass by Primary Weakness +306=Missing Authentication for Critical Function +307=Improper Restriction of Excessive Authentication Attempts +308=Use of Single-factor Authentication +309=Use of Password System for Primary Authentication +310=Cryptographic Issues +311=Missing Encryption of Sensitive Data +312=Cleartext Storage of Sensitive Information +313=Plaintext Storage in a File or on Disk +314=Plaintext Storage in the Registry +315=Plaintext Storage in a Cookie +316=Plaintext Storage in Memory +317=Plaintext Storage in GUI +318=Plaintext Storage in Executable +319=Cleartext Transmission of Sensitive Information +320=Key Management Errors +321=Use of Hard-coded Cryptographic Key +322=Key Exchange without Entity Authentication +323=Reusing a Nonce, Key Pair in Encryption +324=Use of a Key Past its Expiration Date +325=Missing Required Cryptographic Step +326=Inadequate Encryption Strength +327=Use of a Broken or Risky Cryptographic Algorithm +328=Reversible One-Way Hash +329=Not Using a Random IV with CBC Mode +330=Use of Insufficiently Random Values +331=Insufficient Entropy +332=Insufficient Entropy in PRNG +333=Improper Handling of Insufficient Entropy in TRNG +334=Small Space of Random Values +335=PRNG Seed Error +336=Same Seed in PRNG +337=Predictable Seed in PRNG +338=Use of Cryptographically Weak PRNG +339=Small Seed Space in PRNG +340=Predictability Problems +341=Predictable from Observable State +342=Predictable Exact Value from Previous Values +343=Predictable Value Range from Previous Values +344=Use of Invariant Value in Dynamically Changing Context +345=Insufficient Verification of Data Authenticity +346=Origin Validation Error +347=Improper Verification of Cryptographic Signature +348=Use of Less Trusted Source +349=Acceptance of Extraneous Untrusted Data With Trusted Data +350=Improperly Trusted Reverse DNS +351=Insufficient Type Distinction +352=Cross-Site Request Forgery (CSRF) +353=Missing Support for Integrity Check +354=Improper Validation of Integrity Check Value +355=User Interface Security Issues +356=Product UI does not Warn User of Unsafe Actions +357=Insufficient UI Warning of Dangerous Operations +358=Improperly Implemented Security Check for Standard +359=Privacy Violation +360=Trust of System Event Data +361=Time and State +362=Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition') +363=Race Condition Enabling Link Following +364=Signal Handler Race Condition +365=Race Condition in Switch +366=Race Condition within a Thread +367=Time-of-check Time-of-use (TOCTOU) Race Condition +368=Context Switching Race Condition +369=Divide By Zero +370=Missing Check for Certificate Revocation after Initial Check +371=State Issues +372=Incomplete Internal State Distinction +373=DEPRECATED: State Synchronization Error +374=Passing Mutable Objects to an Untrusted Method +375=Returning a Mutable Object to an Untrusted Caller +376=Temporary File Issues +377=Insecure Temporary File +378=Creation of Temporary File With Insecure Permissions +379=Creation of Temporary File in Directory with Incorrect Permissions +380=Technology-Specific Time and State Issues +381=J2EE Time and State Issues +382=J2EE Bad Practices: Use of System.exit() +383=J2EE Bad Practices: Direct Use of Threads +384=Session Fixation +385=Covert Timing Channel +386=Symbolic Name not Mapping to Correct Object +387=Signal Errors +388=Error Handling +389=Error Conditions, Return Values, Status Codes +390=Detection of Error Condition Without Action +391=Unchecked Error Condition +392=Missing Report of Error Condition +393=Return of Wrong Status Code +394=Unexpected Status Code or Return Value +395=Use of NullPointerException Catch to Detect NULL Pointer Dereference +396=Declaration of Catch for Generic Exception +397=Declaration of Throws for Generic Exception +398=Indicator of Poor Code Quality +399=Resource Management Errors +400=Uncontrolled Resource Consumption ('Resource Exhaustion') +401=Improper Release of Memory Before Removing Last Reference ('Memory Leak') +402=Transmission of Private Resources into a New Sphere ('Resource Leak') +403=Exposure of File Descriptor to Unintended Control Sphere +404=Improper Resource Shutdown or Release +405=Asymmetric Resource Consumption (Amplification) +406=Insufficient Control of Network Message Volume (Network Amplification) +407=Algorithmic Complexity +408=Incorrect Behavior Order: Early Amplification +409=Improper Handling of Highly Compressed Data (Data Amplification) +410=Insufficient Resource Pool +411=Resource Locking Problems +412=Unrestricted Externally Accessible Lock +413=Improper Resource Locking +414=Missing Lock Check +415=Double Free +416=Use After Free +417=Channel and Path Errors +418=Channel Errors +419=Unprotected Primary Channel +420=Unprotected Alternate Channel +421=Race Condition During Access to Alternate Channel +422=Unprotected Windows Messaging Channel ('Shatter') +423=DEPRECATED (Duplicate): Proxied Trusted Channel +424=Improper Protection of Alternate Path +425=Direct Request ('Forced Browsing') +426=Untrusted Search Path +427=Uncontrolled Search Path Element +428=Unquoted Search Path or Element +429=Handler Errors +430=Deployment of Wrong Handler +431=Missing Handler +432=Dangerous Signal Handler not Disabled During Sensitive Operations +433=Unparsed Raw Web Content Delivery +434=Unrestricted Upload of File with Dangerous Type +435=Interaction Error +436=Interpretation Conflict +437=Incomplete Model of Endpoint Features +438=Behavioral Problems +439=Behavioral Change in New Version or Environment +440=Expected Behavior Violation +441=Unintended Proxy/Intermediary +442=Web Problems +443=DEPRECATED (Duplicate): HTTP response splitting +444=Inconsistent Interpretation of HTTP Requests ('HTTP Request Smuggling') +445=User Interface Errors +446=UI Discrepancy for Security Feature +447=Unimplemented or Unsupported Feature in UI +448=Obsolete Feature in UI +449=The UI Performs the Wrong Action +450=Multiple Interpretations of UI Input +451=UI Misrepresentation of Critical Information +452=Initialization and Cleanup Errors +453=Insecure Default Variable Initialization +454=External Initialization of Trusted Variables or Data Stores +455=Non-exit on Failed Initialization +456=Missing Initialization +457=Use of Uninitialized Variable +458=DEPRECATED: Incorrect Initialization +459=Incomplete Cleanup +460=Improper Cleanup on Thrown Exception +461=Data Structure Issues +462=Duplicate Key in Associative List (Alist) +463=Deletion of Data Structure Sentinel +464=Addition of Data Structure Sentinel +465=Pointer Issues +466=Return of Pointer Value Outside of Expected Range +467=Use of sizeof() on a Pointer Type +468=Incorrect Pointer Scaling +469=Use of Pointer Subtraction to Determine Size +470=Use of Externally-Controlled Input to Select Classes or Code ('Unsafe Reflection') +471=Modification of Assumed-Immutable Data (MAID) +472=External Control of Assumed-Immutable Web Parameter +473=PHP External Variable Modification +474=Use of Function with Inconsistent Implementations +475=Undefined Behavior for Input to API +476=NULL Pointer Dereference +477=Use of Obsolete Functions +478=Missing Default Case in Switch Statement +479=Signal Handler Use of a Non-reentrant Function +480=Use of Incorrect Operator +481=Assigning instead of Comparing +482=Comparing instead of Assigning +483=Incorrect Block Delimitation +484=Omitted Break Statement in Switch +485=Insufficient Encapsulation +486=Comparison of Classes by Name +487=Reliance on Package-level Scope +488=Exposure of Data Element to Wrong Session +489=Leftover Debug Code +490=Mobile Code Issues +491=Public cloneable() Method Without Final ('Object Hijack') +492=Use of Inner Class Containing Sensitive Data +493=Critical Public Variable Without Final Modifier +494=Download of Code Without Integrity Check +495=Private Array-Typed Field Returned From A Public Method +496=Public Data Assigned to Private Array-Typed Field +497=Exposure of System Data to an Unauthorized Control Sphere +498=Cloneable Class Containing Sensitive Information +499=Serializable Class Containing Sensitive Data +500=Public Static Field Not Marked Final +501=Trust Boundary Violation +502=Deserialization of Untrusted Data +503=Byte/Object Code +504=Motivation/Intent +505=Intentionally Introduced Weakness +506=Embedded Malicious Code +507=Trojan Horse +508=Non-Replicating Malicious Code +509=Replicating Malicious Code (Virus or Worm) +510=Trapdoor +511=Logic/Time Bomb +512=Spyware +513=Intentionally Introduced Nonmalicious Weakness +514=Covert Channel +515=Covert Storage Channel +516=DEPRECATED (Duplicate): Covert Timing Channel +517=Other Intentional, Nonmalicious Weakness +518=Inadvertently Introduced Weakness +519=.NET Environment Issues +520=.NET Misconfiguration: Use of Impersonation +521=Weak Password Requirements +522=Insufficiently Protected Credentials +523=Unprotected Transport of Credentials +524=Information Exposure Through Caching +525=Information Exposure Through Browser Caching +526=Information Exposure Through Environmental Variables +527=Exposure of CVS Repository to an Unauthorized Control Sphere +528=Exposure of Core Dump File to an Unauthorized Control Sphere +529=Exposure of Access Control List Files to an Unauthorized Control Sphere +530=Exposure of Backup File to an Unauthorized Control Sphere +531=Information Exposure Through Test Code +532=Information Exposure Through Log Files +533=Information Exposure Through Server Log Files +534=Information Exposure Through Debug Log Files +535=Information Exposure Through Shell Error Message +536=Information Exposure Through Servlet Runtime Error Message +537=Information Exposure Through Java Runtime Error Message +538=File and Directory Information Exposure +539=Information Exposure Through Persistent Cookies +540=Information Exposure Through Source Code +541=Information Exposure Through Include Source Code +542=Information Exposure Through Cleanup Log Files +543=Use of Singleton Pattern Without Synchronization in a Multithreaded Context +544=Missing Standardized Error Handling Mechanism +545=Use of Dynamic Class Loading +546=Suspicious Comment +547=Use of Hard-coded, Security-relevant Constants +548=Information Exposure Through Directory Listing +549=Missing Password Field Masking +550=Information Exposure Through Server Error Message +551=Incorrect Behavior Order: Authorization Before Parsing and Canonicalization +552=Files or Directories Accessible to External Parties +553=Command Shell in Externally Accessible Directory +554=ASP.NET Misconfiguration: Not Using Input Validation Framework +555=J2EE Misconfiguration: Plaintext Password in Configuration File +556=ASP.NET Misconfiguration: Use of Identity Impersonation +557=Concurrency Issues +558=Use of getlogin() in Multithreaded Application +559=Often Misused: Arguments and Parameters +560=Use of umask() with chmod-style Argument +561=Dead Code +562=Return of Stack Variable Address +563=Unused Variable +564=SQL Injection: Hibernate +565=Reliance on Cookies without Validation and Integrity Checking +566=Authorization Bypass Through User-Controlled SQL Primary Key +567=Unsynchronized Access to Shared Data in a Multithreaded Context +568=finalize() Method Without super.finalize() +569=Expression Issues +570=Expression is Always False +571=Expression is Always True +572=Call to Thread run() instead of start() +573=Improper Following of Specification by Caller +574=EJB Bad Practices: Use of Synchronization Primitives +575=EJB Bad Practices: Use of AWT Swing +576=EJB Bad Practices: Use of Java I/O +577=EJB Bad Practices: Use of Sockets +578=EJB Bad Practices: Use of Class Loader +579=J2EE Bad Practices: Non-serializable Object Stored in Session +580=clone() Method Without super.clone() +581=Object Model Violation: Just One of Equals and Hashcode Defined +582=Array Declared Public, Final, and Static +583=finalize() Method Declared Public +584=Return Inside Finally Block +585=Empty Synchronized Block +586=Explicit Call to Finalize() +587=Assignment of a Fixed Address to a Pointer +588=Attempt to Access Child of a Non-structure Pointer +589=Call to Non-ubiquitous API +590=Free of Memory not on the Heap +591=Sensitive Data Storage in Improperly Locked Memory +592=Authentication Bypass Issues +593=Authentication Bypass: OpenSSL CTX Object Modified after SSL Objects are Created +594=J2EE Framework: Saving Unserializable Objects to Disk +595=Comparison of Object References Instead of Object Contents +596=Incorrect Semantic Object Comparison +597=Use of Wrong Operator in String Comparison +598=Information Exposure Through Query Strings in GET Request +599=Trust of OpenSSL Certificate Without Validation +600=Uncaught Exception in Servlet +601=URL Redirection to Untrusted Site ('Open Redirect') +602=Client-Side Enforcement of Server-Side Security +603=Use of Client-Side Authentication +604=Deprecated Entries +605=Multiple Binds to the Same Port +606=Unchecked Input for Loop Condition +607=Public Static Final Field References Mutable Object +608=Struts: Non-private Field in ActionForm Class +609=Double-Checked Locking +610=Externally Controlled Reference to a Resource in Another Sphere +611=Information Exposure Through XML External Entity Reference +612=Information Exposure Through Indexing of Private Data +613=Insufficient Session Expiration +614=Sensitive Cookie in HTTPS Session Without 'Secure' Attribute +615=Information Exposure Through Comments +616=Incomplete Identification of Uploaded File Variables (PHP) +617=Reachable Assertion +618=Exposed Unsafe ActiveX Method +619=Dangling Database Cursor ('Cursor Injection') +620=Unverified Password Change +621=Variable Extraction Error +622=Unvalidated Function Hook Arguments +623=Unsafe ActiveX Control Marked Safe For Scripting +624=Executable Regular Expression Error +625=Permissive Regular Expression +626=Null Byte Interaction Error (Poison Null Byte) +627=Dynamic Variable Evaluation +628=Function Call with Incorrectly Specified Arguments +629=Weaknesses in OWASP Top Ten (2007) +630=Weaknesses Examined by SAMATE +631=Resource-specific Weaknesses +632=Weaknesses that Affect Files or Directories +633=Weaknesses that Affect Memory +634=Weaknesses that Affect System Processes +635=Weaknesses Used by NVD +636=Not Failing Securely ('Failing Open') +637=Unnecessary Complexity in Protection Mechanism (Not Using 'Economy of Mechanism') +638=Not Using Complete Mediation +639=Authorization Bypass Through User-Controlled Key +640=Weak Password Recovery Mechanism for Forgotten Password +641=Improper Restriction of Names for Files and Other Resources +642=External Control of Critical State Data +643=Improper Neutralization of Data within XPath Expressions ('XPath Injection') +644=Improper Neutralization of HTTP Headers for Scripting Syntax +645=Overly Restrictive Account Lockout Mechanism +646=Reliance on File Name or Extension of Externally-Supplied File +647=Use of Non-Canonical URL Paths for Authorization Decisions +648=Incorrect Use of Privileged APIs +649=Reliance on Obfuscation or Encryption of Security-Relevant Inputs without Integrity Checking +650=Trusting HTTP Permission Methods on the Server Side +651=Information Exposure Through WSDL File +652=Improper Neutralization of Data within XQuery Expressions ('XQuery Injection') +653=Insufficient Compartmentalization +654=Reliance on a Single Factor in a Security Decision +655=Insufficient Psychological Acceptability +656=Reliance on Security Through Obscurity +657=Violation of Secure Design Principles +658=Weaknesses in Software Written in C +659=Weaknesses in Software Written in C++ +660=Weaknesses in Software Written in Java +661=Weaknesses in Software Written in PHP +662=Improper Synchronization +663=Use of a Non-reentrant Function in a Concurrent Context +664=Improper Control of a Resource Through its Lifetime +665=Improper Initialization +666=Operation on Resource in Wrong Phase of Lifetime +667=Improper Locking +668=Exposure of Resource to Wrong Sphere +669=Incorrect Resource Transfer Between Spheres +670=Always-Incorrect Control Flow Implementation +671=Lack of Administrator Control over Security +672=Operation on a Resource after Expiration or Release +673=External Influence of Sphere Definition +674=Uncontrolled Recursion +675=Duplicate Operations on Resource +676=Use of Potentially Dangerous Function +677=Weakness Base Elements +678=Composites +679=Chain Elements +680=Integer Overflow to Buffer Overflow +681=Incorrect Conversion between Numeric Types +682=Incorrect Calculation +683=Function Call With Incorrect Order of Arguments +684=Incorrect Provision of Specified Functionality +685=Function Call With Incorrect Number of Arguments +686=Function Call With Incorrect Argument Type +687=Function Call With Incorrectly Specified Argument Value +688=Function Call With Incorrect Variable or Reference as Argument +689=Permission Race Condition During Resource Copy +690=Unchecked Return Value to NULL Pointer Dereference +691=Insufficient Control Flow Management +692=Incomplete Blacklist to Cross-Site Scripting +693=Protection Mechanism Failure +694=Use of Multiple Resources with Duplicate Identifier +695=Use of Low-Level Functionality +696=Incorrect Behavior Order +697=Insufficient Comparison +698=Redirect Without Exit +699=Development Concepts +700=Seven Pernicious Kingdoms +701=Weaknesses Introduced During Design +702=Weaknesses Introduced During Implementation +703=Improper Check or Handling of Exceptional Conditions +704=Incorrect Type Conversion or Cast +705=Incorrect Control Flow Scoping +706=Use of Incorrectly-Resolved Name or Reference +707=Improper Enforcement of Message or Data Structure +708=Incorrect Ownership Assignment +709=Named Chains +710=Coding Standards Violation +711=Weaknesses in OWASP Top Ten (2004) +712=OWASP Top Ten 2007 Category A1 - Cross Site Scripting (XSS) +713=OWASP Top Ten 2007 Category A2 - Injection Flaws +714=OWASP Top Ten 2007 Category A3 - Malicious File Execution +715=OWASP Top Ten 2007 Category A4 - Insecure Direct Object Reference +716=OWASP Top Ten 2007 Category A5 - Cross Site Request Forgery (CSRF) +717=OWASP Top Ten 2007 Category A6 - Information Leakage and Improper Error Handling +718=OWASP Top Ten 2007 Category A7 - Broken Authentication and Session Management +719=OWASP Top Ten 2007 Category A8 - Insecure Cryptographic Storage +720=OWASP Top Ten 2007 Category A9 - Insecure Communications +721=OWASP Top Ten 2007 Category A10 - Failure to Restrict URL Access +722=OWASP Top Ten 2004 Category A1 - Unvalidated Input +723=OWASP Top Ten 2004 Category A2 - Broken Access Control +724=OWASP Top Ten 2004 Category A3 - Broken Authentication and Session Management +725=OWASP Top Ten 2004 Category A4 - Cross-Site Scripting (XSS) Flaws +726=OWASP Top Ten 2004 Category A5 - Buffer Overflows +727=OWASP Top Ten 2004 Category A6 - Injection Flaws +728=OWASP Top Ten 2004 Category A7 - Improper Error Handling +729=OWASP Top Ten 2004 Category A8 - Insecure Storage +730=OWASP Top Ten 2004 Category A9 - Denial of Service +731=OWASP Top Ten 2004 Category A10 - Insecure Configuration Management +732=Incorrect Permission Assignment for Critical Resource +733=Compiler Optimization Removal or Modification of Security-critical Code +734=Weaknesses Addressed by the CERT C Secure Coding Standard +735=CERT C Secure Coding Section 01 - Preprocessor (PRE) +736=CERT C Secure Coding Section 02 - Declarations and Initialization (DCL) +737=CERT C Secure Coding Section 03 - Expressions (EXP) +738=CERT C Secure Coding Section 04 - Integers (INT) +739=CERT C Secure Coding Section 05 - Floating Point (FLP) +740=CERT C Secure Coding Section 06 - Arrays (ARR) +741=CERT C Secure Coding Section 07 - Characters and Strings (STR) +742=CERT C Secure Coding Section 08 - Memory Management (MEM) +743=CERT C Secure Coding Section 09 - Input Output (FIO) +744=CERT C Secure Coding Section 10 - Environment (ENV) +745=CERT C Secure Coding Section 11 - Signals (SIG) +746=CERT C Secure Coding Section 12 - Error Handling (ERR) +747=CERT C Secure Coding Section 49 - Miscellaneous (MSC) +748=CERT C Secure Coding Section 50 - POSIX (POS) +749=Exposed Dangerous Method or Function +750=Weaknesses in the 2009 CWE/SANS Top 25 Most Dangerous Programming Errors +751=Insecure Interaction Between Components +752=Risky Resource Management +753=Porous Defenses +754=Improper Check for Unusual or Exceptional Conditions +755=Improper Handling of Exceptional Conditions +756=Missing Custom Error Page +757=Selection of Less-Secure Algorithm During Negotiation ('Algorithm Downgrade') +758=Reliance on Undefined, Unspecified, or Implementation-Defined Behavior +759=Use of a One-Way Hash without a Salt +760=Use of a One-Way Hash with a Predictable Salt +761=Free of Pointer not at Start of Buffer +762=Mismatched Memory Management Routines +763=Release of Invalid Pointer or Reference +764=Multiple Locks of a Critical Resource +765=Multiple Unlocks of a Critical Resource +766=Critical Variable Declared Public +767=Access to Critical Private Variable via Public Method +768=Incorrect Short Circuit Evaluation +769=File Descriptor Exhaustion +770=Allocation of Resources Without Limits or Throttling +771=Missing Reference to Active Allocated Resource +772=Missing Release of Resource after Effective Lifetime +773=Missing Reference to Active File Descriptor or Handle +774=Allocation of File Descriptors or Handles Without Limits or Throttling +775=Missing Release of File Descriptor or Handle after Effective Lifetime +776=Unrestricted Recursive Entity References in DTDs ('XML Bomb') +777=Regular Expression without Anchors +778=Insufficient Logging +779=Logging of Excessive Data +780=Use of RSA Algorithm without OAEP +781=Improper Address Validation in IOCTL with METHOD_NEITHER I/O Control Code +782=Exposed IOCTL with Insufficient Access Control +783=Operator Precedence Logic Error +784=Reliance on Cookies without Validation and Integrity Checking in a Security Decision +785=Use of Path Manipulation Function without Maximum-sized Buffer +786=Access of Memory Location Before Start of Buffer +787=Out-of-bounds Write +788=Access of Memory Location After End of Buffer +789=Uncontrolled Memory Allocation +790=Improper Filtering of Special Elements +791=Incomplete Filtering of Special Elements +792=Incomplete Filtering of One or More Instances of Special Elements +793=Only Filtering One Instance of a Special Element +794=Incomplete Filtering of Multiple Instances of Special Elements +795=Only Filtering Special Elements at a Specified Location +796=Only Filtering Special Elements Relative to a Marker +797=Only Filtering Special Elements at an Absolute Position +798=Use of Hard-coded Credentials +799=Improper Control of Interaction Frequency +800=Weaknesses in the 2010 CWE/SANS Top 25 Most Dangerous Programming Errors +801=Insecure Interaction Between Components +802=Risky Resource Management +803=Porous Defenses +804=Guessable CAPTCHA +805=Buffer Access with Incorrect Length Value +806=Buffer Access Using Size of Source Buffer +807=Reliance on Untrusted Inputs in a Security Decision +808=Weaknesses On the Cusp +809=Weaknesses in OWASP Top Ten (2010) +810=OWASP Top Ten 2010 Category A1 - Injection +811=OWASP Top Ten 2010 Category A2 - Cross-Site Scripting (XSS) +812=OWASP Top Ten 2010 Category A3 - Broken Authentication and Session Management +813=OWASP Top Ten 2010 Category A4 - Insecure Direct Object References +814=OWASP Top Ten 2010 Category A5 - Cross-Site Request Forgery(CSRF) +815=OWASP Top Ten 2010 Category A6 - Security Misconfiguration +816=OWASP Top Ten 2010 Category A7 - Insecure Cryptographic Storage +817=OWASP Top Ten 2010 Category A8 - Failure to Restrict URL Access +818=OWASP Top Ten 2010 Category A9 - Insufficient Transport Layer Protection +819=OWASP Top Ten 2010 Category A10 - Unvalidated Redirects and Forwards +820=Missing Synchronization +821=Incorrect Synchronization +822=Untrusted Pointer Dereference +823=Use of Out-of-range Pointer Offset +824=Access of Uninitialized Pointer +825=Expired Pointer Dereference +826=Premature Release of Resource During Expected Lifetime +827=Improper Control of Document Type Definition +828=Signal Handler with Functionality that is not Asynchronous-Safe +829=Inclusion of Functionality from Untrusted Control Sphere +830=Inclusion of Web Functionality from an Untrusted Source +831=Signal Handler Function Associated with Multiple Signals +832=Unlock of a Resource that is not Locked +833=Deadlock +834=Excessive Iteration +835=Loop with Unreachable Exit Condition ('Infinite Loop') +836=Use of Password Hash Instead of Password for Authentication +837=Improper Enforcement of a Single, Unique Action +838=Inappropriate Encoding for Output Context +839=Numeric Range Comparison Without Minimum Check +840=Business Logic Errors +841=Improper Enforcement of Behavioral Workflow +842=Placement of User into Incorrect Group +843=Access of Resource Using Incompatible Type ('Type Confusion') +844=Weaknesses Addressed by the CERT Java Secure Coding Standard +845=CERT Java Secure Coding Section 00 - Input Validation and Data Sanitization (IDS) +846=CERT Java Secure Coding Section 01 - Declarations and Initialization (DCL) +847=CERT Java Secure Coding Section 02 - Expressions (EXP) +848=CERT Java Secure Coding Section 03 - Numeric Types and Operations (NUM) +849=CERT Java Secure Coding Section 04 - Object Orientation (OBJ) +850=CERT Java Secure Coding Section 05 - Methods (MET) +851=CERT Java Secure Coding Section 06 - Exceptional Behavior (ERR) +852=CERT Java Secure Coding Section 07 - Visibility and Atomicity (VNA) +853=CERT Java Secure Coding Section 08 - Locking (LCK) +854=CERT Java Secure Coding Section 09 - Thread APIs (THI) +855=CERT Java Secure Coding Section 10 - Thread Pools (TPS) +856=CERT Java Secure Coding Section 11 - Thread-Safety Miscellaneous (TSM) +857=CERT Java Secure Coding Section 12 - Input Output (FIO) +858=CERT Java Secure Coding Section 13 - Serialization (SER) +859=CERT Java Secure Coding Section 14 - Platform Security (SEC) +860=CERT Java Secure Coding Section 15 - Runtime Environment (ENV) +861=CERT Java Secure Coding Section 49 - Miscellaneous (MSC) +862=Missing Authorization +863=Incorrect Authorization +864=Insecure Interaction Between Components +865=Risky Resource Management +866=Porous Defenses +867=Weaknesses On the Cusp +868=Weaknesses Addressed by the CERT C++ Secure Coding Standard +869=CERT C++ Secure Coding Section 01 - Preprocessor (PRE) +870=CERT C++ Secure Coding Section 02 - Declarations and Initialization (DCL) +871=CERT C++ Secure Coding Section 03 - Expressions (EXP) +872=CERT C++ Secure Coding Section 04 - Integers (INT) +873=CERT C++ Secure Coding Section 05 - Floating Point Arithmetic (FLP) +874=CERT C++ Secure Coding Section 06 - Arrays and the STL (ARR) +875=CERT C++ Secure Coding Section 07 - Characters and Strings (STR) +876=CERT C++ Secure Coding Section 08 - Memory Management (MEM) +877=CERT C++ Secure Coding Section 09 - Input Output (FIO) +878=CERT C++ Secure Coding Section 10 - Environment (ENV) +879=CERT C++ Secure Coding Section 11 - Signals (SIG) +880=CERT C++ Secure Coding Section 12 - Exceptions and Error Handling (ERR) +881=CERT C++ Secure Coding Section 13 - Object Oriented Programming (OOP) +882=CERT C++ Secure Coding Section 14 - Concurrency (CON) +883=CERT C++ Secure Coding Section 49 - Miscellaneous (MSC) +900=Weaknesses in the 2011 CWE/SANS Top 25 Most Dangerous Software Errors +1000=Research Concepts +2000=Comprehensive CWE Dictionary diff --git a/com.kdmanalytics.toif.ccr/target/classes/generated/CWECoverageClaimType$Claims$Claim$RuleSet$Rule.class b/com.kdmanalytics.toif.ccr/target/classes/generated/CWECoverageClaimType$Claims$Claim$RuleSet$Rule.class new file mode 100644 index 00000000..83cf56e4 Binary files /dev/null and b/com.kdmanalytics.toif.ccr/target/classes/generated/CWECoverageClaimType$Claims$Claim$RuleSet$Rule.class differ diff --git a/com.kdmanalytics.toif.ccr/target/classes/generated/CWECoverageClaimType$Claims$Claim$RuleSet.class b/com.kdmanalytics.toif.ccr/target/classes/generated/CWECoverageClaimType$Claims$Claim$RuleSet.class new file mode 100644 index 00000000..78c0cf99 Binary files /dev/null and b/com.kdmanalytics.toif.ccr/target/classes/generated/CWECoverageClaimType$Claims$Claim$RuleSet.class differ diff --git a/com.kdmanalytics.toif.ccr/target/classes/generated/CWECoverageClaimType$Claims$Claim.class b/com.kdmanalytics.toif.ccr/target/classes/generated/CWECoverageClaimType$Claims$Claim.class new file mode 100644 index 00000000..ad79cd38 Binary files /dev/null and b/com.kdmanalytics.toif.ccr/target/classes/generated/CWECoverageClaimType$Claims$Claim.class differ diff --git a/com.kdmanalytics.toif.ccr/target/classes/generated/CWECoverageClaimType$Claims.class b/com.kdmanalytics.toif.ccr/target/classes/generated/CWECoverageClaimType$Claims.class new file mode 100644 index 00000000..b002acdc Binary files /dev/null and b/com.kdmanalytics.toif.ccr/target/classes/generated/CWECoverageClaimType$Claims.class differ diff --git a/com.kdmanalytics.toif.ccr/target/classes/generated/CWECoverageClaimType.class b/com.kdmanalytics.toif.ccr/target/classes/generated/CWECoverageClaimType.class new file mode 100644 index 00000000..7173ea11 Binary files /dev/null and b/com.kdmanalytics.toif.ccr/target/classes/generated/CWECoverageClaimType.class differ diff --git a/com.kdmanalytics.toif.ccr/target/classes/generated/CWECoverageClaims.class b/com.kdmanalytics.toif.ccr/target/classes/generated/CWECoverageClaims.class new file mode 100644 index 00000000..bbdb0a6d Binary files /dev/null and b/com.kdmanalytics.toif.ccr/target/classes/generated/CWECoverageClaims.class differ diff --git a/com.kdmanalytics.toif.ccr/target/classes/generated/CWE_Coverage_Claims_Schema_v0.3.xsd b/com.kdmanalytics.toif.ccr/target/classes/generated/CWE_Coverage_Claims_Schema_v0.3.xsd new file mode 100644 index 00000000..9aaecfab --- /dev/null +++ b/com.kdmanalytics.toif.ccr/target/classes/generated/CWE_Coverage_Claims_Schema_v0.3.xsd @@ -0,0 +1,217 @@ + + + + + + + + + + + + + + + + + + + + vendor comments for overall claim + + + + + + each CWE can be covered by one or more + "rules" + + + + + + + + + comment for each rule allows + vendors to explain what they look for in more + detail + + + + + + vendor may or may not have ID's + + + + + + + + + + + + + Strength/accuracy of the covered rules to + the CWE entry. + + + + + unique identifier of the CWE being covered + + + + + + name of the CWE being covered (included + for better readability) + + + + + + + + + + Optional comments for the entire set of claims. + + + + + + + all claims are made against a specific version of + CWE + + + + + all claims are specific to a specific vendor + + + + + all claims are specific to a specific named tool set + + + + + + all claims are specific to a specific tool set version + + + + + + a URI that contains more details, or a human-friendly version of + this coverage claim + + + + + claims are made as of a date (NOT IN THE FUTURE!) + + + + + + all claims are made against a specific type of + language + + + + + + + + + + + + all claims are made against a specific language + + + + + + Archetype_Type contains values for the Archetype of the system + described by the vignette + + + + + The CWE entry exactly covers the same weakness(es) as the + given rule set. + + + + + The CWE entry covers more concepts than the given rule set, + but there are not any more precise matches available. For example, a rule + set might detect resource consumption for a resource that is not + specifically covered by CWE. + + + + + The CWE entry is more specific than the weakness reported by + the given rule set, but the entry's parent(s) are not appropriate matches. + This might indicate a difference in perspective between CWE and the + capability providing the coverage mapping. It could also include a single + rule that covers multiple CWE entries (which might imply that there would be + multiple claims for a single rule/ruleset). + + + + + The CWE entry is only a partial match with the weakness + reported by the given rule set, but the entry is the closest available + match. + + + + + The CWE entry is not covered by any rule set. The provider is + not required to include information about uncovered CWEs. + + + + + There is no CWE entry available that closely matches the + weakness reported by the given rule set, but the provider believes that a + CWE entry should exist for the reported weakness. The associated CWE_ID + should be 0. + + + + + The rule/ruleset is not applicable to CWE, i.e., it is not + necessarily about a weakness. This could include rulesets related to coding + style conformance, informational messages about the scan, etc. The + associated CWE_ID should be -1. The provider is not required to include + information about non-applicable rules. + + + + + The match accuracy is unknown. Typically this would be used by + a third party who is creating a coverage claim and does not have insight + into the technology. + + + + + No other CWE match accuracy type is + applicable. + + + + + diff --git a/com.kdmanalytics.toif.ccr/target/classes/generated/MatchAccuracyType.class b/com.kdmanalytics.toif.ccr/target/classes/generated/MatchAccuracyType.class new file mode 100644 index 00000000..4b2b23db Binary files /dev/null and b/com.kdmanalytics.toif.ccr/target/classes/generated/MatchAccuracyType.class differ diff --git a/com.kdmanalytics.toif.ccr/target/classes/generated/ObjectFactory.class b/com.kdmanalytics.toif.ccr/target/classes/generated/ObjectFactory.class new file mode 100644 index 00000000..cc403324 Binary files /dev/null and b/com.kdmanalytics.toif.ccr/target/classes/generated/ObjectFactory.class differ diff --git a/com.kdmanalytics.toif.ccr/target/com.kdmanalytics.toif.ccr-1.15.5.jar b/com.kdmanalytics.toif.ccr/target/com.kdmanalytics.toif.ccr-1.15.5.jar new file mode 100644 index 00000000..3e24f52d Binary files /dev/null and b/com.kdmanalytics.toif.ccr/target/com.kdmanalytics.toif.ccr-1.15.5.jar differ diff --git a/com.kdmanalytics.toif.ccr/target/local-artifacts.properties b/com.kdmanalytics.toif.ccr/target/local-artifacts.properties new file mode 100644 index 00000000..7a257132 --- /dev/null +++ b/com.kdmanalytics.toif.ccr/target/local-artifacts.properties @@ -0,0 +1,4 @@ +#Thu May 29 09:55:49 EDT 2014 +artifact.attached.p2metadata=/home/adam/git/toif/plugins/com.kdmanalytics.toif.ccr/target/p2content.xml +artifact.main=/home/adam/git/toif/plugins/com.kdmanalytics.toif.ccr/target/com.kdmanalytics.toif.ccr-1.15.5.jar +artifact.attached.p2artifacts=/home/adam/git/toif/plugins/com.kdmanalytics.toif.ccr/target/p2artifacts.xml diff --git a/com.kdmanalytics.toif.ccr/target/maven-archiver/pom.properties b/com.kdmanalytics.toif.ccr/target/maven-archiver/pom.properties new file mode 100644 index 00000000..25416a48 --- /dev/null +++ b/com.kdmanalytics.toif.ccr/target/maven-archiver/pom.properties @@ -0,0 +1,5 @@ +#Generated by Maven +#Thu May 29 09:55:49 EDT 2014 +version=1.15.5 +groupId=com.kdmanalytics.kdm.wb.plugins +artifactId=com.kdmanalytics.toif.ccr diff --git a/com.kdmanalytics.toif.ccr/target/p2artifacts.xml b/com.kdmanalytics.toif.ccr/target/p2artifacts.xml new file mode 100644 index 00000000..3a7423b8 --- /dev/null +++ b/com.kdmanalytics.toif.ccr/target/p2artifacts.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/com.kdmanalytics.toif.ccr/target/p2content.xml b/com.kdmanalytics.toif.ccr/target/p2content.xml new file mode 100644 index 00000000..3de17934 --- /dev/null +++ b/com.kdmanalytics.toif.ccr/target/p2content.xml @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Bundle-SymbolicName: com.kdmanalytics.toif.ccr;singleton:=true Bundle-Version: 1.15.5 + + + + + diff --git a/com.kdmanalytics.toif.ccr/testData/bindsToifKdm/namespaces.dat b/com.kdmanalytics.toif.ccr/testData/bindsToifKdm/namespaces.dat new file mode 100644 index 00000000..b1ec9998 --- /dev/null +++ b/com.kdmanalytics.toif.ccr/testData/bindsToifKdm/namespaces.dat @@ -0,0 +1 @@ +nnf \ No newline at end of file diff --git a/com.kdmanalytics.toif.ccr/testData/bindsToifKdm/triples-posc.alloc b/com.kdmanalytics.toif.ccr/testData/bindsToifKdm/triples-posc.alloc new file mode 100644 index 00000000..11c6d7ed Binary files /dev/null and b/com.kdmanalytics.toif.ccr/testData/bindsToifKdm/triples-posc.alloc differ diff --git a/com.kdmanalytics.toif.ccr/testData/bindsToifKdm/triples-posc.dat b/com.kdmanalytics.toif.ccr/testData/bindsToifKdm/triples-posc.dat new file mode 100644 index 00000000..65990d27 Binary files /dev/null and b/com.kdmanalytics.toif.ccr/testData/bindsToifKdm/triples-posc.dat differ diff --git a/com.kdmanalytics.toif.ccr/testData/bindsToifKdm/triples-spoc.alloc b/com.kdmanalytics.toif.ccr/testData/bindsToifKdm/triples-spoc.alloc new file mode 100644 index 00000000..84b56c26 Binary files /dev/null and b/com.kdmanalytics.toif.ccr/testData/bindsToifKdm/triples-spoc.alloc differ diff --git a/com.kdmanalytics.toif.ccr/testData/bindsToifKdm/triples-spoc.dat b/com.kdmanalytics.toif.ccr/testData/bindsToifKdm/triples-spoc.dat new file mode 100644 index 00000000..15ace0b1 Binary files /dev/null and b/com.kdmanalytics.toif.ccr/testData/bindsToifKdm/triples-spoc.dat differ diff --git a/com.kdmanalytics.toif.ccr/testData/bindsToifKdm/triples.prop b/com.kdmanalytics.toif.ccr/testData/bindsToifKdm/triples.prop new file mode 100644 index 00000000..bcff36bd --- /dev/null +++ b/com.kdmanalytics.toif.ccr/testData/bindsToifKdm/triples.prop @@ -0,0 +1,4 @@ +#triple indexes meta-data, DO NOT EDIT! +#Sun Apr 01 12:00:04 EDT 2012 +version=10 +triple-indexes=spoc,posc diff --git a/com.kdmanalytics.toif.ccr/testData/bindsToifKdm/txn-status b/com.kdmanalytics.toif.ccr/testData/bindsToifKdm/txn-status new file mode 100644 index 00000000..db3df79d --- /dev/null +++ b/com.kdmanalytics.toif.ccr/testData/bindsToifKdm/txn-status @@ -0,0 +1 @@ +NONE \ No newline at end of file diff --git a/com.kdmanalytics.toif.ccr/testData/bindsToifKdm/values.dat b/com.kdmanalytics.toif.ccr/testData/bindsToifKdm/values.dat new file mode 100644 index 00000000..5fadaca0 Binary files /dev/null and b/com.kdmanalytics.toif.ccr/testData/bindsToifKdm/values.dat differ diff --git a/com.kdmanalytics.toif.ccr/testData/bindsToifKdm/values.hash b/com.kdmanalytics.toif.ccr/testData/bindsToifKdm/values.hash new file mode 100644 index 00000000..d19c7962 Binary files /dev/null and b/com.kdmanalytics.toif.ccr/testData/bindsToifKdm/values.hash differ diff --git a/com.kdmanalytics.toif.ccr/testData/bindsToifKdm/values.id b/com.kdmanalytics.toif.ccr/testData/bindsToifKdm/values.id new file mode 100644 index 00000000..ba7292cc Binary files /dev/null and b/com.kdmanalytics.toif.ccr/testData/bindsToifKdm/values.id differ diff --git a/com.kdmanalytics.toif.cppcheck/.classpath b/com.kdmanalytics.toif.cppcheck/.classpath new file mode 100644 index 00000000..098194ca --- /dev/null +++ b/com.kdmanalytics.toif.cppcheck/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/com.kdmanalytics.toif.cppcheck/.project b/com.kdmanalytics.toif.cppcheck/.project new file mode 100644 index 00000000..91bf66dc --- /dev/null +++ b/com.kdmanalytics.toif.cppcheck/.project @@ -0,0 +1,28 @@ + + + com.kdmanalytics.toif.cppcheck + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + + org.eclipse.pde.PluginNature + org.eclipse.jdt.core.javanature + + diff --git a/com.kdmanalytics.toif.cppcheck/.settings/org.eclipse.jdt.core.prefs b/com.kdmanalytics.toif.cppcheck/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 00000000..f42de363 --- /dev/null +++ b/com.kdmanalytics.toif.cppcheck/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,7 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 +org.eclipse.jdt.core.compiler.compliance=1.7 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.7 diff --git a/com.kdmanalytics.toif.cppcheck/META-INF/MANIFEST.MF b/com.kdmanalytics.toif.cppcheck/META-INF/MANIFEST.MF new file mode 100644 index 00000000..bc12f451 --- /dev/null +++ b/com.kdmanalytics.toif.cppcheck/META-INF/MANIFEST.MF @@ -0,0 +1,14 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: TOIF Cppcheck +Bundle-SymbolicName: com.kdmanalytics.toif.cppcheck;singleton:=true +Bundle-Version: 1.16.0.qualifier +Bundle-Activator: com.kdmanalytics.toif.cppcheck.Activator +Bundle-Vendor: KDM Analytics Inc. +Require-Bundle: org.eclipse.core.runtime, + com.kdmanalytics.toif.framework;bundle-version="[1.15.0,2.0.0)", + org.apache.xerces;bundle-version="[2.11.0,3.0.0)", + com.kdmanalytics.toif.common;bundle-version="[1.15.0,2.0.0)" +Bundle-RequiredExecutionEnvironment: JavaSE-1.7 +Export-Package: com.kdmanalytics.toif.adaptor,com.kdmanalytics.toif.cp + pcheck diff --git a/com.kdmanalytics.toif.cppcheck/bin/com/kdmanalytics/toif/adaptor/CppcheckAdaptor.class b/com.kdmanalytics.toif.cppcheck/bin/com/kdmanalytics/toif/adaptor/CppcheckAdaptor.class new file mode 100644 index 00000000..34ad45a7 Binary files /dev/null and b/com.kdmanalytics.toif.cppcheck/bin/com/kdmanalytics/toif/adaptor/CppcheckAdaptor.class differ diff --git a/com.kdmanalytics.toif.cppcheck/bin/com/kdmanalytics/toif/cppcheck/Activator.class b/com.kdmanalytics.toif.cppcheck/bin/com/kdmanalytics/toif/cppcheck/Activator.class new file mode 100644 index 00000000..5747ceeb Binary files /dev/null and b/com.kdmanalytics.toif.cppcheck/bin/com/kdmanalytics/toif/cppcheck/Activator.class differ diff --git a/com.kdmanalytics.toif.cppcheck/bin/com/kdmanalytics/toif/cppcheck/CppCheckParser.class b/com.kdmanalytics.toif.cppcheck/bin/com/kdmanalytics/toif/cppcheck/CppCheckParser.class new file mode 100644 index 00000000..ff0f9b5f Binary files /dev/null and b/com.kdmanalytics.toif.cppcheck/bin/com/kdmanalytics/toif/cppcheck/CppCheckParser.class differ diff --git a/com.kdmanalytics.toif.cppcheck/bin/config/CppcheckAdaptorConfiguration b/com.kdmanalytics.toif.cppcheck/bin/config/CppcheckAdaptorConfiguration new file mode 100644 index 00000000..d5a81e8a --- /dev/null +++ b/com.kdmanalytics.toif.cppcheck/bin/config/CppcheckAdaptorConfiguration @@ -0,0 +1,282 @@ +## +# +#http://sourceforge.net/apps/trac/cppcheck/wiki/ErrorMessages +# +## + + +############################ Need cwes and sfps ############################################################## + +duplicateExpression=;SFP--1;CWE-710 +unsignedPositive=;SFP--1;CWE-710 +missingInclude=;SFP--1;CWE-710 + +#(sizeArgumentAsChar, possible error) The size argument is given as a char constant +sizeArgumentAsChar=;SFP-1;CWE-195 + +#(virtualDestructor, error) Class Base which is inherited by class Derived does not have a virtual destructor +virtualDestructor=;SFP--1;CWE-710 + +#(operatorEqToSelf, possible style) 'operator=' should check for assignment to self +operatorEqToSelfElement='#' should check for assignment to self +operatorEqToSelf=;SFP--1;CWE-710 + +#(functionConst, style) The function 'class::function' can be const +functionConstElement=The function '#' can be const +functionConst=;SFP--1;CWE-710 + +#(mismatchSize, error) The given size sz is mismatching +mismatchSizeElement=The given size # is mismatching +mismatchSize=Memory Managemant;SFP--1;CWE-131 + +#(udivError, error) Unsigned division. The result will be wrong. +udivError=;SFP-1;CWE-195 + +#(variableScope, style) The scope of the variable varname can be reduced +variableScopeElement=The scope of the variable # can be reduced +variableScope=;SFP--1;CWE-710 + +#(constStatement, style) Redundant code: Found a statement that begins with type constant +constStatement=;SFP--1;CWE-710 + +#(syntaxError, error) Invalid number of character ( ) when these macros are defined: . +syntaxErrorElement=when these macros are defined: '#' +syntaxError=;SFP--1;CWE-710 + +#(stlIfStrFind, possible style) Suspicious condition. string::find will return 0 if the string is found at position 0. If this is what you want to check then string::compare is a faster alternative because it doesn't scan through the string. +stlIfStrFind=;SFP--1;CWE-710 + +#(stlSize, possible style) Use list.empty() instead of list.size() to guarantee fast code. size() can take linear time but empty() is guaranteed to take constant time. +stlSize=;SFP--1;CWE-710 + +#(stlBoundries, error) container range check should use != and not < since the order of the pointers isn't guaranteed +stlBoundries=;SFP--1;CWE-710 + +#(erase, error) Dangerous iterator usage. After erase the iterator is invalid so dereferencing it or comparing it with another iterator is invalid. +erase=;SFP--1;CWE-710 + +#(invalidIterator, error) After push_back|push_front|insert, the iterator 'iterator' may be invalid +invalidIteratorElement=After push_back|push_front|insert, the iterator '#' may be invalid +invalidIterator=;SFP--1;CWE-710 + +#(invalidPointer, error) Invalid pointer 'pointer' after push_back / push_front +invalidPointerElement=Invalid pointer '#' after push_back / push_front +invalidPointer=;SFP--1;CWE-710 + +#(strPlusChar, error) Unusual pointer arithmetic +strPlusChar=;SFP-1;CWE-468 + +#(postIncrementDecrement, possible style) Pre-Incrementing variable 'varname' is preferred to Post-Incrementing +postIncrementDecrementElement=Pre-Incrementing variable '#' is preferred to Post-Incrementing +postIncrementDecrement=;SFP--1;CWE-710 + +#(iterators, error) Same iterator is used with both container1 and container2 +iterators=;SFP--1;CWE-710 + +#(mismatchingContainers, error) mismatching containers +mismatchingContainers=;SFP--1;CWE-710 + +#(eraseDereference, error) Dereferenced iterator 'iter' has been erased +eraseDereferenceElement=Dereferenced iterator '#' has been erased +eraseDereference=;SFP--1;CWE-710 + + +#################################################################################################################### + + +#unreadVariable +unreadVariable=;SFP-2;CWE-563 + +#unassignedVariable +unassignedVariable=;SFP-2;CWE-457 + +#(autoVariables, error) Wrong assignment of an auto-variable to an effective parameter of a function +autoVariables=;SFP-1;CWE-562 + +#(returnLocalVariable, error) Returning pointer to local array variable +returnLocalVariable=;SFP-1;CWE-562 + +#(returnReference, error) Returning reference to auto variable +returnReference=;SFP-1;CWE-562 + +#(returnTempReference, error) Returning reference to temporary +returnTempReference=;SFP-1;CWE-562 + +#(returnAutocstr, error) Returning pointer to auto variable +returnAutocstr=;SFP-1;CWE-562 + +#(returnTempPointer, error) Returning pointer to temporary +returnTempPointer=;SFP-1;CWE-562 + +#(arrayIndexOutOfBounds, error) Array index out of bounds +arrayIndexOutOfBounds=;SFP-8;CWE-118 + +#(bufferAccessOutOfBounds, error) Buffer access out-of-bounds: buffer +bufferAccessOutOfBounds=;SFP-8;CWE-120 +bufferAccessOutOfBoundsElement=Buffer access out-of-bounds: # + +#(dangerousStdCin, possible error) Dangerous usage of std::cin, possible buffer overrun +dangerousStdCin=;SFP-3;CWE-676 +dangerousStdCinElement=Dangerous usage of #, possible buffer overrun + +#(strncatUsage, possible error) Dangerous usage of strncat. Tip: the 3rd parameter means maximum number of characters to append +strncatUsage=;SFP-3;CWE-676 +strncatUsageElemnet=Dangerous usage of #. Tip: the 3rd parameter means maximum number of characters to append + +#(outOfBounds, error) index is out of bounds +outOfBounds=;SFP-8;CWE-118 + +#(terminateStrncpy, style) After a strncpy() the buffer should be zero-terminated +terminateStrncpy=;SFP-11;CWE-170 + +#(noConstructor, style) The class 'classname' has no constructor. Member variables not initialized. +noConstructor=;SFP--1;CWE-710 +noConstructorElement=The class '#' has no constructor. Member variables not initialized. + +#(uninitVar, style) Member variable not initialized in the constructor 'classname::varname' +uninitvar=;SFP--1;CWE-710 +uninitVarElement=Member variable not initialized in the constructor '#' + +#(operatorEqVarError, possible style) Member variable 'classname::' is not assigned a value in 'classname::operator=' +operatorEqVarErrorElement=Member variable '#' is not assigned a value in +operatorEqVarError=;SFP--1;CWE-710 + +#(unusedPrivateFunction, style) Unused private function 'classname::funcname' +unusedPrivateFunctionElement=Unused private function '#' +unusedPrivateFunction=;SFP-2;CWE-561 + +#(memsetClass, error) Using 'memfunc' on class +memsetClassElement=Using '#' on class +memsetClass=;SFP--1;CWE-710 + +#(memsetStruct, error) Using 'memfunc' on struct that contains a 'std::classname' +memsetStructElement=Using '#' on struct that contains a 'std::classname' +memsetStruct=;SFP--1;CWE-710 + +#(operatorEq, style) 'operator=' should return something +operatorEq=;SFP--1;CWE-710 +operatorEqElement='#' should return something + +#(thisSubtraction, possible style) Suspicious pointer subtraction +thisSubtraction=;SFP--1;CWE-710 + +#(operatorEqRetRefThis, style) 'operator=' should return reference to self +operatorEq=;SFP--1;CWE-710 +operatorEqRetRefThisElement='#' should return reference to self + +#(dangerousFunctionmktemp, style) Found 'mktemp'. You should use 'mkstemp' instead +dangerousFunctionmktemp=;SFP-16;CWE-73 +dangerousFunctionmktempElement=Found '#'. You should use 'mkstemp' instead + +#(dangerousFunctiongets, style) Found 'gets'. You should use 'fgets' instead +dangerousFunctiongets=;SFP-3;CWE-676 +dangerousFunctiongetsElement=Found '#'. You should use 'fgets' instead + +#(dangerousFunctionscanf, style) Found 'scanf'. You should use 'fgets' instead +dangerousFunctionscanf=;SFP-3;CWE-676 +dangerousFunctionscanfElement=Found '#'. You should use 'fgets' instead + +#(exceptThrowInDestructor, style) Throwing exception in destructor +exceptThrowInDestructor=;SFP-14;CWE-401 + +#(exceptNew, style) Upon exception there is memory leak: p +exceptNewElement=Upon exception there is memory leak: # +exceptNew=;SFP-14;CWE-401 + +#(exceptRealloc, style) Upon exception p becomes a dead pointer +exceptRealloc=;SFP-14;CWE-401 +exceptReallocElement=Upon exception # becomes a dead pointer + +#(exceptDeallocThrow, error) Throwing exception in invalid state, p points at deallocated memory +exceptDeallocThrow=;SFP-15;CWE-416 +exceptDeallocThrowElement=Throwing exception in invalid state, # points at deallocated memory + +#(memleak, error) Memory leak: varname +memleak=Resource Management=;SFP-14;CWE-401 +memleakElement=Memory leak: # + +#(resourceLeak, error) Resource leak: varname +resourceLeak=;SFP-14;CWE-404 +resourceLeakElement=Resource leak: # + +#(deallocDealloc, error) Deallocating a deallocated pointer: varname +deallocDealloc=;SFP-12;CWE-415 +deallocDeallocElement=Deallocating a deallocated pointer: # + +#(deallocuse, error) Dereferencing 'varname' after it is deallocated / released +deallocuse=;SFP-15;CWE-416 +deallocuseElement=Dereferencing '#' after it is deallocated / released + +#(mismatchAllocDealloc, error) Mismatching allocation and deallocation: varname +mismatchAllocDealloc=;SFP-12;CWE-762 +mismatchAllocDeallocElement=Mismatching allocation and deallocation: # + +#(sprintfOverlappingData, error) Undefined behaviour: varname is used wrong in call to sprintf or snprintf. Quote: If copying takes place between objects that overlap as a result of a call to sprintf() or snprintf(), the results are undefined. +sprintfOverlappingData=Other.Design;SFP--1;CWE-682 +sprintfOverlappingDataElement=Undefined behaviour: # is used wrong in call to sprintf or snprintf + +#(nullPointer, error) Possible null pointer dereference: pointer +nullPointer=;SFP-7;CWE-476 +nullPointerElement=Possible null pointer dereference: # + +#(uninitstring, error) Dangerous usage of 'varname' (strncpy doesn't always 0-terminate it) +uninitstringElement=Dangerous usage of '#' (strncpy doesn't always 0-terminate it) +uninitstring=;SFP-11;CWE-170 + +#(uninitdata, error) Data is allocated but not initialized: varname +uninitdata=;SFP-1;CWE-456 +uninitdataElement=Data is allocated but not initialized: # + +#(uninitvar, error) Uninitialized variable: varname +uninitvar=;SFP-1;CWE-457 +uninitvarElement=Uninitialized variable: # +Passing value to () leads to undefined result +#(zerodiv, error) Division by zero +zerodiv=;SFP-1;CWE-369 + +#(wrongmathcall, error) Passing value to () leads to undefined result +wrongmathcall=;SFP--1;CWE-687 +wrongmathcallElement=Passing value to # leads to undefined result + +#(cstyleCast, style) C-style pointer casting +cstyleCast=;SFP-1;CWE-704 + +#(redundantIfDelete0, style) Redundant condition. It is safe to deallocate a NULL pointer +redundantIfDelete0=;SFP--1;CWE-710 + +#(redundantIfRemove, style) Redundant condition. The remove function in the STL will not do anything if element doesn't exist +redundantIfRemove=;SFP--1;CWE-710 + +#(dangerousUsageStrtol, error) Invalid radix in call to strtol or strtoul. Must be 0 or 2-36 +dangerousUsageStrtol=Other.Design;SFP--1;CWE-682 + +#(udivWarning, possible style) Division with signed and unsigned operators +udivWarning=Other.Design;SFP--1;CWE-682 + +#(unusedStructMember, style) struct or union member 'structname::variable' is never used +unusedStructMember=;SFP-2;CWE-563 +unusedStructMemberElement=struct or union member '#' is never used + +#(passedByValue, style) Function parameter 'parametername' is passed by value. It could be passed by reference instead. +passedByValueElement=Function parameter '#' is passed by value. It could be passed by reference instead. +passedByValue=;SFP-24;CWE-686 + +#(charArrayIndex, style) Warning - using char variable as array index +charArrayIndex=;SFP-1;CWE-195 + +#(charBitOp, style) Warning - using char variable in bit operation +charBitOp=Other.Design;SFP--1;CWE-682 + +#(conditionAlwaysTrueFalse, style) Condition is always true/false +conditionAlwaysTrueFalse=;SFP--1;CWE-398 + +#(stlOutOfBounds, error) When i==foo.size(), foo[i] is out of bounds +stlOutOfBounds=;SFP-8;CWE-125 + +#(stlIfFind, style) Suspicious condition. The result of find is an iterator, but it is not properly checked. +stlIfFind=;SFP--1;CWE-710 + +#(unusedFunction, style) The function 'funcName' is never used +unusedFunction=;SFP-2;CWE-561 +unusedFunctionElement=The function '#' is never used + diff --git a/com.kdmanalytics.toif.cppcheck/build.properties b/com.kdmanalytics.toif.cppcheck/build.properties new file mode 100644 index 00000000..e9863e28 --- /dev/null +++ b/com.kdmanalytics.toif.cppcheck/build.properties @@ -0,0 +1,5 @@ +source.. = src/ +output.. = bin/ +bin.includes = META-INF/,\ + .,\ + plugin.xml diff --git a/com.kdmanalytics.toif.cppcheck/plugin.xml b/com.kdmanalytics.toif.cppcheck/plugin.xml new file mode 100644 index 00000000..7a3b03da --- /dev/null +++ b/com.kdmanalytics.toif.cppcheck/plugin.xml @@ -0,0 +1,11 @@ + + + + + + + + + diff --git a/com.kdmanalytics.toif.cppcheck/pom.xml b/com.kdmanalytics.toif.cppcheck/pom.xml new file mode 100644 index 00000000..50748ccd --- /dev/null +++ b/com.kdmanalytics.toif.cppcheck/pom.xml @@ -0,0 +1,21 @@ + + + + 4.0.0 + + + com.kdmanalytics.toif + plugins + 1.16.0-SNAPSHOT + + + com.kdmanalytics.toif.compile + com.kdmanalytics.toif.cppcheck + + + eclipse-plugin + + Cppcheck Adaptor + \ No newline at end of file diff --git a/com.kdmanalytics.toif.cppcheck/src/com/kdmanalytics/toif/adaptor/CppcheckAdaptor.java b/com.kdmanalytics.toif.cppcheck/src/com/kdmanalytics/toif/adaptor/CppcheckAdaptor.java new file mode 100644 index 00000000..14279dd3 --- /dev/null +++ b/com.kdmanalytics.toif.cppcheck/src/com/kdmanalytics/toif/adaptor/CppcheckAdaptor.java @@ -0,0 +1,319 @@ + +package com.kdmanalytics.toif.adaptor; + +/******************************************************************************* + * Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This program and + * the accompanying materials are made available under the terms of the Open + * Source Initiative OSI - Open Software License v3.0 which accompanies this + * distribution, and is available at + * http://www.opensource.org/licenses/osl-3.0.php/ + ******************************************************************************/ +import java.io.BufferedReader; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.FileInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import org.xml.sax.SAXException; +import org.xml.sax.XMLReader; +import org.xml.sax.helpers.XMLReaderFactory; + +import com.kdmanalytics.toif.cppcheck.CppCheckParser; +import com.kdmanalytics.toif.framework.parser.StreamGobbler; +import com.kdmanalytics.toif.framework.toolAdaptor.AbstractAdaptor; +import com.kdmanalytics.toif.framework.toolAdaptor.AdaptorOptions; +import com.kdmanalytics.toif.framework.toolAdaptor.Language; +import com.kdmanalytics.toif.framework.xmlElements.entities.Element; +import com.kdmanalytics.toif.framework.xmlElements.entities.File; + +/** + * Create the implementation of the adaptor. + * + * @author Adam Nunn + * + */ +public class CppcheckAdaptor extends AbstractAdaptor +{ + + public CppcheckAdaptor() + { + + } + + /** + * Create the command array to run the tool. + */ + @Override + public String[] runToolCommands(AdaptorOptions options, String[] otherOpts) + { + // The basic commands to run the tool. + final String[] commands = { "cppcheck", "--xml", "-q", options.getInputFile().toString() }; + + /* + * the optional arguments are inserted in to the command array before + * the inputfile. + */ + List commandList; + commandList = new ArrayList(); + commandList.addAll(Arrays.asList(commands)); + commandList.addAll(commands.length - 1, Arrays.asList(otherOpts)); + String[] s = commandList.toArray(new String[commandList.size()]); + + // return the commands. + return s; + } + + /** + * parse the output of the tool. In this case, because cppcheck outputs xml + * on the error stream, I am using an XMLreader and my own parser + * (CppParser) to generate the elements. + */ + @Override + public ArrayList parse(java.io.File process, AdaptorOptions options, File file, boolean[] validLines, boolean unknownCWE) + { + InputStream inputStream; + try + { + String path = process.getAbsolutePath(); + path = path.replace(".cppcheck", "-err.cppcheck"); + java.io.File fileerr = new java.io.File(path); + inputStream = new FileInputStream(fileerr); + + Thread stderr; + final CppCheckParser parser = new CppCheckParser(getProperties(), file, getAdaptorName(), validLines, unknownCWE); + + final ByteArrayOutputStream errStream = new ByteArrayOutputStream(); + + /* + * The act of using a streamGobbler to consume the error stream is + * probably not required if redirectErrorStream() had been used. + */ + + stderr = new Thread(new StreamGobbler(inputStream, errStream)); + + stderr.start(); + stderr.join(); + + // process.waitFor(); + + final byte[] data = errStream.toByteArray(); + final ByteArrayInputStream in = new ByteArrayInputStream(data); + + final XMLReader rdr = XMLReaderFactory.createXMLReader("org.apache.xerces.parsers.SAXParser"); + rdr.setContentHandler(parser); + rdr.parse(fileerr.toURI().toURL().toString()); + + return parser.getElements(); + + } + catch (final SAXException e) + { + System.err.println(getAdaptorName() + ": Error parsing file."); + } + catch (final IOException e) + { + System.err.println(getAdaptorName() + ": Error parsing file."); + } + catch (final InterruptedException e) + { + System.err.println(getAdaptorName() + ": Error parsing file."); + } + + return null; + } + + /** + * Return the name of this adaptor for housekeeping + */ + @Override + public String getAdaptorName() + { + return "Cppcheck"; + } + + /** + * return the description of the adaptor for housekeeping + */ + @Override + public String getAdaptorDescription() + { + return "The cppCheck adaptor"; + } + + /** + * get the name of the Adaptors Vendor. + */ + @Override + public String getAdaptorVendorName() + { + return "KDM Analytics"; + } + + /** + * get the description of the adaptor's vendor + */ + @Override + public String getAdaptorVendorDescription() + { + return "KDM Analytics is a security assurance company providing products and services for threat risk assessment and management, due diligence assessments, and information and data assurance. Leveraging our decades of experience in static analysis, reverse engineering and formal methods, we have created breakthrough products for the automated and systematic investigation of code, data and networks."; + } + + @Override + public String getAdaptorVendorAddress() + { + return "3730 Richmond Rd, Suite 204, Ottawa, ON, K2H 5B9"; + } + + /** + * get the adaptor vendor's phone number + */ + @Override + public String getAdaptorVendorPhone() + { + return "613-627-1011"; + } + + /** + * get the adaptor vendor's email + */ + @Override + public String getAdaptorVendorEmail() + { + return "adam@kdmanalytics.com"; + } + + /** + * get the description of the generator. + */ + @Override + public String getGeneratorDescription() + { + return "Cppcheck is an analysis tool for C/C++ code."; + } + + /** + * get the generator's name + */ + @Override + public String getGeneratorName() + { + return "cppcheck"; + } + + /** + * get the address of the generator's vendor + */ + @Override + public String getGeneratorVendorAddress() + { + return "http://cppcheck.sourceforge.net/"; + } + + /** + * get the description of the generator's vendor + */ + @Override + public String getGeneratorVendorDescription() + { + return "SourceForge is a web-based source code repository."; + } + + /** + * get the generator vendor's email. + */ + @Override + public String getGeneratorVendorEmail() + { + return ""; + } + + /** + * get the generator vendor's name + */ + @Override + public String getGeneratorVendorName() + { + return "sourceforge"; + } + + /** + * get the generator vendor's phone number + */ + @Override + public String getGeneratorVendorPhone() + { + return ""; + } + + /** + * get the version from the tool. To do this, the tool is executed with the + * version option and the version number is parsed from its output. + */ + @Override + public String getGeneratorVersion() + { + final String[] commands = { "cppcheck", "--version" }; + ProcessBuilder cppcheck = new ProcessBuilder(commands); + try + { + Process cppInstance = cppcheck.start(); + InputStream in = cppInstance.getInputStream(); + + BufferedReader br = new BufferedReader(new InputStreamReader(in)); + + String strLine; + + while ((strLine = br.readLine()) != null) + { + String[] stringArray = strLine.split(" "); + if (stringArray[1].trim().equals("1.40")) + { + return stringArray[1].trim(); + } + else + { + // give a warning that a different version was found. + System.err.println(getAdaptorName() + ": Generator " + stringArray[1] + " found, only version 1.40 has been tested"); + return stringArray[1].trim(); + } + } + + } + catch (IOException e) + { + e.printStackTrace(); + } + + return ""; + } + + @Override + public String getRuntoolName() + { + return "cppcheck"; + } + + @Override + public Language getLanguage() + { + return Language.C; + } + + @Override + public boolean acceptsDOptions() + { + return false; + } + + @Override + public boolean acceptsIOptions() + { + return true; + } + +} diff --git a/com.kdmanalytics.toif.cppcheck/src/com/kdmanalytics/toif/cppcheck/Activator.java b/com.kdmanalytics.toif.cppcheck/src/com/kdmanalytics/toif/cppcheck/Activator.java new file mode 100644 index 00000000..3560aa2b --- /dev/null +++ b/com.kdmanalytics.toif.cppcheck/src/com/kdmanalytics/toif/cppcheck/Activator.java @@ -0,0 +1,37 @@ +/******************************************************************************* + * Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This program and the + * accompanying materials are made available under the terms of the Open Source + * Initiative OSI - Open Software License v3.0 which accompanies this + * distribution, and is available at http://www.opensource.org/licenses/osl-3.0.php/ + ******************************************************************************/ +package com.kdmanalytics.toif.cppcheck; + + +import org.osgi.framework.BundleActivator; +import org.osgi.framework.BundleContext; + +public class Activator implements BundleActivator { + + private static BundleContext context; + + static BundleContext getContext() { + return context; + } + + /* + * (non-Javadoc) + * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext) + */ + public void start(BundleContext bundleContext) throws Exception { + Activator.context = bundleContext; + } + + /* + * (non-Javadoc) + * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext) + */ + public void stop(BundleContext bundleContext) throws Exception { + Activator.context = null; + } + +} diff --git a/com.kdmanalytics.toif.cppcheck/src/com/kdmanalytics/toif/cppcheck/CppCheckParser.java b/com.kdmanalytics.toif.cppcheck/src/com/kdmanalytics/toif/cppcheck/CppCheckParser.java new file mode 100644 index 00000000..411f2d8d --- /dev/null +++ b/com.kdmanalytics.toif.cppcheck/src/com/kdmanalytics/toif/cppcheck/CppCheckParser.java @@ -0,0 +1,203 @@ + +package com.kdmanalytics.toif.cppcheck; + +/******************************************************************************* + * Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This program and the + * accompanying materials are made available under the terms of the Open Source + * Initiative OSI - Open Software License v3.0 which accompanies this + * distribution, and is available at http://www.opensource.org/licenses/osl-3.0.php/ + ******************************************************************************/ +import java.io.IOException; +import java.util.ArrayList; +import java.util.Properties; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import org.xml.sax.Attributes; +import org.xml.sax.helpers.DefaultHandler; + +import com.kdmanalytics.toif.framework.utils.FindingCreator; +import com.kdmanalytics.toif.framework.xmlElements.entities.Element; +import com.kdmanalytics.toif.framework.xmlElements.entities.File; + +/** + * Create a parser to handle the specific output of the cppcheck tool + * + * @author Adam Nunn + * + */ +public class CppCheckParser extends DefaultHandler +{ + + public FindingCreator findingCreator; + + public Properties props; + + private File file; + + private boolean[] validLines; + + /** + * constructor for the cppcheck parser + * + * @param properties + * @param file + * @param validLines + * @param unknownCWE + */ + public CppCheckParser(Properties properties, File file, String name, boolean[] validLines, boolean unknownCWE) + { + this.file = file; + this.validLines = validLines; + props = properties; + findingCreator = new FindingCreator(properties, name,unknownCWE); + } + + /** + * This gets called every time there is an xml element found. The idea here + * is to extract the required elements, such as the error id, message, line + * number, and file. This information should be passed on to the + * FindingCreator which will then construct the entities in the toif output. + */ + @Override + public void startElement(String uri, String localName, String qName, Attributes attrs) + { + if (attrs.getLength() == 0) + { + return; + } + + // the error's message + final String msg = attrs.getValue("msg"); + // the id of the error + final String id = attrs.getValue("id"); + // the line number the error was found on + Integer lineNumber = null; + try + { + lineNumber = Integer.parseInt(attrs.getValue("line")); + } + catch (NumberFormatException e) + { + System.err.println("Number exception"); + } + + if (lineNumber == null) + { + return; + } + + // if the line is not an error, skip. + if (!"error".equals(localName)) + { + return; + } + + // Parse errors shouldn't count against the code. That's just not fair. + if (msg.contains("Can't process file")) + { + return; + } + + final String dataElement = getDataElement(id, msg); + + // if there are valid lines + if (validLines != null) + { + // return if the line number is greater than the array size. + if (lineNumber >= validLines.length) + { + try + { + FindingCreator.writeToFile("Cppcheck: Not a valid line (uncompiled) "+file.getPath()+":"+lineNumber+"\n"); + } + catch (IOException e) + { + // TODO Auto-generated catch block + e.printStackTrace(); + } + return; + } + // return if the validity is false. + else if (!validLines[lineNumber]) + { + try + { + FindingCreator.writeToFile("Cppcheck: Not a valid line (uncompiled) "+file.getPath()+":"+lineNumber+"\n"); + } + catch (IOException e) + { + // TODO Auto-generated catch block + e.printStackTrace(); + } + return; + } + } + + // pass the required information to the finding creator. + findingCreator.create(msg, id, lineNumber, null, null, file, dataElement, null); + + } + + public ArrayList getElements() + { + return findingCreator.getElements(); + } + + /** + * Get the dataElement's name from the configuration file. + * + * @param id + * the error's id. + * @param msg + * the error's message. + * @return The name as a string for the dataElement. + */ + public String getDataElement(String id, String msg) + { + // look for the property which defines where the element is. + final String prop = props.getProperty(id + "Element"); + + if (prop == null) + { + return null; + } + + String reg = ""; + + // choose which regex to use. + if (prop.startsWith("#")) + { + final String text = msg.substring(msg.length() - prop.length() + 1); + reg = ".*(?=" + text + ")"; + } + else if (prop.endsWith("#")) + { + final String text = prop.split("#")[0]; + reg = "(?<=" + text + ").*"; + } + else + { + final String[] text = prop.split("#"); + reg = "(?<=" + text[0] + ").*(?=" + text[1] + ")"; + } + + // match the pattern to the message + final Pattern pat = Pattern.compile(reg, Pattern.DOTALL); + final Matcher matcher = pat.matcher(msg); + + String name = ""; + + // if the matcher makes a find, use this as the name + if (matcher.find()) + { + name = matcher.group(); + } + else + { + return null; + } + + return name; + } +} diff --git a/com.kdmanalytics.toif.cppcheck/src/config/CppcheckAdaptorConfiguration b/com.kdmanalytics.toif.cppcheck/src/config/CppcheckAdaptorConfiguration new file mode 100644 index 00000000..d5a81e8a --- /dev/null +++ b/com.kdmanalytics.toif.cppcheck/src/config/CppcheckAdaptorConfiguration @@ -0,0 +1,282 @@ +## +# +#http://sourceforge.net/apps/trac/cppcheck/wiki/ErrorMessages +# +## + + +############################ Need cwes and sfps ############################################################## + +duplicateExpression=;SFP--1;CWE-710 +unsignedPositive=;SFP--1;CWE-710 +missingInclude=;SFP--1;CWE-710 + +#(sizeArgumentAsChar, possible error) The size argument is given as a char constant +sizeArgumentAsChar=;SFP-1;CWE-195 + +#(virtualDestructor, error) Class Base which is inherited by class Derived does not have a virtual destructor +virtualDestructor=;SFP--1;CWE-710 + +#(operatorEqToSelf, possible style) 'operator=' should check for assignment to self +operatorEqToSelfElement='#' should check for assignment to self +operatorEqToSelf=;SFP--1;CWE-710 + +#(functionConst, style) The function 'class::function' can be const +functionConstElement=The function '#' can be const +functionConst=;SFP--1;CWE-710 + +#(mismatchSize, error) The given size sz is mismatching +mismatchSizeElement=The given size # is mismatching +mismatchSize=Memory Managemant;SFP--1;CWE-131 + +#(udivError, error) Unsigned division. The result will be wrong. +udivError=;SFP-1;CWE-195 + +#(variableScope, style) The scope of the variable varname can be reduced +variableScopeElement=The scope of the variable # can be reduced +variableScope=;SFP--1;CWE-710 + +#(constStatement, style) Redundant code: Found a statement that begins with type constant +constStatement=;SFP--1;CWE-710 + +#(syntaxError, error) Invalid number of character ( ) when these macros are defined: . +syntaxErrorElement=when these macros are defined: '#' +syntaxError=;SFP--1;CWE-710 + +#(stlIfStrFind, possible style) Suspicious condition. string::find will return 0 if the string is found at position 0. If this is what you want to check then string::compare is a faster alternative because it doesn't scan through the string. +stlIfStrFind=;SFP--1;CWE-710 + +#(stlSize, possible style) Use list.empty() instead of list.size() to guarantee fast code. size() can take linear time but empty() is guaranteed to take constant time. +stlSize=;SFP--1;CWE-710 + +#(stlBoundries, error) container range check should use != and not < since the order of the pointers isn't guaranteed +stlBoundries=;SFP--1;CWE-710 + +#(erase, error) Dangerous iterator usage. After erase the iterator is invalid so dereferencing it or comparing it with another iterator is invalid. +erase=;SFP--1;CWE-710 + +#(invalidIterator, error) After push_back|push_front|insert, the iterator 'iterator' may be invalid +invalidIteratorElement=After push_back|push_front|insert, the iterator '#' may be invalid +invalidIterator=;SFP--1;CWE-710 + +#(invalidPointer, error) Invalid pointer 'pointer' after push_back / push_front +invalidPointerElement=Invalid pointer '#' after push_back / push_front +invalidPointer=;SFP--1;CWE-710 + +#(strPlusChar, error) Unusual pointer arithmetic +strPlusChar=;SFP-1;CWE-468 + +#(postIncrementDecrement, possible style) Pre-Incrementing variable 'varname' is preferred to Post-Incrementing +postIncrementDecrementElement=Pre-Incrementing variable '#' is preferred to Post-Incrementing +postIncrementDecrement=;SFP--1;CWE-710 + +#(iterators, error) Same iterator is used with both container1 and container2 +iterators=;SFP--1;CWE-710 + +#(mismatchingContainers, error) mismatching containers +mismatchingContainers=;SFP--1;CWE-710 + +#(eraseDereference, error) Dereferenced iterator 'iter' has been erased +eraseDereferenceElement=Dereferenced iterator '#' has been erased +eraseDereference=;SFP--1;CWE-710 + + +#################################################################################################################### + + +#unreadVariable +unreadVariable=;SFP-2;CWE-563 + +#unassignedVariable +unassignedVariable=;SFP-2;CWE-457 + +#(autoVariables, error) Wrong assignment of an auto-variable to an effective parameter of a function +autoVariables=;SFP-1;CWE-562 + +#(returnLocalVariable, error) Returning pointer to local array variable +returnLocalVariable=;SFP-1;CWE-562 + +#(returnReference, error) Returning reference to auto variable +returnReference=;SFP-1;CWE-562 + +#(returnTempReference, error) Returning reference to temporary +returnTempReference=;SFP-1;CWE-562 + +#(returnAutocstr, error) Returning pointer to auto variable +returnAutocstr=;SFP-1;CWE-562 + +#(returnTempPointer, error) Returning pointer to temporary +returnTempPointer=;SFP-1;CWE-562 + +#(arrayIndexOutOfBounds, error) Array index out of bounds +arrayIndexOutOfBounds=;SFP-8;CWE-118 + +#(bufferAccessOutOfBounds, error) Buffer access out-of-bounds: buffer +bufferAccessOutOfBounds=;SFP-8;CWE-120 +bufferAccessOutOfBoundsElement=Buffer access out-of-bounds: # + +#(dangerousStdCin, possible error) Dangerous usage of std::cin, possible buffer overrun +dangerousStdCin=;SFP-3;CWE-676 +dangerousStdCinElement=Dangerous usage of #, possible buffer overrun + +#(strncatUsage, possible error) Dangerous usage of strncat. Tip: the 3rd parameter means maximum number of characters to append +strncatUsage=;SFP-3;CWE-676 +strncatUsageElemnet=Dangerous usage of #. Tip: the 3rd parameter means maximum number of characters to append + +#(outOfBounds, error) index is out of bounds +outOfBounds=;SFP-8;CWE-118 + +#(terminateStrncpy, style) After a strncpy() the buffer should be zero-terminated +terminateStrncpy=;SFP-11;CWE-170 + +#(noConstructor, style) The class 'classname' has no constructor. Member variables not initialized. +noConstructor=;SFP--1;CWE-710 +noConstructorElement=The class '#' has no constructor. Member variables not initialized. + +#(uninitVar, style) Member variable not initialized in the constructor 'classname::varname' +uninitvar=;SFP--1;CWE-710 +uninitVarElement=Member variable not initialized in the constructor '#' + +#(operatorEqVarError, possible style) Member variable 'classname::' is not assigned a value in 'classname::operator=' +operatorEqVarErrorElement=Member variable '#' is not assigned a value in +operatorEqVarError=;SFP--1;CWE-710 + +#(unusedPrivateFunction, style) Unused private function 'classname::funcname' +unusedPrivateFunctionElement=Unused private function '#' +unusedPrivateFunction=;SFP-2;CWE-561 + +#(memsetClass, error) Using 'memfunc' on class +memsetClassElement=Using '#' on class +memsetClass=;SFP--1;CWE-710 + +#(memsetStruct, error) Using 'memfunc' on struct that contains a 'std::classname' +memsetStructElement=Using '#' on struct that contains a 'std::classname' +memsetStruct=;SFP--1;CWE-710 + +#(operatorEq, style) 'operator=' should return something +operatorEq=;SFP--1;CWE-710 +operatorEqElement='#' should return something + +#(thisSubtraction, possible style) Suspicious pointer subtraction +thisSubtraction=;SFP--1;CWE-710 + +#(operatorEqRetRefThis, style) 'operator=' should return reference to self +operatorEq=;SFP--1;CWE-710 +operatorEqRetRefThisElement='#' should return reference to self + +#(dangerousFunctionmktemp, style) Found 'mktemp'. You should use 'mkstemp' instead +dangerousFunctionmktemp=;SFP-16;CWE-73 +dangerousFunctionmktempElement=Found '#'. You should use 'mkstemp' instead + +#(dangerousFunctiongets, style) Found 'gets'. You should use 'fgets' instead +dangerousFunctiongets=;SFP-3;CWE-676 +dangerousFunctiongetsElement=Found '#'. You should use 'fgets' instead + +#(dangerousFunctionscanf, style) Found 'scanf'. You should use 'fgets' instead +dangerousFunctionscanf=;SFP-3;CWE-676 +dangerousFunctionscanfElement=Found '#'. You should use 'fgets' instead + +#(exceptThrowInDestructor, style) Throwing exception in destructor +exceptThrowInDestructor=;SFP-14;CWE-401 + +#(exceptNew, style) Upon exception there is memory leak: p +exceptNewElement=Upon exception there is memory leak: # +exceptNew=;SFP-14;CWE-401 + +#(exceptRealloc, style) Upon exception p becomes a dead pointer +exceptRealloc=;SFP-14;CWE-401 +exceptReallocElement=Upon exception # becomes a dead pointer + +#(exceptDeallocThrow, error) Throwing exception in invalid state, p points at deallocated memory +exceptDeallocThrow=;SFP-15;CWE-416 +exceptDeallocThrowElement=Throwing exception in invalid state, # points at deallocated memory + +#(memleak, error) Memory leak: varname +memleak=Resource Management=;SFP-14;CWE-401 +memleakElement=Memory leak: # + +#(resourceLeak, error) Resource leak: varname +resourceLeak=;SFP-14;CWE-404 +resourceLeakElement=Resource leak: # + +#(deallocDealloc, error) Deallocating a deallocated pointer: varname +deallocDealloc=;SFP-12;CWE-415 +deallocDeallocElement=Deallocating a deallocated pointer: # + +#(deallocuse, error) Dereferencing 'varname' after it is deallocated / released +deallocuse=;SFP-15;CWE-416 +deallocuseElement=Dereferencing '#' after it is deallocated / released + +#(mismatchAllocDealloc, error) Mismatching allocation and deallocation: varname +mismatchAllocDealloc=;SFP-12;CWE-762 +mismatchAllocDeallocElement=Mismatching allocation and deallocation: # + +#(sprintfOverlappingData, error) Undefined behaviour: varname is used wrong in call to sprintf or snprintf. Quote: If copying takes place between objects that overlap as a result of a call to sprintf() or snprintf(), the results are undefined. +sprintfOverlappingData=Other.Design;SFP--1;CWE-682 +sprintfOverlappingDataElement=Undefined behaviour: # is used wrong in call to sprintf or snprintf + +#(nullPointer, error) Possible null pointer dereference: pointer +nullPointer=;SFP-7;CWE-476 +nullPointerElement=Possible null pointer dereference: # + +#(uninitstring, error) Dangerous usage of 'varname' (strncpy doesn't always 0-terminate it) +uninitstringElement=Dangerous usage of '#' (strncpy doesn't always 0-terminate it) +uninitstring=;SFP-11;CWE-170 + +#(uninitdata, error) Data is allocated but not initialized: varname +uninitdata=;SFP-1;CWE-456 +uninitdataElement=Data is allocated but not initialized: # + +#(uninitvar, error) Uninitialized variable: varname +uninitvar=;SFP-1;CWE-457 +uninitvarElement=Uninitialized variable: # +Passing value to () leads to undefined result +#(zerodiv, error) Division by zero +zerodiv=;SFP-1;CWE-369 + +#(wrongmathcall, error) Passing value to () leads to undefined result +wrongmathcall=;SFP--1;CWE-687 +wrongmathcallElement=Passing value to # leads to undefined result + +#(cstyleCast, style) C-style pointer casting +cstyleCast=;SFP-1;CWE-704 + +#(redundantIfDelete0, style) Redundant condition. It is safe to deallocate a NULL pointer +redundantIfDelete0=;SFP--1;CWE-710 + +#(redundantIfRemove, style) Redundant condition. The remove function in the STL will not do anything if element doesn't exist +redundantIfRemove=;SFP--1;CWE-710 + +#(dangerousUsageStrtol, error) Invalid radix in call to strtol or strtoul. Must be 0 or 2-36 +dangerousUsageStrtol=Other.Design;SFP--1;CWE-682 + +#(udivWarning, possible style) Division with signed and unsigned operators +udivWarning=Other.Design;SFP--1;CWE-682 + +#(unusedStructMember, style) struct or union member 'structname::variable' is never used +unusedStructMember=;SFP-2;CWE-563 +unusedStructMemberElement=struct or union member '#' is never used + +#(passedByValue, style) Function parameter 'parametername' is passed by value. It could be passed by reference instead. +passedByValueElement=Function parameter '#' is passed by value. It could be passed by reference instead. +passedByValue=;SFP-24;CWE-686 + +#(charArrayIndex, style) Warning - using char variable as array index +charArrayIndex=;SFP-1;CWE-195 + +#(charBitOp, style) Warning - using char variable in bit operation +charBitOp=Other.Design;SFP--1;CWE-682 + +#(conditionAlwaysTrueFalse, style) Condition is always true/false +conditionAlwaysTrueFalse=;SFP--1;CWE-398 + +#(stlOutOfBounds, error) When i==foo.size(), foo[i] is out of bounds +stlOutOfBounds=;SFP-8;CWE-125 + +#(stlIfFind, style) Suspicious condition. The result of find is an iterator, but it is not properly checked. +stlIfFind=;SFP--1;CWE-710 + +#(unusedFunction, style) The function 'funcName' is never used +unusedFunction=;SFP-2;CWE-561 +unusedFunctionElement=The function '#' is never used + diff --git a/com.kdmanalytics.toif.cppcheck/target/MANIFEST.MF b/com.kdmanalytics.toif.cppcheck/target/MANIFEST.MF new file mode 100644 index 00000000..71691e49 --- /dev/null +++ b/com.kdmanalytics.toif.cppcheck/target/MANIFEST.MF @@ -0,0 +1,15 @@ +Manifest-Version: 1.0 +Export-Package: com.kdmanalytics.toif.adaptor,com.kdmanalytics.toif.cp + pcheck +Require-Bundle: org.eclipse.core.runtime,com.kdmanalytics.toif.framewo + rk;bundle-version="[1.15.0,2.0.0)",org.apache.xerces;bundle-version=" + [2.11.0,3.0.0)",com.kdmanalytics.toif.common;bundle-version="[1.15.0, + 2.0.0)" +Bundle-Vendor: KDM Analytics Inc. +Bundle-Version: 1.15.5 +Bundle-Name: TOIF Cppcheck +Bundle-Activator: com.kdmanalytics.toif.cppcheck.Activator +Bundle-ManifestVersion: 2 +Bundle-SymbolicName: com.kdmanalytics.toif.cppcheck;singleton:=true +Bundle-RequiredExecutionEnvironment: JavaSE-1.7 + diff --git a/com.kdmanalytics.toif.cppcheck/target/classes/com/kdmanalytics/toif/adaptor/CppcheckAdaptor.class b/com.kdmanalytics.toif.cppcheck/target/classes/com/kdmanalytics/toif/adaptor/CppcheckAdaptor.class new file mode 100644 index 00000000..776f24c9 Binary files /dev/null and b/com.kdmanalytics.toif.cppcheck/target/classes/com/kdmanalytics/toif/adaptor/CppcheckAdaptor.class differ diff --git a/com.kdmanalytics.toif.cppcheck/target/classes/com/kdmanalytics/toif/cppcheck/Activator.class b/com.kdmanalytics.toif.cppcheck/target/classes/com/kdmanalytics/toif/cppcheck/Activator.class new file mode 100644 index 00000000..5747ceeb Binary files /dev/null and b/com.kdmanalytics.toif.cppcheck/target/classes/com/kdmanalytics/toif/cppcheck/Activator.class differ diff --git a/com.kdmanalytics.toif.cppcheck/target/classes/com/kdmanalytics/toif/cppcheck/CppCheckParser.class b/com.kdmanalytics.toif.cppcheck/target/classes/com/kdmanalytics/toif/cppcheck/CppCheckParser.class new file mode 100644 index 00000000..289a93eb Binary files /dev/null and b/com.kdmanalytics.toif.cppcheck/target/classes/com/kdmanalytics/toif/cppcheck/CppCheckParser.class differ diff --git a/com.kdmanalytics.toif.cppcheck/target/classes/config/CppcheckAdaptorConfiguration b/com.kdmanalytics.toif.cppcheck/target/classes/config/CppcheckAdaptorConfiguration new file mode 100644 index 00000000..d5a81e8a --- /dev/null +++ b/com.kdmanalytics.toif.cppcheck/target/classes/config/CppcheckAdaptorConfiguration @@ -0,0 +1,282 @@ +## +# +#http://sourceforge.net/apps/trac/cppcheck/wiki/ErrorMessages +# +## + + +############################ Need cwes and sfps ############################################################## + +duplicateExpression=;SFP--1;CWE-710 +unsignedPositive=;SFP--1;CWE-710 +missingInclude=;SFP--1;CWE-710 + +#(sizeArgumentAsChar, possible error) The size argument is given as a char constant +sizeArgumentAsChar=;SFP-1;CWE-195 + +#(virtualDestructor, error) Class Base which is inherited by class Derived does not have a virtual destructor +virtualDestructor=;SFP--1;CWE-710 + +#(operatorEqToSelf, possible style) 'operator=' should check for assignment to self +operatorEqToSelfElement='#' should check for assignment to self +operatorEqToSelf=;SFP--1;CWE-710 + +#(functionConst, style) The function 'class::function' can be const +functionConstElement=The function '#' can be const +functionConst=;SFP--1;CWE-710 + +#(mismatchSize, error) The given size sz is mismatching +mismatchSizeElement=The given size # is mismatching +mismatchSize=Memory Managemant;SFP--1;CWE-131 + +#(udivError, error) Unsigned division. The result will be wrong. +udivError=;SFP-1;CWE-195 + +#(variableScope, style) The scope of the variable varname can be reduced +variableScopeElement=The scope of the variable # can be reduced +variableScope=;SFP--1;CWE-710 + +#(constStatement, style) Redundant code: Found a statement that begins with type constant +constStatement=;SFP--1;CWE-710 + +#(syntaxError, error) Invalid number of character ( ) when these macros are defined: . +syntaxErrorElement=when these macros are defined: '#' +syntaxError=;SFP--1;CWE-710 + +#(stlIfStrFind, possible style) Suspicious condition. string::find will return 0 if the string is found at position 0. If this is what you want to check then string::compare is a faster alternative because it doesn't scan through the string. +stlIfStrFind=;SFP--1;CWE-710 + +#(stlSize, possible style) Use list.empty() instead of list.size() to guarantee fast code. size() can take linear time but empty() is guaranteed to take constant time. +stlSize=;SFP--1;CWE-710 + +#(stlBoundries, error) container range check should use != and not < since the order of the pointers isn't guaranteed +stlBoundries=;SFP--1;CWE-710 + +#(erase, error) Dangerous iterator usage. After erase the iterator is invalid so dereferencing it or comparing it with another iterator is invalid. +erase=;SFP--1;CWE-710 + +#(invalidIterator, error) After push_back|push_front|insert, the iterator 'iterator' may be invalid +invalidIteratorElement=After push_back|push_front|insert, the iterator '#' may be invalid +invalidIterator=;SFP--1;CWE-710 + +#(invalidPointer, error) Invalid pointer 'pointer' after push_back / push_front +invalidPointerElement=Invalid pointer '#' after push_back / push_front +invalidPointer=;SFP--1;CWE-710 + +#(strPlusChar, error) Unusual pointer arithmetic +strPlusChar=;SFP-1;CWE-468 + +#(postIncrementDecrement, possible style) Pre-Incrementing variable 'varname' is preferred to Post-Incrementing +postIncrementDecrementElement=Pre-Incrementing variable '#' is preferred to Post-Incrementing +postIncrementDecrement=;SFP--1;CWE-710 + +#(iterators, error) Same iterator is used with both container1 and container2 +iterators=;SFP--1;CWE-710 + +#(mismatchingContainers, error) mismatching containers +mismatchingContainers=;SFP--1;CWE-710 + +#(eraseDereference, error) Dereferenced iterator 'iter' has been erased +eraseDereferenceElement=Dereferenced iterator '#' has been erased +eraseDereference=;SFP--1;CWE-710 + + +#################################################################################################################### + + +#unreadVariable +unreadVariable=;SFP-2;CWE-563 + +#unassignedVariable +unassignedVariable=;SFP-2;CWE-457 + +#(autoVariables, error) Wrong assignment of an auto-variable to an effective parameter of a function +autoVariables=;SFP-1;CWE-562 + +#(returnLocalVariable, error) Returning pointer to local array variable +returnLocalVariable=;SFP-1;CWE-562 + +#(returnReference, error) Returning reference to auto variable +returnReference=;SFP-1;CWE-562 + +#(returnTempReference, error) Returning reference to temporary +returnTempReference=;SFP-1;CWE-562 + +#(returnAutocstr, error) Returning pointer to auto variable +returnAutocstr=;SFP-1;CWE-562 + +#(returnTempPointer, error) Returning pointer to temporary +returnTempPointer=;SFP-1;CWE-562 + +#(arrayIndexOutOfBounds, error) Array index out of bounds +arrayIndexOutOfBounds=;SFP-8;CWE-118 + +#(bufferAccessOutOfBounds, error) Buffer access out-of-bounds: buffer +bufferAccessOutOfBounds=;SFP-8;CWE-120 +bufferAccessOutOfBoundsElement=Buffer access out-of-bounds: # + +#(dangerousStdCin, possible error) Dangerous usage of std::cin, possible buffer overrun +dangerousStdCin=;SFP-3;CWE-676 +dangerousStdCinElement=Dangerous usage of #, possible buffer overrun + +#(strncatUsage, possible error) Dangerous usage of strncat. Tip: the 3rd parameter means maximum number of characters to append +strncatUsage=;SFP-3;CWE-676 +strncatUsageElemnet=Dangerous usage of #. Tip: the 3rd parameter means maximum number of characters to append + +#(outOfBounds, error) index is out of bounds +outOfBounds=;SFP-8;CWE-118 + +#(terminateStrncpy, style) After a strncpy() the buffer should be zero-terminated +terminateStrncpy=;SFP-11;CWE-170 + +#(noConstructor, style) The class 'classname' has no constructor. Member variables not initialized. +noConstructor=;SFP--1;CWE-710 +noConstructorElement=The class '#' has no constructor. Member variables not initialized. + +#(uninitVar, style) Member variable not initialized in the constructor 'classname::varname' +uninitvar=;SFP--1;CWE-710 +uninitVarElement=Member variable not initialized in the constructor '#' + +#(operatorEqVarError, possible style) Member variable 'classname::' is not assigned a value in 'classname::operator=' +operatorEqVarErrorElement=Member variable '#' is not assigned a value in +operatorEqVarError=;SFP--1;CWE-710 + +#(unusedPrivateFunction, style) Unused private function 'classname::funcname' +unusedPrivateFunctionElement=Unused private function '#' +unusedPrivateFunction=;SFP-2;CWE-561 + +#(memsetClass, error) Using 'memfunc' on class +memsetClassElement=Using '#' on class +memsetClass=;SFP--1;CWE-710 + +#(memsetStruct, error) Using 'memfunc' on struct that contains a 'std::classname' +memsetStructElement=Using '#' on struct that contains a 'std::classname' +memsetStruct=;SFP--1;CWE-710 + +#(operatorEq, style) 'operator=' should return something +operatorEq=;SFP--1;CWE-710 +operatorEqElement='#' should return something + +#(thisSubtraction, possible style) Suspicious pointer subtraction +thisSubtraction=;SFP--1;CWE-710 + +#(operatorEqRetRefThis, style) 'operator=' should return reference to self +operatorEq=;SFP--1;CWE-710 +operatorEqRetRefThisElement='#' should return reference to self + +#(dangerousFunctionmktemp, style) Found 'mktemp'. You should use 'mkstemp' instead +dangerousFunctionmktemp=;SFP-16;CWE-73 +dangerousFunctionmktempElement=Found '#'. You should use 'mkstemp' instead + +#(dangerousFunctiongets, style) Found 'gets'. You should use 'fgets' instead +dangerousFunctiongets=;SFP-3;CWE-676 +dangerousFunctiongetsElement=Found '#'. You should use 'fgets' instead + +#(dangerousFunctionscanf, style) Found 'scanf'. You should use 'fgets' instead +dangerousFunctionscanf=;SFP-3;CWE-676 +dangerousFunctionscanfElement=Found '#'. You should use 'fgets' instead + +#(exceptThrowInDestructor, style) Throwing exception in destructor +exceptThrowInDestructor=;SFP-14;CWE-401 + +#(exceptNew, style) Upon exception there is memory leak: p +exceptNewElement=Upon exception there is memory leak: # +exceptNew=;SFP-14;CWE-401 + +#(exceptRealloc, style) Upon exception p becomes a dead pointer +exceptRealloc=;SFP-14;CWE-401 +exceptReallocElement=Upon exception # becomes a dead pointer + +#(exceptDeallocThrow, error) Throwing exception in invalid state, p points at deallocated memory +exceptDeallocThrow=;SFP-15;CWE-416 +exceptDeallocThrowElement=Throwing exception in invalid state, # points at deallocated memory + +#(memleak, error) Memory leak: varname +memleak=Resource Management=;SFP-14;CWE-401 +memleakElement=Memory leak: # + +#(resourceLeak, error) Resource leak: varname +resourceLeak=;SFP-14;CWE-404 +resourceLeakElement=Resource leak: # + +#(deallocDealloc, error) Deallocating a deallocated pointer: varname +deallocDealloc=;SFP-12;CWE-415 +deallocDeallocElement=Deallocating a deallocated pointer: # + +#(deallocuse, error) Dereferencing 'varname' after it is deallocated / released +deallocuse=;SFP-15;CWE-416 +deallocuseElement=Dereferencing '#' after it is deallocated / released + +#(mismatchAllocDealloc, error) Mismatching allocation and deallocation: varname +mismatchAllocDealloc=;SFP-12;CWE-762 +mismatchAllocDeallocElement=Mismatching allocation and deallocation: # + +#(sprintfOverlappingData, error) Undefined behaviour: varname is used wrong in call to sprintf or snprintf. Quote: If copying takes place between objects that overlap as a result of a call to sprintf() or snprintf(), the results are undefined. +sprintfOverlappingData=Other.Design;SFP--1;CWE-682 +sprintfOverlappingDataElement=Undefined behaviour: # is used wrong in call to sprintf or snprintf + +#(nullPointer, error) Possible null pointer dereference: pointer +nullPointer=;SFP-7;CWE-476 +nullPointerElement=Possible null pointer dereference: # + +#(uninitstring, error) Dangerous usage of 'varname' (strncpy doesn't always 0-terminate it) +uninitstringElement=Dangerous usage of '#' (strncpy doesn't always 0-terminate it) +uninitstring=;SFP-11;CWE-170 + +#(uninitdata, error) Data is allocated but not initialized: varname +uninitdata=;SFP-1;CWE-456 +uninitdataElement=Data is allocated but not initialized: # + +#(uninitvar, error) Uninitialized variable: varname +uninitvar=;SFP-1;CWE-457 +uninitvarElement=Uninitialized variable: # +Passing value to () leads to undefined result +#(zerodiv, error) Division by zero +zerodiv=;SFP-1;CWE-369 + +#(wrongmathcall, error) Passing value to () leads to undefined result +wrongmathcall=;SFP--1;CWE-687 +wrongmathcallElement=Passing value to # leads to undefined result + +#(cstyleCast, style) C-style pointer casting +cstyleCast=;SFP-1;CWE-704 + +#(redundantIfDelete0, style) Redundant condition. It is safe to deallocate a NULL pointer +redundantIfDelete0=;SFP--1;CWE-710 + +#(redundantIfRemove, style) Redundant condition. The remove function in the STL will not do anything if element doesn't exist +redundantIfRemove=;SFP--1;CWE-710 + +#(dangerousUsageStrtol, error) Invalid radix in call to strtol or strtoul. Must be 0 or 2-36 +dangerousUsageStrtol=Other.Design;SFP--1;CWE-682 + +#(udivWarning, possible style) Division with signed and unsigned operators +udivWarning=Other.Design;SFP--1;CWE-682 + +#(unusedStructMember, style) struct or union member 'structname::variable' is never used +unusedStructMember=;SFP-2;CWE-563 +unusedStructMemberElement=struct or union member '#' is never used + +#(passedByValue, style) Function parameter 'parametername' is passed by value. It could be passed by reference instead. +passedByValueElement=Function parameter '#' is passed by value. It could be passed by reference instead. +passedByValue=;SFP-24;CWE-686 + +#(charArrayIndex, style) Warning - using char variable as array index +charArrayIndex=;SFP-1;CWE-195 + +#(charBitOp, style) Warning - using char variable in bit operation +charBitOp=Other.Design;SFP--1;CWE-682 + +#(conditionAlwaysTrueFalse, style) Condition is always true/false +conditionAlwaysTrueFalse=;SFP--1;CWE-398 + +#(stlOutOfBounds, error) When i==foo.size(), foo[i] is out of bounds +stlOutOfBounds=;SFP-8;CWE-125 + +#(stlIfFind, style) Suspicious condition. The result of find is an iterator, but it is not properly checked. +stlIfFind=;SFP--1;CWE-710 + +#(unusedFunction, style) The function 'funcName' is never used +unusedFunction=;SFP-2;CWE-561 +unusedFunctionElement=The function '#' is never used + diff --git a/com.kdmanalytics.toif.cppcheck/target/com.kdmanalytics.toif.cppcheck-1.15.5.jar b/com.kdmanalytics.toif.cppcheck/target/com.kdmanalytics.toif.cppcheck-1.15.5.jar new file mode 100644 index 00000000..ca2ec2a9 Binary files /dev/null and b/com.kdmanalytics.toif.cppcheck/target/com.kdmanalytics.toif.cppcheck-1.15.5.jar differ diff --git a/com.kdmanalytics.toif.cppcheck/target/local-artifacts.properties b/com.kdmanalytics.toif.cppcheck/target/local-artifacts.properties new file mode 100644 index 00000000..61e6bd07 --- /dev/null +++ b/com.kdmanalytics.toif.cppcheck/target/local-artifacts.properties @@ -0,0 +1,4 @@ +#Thu May 29 09:56:24 EDT 2014 +artifact.attached.p2metadata=/home/adam/git/toif/plugins/com.kdmanalytics.toif.cppcheck/target/p2content.xml +artifact.main=/home/adam/git/toif/plugins/com.kdmanalytics.toif.cppcheck/target/com.kdmanalytics.toif.cppcheck-1.15.5.jar +artifact.attached.p2artifacts=/home/adam/git/toif/plugins/com.kdmanalytics.toif.cppcheck/target/p2artifacts.xml diff --git a/com.kdmanalytics.toif.cppcheck/target/maven-archiver/pom.properties b/com.kdmanalytics.toif.cppcheck/target/maven-archiver/pom.properties new file mode 100644 index 00000000..a2f001b0 --- /dev/null +++ b/com.kdmanalytics.toif.cppcheck/target/maven-archiver/pom.properties @@ -0,0 +1,5 @@ +#Generated by Maven +#Thu May 29 09:56:24 EDT 2014 +version=1.15.5 +groupId=com.kdmanalytics.toif.compile +artifactId=com.kdmanalytics.toif.cppcheck diff --git a/com.kdmanalytics.toif.cppcheck/target/p2artifacts.xml b/com.kdmanalytics.toif.cppcheck/target/p2artifacts.xml new file mode 100644 index 00000000..2322c894 --- /dev/null +++ b/com.kdmanalytics.toif.cppcheck/target/p2artifacts.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/com.kdmanalytics.toif.cppcheck/target/p2content.xml b/com.kdmanalytics.toif.cppcheck/target/p2content.xml new file mode 100644 index 00000000..36e2137e --- /dev/null +++ b/com.kdmanalytics.toif.cppcheck/target/p2content.xml @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Bundle-SymbolicName: com.kdmanalytics.toif.cppcheck;singleton:=true Bundle-Version: 1.15.5 + + + + + diff --git a/com.kdmanalytics.toif.cweUtil/.classpath b/com.kdmanalytics.toif.cweUtil/.classpath new file mode 100644 index 00000000..18d70f02 --- /dev/null +++ b/com.kdmanalytics.toif.cweUtil/.classpath @@ -0,0 +1,6 @@ + + + + + + diff --git a/com.kdmanalytics.toif.cweUtil/.project b/com.kdmanalytics.toif.cweUtil/.project new file mode 100644 index 00000000..ecb8cd6f --- /dev/null +++ b/com.kdmanalytics.toif.cweUtil/.project @@ -0,0 +1,17 @@ + + + com.kdmanalytics.toif.cweUtil + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/com.kdmanalytics.toif.cweUtil/.settings/org.eclipse.jdt.core.prefs b/com.kdmanalytics.toif.cweUtil/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 00000000..8000cd6c --- /dev/null +++ b/com.kdmanalytics.toif.cweUtil/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,11 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +org.eclipse.jdt.core.compiler.compliance=1.6 +org.eclipse.jdt.core.compiler.debug.lineNumber=generate +org.eclipse.jdt.core.compiler.debug.localVariable=generate +org.eclipse.jdt.core.compiler.debug.sourceFile=generate +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.6 diff --git a/com.kdmanalytics.toif.facade/.classpath b/com.kdmanalytics.toif.facade/.classpath new file mode 100644 index 00000000..ad32c83a --- /dev/null +++ b/com.kdmanalytics.toif.facade/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/com.kdmanalytics.toif.facade/.project b/com.kdmanalytics.toif.facade/.project new file mode 100644 index 00000000..747de4a5 --- /dev/null +++ b/com.kdmanalytics.toif.facade/.project @@ -0,0 +1,28 @@ + + + com.kdmanalytics.toif.facade + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + + org.eclipse.pde.PluginNature + org.eclipse.jdt.core.javanature + + diff --git a/com.kdmanalytics.toif.facade/.settings/org.eclipse.jdt.core.prefs b/com.kdmanalytics.toif.facade/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 00000000..c537b630 --- /dev/null +++ b/com.kdmanalytics.toif.facade/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,7 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 +org.eclipse.jdt.core.compiler.compliance=1.6 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.6 diff --git a/com.kdmanalytics.toif.facade/META-INF/MANIFEST.MF b/com.kdmanalytics.toif.facade/META-INF/MANIFEST.MF new file mode 100644 index 00000000..a1a542ed --- /dev/null +++ b/com.kdmanalytics.toif.facade/META-INF/MANIFEST.MF @@ -0,0 +1,15 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: ExtractorInterface +Bundle-SymbolicName: com.kdmanalytics.toif.facade +Bundle-Version: 1.16.0.qualifier +Bundle-Activator: com.kdmanalytics.toif.facade.internal.Activator +Bundle-Vendor: KDMANALYTICS +Require-Bundle: org.eclipse.core.runtime, + com.kdmanalytics.toif.framework;bundle-version="[1.14.0,2.0.0)", + com.google.guava;bundle-version="[14.0.1,15.0.0)", + com.kdmanalytics.toif.assimilator;bundle-version="[1.14.0,2.0.0)", + com.kdmanalytics.toif.common;bundle-version="[1.14.0,2.0.0)";visibility:=reexport +Bundle-RequiredExecutionEnvironment: JavaSE-1.6 +Bundle-ActivationPolicy: lazy +Export-Package: com.kdmanalytics.toif.facade diff --git a/com.kdmanalytics.toif.facade/bin/com/kdmanalytics/toif/facade/IToifFacade.class b/com.kdmanalytics.toif.facade/bin/com/kdmanalytics/toif/facade/IToifFacade.class new file mode 100644 index 00000000..357dfa30 Binary files /dev/null and b/com.kdmanalytics.toif.facade/bin/com/kdmanalytics/toif/facade/IToifFacade.class differ diff --git a/com.kdmanalytics.toif.facade/bin/com/kdmanalytics/toif/facade/ToifFacade.class b/com.kdmanalytics.toif.facade/bin/com/kdmanalytics/toif/facade/ToifFacade.class new file mode 100644 index 00000000..29469b70 Binary files /dev/null and b/com.kdmanalytics.toif.facade/bin/com/kdmanalytics/toif/facade/ToifFacade.class differ diff --git a/com.kdmanalytics.toif.facade/bin/com/kdmanalytics/toif/facade/internal/Activator.class b/com.kdmanalytics.toif.facade/bin/com/kdmanalytics/toif/facade/internal/Activator.class new file mode 100644 index 00000000..075d9753 Binary files /dev/null and b/com.kdmanalytics.toif.facade/bin/com/kdmanalytics/toif/facade/internal/Activator.class differ diff --git a/com.kdmanalytics.toif.facade/build.properties b/com.kdmanalytics.toif.facade/build.properties new file mode 100644 index 00000000..34d2e4d2 --- /dev/null +++ b/com.kdmanalytics.toif.facade/build.properties @@ -0,0 +1,4 @@ +source.. = src/ +output.. = bin/ +bin.includes = META-INF/,\ + . diff --git a/com.kdmanalytics.toif.facade/pom.xml b/com.kdmanalytics.toif.facade/pom.xml new file mode 100644 index 00000000..029d6039 --- /dev/null +++ b/com.kdmanalytics.toif.facade/pom.xml @@ -0,0 +1,21 @@ + + + + 4.0.0 + + + com.kdmanalytics.toif + plugins + 1.16.0-SNAPSHOT + + + com.kdmanalytics.toif.compile + com.kdmanalytics.toif.facade + + + eclipse-plugin + + TOIF Application Interface + diff --git a/com.kdmanalytics.toif.facade/src/com/kdmanalytics/toif/facade/IToifFacade.java b/com.kdmanalytics.toif.facade/src/com/kdmanalytics/toif/facade/IToifFacade.java new file mode 100644 index 00000000..71737196 --- /dev/null +++ b/com.kdmanalytics.toif.facade/src/com/kdmanalytics/toif/facade/IToifFacade.java @@ -0,0 +1,140 @@ + +package com.kdmanalytics.toif.facade; + +/******************************************************************************* + * Copyright (c) 2013 KDM Analytics, Inc. All rights reserved. This program and + * the accompanying materials are made available under the terms of the Open + * Source Initiative OSI - Open Software License v3.0 which accompanies this + * distribution, and is available at + * http://www.opensource.org/licenses/osl-3.0.php/ + ******************************************************************************/ +import java.io.File; +import java.util.Set; + +import com.kdmanalytics.toif.common.exception.ToifException; +import com.kdmanalytics.toif.framework.toolAdaptor.AbstractAdaptor; +import com.kdmanalytics.toif.framework.toolAdaptor.Language; + +public interface IToifFacade +{ + + /** + * get all the available adaptors that can be run. + * + * @param lang + * the enumerated value of the language that you need the adaptor + * to be for. + * @return the list of adaptors. + */ + Set availableAdapters(); + + /** + * get all the available adaptors that can be run. + * + * @param lang + * the enumerated value of the language that you need the adaptor + * to be for. + * @return the list of adaptors. + */ + Set availableAdapters(Language lang); + + + /** + * Return list of runnable reporting tools. + * + * @return return a list of runnable reporting tools. + */ + Set runnableAdapterReportingTool(); + + /** + * returns if the reporting tool for the given adaptor is runnable. + * + * @param adaptor + * the adaptor that we want to check has a working reporting + * tool. + * @return true if the reporting tool is runnable. + */ + boolean isAdapterReportingToolRunnable(AbstractAdaptor adaptor); + + + /** + * execute the adaptors. these create the toif files. + * + * @param adapter + * the adaptor to be run. + * @param inputFile + * the source file on which to run the adaptor. + * @param houseKeepingFile + * the housekeeping file for the adaptor. + * @param OutputDirectory + * the output directory to store the toif file. + * @param additionalArgs + * and additional arguments for the adaptors. + * + * @return true if run. + * @throws IllegalArgumentException + * @throws ToifInternalException + */ + boolean execute(AbstractAdaptor adapter, File inputFile, File houseKeepingFile, File OutputDirectory, File workingDirectory, + String[] additionalArgs, String rename) + throws IllegalArgumentException, ToifException; + + /** + * execute the adaptors. these create the toif files. + * + * @param adapter + * the adaptor to be run. + * @param inputFile + * the source file on which to run the adaptor. + * @param houseKeepingFile + * the housekeeping file for the adaptor. + * @param OutputDirectory + * the output directory to store the toif file. + * @param additionalArgs + * and additional arguments for the adaptors. + * @param validLines + * array for booleans. each index is a different line of the + * file. valid or not. + * + * @return true if run. + * @throws IllegalArgumentException + * @throws ToifInternalException + */ + boolean execute(AbstractAdaptor adapter, File inputFile, File houseKeepingFile, File OutputDirectory, File workingDirectory, + String[] additionalArgs, boolean[] validLines,String rename) throws IllegalArgumentException, ToifException; + + + /** + * merge the toif and kdm files. + * + * @param kdmOutputFile + * the file that we are going to output. Its a zipped kdm file + * eg: test.kdm + * @param kdmFile + * the input file. This zipped kdm file has come from the + * extractor linker. + * @param toifFiles + * the files that were created by the adaptors. + * @return true if run. + * @throws ToifInternalException + */ + boolean merge(File kdmOutputFile, File kdmFile, Set toifFiles, boolean createZip) throws ToifException; + + /** + * merge the toif and kdm files. + * + * @param kdmOutputFile + * the file that we are going to output. Its a zipped kdm file + * eg: test.kdm + * @param kdmFile + * the input file. This zipped kdm file has come from the + * extractor linker. + * @param toifFiles + * the files that were created by the adaptors. + * @return true if run. + * @throws ToifInternalException + */ + boolean merge(File kdmOutputFile, Set toifFiles, boolean createZip) throws ToifException; + + +} diff --git a/com.kdmanalytics.toif.facade/src/com/kdmanalytics/toif/facade/ToifFacade.java b/com.kdmanalytics.toif.facade/src/com/kdmanalytics/toif/facade/ToifFacade.java new file mode 100644 index 00000000..eacf64c4 --- /dev/null +++ b/com.kdmanalytics.toif.facade/src/com/kdmanalytics/toif/facade/ToifFacade.java @@ -0,0 +1,324 @@ +package com.kdmanalytics.toif.facade; + +/******************************************************************************* + * Copyright (c) 2013 KDM Analytics, Inc. All rights reserved. This program and + * the accompanying materials are made available under the terms of the Open + * Source Initiative OSI - Open Software License v3.0 which accompanies this + * distribution, and is available at + * http://www.opensource.org/licenses/osl-3.0.php/ + ******************************************************************************/ +import static com.google.common.base.Preconditions.checkNotNull; + +import java.io.BufferedReader; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Set; + +import com.google.common.collect.Lists; +import com.kdmanalytics.toif.assimilator.Assimilator; +import com.kdmanalytics.toif.common.exception.ToifException; +import com.kdmanalytics.toif.framework.toolAdaptor.AbstractAdaptor; +import com.kdmanalytics.toif.framework.toolAdaptor.Language; +import com.kdmanalytics.toif.framework.toolAdaptor.ToolAdaptor; +import com.kdmanalytics.toif.framework.toolAdaptor.ToolAdaptorUtil; + +public class ToifFacade implements IToifFacade + { + + /** + * Empty constructor. + */ + public ToifFacade() + { + + } + + @Override + public Set availableAdapters() + { + return ToolAdaptorUtil.getAdaptors(); + } + + @Override + public Set availableAdapters(Language lang) + { + Set aset = new HashSet(); + + for (AbstractAdaptor adaptor : ToolAdaptorUtil.getAdaptors()) + { + if (adaptor.getLanguage() == lang) + aset.add(adaptor); + } + return aset; + } + + @Override + public Set runnableAdapterReportingTool() + { + Set result = new HashSet(); + + for (AbstractAdaptor instance : ToolAdaptorUtil.getAdaptors()) + { + String runtimeName = instance.getRuntoolName(); + + ProcessBuilder process = null; + + // TODO: push the check into the adaptor + if (runtimeName.equals("findbugs")) + { + // if the system is linux, findbugs can be executed on its + // own. + if ("Linux".equals(System.getProperty("os.name"))) + { + process = new ProcessBuilder(); + ArrayList commands = new ArrayList(); + commands.add(runtimeName); + commands.add("-textui"); + process.command(commands); + } + else + { + process = new ProcessBuilder(); + String[] commands = { "cmd.exe", "/C", "findbugs.bat", + "-textui" }; + process.command(commands); + } + } + else + { + process = new ProcessBuilder(runtimeName); + } + + try + { + process.start(); + + result.add(instance); + } + catch (IOException e) + { + System.err.println("The process for " + + instance.getAdaptorName() + " could not be started."); + continue; + } + } + + return result; + } + + @Override + public boolean isAdapterReportingToolRunnable(AbstractAdaptor adaptor) + { + try + { + + String runtimeName = adaptor.getRuntoolName(); + ProcessBuilder process = null; + if ("findbugs".equals(runtimeName)) + { + + // if the system is linux, findbugs can be executed on its + // own. + if ("Linux".equals(System.getProperty("os.name"))) + { + process = new ProcessBuilder(); + ArrayList commands = new ArrayList(); + commands.add(runtimeName); + commands.add("-version"); + process.command(commands); + + } + else + { + process = new ProcessBuilder(); + String[] commands = { "cmd.exe", "/C", "findbugs.bat", + "-version" }; + process.command(commands); + + Process child = process.start(); + + InputStream is = child.getInputStream(); + InputStreamReader isr = new InputStreamReader(is); + BufferedReader br = new BufferedReader(isr); + String line; + while ((line = br.readLine()) != null) + { + if (line.startsWith("1.3")) + { + return true; + } + else + { + return false; + } + } + + // Close file and free resources + isr.close(); + is.close(); + + return false; + } + } + else + { + process = new ProcessBuilder(runtimeName); + } + + process.start(); + + return true; + + } + catch (IOException e) + { + System.err.println("The process for " + adaptor.getAdaptorName() + + " could not be started."); + return false; + } + + } + + /** + * executes the adaptor. + */ + @Override + public boolean execute(AbstractAdaptor adaptor, File inputFile, + File houseKeepingFile, File outputDirectory, File workingDirectory, + String[] additionalArgs, String rename) + throws IllegalArgumentException, ToifException + { + + // Provide exception guard for internal TOIF Exceptions + try + { + return execute(adaptor, inputFile, houseKeepingFile, + outputDirectory, workingDirectory, additionalArgs, null, + rename); + } + + // do not map IllegalArgumentException + catch( IllegalArgumentException iex) + { + throw iex; + } + // All other exceptions map to ToifException + catch (Exception e) + { + throw new ToifException(e); + } + } + + @Override + public boolean execute(AbstractAdaptor adaptor, File inputFile, + File houseKeepingFile, File OutputDirectory, File workingDirectory, + String additionalArgs[], boolean[] validLines, String rename) + throws IllegalArgumentException, ToifException + { + checkNotNull(adaptor, "Adaptor must be specified"); + checkNotNull(inputFile, "input File must be specified"); + checkNotNull(houseKeepingFile, "Housekeeping file must be specified"); + checkNotNull(OutputDirectory, "output directory must be specified"); + + List args = Lists.newArrayList("-i", + inputFile.getAbsolutePath(), "-h", + houseKeepingFile.getAbsolutePath(), "-o", + OutputDirectory.getAbsolutePath(), "--unknownCWE"); + + if (rename != null) + { + args.add("-n"); + args.add(rename); + } + + if (additionalArgs != null) + { + for (String arg : additionalArgs) + args.add(arg); + } + + // Provide exception guard for internal TOIF Exceptions + try + { + ToolAdaptor toolAdaptor = new ToolAdaptor(); + + return toolAdaptor.runToolAdaptor(adaptor, args, workingDirectory, + validLines); + } + // do not map IllegalArgumentException + catch( IllegalArgumentException iex) + { + throw iex; + } + + catch (ToifException te) + { + throw te; + } + + // All other exceptions map to ToifException + catch (Exception e) + { + throw new ToifException(e); + } + } + + @Override + public boolean merge(File kdmOutputFile, Set toifFiles, + boolean createZip) throws ToifException + { + // Provide exception guard for internal TOIF Exceptions + try + { + Assimilator ass = new Assimilator(createZip); + List args = Lists.newArrayList("-k", + kdmOutputFile.getAbsolutePath()); + + for (File file : toifFiles) + { + args.add(file.getAbsolutePath()); + } + + ass.assimilate(args.toArray(new String[args.size()])); + return true; + } + + + catch (Exception e) + { + throw new ToifException(e); + } + } + + @Override + public boolean merge(File kdmOutputFile, File kdmFile, Set toifFiles, + boolean createZip) throws ToifException + { + // Provide exception guard for internal TOIF Exceptions + try + { + Assimilator ass = new Assimilator(createZip); + List args = Lists.newArrayList("-m", + kdmOutputFile.getAbsolutePath()); + List kdm = Lists.newArrayList(kdmFile.getAbsolutePath()); + args.addAll(kdm); + + for (File file : toifFiles) + { + args.add(file.getAbsolutePath()); + } + + ass.assimilate(args.toArray(new String[args.size()])); + return true; + } + catch (Exception e) + { + throw new ToifException(e.getMessage(),e); + } + } + } diff --git a/com.kdmanalytics.toif.facade/src/com/kdmanalytics/toif/facade/internal/Activator.java b/com.kdmanalytics.toif.facade/src/com/kdmanalytics/toif/facade/internal/Activator.java new file mode 100644 index 00000000..0084d6f6 --- /dev/null +++ b/com.kdmanalytics.toif.facade/src/com/kdmanalytics/toif/facade/internal/Activator.java @@ -0,0 +1,45 @@ +package com.kdmanalytics.toif.facade.internal; + +import org.osgi.framework.BundleActivator; +import org.osgi.framework.BundleContext; +/** + * The activator class controls the plug-in life cycle + */ +public class Activator implements BundleActivator { + + // The plug-in ID + public static final String PLUGIN_ID = "com.kdmanalytics.toif.extractorInterface"; //$NON-NLS-1$ + + // The shared instance + + private static BundleContext context; + + /** + * The constructor + */ + public Activator() { + } + + + static BundleContext getContext() { + return context; +} + + + /* + * (non-Javadoc) + * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext) + */ + public void start(BundleContext bundleContext) throws Exception { + Activator.context = bundleContext; + } + + /* + * (non-Javadoc) + * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext) + */ + public void stop(BundleContext bundleContext) throws Exception { + Activator.context = null; + } + +} diff --git a/com.kdmanalytics.toif.facade/target/MANIFEST.MF b/com.kdmanalytics.toif.facade/target/MANIFEST.MF new file mode 100644 index 00000000..3d56aef0 --- /dev/null +++ b/com.kdmanalytics.toif.facade/target/MANIFEST.MF @@ -0,0 +1,16 @@ +Manifest-Version: 1.0 +Export-Package: com.kdmanalytics.toif.facade +Require-Bundle: org.eclipse.core.runtime,com.kdmanalytics.toif.framewo + rk;bundle-version="[1.14.0,2.0.0)",com.google.guava;bundle-version="[ + 14.0.1,15.0.0)",com.kdmanalytics.toif.assimilator;bundle-version="[1. + 14.0,2.0.0)",com.kdmanalytics.toif.common;bundle-version="[1.14.0,2.0 + .0)";visibility:=reexport +Bundle-Vendor: KDMANALYTICS +Bundle-ActivationPolicy: lazy +Bundle-Version: 1.15.5 +Bundle-Name: ExtractorInterface +Bundle-Activator: com.kdmanalytics.toif.facade.internal.Activator +Bundle-ManifestVersion: 2 +Bundle-SymbolicName: com.kdmanalytics.toif.facade +Bundle-RequiredExecutionEnvironment: JavaSE-1.6 + diff --git a/com.kdmanalytics.toif.facade/target/classes/com/kdmanalytics/toif/facade/IToifFacade.class b/com.kdmanalytics.toif.facade/target/classes/com/kdmanalytics/toif/facade/IToifFacade.class new file mode 100644 index 00000000..357dfa30 Binary files /dev/null and b/com.kdmanalytics.toif.facade/target/classes/com/kdmanalytics/toif/facade/IToifFacade.class differ diff --git a/com.kdmanalytics.toif.facade/target/classes/com/kdmanalytics/toif/facade/ToifFacade.class b/com.kdmanalytics.toif.facade/target/classes/com/kdmanalytics/toif/facade/ToifFacade.class new file mode 100644 index 00000000..09535213 Binary files /dev/null and b/com.kdmanalytics.toif.facade/target/classes/com/kdmanalytics/toif/facade/ToifFacade.class differ diff --git a/com.kdmanalytics.toif.facade/target/classes/com/kdmanalytics/toif/facade/internal/Activator.class b/com.kdmanalytics.toif.facade/target/classes/com/kdmanalytics/toif/facade/internal/Activator.class new file mode 100644 index 00000000..075d9753 Binary files /dev/null and b/com.kdmanalytics.toif.facade/target/classes/com/kdmanalytics/toif/facade/internal/Activator.class differ diff --git a/com.kdmanalytics.toif.facade/target/com.kdmanalytics.toif.facade-1.15.5.jar b/com.kdmanalytics.toif.facade/target/com.kdmanalytics.toif.facade-1.15.5.jar new file mode 100644 index 00000000..a27ecb39 Binary files /dev/null and b/com.kdmanalytics.toif.facade/target/com.kdmanalytics.toif.facade-1.15.5.jar differ diff --git a/com.kdmanalytics.toif.facade/target/local-artifacts.properties b/com.kdmanalytics.toif.facade/target/local-artifacts.properties new file mode 100644 index 00000000..c9ccccdc --- /dev/null +++ b/com.kdmanalytics.toif.facade/target/local-artifacts.properties @@ -0,0 +1,4 @@ +#Thu May 29 09:56:13 EDT 2014 +artifact.attached.p2metadata=/home/adam/git/toif/plugins/com.kdmanalytics.toif.facade/target/p2content.xml +artifact.main=/home/adam/git/toif/plugins/com.kdmanalytics.toif.facade/target/com.kdmanalytics.toif.facade-1.15.5.jar +artifact.attached.p2artifacts=/home/adam/git/toif/plugins/com.kdmanalytics.toif.facade/target/p2artifacts.xml diff --git a/com.kdmanalytics.toif.facade/target/maven-archiver/pom.properties b/com.kdmanalytics.toif.facade/target/maven-archiver/pom.properties new file mode 100644 index 00000000..56d05bc8 --- /dev/null +++ b/com.kdmanalytics.toif.facade/target/maven-archiver/pom.properties @@ -0,0 +1,5 @@ +#Generated by Maven +#Thu May 29 09:56:13 EDT 2014 +version=1.15.5 +groupId=com.kdmanalytics.toif.compile +artifactId=com.kdmanalytics.toif.facade diff --git a/com.kdmanalytics.toif.facade/target/p2artifacts.xml b/com.kdmanalytics.toif.facade/target/p2artifacts.xml new file mode 100644 index 00000000..4475ce7e --- /dev/null +++ b/com.kdmanalytics.toif.facade/target/p2artifacts.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/com.kdmanalytics.toif.facade/target/p2content.xml b/com.kdmanalytics.toif.facade/target/p2content.xml new file mode 100644 index 00000000..b70f3f48 --- /dev/null +++ b/com.kdmanalytics.toif.facade/target/p2content.xml @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Bundle-SymbolicName: com.kdmanalytics.toif.facade Bundle-Version: 1.15.5 + + + + + diff --git a/com.kdmanalytics.toif.findbugs/.classpath b/com.kdmanalytics.toif.findbugs/.classpath new file mode 100644 index 00000000..098194ca --- /dev/null +++ b/com.kdmanalytics.toif.findbugs/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/com.kdmanalytics.toif.findbugs/.project b/com.kdmanalytics.toif.findbugs/.project new file mode 100644 index 00000000..9d147ff5 --- /dev/null +++ b/com.kdmanalytics.toif.findbugs/.project @@ -0,0 +1,28 @@ + + + com.kdmanalytics.toif.findbugs + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + + org.eclipse.pde.PluginNature + org.eclipse.jdt.core.javanature + + diff --git a/com.kdmanalytics.toif.findbugs/.settings/org.eclipse.jdt.core.prefs b/com.kdmanalytics.toif.findbugs/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 00000000..f42de363 --- /dev/null +++ b/com.kdmanalytics.toif.findbugs/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,7 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 +org.eclipse.jdt.core.compiler.compliance=1.7 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.7 diff --git a/com.kdmanalytics.toif.findbugs/META-INF/MANIFEST.MF b/com.kdmanalytics.toif.findbugs/META-INF/MANIFEST.MF new file mode 100644 index 00000000..1d173048 --- /dev/null +++ b/com.kdmanalytics.toif.findbugs/META-INF/MANIFEST.MF @@ -0,0 +1,14 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: TOIF Findbugs +Bundle-SymbolicName: com.kdmanalytics.toif.findbugs;singleton:=true +Bundle-Version: 1.16.0.qualifier +Bundle-Activator: com.kdmanalytics.toif.findbugs.Activator +Bundle-Vendor: KDM Analytics Inc. +Require-Bundle: org.apache.xerces;bundle-version="[2.11.0,3.0.0)", + org.eclipse.core.runtime, + com.kdmanalytics.toif.framework;bundle-version="1.15.0", + com.kdmanalytics.toif.common;bundle-version="1.15.0", + org.apache.log4j;bundle-version="[1.2.15,1.3.0)" +Bundle-RequiredExecutionEnvironment: JavaSE-1.7 +Export-Package: com.kdmanalytics.toif.adaptor diff --git a/com.kdmanalytics.toif.findbugs/bin/com/kdmanalytics/toif/adaptor/FindbugsAdaptor.class b/com.kdmanalytics.toif.findbugs/bin/com/kdmanalytics/toif/adaptor/FindbugsAdaptor.class new file mode 100644 index 00000000..4e721a6c Binary files /dev/null and b/com.kdmanalytics.toif.findbugs/bin/com/kdmanalytics/toif/adaptor/FindbugsAdaptor.class differ diff --git a/com.kdmanalytics.toif.findbugs/bin/com/kdmanalytics/toif/findbugs/Activator.class b/com.kdmanalytics.toif.findbugs/bin/com/kdmanalytics/toif/findbugs/Activator.class new file mode 100644 index 00000000..8a550352 Binary files /dev/null and b/com.kdmanalytics.toif.findbugs/bin/com/kdmanalytics/toif/findbugs/Activator.class differ diff --git a/com.kdmanalytics.toif.findbugs/bin/com/kdmanalytics/toif/findbugs/FindBugsParser.class b/com.kdmanalytics.toif.findbugs/bin/com/kdmanalytics/toif/findbugs/FindBugsParser.class new file mode 100644 index 00000000..91c5696a Binary files /dev/null and b/com.kdmanalytics.toif.findbugs/bin/com/kdmanalytics/toif/findbugs/FindBugsParser.class differ diff --git a/com.kdmanalytics.toif.findbugs/bin/config/FindbugsAdaptorConfiguration b/com.kdmanalytics.toif.findbugs/bin/config/FindbugsAdaptorConfiguration new file mode 100644 index 00000000..063719c5 --- /dev/null +++ b/com.kdmanalytics.toif.findbugs/bin/config/FindbugsAdaptorConfiguration @@ -0,0 +1,1488 @@ +# - No SFP or CWE found +# - No CWE Found +# - SFP and CWE Found + +############################################################################# +# +# http://findbugs.sourceforge.net/bugDescriptions.html +# +############################################################################# + + +#AM: Creates an empty jar file entry (AM_CREATES_EMPTY_JAR_FILE_ENTRY) +AM_CREATES_EMPTY_JAR_FILE_ENTRY=;SFP--1;CWE-398 +AM_CREATES_EMPTY_JAR_FILE_ENTRYMsg=The code calls putNextEntry(), immediately followed by a call to closeEntry(). This results in an empty JarFile entry. The contents of the entry should be written to the JarFile between the calls to putNextEntry() and closeEntry(). + +#AM: Creates an empty zip file entry (AM_CREATES_EMPTY_ZIP_FILE_ENTRY) +AM_CREATES_EMPTY_ZIP_FILE_ENTRY=;SFP--1;CWE-398 +AM_CREATES_EMPTY_ZIP_FILE_ENTRYMsg=The code calls putNextEntry(), immediately followed by a call to closeEntry(). This results in an empty ZipFile entry. The contents of the entry should be written to the ZipFile between the calls to putNextEntry() and closeEntry(). + +#BC: Equals method should not assume anything about the type of its argument (BC_EQUALS_METHOD_SHOULD_WORK_FOR_ALL_OBJECTS) +BC_EQUALS_METHOD_SHOULD_WORK_FOR_ALL_OBJECTS=;SFP--1;CWE-398 +BC_EQUALS_METHOD_SHOULD_WORK_FOR_ALL_OBJECTSMsg=The equals(Object o) method shouldn't make any assumptions about the type of o. It should simply return false if o is not the same type as this. + +#BC: Random object created and used only once (DMI_RANDOM_USED_ONLY_ONCE) +DMI_RANDOM_USED_ONLY_ONCE=;SFP--1;CWE-330 +DMI_RANDOM_USED_ONLY_ONCEMsg=This code creates a java.util.Random object, uses it to generate one random number, and then discards the Random object. This produces mediocre quality random numbers and is inefficient. If possible, rewrite the code so that the Random object is created once and saved, and each time a new random number is required invoke a method on the existing Random object to obtain it. If it is important that the generated Random numbers not be guessable, you must not create a new Random for each random number; the values are too easily guessable. You should strongly consider using a java.security.SecureRandom instead (and avoid allocating a new SecureRandom for each random number needed). + +#BIT: Check for sign of bitwise operation (BIT_SIGNED_CHECK) +BIT_SIGNED_CHECK=;SFP--1;CWE-480 +IT_SIGNED_CHECKMsg=This method compares an expression such as ((event.detail & SWT.SELECTED) > 0). Using bit arithmetic and then comparing with the greater than operator can lead to unexpected results (of course depending on the value of SWT.SELECTED). If SWT.SELECTED is a negative number, this is a candidate for a bug. Even when SWT.SELECTED is not negative, it seems good practice to use '!= 0' instead of '> 0'. + +#CN: Class implements Cloneable but does not define or use clone method (CN_IDIOM) +CN_IDIOM=;SFP--1;CWE-710 +CN_IDIOMMsg=Class implements Cloneable but does not define or use the clone method. + +#CN: clone method does not call super.clone() (CN_IDIOM_NO_SUPER_CALL) +CN_IDIOM_NO_SUPER_CALL=;SFP-28;CWE-580 +CN_IDIOM_NO_SUPER_CALLMsg=This non-final class defines a clone() method that does not call super.clone(). If this class ("A") is extended by a subclass ("B"), and the subclass B calls super.clone(), then it is likely that B's clone() method will return an object of type A, which violates the standard contract for clone(). If all clone() methods call super.clone(), then they are guaranteed to use Object.clone(), which always returns an object of the correct type. + +#CN: Class defines clone() but doesn't implement Cloneable (CN_IMPLEMENTS_CLONE_BUT_NOT_CLONEABLE) +CN_IMPLEMENTS_CLONE_BUT_NOT_CLONEABLE=;SFP--1;CWE-710 +CN_IMPLEMENTS_CLONE_BUT_NOT_CLONEABLEMsg=This class defines a clone() method but the class doesn't implement Cloneable. There are some situations in which this is OK (e.g., you want to control how subclasses can clone themselves), but just make sure that this is what you intended. + +#Co: Abstract class defines covariant compareTo() method (CO_ABSTRACT_SELF) +CO_ABSTRACT_SELF=;SFP--1;CWE-710 +CO_ABSTRACT_SELFMsg=This class defines a covariant version of compareTo(). To correctly override the compareTo() method in the Comparable interface, the parameter of compareTo() must have type java.lang.Object. + +#Co: Covariant compareTo() method defined (CO_SELF_NO_OBJECT) +CO_SELF_NO_OBJECT=;SFP--1;CWE-710 +CO_SELF_NO_OBJECTMsg=This class defines a covariant version of compareTo(). To correctly override the compareTo() method in the Comparable interface, the parameter of compareTo() must have type java.lang.Object. + +#DE: Method might drop exception (DE_MIGHT_DROP) +DE_MIGHT_DROP=;SFP-4;CWE-390 +DE_MIGHT_DROPMsg=This method might drop an exception. In general, exceptions should be handled or reported in some way, or they should be thrown out of the method. + +#DE: Method might ignore exception (DE_MIGHT_IGNORE) +DE_MIGHT_IGNORE=;SFP-4;CWE-390 +DE_MIGHT_IGNOREMsg=This method might ignore an exception. In general, exceptions should be handled or reported in some way, or they should be thrown out of the method. + +#DMI: Don't use removeAll to clear a collection (DMI_USING_REMOVEALL_TO_CLEAR_COLLECTION) +DMI_USING_REMOVEALL_TO_CLEAR_COLLECTION=;SFP-1;CWE-710 +DMI_USING_REMOVEALL_TO_CLEAR_COLLECTIONMsg=If you want to remove all elements from a collection c, use c.clear, not c.removeAll(c). Calling c.removeAll(c) to clear a collection is less clear, susceptible to errors from typos, less efficient and for some collections, might throw a ConcurrentModificationException. + +#DP: Classloaders should only be created inside doPrivileged block (DP_CREATE_CLASSLOADER_INSIDE_DO_PRIVILEGED) +DP_CREATE_CLASSLOADER_INSIDE_DO_PRIVILEGED=;SFP-27;CWE-545 +DP_CREATE_CLASSLOADER_INSIDE_DO_PRIVILEGEDMsg=This code creates a classloader, which requires a security manager. If this code will be granted security permissions, but might be invoked by code that does not have security permissions, then the classloader creation needs to occur inside a doPrivileged block. + +#DP: Method invoked that should be only be invoked inside a doPrivileged block (DP_DO_INSIDE_DO_PRIVILEGED) +DP_DO_INSIDE_DO_PRIVILEGED=;SFP--1;CWE-250 +DP_DO_INSIDE_DO_PRIVILEGEDMsg=This code invokes a method that requires a security permission check. If this code will be granted security permissions, but might be invoked by code that does not have security permissions, then the invocation needs to occur inside a doPrivileged block. + +#Dm: Method invokes System.exit(...) (DM_EXIT) +DM_EXIT=;SFP--1;CWE-710 +DM_EXITMsg=Invoking System.exit shuts down the entire Java virtual machine. This should only been done when it is appropriate. Such calls make it hard or impossible for your code to be invoked by other code. Consider throwing a RuntimeException instead. + +#Dm: Method invokes dangerous method runFinalizersOnExit (DM_RUN_FINALIZERS_ON_EXIT) +DM_RUN_FINALIZERS_ON_EXIT=;SFP-3;CWE-242 +DM_RUN_FINALIZERS_ON_EXITMsg=Never call System.runFinalizersOnExit or Runtime.runFinalizersOnExit for any reason: they are among the most dangerous methods in the Java libraries. -- Joshua Bloch + +#ES: Comparison of String parameter using == or != (ES_COMPARING_PARAMETER_STRING_WITH_EQ) +ES_COMPARING_PARAMETER_STRING_WITH_EQ=;SFP-1;CWE-597 +ES_COMPARING_PARAMETER_STRING_WITH_EQMsg=This code compares a java.lang.String parameter for reference equality using the == or != operators. Requiring callers to pass only String constants or interned strings to a method is unnecessarily fragile, and rarely leads to measurable performance gains. Consider using the equals(Object) method instead. + +#ES: Comparison of String objects using == or != (ES_COMPARING_STRINGS_WITH_EQ) +ES_COMPARING_STRINGS_WITH_EQ=;SFP-1;CWE-597 +ES_COMPARING_STRINGS_WITH_EQMsg=This code compares java.lang.String objects for reference equality using the == or != operators. Unless both strings are either constants in a source file, or have been interned using the String.intern() method, the same string value may be represented by two different String objects. Consider using the equals(Object) method instead. + +#Eq: Abstract class defines covariant equals() method (EQ_ABSTRACT_SELF) +EQ_ABSTRACT_SELF=;SFP--1;CWE-710 +EQ_ABSTRACT_SELFMsg=This class defines a covariant version of equals(). To correctly override the equals() method in java.lang.Object, the parameter of equals() must have type java.lang.Object. + +#Eq: Equals checks for noncompatible operand (EQ_CHECK_FOR_OPERAND_NOT_COMPATIBLE_WITH_THIS) +EQ_CHECK_FOR_OPERAND_NOT_COMPATIBLE_WITH_THIS=;SFP--1;CWE-710 +EQ_CHECK_FOR_OPERAND_NOT_COMPATIBLE_WITH_THISMsg=This equals method is checking to see if the argument is some incompatible type (i.e., a class that is neither a supertype nor subtype of the class that defines the equals method). + +#Eq: Class defines compareTo(...) and uses Object.equals() (EQ_COMPARETO_USE_OBJECT_EQUALS) +EQ_COMPARETO_USE_OBJECT_EQUALS=;SFP--1;CWE-710 +EQ_COMPARETO_USE_OBJECT_EQUALSMsg=This class defines a compareTo(...) method but inherits its equals() method from java.lang.Object. Generally, the value of compareTo should return zero if and only if equals returns true. If this is violated, weird and unpredictable failures will occur in classes such as PriorityQueue. In Java 5 the PriorityQueue.remove method uses the compareTo method, while in Java 6 it uses the equals method. + +#Eq: equals method fails for subtypes (EQ_GETCLASS_AND_CLASS_CONSTANT) +EQ_GETCLASS_AND_CLASS_CONSTANT=;SFP--1;CWE-710 +EQ_GETCLASS_AND_CLASS_CONSTANTMsg=This class has an equals method that will be broken if it is inherited by subclasses. It compares a class literal with the class of the argument (e.g., in class Foo it might check if Foo.class == o.getClass()). It is better to check if this.getClass() == o.getClass(). + +#Eq: Covariant equals() method defined (EQ_SELF_NO_OBJECT) +EQ_SELF_NO_OBJECT=;SFP--1;CWE-710 +EQ_SELF_NO_OBJECTMsg=This class defines a covariant version of equals(). To correctly override the equals() method in java.lang.Object, the parameter of equals() must have type java.lang.Object. + +#FI: Empty finalizer should be deleted (FI_EMPTY) +FI_EMPTY=;SFP--1;CWE-710 +FI_EMPTY=Empty finalize() methods are useless, so they should be deleted. + +#FI: Explicit invocation of finalizer (FI_EXPLICIT_INVOCATION) +FI_EXPLICIT_INVOCATION=;SFP-3;CWE-586 +FI_EXPLICIT_INVOCATIONMsg=This method contains an explicit invocation of the finalize() method on an object. Because finalizer methods are supposed to be executed once, and only by the VM, this is a bad idea. If a connected set of objects beings finalizable, then the VM will invoke the finalize method on all the finalizable object, possibly at the same time in different threads. Thus, it is a particularly bad idea, in the finalize method for a class X, invoke finalize on objects referenced by X, because they may already be getting finalized in a separate thread. + +#FI: Finalizer nulls fields (FI_FINALIZER_NULLS_FIELDS) +FI_FINALIZER_NULLS_FIELDS=;SFP--1;CWE-710 +FI_FINALIZER_NULLS_FIELDSMsg=This finalizer nulls out fields. This is usually an error, as it does not aid garbage collection, and the object is going to be garbage collected anyway. + +#FI: Finalizer only nulls fields (FI_FINALIZER_ONLY_NULLS_FIELDS) +FI_FINALIZER_ONLY_NULLS_FIELDS=;SFP--1;CWE-710 +FI_FINALIZER_ONLY_NULLS_FIELDSMsg=This finalizer does nothing except null out fields. This is completely pointless, and requires that the object be garbage collected, finalized, and then garbage collected again. You should just remove the finalize method. + +#FI: Finalizer does not call superclass finalizer (FI_MISSING_SUPER_CALL) +FI_MISSING_SUPER_CALL=;SFP-28;CWE-586 +FI_MISSING_SUPER_CALLMsg=This finalize() method does not make a call to its superclass's finalize() method. So, any finalizer actions defined for the superclass will not be performed. Add a call to super.finalize(). + +#FI: Finalizer nullifies superclass finalizer (FI_NULLIFY_SUPER) +FI_NULLIFY_SUPER=;SFP--1;CWE-710 +FI_NULLIFY_SUPERMsg=This empty finalize() method explicitly negates the effect of any finalizer defined by its superclass. Any finalizer actions defined for the superclass will not be performed. Unless this is intended, delete this method. + +#FI: Finalizer does nothing but call superclass finalizer (FI_USELESS) +FI_USELESS=;SFP--1;CWE-710 +FI_USELESSMsg=The only thing this finalize() method does is call the superclass's finalize() method, making it redundant. Delete it. + +#GC: Unchecked type in generic call (GC_UNCHECKED_TYPE_IN_GENERIC_CALL) +GC_UNCHECKED_TYPE_IN_GENERIC_CALL=;SFP--1;CWE-710 +GC_UNCHECKED_TYPE_IN_GENERIC_CALLMsg=This call to a generic collection method passes an argument while compile type Object where a specific type from the generic type parameters is expected. Thus, neither the standard Java type system nor static analysis can provide useful information on whether the object being passed as a parameter is of an appropriate type. + +#HE: Class defines equals() but not hashCode() (HE_EQUALS_NO_HASHCODE) +HE_EQUALS_NO_HASHCODE=;SFP--1;CWE-581 +HE_EQUALS_NO_HASHCODEMsg=This class overrides equals(Object), but does not override hashCode(). Therefore, the class may violate the invariant that equal objects must have equal hashcodes. + +#HE: Class defines equals() and uses Object.hashCode() (HE_EQUALS_USE_HASHCODE) +HE_EQUALS_USE_HASHCODE=;SFP--1;CWE-581 +HE_EQUALS_USE_HASHCODEMsg=This class overrides equals(Object), but does not override hashCode(), and inherits the implementation of hashCode() from java.lang.Object (which returns the identity hash code, an arbitrary value assigned to the object by the VM). Therefore, the class is very likely to violate the invariant that equal objects must have equal hashcodes. + +#HE: Class defines hashCode() but not equals() (HE_HASHCODE_NO_EQUALS) +HE_HASHCODE_NO_EQUALS=;SFP--1;CWE-581 +HE_HASHCODE_NO_EQUALSMsg=This class defines a hashCode() method but not an equals() method. Therefore, the class may violate the invariant that equal objects must have equal hashcodes. + +#HE: Class defines hashCode() and uses Object.equals() (HE_HASHCODE_USE_OBJECT_EQUALS) +HE_HASHCODE_USE_OBJECT_EQUALS=;SFP--1;CWE-581 +HE_HASHCODE_USE_OBJECT_EQUALSMsg=This class defines a hashCode() method but inherits its equals() method from java.lang.Object (which defines equality by comparing object references). Although this will probably satisfy the contract that equal objects must have equal hashcodes, it is probably not what was intended by overriding the hashCode() method. (Overriding hashCode() implies that the object's identity is based on criteria more complicated than simple reference equality.) + +#HE: Class inherits equals() and uses Object.hashCode() (HE_INHERITS_EQUALS_USE_HASHCODE) +HE_INHERITS_EQUALS_USE_HASHCODE=;SFP--1;CWE-581 +HE_INHERITS_EQUALS_USE_HASHCODEMsg=This class inherits equals(Object) from an abstract superclass, and hashCode() from java.lang.Object (which returns the identity hash code, an arbitrary value assigned to the object by the VM). Therefore, the class is very likely to violate the invariant that equal objects must have equal hashcodes. + +#IC: Superclass uses subclass during initialization (IC_SUPERCLASS_USES_SUBCLASS_DURING_INITIALIZATION) +IC_SUPERCLASS_USES_SUBCLASS_DURING_INITIALIZATION=;SFP--1;CWE-710 +IC_SUPERCLASS_USES_SUBCLASS_DURING_INITIALIZATIONMsg=During the initialization of a class, the class makes an active use of a subclass. That subclass will not yet be initialized at the time of this use. + +#IMSE: Dubious catching of IllegalMonitorStateException (IMSE_DONT_CATCH_IMSE) +IMSE_DONT_CATCH_IMSE=;SFP--1;CWE-398 +IMSE_DONT_CATCH_IMSEMsg=IllegalMonitorStateException is generally only thrown in case of a design flaw in your code (calling wait or notify on an object you do not hold a lock on). + +#ISC: Needless instantiation of class that only supplies static methods (ISC_INSTANTIATE_STATIC_CLASS) +ISC_INSTANTIATE_STATIC_CLASS=;SFP--1;CWE-710 +ISC_INSTANTIATE_STATIC_CLASSMsg=This class allocates an object that is based on a class that only supplies static methods. This object does not need to be created, just access the static methods directly using the class name as a qualifier. + +#It: Iterator next() method can't throw NoSuchElementException (IT_NO_SUCH_ELEMENT) +IT_NO_SUCH_ELEMENT=;SFP--1;CWE-710 +IT_NO_SUCH_ELEMENTMsg=This class implements the java.util.Iterator interface. However, its next() method is not capable of throwing java.util.NoSuchElementException. The next() method should be changed so it throws NoSuchElementException if is called when there are no more elements to return. + +#J2EE: Store of non serializable object into HttpSession (J2EE_STORE_OF_NON_SERIALIZABLE_OBJECT_INTO_SESSION) +J2EE_STORE_OF_NON_SERIALIZABLE_OBJECT_INTO_SESSION=;SFP-1;CWE-579 +J2EE_STORE_OF_NON_SERIALIZABLE_OBJECT_INTO_SESSIONMsg=This code seems to be storing a non-serializable object into an HttpSession. If this session is passivated or migrated, an error will result. + +#JCIP: Fields of immutable classes should be final (JCIP_FIELD_ISNT_FINAL_IN_IMMUTABLE_CLASS) +JCIP_FIELD_ISNT_FINAL_IN_IMMUTABLE_CLASS=;SFP--1;CWE-710 +JCIP_FIELD_ISNT_FINAL_IN_IMMUTABLE_CLASSMsg=The class is annotated with net.jcip.annotations.Immutable, and the rules for that annotation require that all fields are final. . + +#NP: Method with Boolean return type returns explicit null (NP_BOOLEAN_RETURN_NULL) +NP_BOOLEAN_RETURN_NULL=;SFP-4;CWE-394 +NP_BOOLEAN_RETURN_NULLMsg=A method that returns either Boolean.TRUE, Boolean.FALSE or null is an accident waiting to happen. This method can be invoked as though it returned a value of type boolean, and the compiler will insert automatic unboxing of the Boolean value. If a null value is returned, this will result in a NullPointerException. + +#NP: Clone method may return null (NP_CLONE_COULD_RETURN_NULL) +NP_CLONE_COULD_RETURN_NULL=;SFP-4;CWE-394 +NP_CLONE_COULD_RETURN_NULLMsg=This clone method seems to return null in some circumstances, but clone is never allowed to return a null value. If you are convinced this path is unreachable, throw an AssertionError instead. + +#NP: equals() method does not check for null argument (NP_EQUALS_SHOULD_HANDLE_NULL_ARGUMENT) +NP_EQUALS_SHOULD_HANDLE_NULL_ARGUMENT=API;SFP--1;CWE-227 +NP_EQUALS_SHOULD_HANDLE_NULL_ARGUMENTMsg=This implementation of equals(Object) violates the contract defined by java.lang.Object.equals() because it does not check for null being passed as the argument. All equals() methods should return false if passed a null value. + +#NP: toString method may return null (NP_TOSTRING_COULD_RETURN_NULL) +NP_TOSTRING_COULD_RETURN_NULL=API;SFP--1;CWE-227 +NP_TOSTRING_COULD_RETURN_NULLMsg=This toString method seems to return null in some circumstances. A liberal reading of the spec could be interpreted as allowing this, but it is probably a bad idea and could cause other code to break. Return the empty string or some other appropriate string rather than null. + +#Nm: Class names should start with an upper case letter (NM_CLASS_NAMING_CONVENTION) +NM_CLASS_NAMING_CONVENTION=;SFP--1;CWE-710 +NM_CLASS_NAMING_CONVENTIONMsg=Class names should be nouns, in mixed case with the first letter of each internal word capitalized. Try to keep your class names simple and descriptive. Use whole words-avoid acronyms and abbreviations (unless the abbreviation is much more widely used than the long form, such as URL or HTML). + +#Nm: Class is not derived from an Exception, even though it is named as such (NM_CLASS_NOT_EXCEPTION) +NM_CLASS_NOT_EXCEPTION=;SFP--1;CWE-710 +NM_CLASS_NOT_EXCEPTIONMsg=This class is not derived from another exception, but ends with 'Exception'. This will be confusing to users of this class. + +#Nm: Confusing method names (NM_CONFUSING) +NM_CONFUSING=;SFP--1;CWE-710 +NM_CONFUSINGMsg=The referenced methods have names that differ only by capitalization. + +#Nm: Field names should start with a lower case letter (NM_FIELD_NAMING_CONVENTION) +NM_FIELD_NAMING_CONVENTION=;SFP--1;CWE-710 +NM_FIELD_NAMING_CONVENTIONMsg=Names of fields that are not final should be in mixed case with a lowercase first letter and the first letters of subsequent words capitalized. + +#Nm: Use of identifier that is a keyword in later versions of Java (NM_FUTURE_KEYWORD_USED_AS_IDENTIFIER) +NM_FUTURE_KEYWORD_USED_AS_IDENTIFIER=;SFP--1;CWE-710 +NM_FUTURE_KEYWORD_USED_AS_IDENTIFIERMsg=The identifier is a word that is reserved as a keyword in later versions of Java, and your code will need to be changed in order to compile it in later versions of Java. + +#Nm: Use of identifier that is a keyword in later versions of Java (NM_FUTURE_KEYWORD_USED_AS_MEMBER_IDENTIFIER) +NM_FUTURE_KEYWORD_USED_AS_MEMBER_IDENTIFIER=;SFP--1;CWE-710 +NM_FUTURE_KEYWORD_USED_AS_MEMBER_IDENTIFIERMsg=This identifier is used as a keyword in later versions of Java. This code, and any code that references this API, will need to be changed in order to compile it in later versions of Java. + +#Nm: Method names should start with a lower case letter (NM_METHOD_NAMING_CONVENTION) +NM_METHOD_NAMING_CONVENTION=;SFP--1;CWE-710 +NM_METHOD_NAMING_CONVENTIONMsg=Methods should be verbs, in mixed case with the first letter lowercase, with the first letter of each internal word capitalized. + +#Nm: Class names shouldn't shadow simple name of implemented interface (NM_SAME_SIMPLE_NAME_AS_INTERFACE) +NM_SAME_SIMPLE_NAME_AS_INTERFACE=;SFP--1;CWE-710 +NM_SAME_SIMPLE_NAME_AS_INTERFACEMsg=This class/interface has a simple name that is identical to that of an implemented/extended interface, except that the interface is in a different package (e.g., alpha.Foo extends beta.Foo). This can be exceptionally confusing, create lots of situations in which you have to look at import statements to resolve references and creates many opportunities to accidently define methods that do not override methods in their superclasses. + +#Nm: Class names shouldn't shadow simple name of superclass (NM_SAME_SIMPLE_NAME_AS_SUPERCLASS) +NM_SAME_SIMPLE_NAME_AS_SUPERCLASS=;SFP--1;CWE-710 +NM_SAME_SIMPLE_NAME_AS_SUPERCLASSMsg=This class has a simple name that is identical to that of its superclass, except that its superclass is in a different package (e.g., alpha.Foo extends beta.Foo). This can be exceptionally confusing, create lots of situations in which you have to look at import statements to resolve references and creates many opportunities to accidently define methods that do not override methods in their superclasses. + +#Nm: Very confusing method names (but perhaps intentional) (NM_VERY_CONFUSING_INTENTIONAL) +NM_VERY_CONFUSING_INTENTIONAL=;SFP--1;CWE-710 +NM_VERY_CONFUSING_INTENTIONALMsg=The referenced methods have names that differ only by capitalization. This is very confusing because if the capitalization were identical then one of the methods would override the other. From the existence of other methods, it seems that the existence of both of these methods is intentional, but is sure is confusing. You should try hard to eliminate one of them, unless you are forced to have both due to frozen APIs. + +#Nm: Method doesn't override method in superclass due to wrong package for parameter (NM_WRONG_PACKAGE_INTENTIONAL) +NM_WRONG_PACKAGE_INTENTIONAL=;SFP--1;CWE-710 +NM_WRONG_PACKAGE_INTENTIONALMsg=The method in the subclass doesn't override a similar method in a superclass because the type of a parameter doesn't exactly match the type of the corresponding parameter in the superclass. + +#ODR: Method may fail to close database resource (ODR_OPEN_DATABASE_RESOURCE) +ODR_OPEN_DATABASE_RESOURCE=;SFP-14;CWE-772 +ODR_OPEN_DATABASE_RESOURCEMsg=The method creates a database resource (such as a database connection or row set), does not assign it to any fields, pass it to other methods, or return it, and does not appear to close the object on all paths out of the method. Failure to close database resources on all paths out of a method may result in poor performance, and could cause the application to have problems communicating with the database. + +#ODR: Method may fail to close database resource on exception (ODR_OPEN_DATABASE_RESOURCE_EXCEPTION_PATH) +ODR_OPEN_DATABASE_RESOURCE_EXCEPTION_PATH=;SFP-14;CWE-772 +ODR_OPEN_DATABASE_RESOURCE_EXCEPTION_PATHMsg=The method creates a database resource (such as a database connection or row set), does not assign it to any fields, pass it to other methods, or return it, and does not appear to close the object on all exception paths out of the method. Failure to close database resources on all paths out of a method may result in poor performance, and could cause the application to have problems communicating with the database. + +#OS: Method may fail to close stream (OS_OPEN_STREAM) +OS_OPEN_STREAM=;SFP-14;CWE-772 +OS_OPEN_STREAMMsg=The method creates an IO stream object, does not assign it to any fields, pass it to other methods that might close it, or return it, and does not appear to close the stream on all paths out of the method. This may result in a file descriptor leak. It is generally a good idea to use a finally block to ensure that streams are closed. + +#OS: Method may fail to close stream on exception (OS_OPEN_STREAM_EXCEPTION_PATH) +OS_OPEN_STREAM_EXCEPTION_PATH=;SFP-14;CWE-772 +OS_OPEN_STREAM_EXCEPTION_PATHMsg=The method creates an IO stream object, does not assign it to any fields, pass it to other methods, or return it, and does not appear to close it on all possible exception paths out of the method. This may result in a file descriptor leak. It is generally a good idea to use a finally block to ensure that streams are closed. + +#RC: Suspicious reference comparison to constant (RC_REF_COMPARISON_BAD_PRACTICE) +RC_REF_COMPARISON_BAD_PRACTICE=;SFP--1;CWE-480 +RC_REF_COMPARISON_BAD_PRACTICEMsg=This method compares a reference value to a constant using the == or != operator, where the correct way to compare instances of this type is generally with the equals() method. It is possible to create distinct instances that are equal but do not compare as == since they are different objects. Examples of classes which should generally not be compared by reference are java.lang.Integer, java.lang.Float, etc. + +#RC: Suspicious reference comparison of Boolean values (RC_REF_COMPARISON_BAD_PRACTICE_BOOLEAN) +RC_REF_COMPARISON_BAD_PRACTICE_BOOLEAN=;SFP--1;CWE-480 +RC_REF_COMPARISON_BAD_PRACTICE_BOOLEANMsg=This method compares two Boolean values using the == or != operator. Normally, there are only two Boolean values (Boolean.TRUE and Boolean.FALSE), but it is possible to create other Boolean objects using the new Boolean(b) constructor. It is best to avoid such objects, but if they do exist, then checking Boolean objects for equality using == or != will give results than are different than you would get using .equals(...) + +#RR: Method ignores results of InputStream.read() (RR_NOT_CHECKED) +RR_NOT_CHECKED=;SFP-4;CWE-252 +RR_NOT_CHECKEDMsg=This method ignores the return value of one of the variants of java.io.InputStream.read() which can return multiple bytes. If the return value is not checked, the caller will not be able to correctly handle the case where fewer bytes were read than the caller requested. This is a particularly insidious kind of bug, because in many programs, reads from input streams usually do read the full amount of data requested, causing the program to fail only sporadically. + +#RR: Method ignores results of InputStream.skip() (SR_NOT_CHECKED) +SR_NOT_CHECKED=;SFP-4;CWE-252 +SR_NOT_CHECKEDMsg=This method ignores the return value of java.io.InputStream.skip() which can skip multiple bytes. If the return value is not checked, the caller will not be able to correctly handle the case where fewer bytes were skipped than the caller requested. This is a particularly insidious kind of bug, because in many programs, skips from input streams usually do skip the full amount of data requested, causing the program to fail only sporadically. With Buffered streams, however, skip() will only skip data in the buffer, and will routinely fail to skip the requested number of bytes. + +#RV: Method ignores exceptional return value (RV_RETURN_VALUE_IGNORED_BAD_PRACTICE) +RV_RETURN_VALUE_IGNORED_BAD_PRACTICE=;SFP-4;CWE-252 +RV_RETURN_VALUE_IGNORED_BAD_PRACTICEMsg=This method returns a value that is not checked. The return value should be checked since it can indicate an unusual or unexpected function execution. For example, the File.delete() method returns false if the file could not be successfully deleted (rather than throwing an Exception). If you don't check the result, you won't notice if the method invocation signals unexpected behavior by returning an atypical return value. + +#SI: Static initializer creates instance before all static final fields assigned (SI_INSTANCE_BEFORE_FINALS_ASSIGNED) +SI_INSTANCE_BEFORE_FINALS_ASSIGNED=;SFP-1;CWE-456 +SI_INSTANCE_BEFORE_FINALS_ASSIGNEDMsg=The class's static initializer creates an instance of the class before all of the static final fields are assigned. + +#SW: Certain swing methods needs to be invoked in Swing thread (SW_SWING_METHODS_INVOKED_IN_SWING_THREAD) +SW_SWING_METHODS_INVOKED_IN_SWING_THREAD=API;SFP--1;CWE-684 +SW_SWING_METHODS_INVOKED_IN_SWING_THREADMsg=The Swing methods show(), setVisible(), and pack() will create the associated peer for the frame. With the creation of the peer, the system creates the event dispatch thread. This makes things problematic because the event dispatch thread could be notifying listeners while pack and validate are still processing. This situation could result in two threads going through the Swing component-based GUI -- it's a serious flaw that could result in deadlocks or other related threading issues. A pack call causes components to be realized. As they are being realized (that is, not necessarily visible), they could trigger listener notification on the event dispatch thread. + +#Se: Non-transient non-serializable instance field in serializable class (SE_BAD_FIELD) +SE_BAD_FIELD=API;SFP--1;CWE-684 +SE_BAD_FIELDMsg=This Serializable class defines a non-primitive instance field which is neither transient, Serializable, or java.lang.Object, and does not appear to implement the Externalizable interface or the readObject() and writeObject() methods. Objects of this class will not be deserialized correctly if a non-Serializable object is stored in this field. + +#Se: Non-serializable class has a serializable inner class (SE_BAD_FIELD_INNER_CLASS) +SE_BAD_FIELD_INNER_CLASS=API;SFP--1;CWE-684 +SE_BAD_FIELD_INNER_CLASSMsg=This Serializable class is an inner class of a non-serializable class. Thus, attempts to serialize it will also attempt to associate instance of the outer class with which it is associated, leading to a runtime error. If possible, making the inner class a static inner class should solve the problem. Making the outer class serializable might also work, but that would mean serializing an instance of the inner class would always also serialize the instance of the outer class, which it often not what you really want. + +#Se: Non-serializable value stored into instance field of a serializable class (SE_BAD_FIELD_STORE) +SE_BAD_FIELD_STORE=API;SFP--1;CWE-684 +SE_BAD_FIELD_STOREMsg=A non-serializable value is stored into a non-transient field of a serializable class. + +#Se: Comparator doesn't implement Serializable (SE_COMPARATOR_SHOULD_BE_SERIALIZABLE) +SE_COMPARATOR_SHOULD_BE_SERIALIZABLE=;SFP--1;CWE-710 +SE_COMPARATOR_SHOULD_BE_SERIALIZABLEMsg=This class implements the Comparator interface. You should consider whether or not it should also implement the Serializable interface. If a comparator is used to construct an ordered collection such as a TreeMap, then the TreeMap will be serializable only if the comparator is also serializable. As most comparators have little or no state, making them serializable is generally easy and good defensive programming. + +#Se: Serializable inner class (SE_INNER_CLASS) +SE_INNER_CLASS=API;SFP--1;CWE-684 +SE_INNER_CLASSMsg=This Serializable class is an inner class. Any attempt to serialize it will also serialize the associated outer instance. The outer instance is serializable, so this won't fail, but it might serialize a lot more data than intended. If possible, making the inner class a static inner class (also known as a nested class) should solve the problem. + +#Se: serialVersionUID isn't final (SE_NONFINAL_SERIALVERSIONID) +SE_NONFINAL_SERIALVERSIONID=;SFP--1;CWE-710 +SE_NONFINAL_SERIALVERSIONIDMsg=This class defines a serialVersionUID field that is not final. The field should be made final if it is intended to specify the version UID for purposes of serialization. + +#Se: serialVersionUID isn't long (SE_NONLONG_SERIALVERSIONID) +SE_NONLONG_SERIALVERSIONID=;SFP--1;CWE-710 +SE_NONLONG_SERIALVERSIONIDMsg=This class defines a serialVersionUID field that is not long. The field should be made long if it is intended to specify the version UID for purposes of serialization. + +#Se: serialVersionUID isn't static (SE_NONSTATIC_SERIALVERSIONID) +SE_NONSTATIC_SERIALVERSIONID=;SFP--1;CWE-710 +SE_NONSTATIC_SERIALVERSIONIDMsg=This class defines a serialVersionUID field that is not static. The field should be made static if it is intended to specify the version UID for purposes of serialization. + +#Se: Class is Serializable but its superclass doesn't define a void constructor (SE_NO_SUITABLE_CONSTRUCTOR) +SE_NO_SUITABLE_CONSTRUCTOR=API;SFP--1;CWE-684 +SE_NO_SUITABLE_CONSTRUCTORMsg=This class implements the Serializable interface and its superclass does not. When such an object is deserialized, the fields of the superclass need to be initialized by invoking the void constructor of the superclass. Since the superclass does not have one, serialization and deserialization will fail at runtime. + +#Se: Class is Externalizable but doesn't define a void constructor (SE_NO_SUITABLE_CONSTRUCTOR_FOR_EXTERNALIZATION) +SE_NO_SUITABLE_CONSTRUCTOR_FOR_EXTERNALIZATION=API;SFP--1;CWE-684 +SE_NO_SUITABLE_CONSTRUCTOR_FOR_EXTERNALIZATIONMsg=This class implements the Externalizable interface, but does not define a void constructor. When Externalizable objects are deserialized, they first need to be constructed by invoking the void constructor. Since this class does not have one, serialization and deserialization will fail at runtime. + +#Se: The readResolve method must be declared with a return type of Object. (SE_READ_RESOLVE_MUST_RETURN_OBJECT) +SE_READ_RESOLVE_MUST_RETURN_OBJECT=API;SFP--1;CWE-684 +SE_READ_RESOLVE_MUST_RETURN_OBJECTMsg=In order for the readResolve method to be recognized by the serialization mechanism, it must be declared to have a return type of Object. + +#Se: Transient field that isn't set by deserialization. (SE_TRANSIENT_FIELD_NOT_RESTORED) +SE_TRANSIENT_FIELD_NOT_RESTORED=API;SFP--1;CWE-684 +SE_TRANSIENT_FIELD_NOT_RESTOREDMsg=This class contains a field that is updated at multiple places in the class, thus it seems to be part of the state of the class. However, since the field is marked as transient and not set in readObject or readResolve, it will contain the default value in any deserialized instance of the class. + +#SnVI: Class is Serializable, but doesn't define serialVersionUID (SE_NO_SERIALVERSIONID) +SE_NO_SERIALVERSIONID=API;SFP--1;CWE-684 +SE_NO_SERIALVERSIONIDMsg=This class implements the Serializable interface, but does not define a serialVersionUID field. A change as simple as adding a reference to a .class object will add synthetic fields to the class, which will unfortunately change the implicit serialVersionUID (e.g., adding a reference to String.class will generate a static field class$java$lang$String). Also, different source code to bytecode compilers may use different naming conventions for synthetic variables generated for references to class objects or inner classes. To ensure interoperability of Serializable across versions, consider adding an explicit serialVersionUID. + +#UI: Usage of GetResource may be unsafe if class is extended (UI_INHERITANCE_UNSAFE_GETRESOURCE) +UI_INHERITANCE_UNSAFE_GETRESOURCE=;SFP-3;CWE-676 +UI_INHERITANCE_UNSAFE_GETRESOURCEMsg=Calling this.getClass().getResource(...) could give results other than expected if this class is extended by a class in another package. + +#BC: Impossible cast (BC_IMPOSSIBLE_CAST) +BC_IMPOSSIBLE_CAST=;SFP-1;CWE-704 +BC_IMPOSSIBLE_CASTMsg=This cast will always throw a ClassCastException. FindBugs tracks type information from instanceof checks, and also uses more precise information about the types of values returned from methods and loaded from fields. Thus, it may have more precise information that just the declared type of a variable, and can use this to determine that a cast will always throw an exception at runtime. + +#BC: Impossible downcast (BC_IMPOSSIBLE_DOWNCAST) +BC_IMPOSSIBLE_DOWNCAST=;SFP-1;CWE-704 +BC_IMPOSSIBLE_DOWNCASTMsg=This cast will always throw a ClassCastException. The analysis believes it knows the precise type of the value being cast, and the attempt to downcast it to a subtype will always fail by throwing a ClassCastException. + +BC: Impossible downcast of toArray() result (BC_IMPOSSIBLE_DOWNCAST_OF_TOARRAY) +BC_IMPOSSIBLE_DOWNCAST_OF_TOARRAY=;SFP-1;CWE-704 +BC_IMPOSSIBLE_DOWNCAST_OF_TOARRAYMsg=This code is casting the result of calling toArray() on a collection to a type more specific than Object[] + +#BC: instanceof will always return false (BC_IMPOSSIBLE_INSTANCEOF) +BC_IMPOSSIBLE_INSTANCEOF=;SFP-1;CWE-570 +BC_IMPOSSIBLE_INSTANCEOFMsg=This instanceof test will always return false. Although this is safe, make sure it isn't an indication of some misunderstanding or some other logic error. + +#BIT: Bitwise add of signed byte value (BIT_ADD_OF_SIGNED_BYTE) +BIT_ADD_OF_SIGNED_BYTE=;SFP-1;CWE-194 +BIT_ADD_OF_SIGNED_BYTEMsg=Adds a byte value and a value which is known to the 8 lower bits clear. Values loaded from a byte array are sign extended to 32 bits before any any bitwise operations are performed on the value. Thus, if b[0] contains the value 0xff, and x is initially 0, then the code ((x << 8) + b[0]) will sign extend 0xff to get 0xffffffff, and thus give the value 0xffffffff as the result. + +#BIT: Incompatible bit masks (BIT_AND) +BIT_AND=;SFP-1;CWE-570 +BIT_ANDMsg=This method compares an expression of the form (e & C) to D, which will always compare unequal due to the specific values of constants C and D. This may indicate a logic error or typo. + +#BIT: Check to see if ((...) & 0) == 0 (BIT_AND_ZZ) +BIT_AND_ZZ=;SFP-1;CWE-571 +BIT_AND_ZZMsg=This method compares an expression of the form (e & 0) to 0, which will always compare equal. This may indicate a logic error or typo. + +#BIT: Incompatible bit masks (BIT_IOR) +BIT_IOR=;SFP-1;CWE-570 +BIT_IORMsg=This method compares an expression of the form (e | C) to D. which will always compare unequal due to the specific values of constants C and D. This may indicate a logic error or typo. Typically, this bug occurs because the code wants to perform a membership test in a bit set, but uses the bitwise OR operator ("|") instead of bitwise AND ("&"). + +#BIT: Bitwise OR of signed byte value (BIT_IOR_OF_SIGNED_BYTE) +BIT_IOR_OF_SIGNED_BYTE=;SFP-1;CWE-194 +BIT_IOR_OF_SIGNED_BYTEMsg=Loads a value from a byte array and performs a bitwise OR with that value. Values loaded from a byte array are sign extended to 32 bits before any any bitwise operations are performed on the value. Thus, if b[0] contains the value 0xff, and x is initially 0, then the code ((x << 8) | b[0]) will sign extend 0xff to get 0xffffffff, and thus give the value 0xffffffff as the result. + +#BIT: Check for sign of bitwise operation (BIT_SIGNED_CHECK_HIGH_BIT) +BIT_SIGNED_CHECK_HIGH_BIT=;SFP-1;CWE-195 +BIT_SIGNED_CHECK_HIGH_BITMsg=This method compares an expression such as ((event.detail & SWT.SELECTED) > 0). Using bit arithmetic and then comparing with the greater than operator can lead to unexpected results (of course depending on the value of SWT.SELECTED). If SWT.SELECTED is a negative number, this is a candidate for a bug. Even when SWT.SELECTED is not negative, it seems good practice to use '!= 0' instead of '> 0'. + +#BOA: Class overrides a method implemented in super class Adapter wrongly (BOA_BADLY_OVERRIDDEN_ADAPTER) +BOA_BADLY_OVERRIDDEN_ADAPTER=;SFP--1;CWE-710 +BOA_BADLY_OVERRIDDEN_ADAPTERMsg=This method overrides a method found in a parent class, where that class is an Adapter that implements a listener defined in the java.awt.event or javax.swing.event package. As a result, this method will not get called when the event occurs. + +#BSHIFT: 32 bit int shifted by an amount not in the range 0..31 (ICAST_BAD_SHIFT_AMOUNT) +ICAST_BAD_SHIFT_AMOUNT=;SFP-1;CWE-682 +ICAST_BAD_SHIFT_AMOUNTMsg=The code performs shift of a 32 bit int by a constant amount outside the range 0..31. The effect of this is to use the lower 5 bits of the integer value to decide how much to shift by (e.g., shifting by 40 bits is the same as shifting by 8 bits, and shifting by 32 bits is the same as shifting by zero bits). This probably isn't want was expected, and it at least confusing. + +#Bx: Primitive value is unboxed and coerced for ternary operator (BX_UNBOXED_AND_COERCED_FOR_TERNARY_OPERATOR) +BX_UNBOXED_AND_COERCED_FOR_TERNARY_OPERATOR=;SFP--1;CWE-192 +BX_UNBOXED_AND_COERCED_FOR_TERNARY_OPERATORMsg=A wrapped primitive value is unboxed and converted to another primitive type as part of the evaluation of a conditional ternary operator (the b ? e1 : e2 operator). The semantics of Java mandate that if e1 and e2 are wrapped numeric values, the values are unboxed and converted/coerced to their common type (e.g, if e1 is of type Integer and e2 is of type Float, then e1 is unboxed, converted to a floating point value, and boxed. See JLS Section 15.25. + +#DLS: Dead store of class literal (DLS_DEAD_STORE_OF_CLASS_LITERAL) +DLS_DEAD_STORE_OF_CLASS_LITERAL=;SFP-2;CWE-563 +DLS_DEAD_STORE_OF_CLASS_LITERALMsg=This instruction assigns a class literal to a variable and then never uses it. The behavior of this differs in Java 1.4 and in Java 5. In Java 1.4 and earlier, a reference to Foo.class would force the static initializer for Foo to be executed, if it has not been executed already. In Java 5 and later, it does not.See Sun's article on Java SE compatibility for more details and examples, and suggestions on how to force class initialization in Java 5. + +#DLS: Overwritten increment (DLS_OVERWRITTEN_INCREMENT) +DLS_OVERWRITTEN_INCREMENT=;SFP--1;CWE-398 +DLS_OVERWRITTEN_INCREMENTMsg=The code performs an increment operation (e.g., i++) and then immediately overwrites it. For example, i = i++ immediately overwrites the incremented value with the original value. + +#DMI: Bad constant value for month (DMI_BAD_MONTH) +DMI_BAD_MONTH=;SFP-1;CWE-682 +DMI_BAD_MONTHMsg=This code passes a constant month value outside the expected range of 0..11 to a method. + +#DMI: hasNext method invokes next (DMI_CALLING_NEXT_FROM_HASNEXT) +DMI_CALLING_NEXT_FROM_HASNEXT=;SFP--1;CWE-398 +DMI_CALLING_NEXT_FROM_HASNEXTMsg=The hasNext() method invokes the next() method. This is almost certainly wrong, since the hasNext() method is not supposed to change the state of the iterator, and the next method is supposed to change the state of the iterator. + +#DMI: Collections should not contain themselves (DMI_COLLECTIONS_SHOULD_NOT_CONTAIN_THEMSELVES) +DMI_COLLECTIONS_SHOULD_NOT_CONTAIN_THEMSELVES=;SFP--1;CWE-687 +DMI_COLLECTIONS_SHOULD_NOT_CONTAIN_THEMSELVESMsg=This call to a generic collection's method would only make sense if a collection contained itself (e.g., if s.contains(s) were true). This is unlikely to be true and would cause problems if it were true (such as the computation of the hash code resulting in infinite recursion). It is likely that the wrong value is being passed as a parameter. + +#DMI: Invocation of hashCode on an array (DMI_INVOKING_HASHCODE_ON_ARRAY) +DMI_INVOKING_HASHCODE_ON_ARRAY=;SFP--1;CWE-398 +DMI_INVOKING_HASHCODE_ON_ARRAYMsg=The code invokes hashCode on an array. Calling hashCode on an array returns the same value as System.identityHashCode, and ingores the contents and length of the array. If you need a hashCode that depends on the contents of an array a, use java.util.Arrays.hashCode(a). + +#DMI: hasNext method invokes next (DMI_CALLING_NEXT_FROM_HASNEXT) +DMI_LONG_BITS_TO_DOUBLE_INVOKED_ON_INT=;SFP--1;CWE-686 +DMI_LONG_BITS_TO_DOUBLE_INVOKED_ON_INTMsg=The Double.longBitsToDouble method is invoked, but a 32 bit int value is passed as an argument. This almostly certainly is not intended and is unlikely to give the intended result. + +#DMI: Vacuous call to collections (DMI_VACUOUS_SELF_COLLECTION_CALL) +DMI_VACUOUS_SELF_COLLECTION_CALL=;SFP--1;CWE-687 +DMI_VACUOUS_SELF_COLLECTION_CALLMsg=This call doesn't make sense. For any collection c, calling c.containsAll(c) should always be true, and c.retainAll(c) should have no effect. + +#Dm: Can't use reflection to check for presence of annotation without runtime retention (DMI_ANNOTATION_IS_NOT_VISIBLE_TO_REFLECTION) +DMI_ANNOTATION_IS_NOT_VISIBLE_TO_REFLECTION=;SFP--1;CWE-710 +DMI_ANNOTATION_IS_NOT_VISIBLE_TO_REFLECTIONMsg=Unless an annotation has itself been annotated with @Retention(RetentionPolicy.RUNTIME), the annotation can't be observed using reflection (e.g., by using the isAnnotationPresent method). + +#Dm: Futile attempt to change max pool size of ScheduledThreadPoolExecutor (DMI_FUTILE_ATTEMPT_TO_CHANGE_MAXPOOL_SIZE_OF_SCHEDULED_THREAD_POOL_EXECUTOR) +DMI_FUTILE_ATTEMPT_TO_CHANGE_MAXPOOL_SIZE_OF_SCHEDULED_THREAD_POOL_EXECUTOR=;SFP--1;CWE-398 +DMI_FUTILE_ATTEMPT_TO_CHANGE_MAXPOOL_SIZE_OF_SCHEDULED_THREAD_POOL_EXECUTORMsg=While ScheduledThreadPoolExecutor inherits from ThreadPoolExecutor, a few of the inherited tuning methods are not useful for it. In particular, because it acts as a fixed-sized pool using corePoolSize threads and an unbounded queue, adjustments to maximumPoolSize have no useful effect. + +#Dm: Creation of ScheduledThreadPoolExecutor with zero core threads (DMI_SCHEDULED_THREAD_POOL_EXECUTOR_WITH_ZERO_CORE_THREADS) +DMI_SCHEDULED_THREAD_POOL_EXECUTOR_WITH_ZERO_CORE_THREADS=;SFP--1;CWE-398 +DMI_SCHEDULED_THREAD_POOL_EXECUTOR_WITH_ZERO_CORE_THREADSMsg=A ScheduledThreadPoolExecutor with zero core threads will never execute anything; changes to the max pool size are ignored. + +#Dm: Useless/vacuous call to EasyMock method (DMI_VACUOUS_CALL_TO_EASYMOCK_METHOD) +DMI_VACUOUS_CALL_TO_EASYMOCK_METHOD=;SFP--1;CWE-398 +DMI_VACUOUS_CALL_TO_EASYMOCK_METHODMsg=This call doesn't pass any objects to the EasyMock method, so the call doesn't do anything. + +#EC: equals() used to compare array and nonarray (EC_ARRAY_AND_NONARRAY) +EC_ARRAY_AND_NONARRAY=;SFP-1;CWE-570 +EC_ARRAY_AND_NONARRAYMsg=This method invokes the .equals(Object o) to compare an array and a reference that doesn't seem to be an array. If things being compared are of different types, they are guaranteed to be unequal and the comparison is almost certainly an error. Even if they are both arrays, the equals method on arrays only determines of the two arrays are the same object. To compare the contents of the arrays, use java.util.Arrays.equals(Object[], Object[]). + +#EC: Invocation of equals() on an array, which is equivalent to == (EC_BAD_ARRAY_COMPARE) +EC_BAD_ARRAY_COMPARE=;SFP-1;CWE-570 +EC_BAD_ARRAY_COMPAREMsg=This method invokes the .equals(Object o) method on an array. Since arrays do not override the equals method of Object, calling equals on an array is the same as comparing their addresses. To compare the contents of the arrays, use java.util.Arrays.equals(Object[], Object[]). To compare the addresses of the arrays, it would be less confusing to explicitly pointer equality using ==. + +#EC: equals(...) used to compare incompatible arrays (EC_INCOMPATIBLE_ARRAY_COMPARE) +EC_INCOMPATIBLE_ARRAY_COMPARE=;SFP-1;CWE-570 +EC_INCOMPATIBLE_ARRAY_COMPAREMsg=This method invokes the .equals(Object o) to compare two arrays, but the arrays of of incompatible types (e.g., String[] and StringBuffer[], or String[] and int[]). They will never be equal. In addition, when equals(...) is used to compare arrays it only checks to see if they are the same array, and ignores the contents of the arrays. + +#EC: Call to equals() with null argument (EC_NULL_ARG) +EC_NULL_ARG=;SFP-1;CWE-570 +EC_NULL_ARGMsg=This method calls equals(Object), passing a null value as the argument. According to the contract of the equals() method, this call should always return false. + +#EC: Call to equals() comparing unrelated class and interface (EC_UNRELATED_CLASS_AND_INTERFACE) +EC_UNRELATED_CLASS_AND_INTERFACE=;SFP-1;CWE-570 +EC_UNRELATED_CLASS_AND_INTERFACEMsg=This method calls equals(Object) on two references, one of which is a class and the other an interface, where neither the class nor any of its non-abstract subclasses implement the interface. Therefore, the objects being compared are unlikely to be members of the same class at runtime (unless some application classes were not analyzed, or dynamic class loading can occur at runtime). According to the contract of equals(), objects of different classes should always compare as unequal; therefore, according to the contract defined by java.lang.Object.equals(Object), the result of this comparison will always be false at runtime. + +#EC: Call to equals() comparing different interface types (EC_UNRELATED_INTERFACES) +EC_UNRELATED_INTERFACES=;SFP-1;CWE-570 +EC_UNRELATED_INTERFACESMsg=This method calls equals(Object) on two references of unrelated interface types, where neither is a subtype of the other, and there are no known non-abstract classes which implement both interfaces. Therefore, the objects being compared are unlikely to be members of the same class at runtime (unless some application classes were not analyzed, or dynamic class loading can occur at runtime). According to the contract of equals(), objects of different classes should always compare as unequal; therefore, according to the contract defined by java.lang.Object.equals(Object), the result of this comparison will always be false at runtime. + +#EC: Call to equals() comparing different types (EC_UNRELATED_TYPES) +EC_UNRELATED_TYPES=;SFP-1;CWE-570 +EC_UNRELATED_TYPESMsg=This method calls equals(Object) on two references of different class types with no common subclasses. Therefore, the objects being compared are unlikely to be members of the same class at runtime (unless some application classes were not analyzed, or dynamic class loading can occur at runtime). According to the contract of equals(), objects of different classes should always compare as unequal; therefore, according to the contract defined by java.lang.Object.equals(Object), the result of this comparison will always be false at runtime. + +#EC: Using pointer equality to compare different types (EC_UNRELATED_TYPES_USING_POINTER_EQUALITY) +EC_UNRELATED_TYPES_USING_POINTER_EQUALITY=;SFP-1;CWE-570 +EC_UNRELATED_TYPES_USING_POINTER_EQUALITYMsg=This method uses using pointer equality to compare two references that seem to be of different types. The result of this comparison will always be false at runtime. + +#Eq: equals method always returns false (EQ_ALWAYS_FALSE) +EQ_ALWAYS_FALSE=;SFP-1;CWE-570 +EQ_ALWAYS_FALSEMsg=This class defines an equals method that always returns false. This means that an object is not equal to itself, and it is impossible to create useful Maps or Sets of this class. More fundamentally, it means that equals is not reflexive, one of the requirements of the equals method. The likely intended semantics are object identity: that an object is equal to itself. This is the behavior inherited from class Object. If you need to override an equals inherited from a different superclass, you can use use: public boolean equals(Object o) { return this == o; } + +#Eq: equals method always returns true (EQ_ALWAYS_TRUE) +EQ_ALWAYS_TRUE=;SFP-1;CWE-571 +EQ_ALWAYS_TRUEMsg=This class defines an equals method that always returns true. This is imaginative, but not very smart. Plus, it means that the equals method is not symmetric. + +#Eq: equals method compares class names rather than class objects (EQ_COMPARING_CLASS_NAMES) +EQ_COMPARING_CLASS_NAMES=;SFP-1;CWE-486 +EQ_COMPARING_CLASS_NAMESMsg=This method checks to see if two objects are the same class by checking to see if the names of their classes are equal. You can have different classes with the same name if they are loaded by different class loaders. Just check to see if the class objects are the same. + +#Eq: Covariant equals() method defined for enum (EQ_DONT_DEFINE_EQUALS_FOR_ENUM) +EQ_DONT_DEFINE_EQUALS_FOR_ENUM=;SFP--1;CWE-710 +EQ_DONT_DEFINE_EQUALS_FOR_ENUMMsg=This class defines an enumeration, and equality on enumerations are defined using object identity. Defining a covariant equals method for an enumeration value is exceptionally bad practice, since it would likely result in having two different enumeration values that compare as equals using the covariant enum method, and as not equal when compared normally. Don't do it. + +#Eq: equals() method defined that doesn't override equals(Object) (EQ_other_NO_OBJECT) +EQ_other_NO_OBJECT=;SFP-1;CWE-581 +EQ_other_NO_OBJECTMsg=This class defines an equals() method, that doesn't override the normal equals(Object) method defined in the base java.lang.Object class. Instead, it inherits an equals(Object) method from a superclass. The class should probably define a boolean equals(Object) method. + +#Eq: equals() method defined that doesn't override Object.equals(Object) (EQ_other_USE_OBJECT) +EQ_other_USE_OBJECT=;SFP--1;CWE-710 +EQ_other_USE_OBJECTMsg=This class defines an equals() method, that doesn't override the normal equals(Object) method defined in the base java.lang.Object class. The class should probably define a boolean equals(Object) method. + +#Eq: equals method overrides equals in superclass and may not be symmetric (EQ_OVERRIDING_EQUALS_NOT_SYMMETRIC) +EQ_OVERRIDING_EQUALS_NOT_SYMMETRIC=;SFP--1;CWE-710 +EQ_OVERRIDING_EQUALS_NOT_SYMMETRICMsg=This class defines an equals method that overrides an equals method in a superclass. Both equals methods methods use instanceof in the determination of whether two objects are equal. This is fraught with peril, since it is important that the equals method is symmetrical (in other words, a.equals(b) == b.equals(a)). If B is a subtype of A, and A's equals method checks that the argument is an instanceof A, and B's equals method checks that the argument is an instanceof B, it is quite likely that the equivalence relation defined by these methods is not symmetric. + +#Eq: Covariant equals() method defined, Object.equals(Object) inherited (EQ_SELF_USE_OBJECT) +EQ_SELF_USE_OBJECT=;SFP--1;CWE-710 +EQ_SELF_USE_OBJECTMsg=This class defines a covariant version of the equals() method, but inherits the normal equals(Object) method defined in the base java.lang.Object class. The class should probably define a boolean equals(Object) method. + +#FE: Doomed test for equality to NaN (FE_TEST_IF_EQUAL_TO_NOT_A_NUMBER) +FE_TEST_IF_EQUAL_TO_NOT_A_NUMBER=;SFP-1;CWE-570 +FE_TEST_IF_EQUAL_TO_NOT_A_NUMBERMsg=This code checks to see if a floating point value is equal to the special Not A Number value (e.g., if (x == Double.NaN)). However, because of the special semantics of NaN, no value is equal to Nan, including NaN. Thus, x == Double.NaN always evaluates to false. To check to see if a value contained in x is the special Not A Number value, use Double.isNaN(x) (or Float.isNaN(x) if x is floating point precision). + +#FS: Format string placeholder incompatible with passed argument (VA_FORMAT_STRING_BAD_ARGUMENT) +VA_FORMAT_STRING_BAD_ARGUMENT=;SFP-1;CWE-687 +VA_FORMAT_STRING_BAD_ARGUMENTMsg=The format string placeholder is incompatible with the corresponding argument. For example, System.out.println("%d\n", "hello"); The %d placeholder requires a numeric argument, but a string value is passed instead. A runtime exception will occur when this statement is executed. + +#FS: The type of a supplied argument doesn't match format specifier (VA_FORMAT_STRING_BAD_CONVERSION) +VA_FORMAT_STRING_BAD_CONVERSION=;SFP-1;CWE-687 +VA_FORMAT_STRING_BAD_CONVERSIONMsg=One of the arguments is uncompatible with the corresponding format string specifier. As a result, this will generate a runtime exception when executed. For example, String.format("%d", "1") will generate an exception, since the String "1" is incompatible with the format specifier %d. + +#FS: MessageFormat supplied where printf style format expected (VA_FORMAT_STRING_EXPECTED_MESSAGE_FORMAT_SUPPLIED) +VA_FORMAT_STRING_EXPECTED_MESSAGE_FORMAT_SUPPLIED=;SFP-1;CWE-685 +VA_FORMAT_STRING_EXPECTED_MESSAGE_FORMAT_SUPPLIEDMsg=A method is called that expects a Java printf format string and a list of arguments. However, the format string doesn't contain any format specifiers (e.g., %s) but does contain message format elements (e.g., {0}). It is likely that the code is supplying a MessageFormat string when a printf-style format string is required. At runtime, all of the arguments will be ignored and the format string will be returned exactly as provided without any formatting. + +#FS: More arguments are passed than are actually used in the format string (VA_FORMAT_STRING_EXTRA_ARGUMENTS_PASSED) +VA_FORMAT_STRING_EXTRA_ARGUMENTS_PASSED=;SFP-1;CWE-685 +VA_FORMAT_STRING_EXTRA_ARGUMENTS_PASSEDMsg=A format-string method with a variable number of arguments is called, but more arguments are passed than are actually used by the format string. This won't cause a runtime exception, but the code may be silently omitting information that was intended to be included in the formatted string. + +#FS: Illegal format string (VA_FORMAT_STRING_ILLEGAL) +VA_FORMAT_STRING_ILLEGAL=;SFP-1;CWE-687 +VA_FORMAT_STRING_ILLEGALMsg=The format string is syntactically invalid, and a runtime exception will occur when this statement is executed. + +#FS: Format string references missing argument (VA_FORMAT_STRING_MISSING_ARGUMENT) +VA_FORMAT_STRING_MISSING_ARGUMENT=;SFP-1;CWE-685 +VA_FORMAT_STRING_MISSING_ARGUMENTMsg=Not enough arguments are passed to satisfy a placeholder in the format string. A runtime exception will occur when this statement is executed. + +#FS: No previous argument for format string (VA_FORMAT_STRING_NO_PREVIOUS_ARGUMENT) +VA_FORMAT_STRING_NO_PREVIOUS_ARGUMENT=;SFP-1;CWE-685 +VA_FORMAT_STRING_NO_PREVIOUS_ARGUMENTMsg=The format string specifies a relative index to request that the argument for the previous format specifier be reused. However, there is no previous argument. + +#GC: No relationship between generic parameter and method argument (GC_UNRELATED_TYPES) +GC_UNRELATED_TYPES=;SFP--1;CWE-687 +GC_UNRELATED_TYPESMsg=This call to a generic collection method contains an argument with an incompatible class from that of the collection's parameter (i.e., the type of the argument is neither a supertype nor a subtype of the corresponding generic type argument). Therefore, it is unlikely that the collection contains any objects that are equal to the method argument used here. Most likely, the wrong value is being passed to the method. In general, instances of two unrelated classes are not equal. For example, if the Foo and Bar classes are not related by subtyping, then an instance of Foo should not be equal to an instance of Bar. Among other issues, doing so will likely result in an equals method that is not symmetrical. For example, if you define the Foo class so that a Foo can be equal to a String, your equals method isn't symmetrical since a String can only be equal to a String. In rare cases, people do define nonsymmetrical equals methods and still manage to make their code work. Although none of the APIs document or guarantee it, it is typically the case that if you check if a Collection contains a Foo, the equals method of argument (e.g., the equals method of the Foo class) used to perform the equality checks. + +#HE: Signature declares use of unhashable class in hashed construct (HE_SIGNATURE_DECLARES_HASHING_OF_UNHASHABLE_CLASS) +HE_SIGNATURE_DECLARES_HASHING_OF_UNHASHABLE_CLASS=;SFP--1;CWE-581 +HE_SIGNATURE_DECLARES_HASHING_OF_UNHASHABLE_CLASSMsg=A method, field or class declares a generic signature where a non-hashable class is used in context where a hashable class is required. A class that declares an equals method but inherits a hashCode() method from Object is unhashable, since it doesn't fulfill the requirement that equal objects have equal hashCodes. + +#HE: Use of class without a hashCode() method in a hashed data structure (HE_USE_OF_UNHASHABLE_CLASS) +HE_USE_OF_UNHASHABLE_CLASS=;SFP--1;CWE-581 +HE_USE_OF_UNHASHABLE_CLASSMsg=A class defines an equals(Object) method but not a hashCode() method, and thus doesn't fulfill the requirement that equal objects have equal hashCodes. An instance of this class is used in a hash data structure, making the need to fix this problem of highest importance. + +#ICAST: integral value cast to double and then passed to Math.ceil (ICAST_INT_CAST_TO_DOUBLE_PASSED_TO_CEIL) +ICAST_INT_CAST_TO_DOUBLE_PASSED_TO_CEIL=;SFP--1;CWE-398 +ICAST_INT_CAST_TO_DOUBLE_PASSED_TO_CEILMsg=This code converts an integral value (e.g., int or long) to a double precision floating point number and then passing the result to the Math.ceil() function, which rounds a double to the next higher integer value. This operation should always be a no-op, since the converting an integer to a double should give a number with no fractional part. It is likely that the operation that generated the value to be passed to Math.ceil was intended to be performed using double precision floating point arithmetic. + +#INT: Bad comparison of signed byte (INT_BAD_COMPARISON_WITH_SIGNED_BYTE) +INT_BAD_COMPARISON_WITH_SIGNED_BYTE=;SFP--1;CWE-195 +INT_BAD_COMPARISON_WITH_SIGNED_BYTEMsg=Signed bytes can only have a value in the range -128 to 127. Comparing a signed byte with a value outside that range is vacuous and likely to be incorrect. To convert a signed byte b to an unsigned value in the range 0..255, use 0xff & b + +#ICAST: int value cast to float and then passed to Math.round (ICAST_INT_CAST_TO_FLOAT_PASSED_TO_ROUND) +ICAST_INT_CAST_TO_FLOAT_PASSED_TO_ROUND=;SFP--1;CWE-398 +ICAST_INT_CAST_TO_FLOAT_PASSED_TO_ROUNDMsg=This code converts an int value to a float precision floating point number and then passing the result to the Math.round() function, which returns the int/long closest to the argument. This operation should always be a no-op, since the converting an integer to a float should give a number with no fractional part. It is likely that the operation that generated the value to be passed to Math.round was intended to be performed using floating point arithmetic. + +#IJU: JUnit assertion in run method will not be noticed by JUnit (IJU_ASSERT_METHOD_INVOKED_FROM_RUN_METHOD) +IJU_ASSERT_METHOD_INVOKED_FROM_RUN_METHOD=;SFP--1;CWE-710 +IJU_ASSERT_METHOD_INVOKED_FROM_RUN_METHODMsg=A JUnit assertion is performed in a run method. Failed JUnit assertions just result in exceptions being thrown. Thus, if this exception occurs in a thread other than the thread that invokes the test method, the exception will terminate the thread but not result in the test failing. + +#IJU: TestCase declares a bad suite method (IJU_BAD_SUITE_METHOD) +IJU_BAD_SUITE_METHOD=;SFP--1;CWE-710 +IJU_BAD_SUITE_METHODMsg=Class is a JUnit TestCase and defines a suite() method. However, the suite method needs to be declared as either public static junit.framework.Test suite() or public static junit.framework.TestSuite suite() + +#IJU: TestCase has no tests (IJU_NO_TESTS) +IJU_NO_TESTS=;SFP--1;CWE-710 +IJU_NO_TESTSMsg=Class is a JUnit TestCase but has not implemented any test methods + +#IJU: TestCase defines setUp that doesn't call super.setUp() (IJU_SETUP_NO_SUPER) +IJU_SETUP_NO_SUPER=;SFP--1;CWE-710 +IJU_SETUP_NO_SUPERMsg=Class is a JUnit TestCase and implements the setUp method. The setUp method should call super.setUp(), but doesn't. + +#IJU: TestCase implements a non-static suite method (IJU_SUITE_NOT_STATIC) +IJU_SUITE_NOT_STATIC=;SFP--1;CWE-710 +IJU_SUITE_NOT_STATICMsg=Class is a JUnit TestCase and implements the suite() method. The suite method should be declared as being static, but isn't. + +#IJU: TestCase defines tearDown that doesn't call super.tearDown() (IJU_TEARDOWN_NO_SUPER) +IJU_TEARDOWN_NO_SUPER=;SFP--1;CWE-710 +IJU_TEARDOWN_NO_SUPERMsg=Class is a JUnit TestCase and implements the tearDown method. The tearDown method should call super.tearDown(), but doesn't. + +#IL: A collection is added to itself (IL_CONTAINER_ADDED_TO_ITSELF) +IL_CONTAINER_ADDED_TO_ITSELF=;SFP-13;CWE-674 +IL_CONTAINER_ADDED_TO_ITSELFMsg=A collection is added to itself. As a result, computing the hashCode of this set will throw a StackOverflowException + +#IL: An apparent infinite loop (IL_INFINITE_LOOP) +IL_INFINITE_LOOP=;SFP--1;CWE-835 +IL_INFINITE_LOOPMsg=This loop doesn't seem to have a way to terminate (other than by perhaps throwing an exception). + +#IL: An apparent infinite recursive loop (IL_INFINITE_RECURSIVE_LOOP) +IL_INFINITE_RECURSIVE_LOOP=;SFP-13;CWE-674 +IL_INFINITE_RECURSIVE_LOOPMsg=This method unconditionally invokes itself. This would seem to indicate an infinite recursive loop that will result in a stack overflow. + +#IM: Integer multiply of result of integer remainder (IM_MULTIPLYING_RESULT_OF_IREM) +IM_MULTIPLYING_RESULT_OF_IREM=;SFP--1;CWE-398 +IM_MULTIPLYING_RESULT_OF_IREMMsg=The code multiplies the result of an integer remaining by an integer constant. Be sure you don't have your operator precedence confused. For example i % 60 * 1000 is (i % 60) * 1000, not i % (60 * 1000). + +#INT: Bad comparison of nonnegative value with negative constant (INT_BAD_COMPARISON_WITH_NONNEGATIVE_VALUE) +INT_BAD_COMPARISON_WITH_NONNEGATIVE_VALUE=;SFP--1;CWE-398 +INT_BAD_COMPARISON_WITH_NONNEGATIVE_VALUEMsg=This code compares a value that is guaranteed to be non-negative with a negative constant. + +#IO: Doomed attempt to append to an object output stream (IO_APPENDING_TO_OBJECT_OUTPUT_STREAM) +IO_APPENDING_TO_OBJECT_OUTPUT_STREAM=;SFP--1;CWE-398 +IO_APPENDING_TO_OBJECT_OUTPUT_STREAMMsg=This code opens a file in append mode and then wraps the result in an object output stream. This won't allow you to append to an existing object output stream stored in a file. If you want to be able to append to an object output stream, you need to keep the object output stream open. The only situation in which opening a file in append mode and the writing an object output stream could work is if on reading the file you plan to open it in random access mode and seek to the byte offset where the append started. + +#IP: A parameter is dead upon entry to a method but overwritten (IP_PARAMETER_IS_DEAD_BUT_OVERWRITTEN) +IP_PARAMETER_IS_DEAD_BUT_OVERWRITTEN=;SFP--1;CWE-398 +IP_PARAMETER_IS_DEAD_BUT_OVERWRITTENMsg=The initial value of this parameter is ignored, and the parameter is overwritten here. This often indicates a mistaken belief that the write to the parameter will be conveyed back to the caller. + +#MF: Class defines field that masks a superclass field (MF_CLASS_MASKS_FIELD) +MF_CLASS_MASKS_FIELD=;SFP--1;CWE-710 +MF_CLASS_MASKS_FIELDMsg=This class defines a field with the same name as a visible instance field in a superclass. This is confusing, and may indicate an error if methods update or access one of the fields when they wanted the other. + +#MF: Method defines a variable that obscures a field (MF_METHOD_MASKS_FIELD) +MF_METHOD_MASKS_FIELD=;SFP--1;CWE-710 +MF_METHOD_MASKS_FIELDMsg=This method defines a local variable with the same name as a field in this class or a superclass. This may cause the method to read an uninitialized value from the field, leave the field uninitialized, or both. + +#NP: Null pointer dereference (NP_ALWAYS_NULL) +NP_ALWAYS_NULL=;SFP-7;CWE-476 +NP_ALWAYS_NULLMsg=A null pointer is dereferenced here. This will lead to a NullPointerException when the code is executed. + +#NP: Null pointer dereference in method on exception path (NP_ALWAYS_NULL_EXCEPTION) +NP_ALWAYS_NULL_EXCEPTION=;SFP-7;CWE-476 +NP_ALWAYS_NULL_EXCEPTIONMsg=A pointer which is null on an exception path is dereferenced here. This will lead to a NullPointerException when the code is executed. Note that because FindBugs currently does not prune infeasible exception paths, this may be a false warning. Also note that FindBugs considers the default case of a switch statement to be an exception path, since the default case is often infeasible. + +#NP: Method does not check for null argument (NP_ARGUMENT_MIGHT_BE_NULL) +NP_ARGUMENT_MIGHT_BE_NULL=;SFP-7;CWE-476 +NP_ARGUMENT_MIGHT_BE_NULLMsg=A parameter to this method has been identified as a value that should always be checked to see whether or not it is null, but it is being dereferenced without a preceding null check. + +#NP: close() invoked on a value that is always null (NP_CLOSING_NULL) +NP_CLOSING_NULL=;SFP-7;CWE-476 +NP_CLOSING_NULLMsg=close() is being invoked on a value that is always null. If this statement is executed, a null pointer exception will occur. But the big risk here you never close something that should be closed. + +#NP: Null value is guaranteed to be dereferenced (NP_GUARANTEED_DEREF) +NP_GUARANTEED_DEREF=;SFP-7;CWE-476 +NP_GUARANTEED_DEREFMsg=There is a statement or branch that if executed guarantees that a value is null at this point, and that value that is guaranteed to be dereferenced (except on forward paths involving runtime exceptions). + +#NP: Value is null and guaranteed to be dereferenced on exception path (NP_GUARANTEED_DEREF_ON_EXCEPTION_PATH) +NP_GUARANTEED_DEREF_ON_EXCEPTION_PATH=;SFP-7;CWE-476 +NP_GUARANTEED_DEREF_ON_EXCEPTION_PATHMsg=There is a statement or branch on an exception path that if executed guarantees that a value is null at this point, and that value that is guaranteed to be dereferenced (except on forward paths involving runtime exceptions). + +#NP: Method call passes null to a nonnull parameter (NP_NONNULL_PARAM_VIOLATION) +NP_NONNULL_PARAM_VIOLATION=;SFP-7;CWE-476 +NP_NONNULL_PARAM_VIOLATIONMsg=This method passes a null value as the parameter of a method which must be nonnull. Either this parameter has been explicitly marked as @Nonnull, or analysis has determined that this parameter is always dereferenced. + +#NP: Method may return null, but is declared @NonNull (NP_NONNULL_RETURN_VIOLATION) +NP_NONNULL_RETURN_VIOLATION=;SFP-7;CWE-476 +NP_NONNULL_RETURN_VIOLATIONMsg=This method may return a null value, but the method (or a superclass method which it overrides) is declared to return @NonNull. + +#NP: A known null value is checked to see if it is an instance of a type (NP_NULL_INSTANCEOF) +NP_NULL_INSTANCEOF=;SFP-1;CWE-570 +NP_NULL_INSTANCEOFMsg=This instanceof test will always return false, since the value being checked is guaranteed to be null. Although this is safe, make sure it isn't an indication of some misunderstanding or some other logic error. + +#NP: Possible null pointer dereference (NP_NULL_ON_SOME_PATH) +NP_NULL_ON_SOME_PATH=;SFP-7;CWE-476 +NP_NULL_ON_SOME_PATHMsg=There is a branch of statement that, if executed, guarantees that a null value will be dereferenced, which would generate a NullPointerException when the code is executed. Of course, the problem might be that the branch or statement is infeasible and that the null pointer exception can't ever be executed; deciding that is beyond the ability of FindBugs. + +#NP: Possible null pointer dereference in method on exception path (NP_NULL_ON_SOME_PATH_EXCEPTION) +NP_NULL_ON_SOME_PATH_EXCEPTION=;SFP-7;CWE-476 +NP_NULL_ON_SOME_PATH_EXCEPTIONMsg=A reference value which is null on some exception control path is dereferenced here. This may lead to a NullPointerException when the code is executed. Note that because FindBugs currently does not prune infeasible exception paths, this may be a false warning. Also note that FindBugs considers the default case of a switch statement to be an exception path, since the default case is often infeasible. + +#NP: Method call passes null for nonnull parameter (NP_NULL_PARAM_DEREF) +NP_NULL_PARAM_DEREF=;SFP-7;CWE-476 +NP_NULL_PARAM_DEREFMsg=This method call passes a null value for a nonnull method parameter. Either the parameter is annotated as a parameter that should always be nonnull, or analysis has shown that it will always be dereferenced. + +#NP: Method call passes null for nonnull parameter (NP_NULL_PARAM_DEREF_ALL_TARGETS_DANGEROUS) +NP_NULL_PARAM_DEREF_ALL_TARGETS_DANGEROUS=;SFP-7;CWE-476 +NP_NULL_PARAM_DEREF_ALL_TARGETS_DANGEROUSMsg=A possibly-null value is passed at a call site where all known target methods require the parameter to be nonnull. Either the parameter is annotated as a parameter that should always be nonnull, or analysis has shown that it will always be dereferenced. + +#NP: Non-virtual method call passes null for nonnull parameter (NP_NULL_PARAM_DEREF_NONVIRTUAL) +NP_NULL_PARAM_DEREF_NONVIRTUAL=;SFP-7;CWE-476 +NP_NULL_PARAM_DEREF_NONVIRTUALMsg=A possibly-null value is passed to a nonnull method parameter. Either the parameter is annotated as a parameter that should always be nonnull, or analysis has shown that it will always be dereferenced. + +#NP: Store of null value into field annotated NonNull (NP_STORE_INTO_NONNULL_FIELD) +NP_STORE_INTO_NONNULL_FIELD=;SFP-7;CWE-476 +NP_STORE_INTO_NONNULL_FIELDMsg=A value that could be null is stored into a field that has been annotated as NonNull. + +#NP: Read of unwritten field (NP_UNWRITTEN_FIELD) +NP_UNWRITTEN_FIELD=;SFP-7;CWE-476 +NP_UNWRITTEN_FIELDMsg=The program is dereferencing a field that does not seem to ever have a non-null value written to it. Dereferencing this value will generate a null pointer exception. + +#Nm: Class defines equal(Object); should it be equals(Object)? (NM_BAD_EQUAL) +NM_BAD_EQUAL=;SFP--1;CWE-710 +NM_BAD_EQUALMsg=This class defines a method equal(Object). This method does not override the equals(Object) method in java.lang.Object, which is probably what was intended. + +#Nm: Class defines hashcode(); should it be hashCode()? (NM_LCASE_HASHCODE) +NM_LCASE_HASHCODE=;SFP--1;CWE-710 +NM_LCASE_HASHCODEMsg=This class defines a method called hashcode(). This method does not override the hashCode() method in java.lang.Object, which is probably what was intended. + +#Nm: Class defines tostring(); should it be toString()? (NM_LCASE_TOSTRING) +NM_LCASE_TOSTRING=;SFP--1;CWE-710 +NM_LCASE_TOSTRINGMsg=This class defines a method called tostring(). This method does not override the toString() method in java.lang.Object, which is probably what was intended. + +#Nm: Apparent method/constructor confusion (NM_METHOD_CONSTRUCTOR_CONFUSION) +NM_METHOD_CONSTRUCTOR_CONFUSION=;SFP--1;CWE-710 +NM_METHOD_CONSTRUCTOR_CONFUSIONMsg=This regular method has the same name as the class it is defined in. It is likely that this was intended to be a constructor. If it was intended to be a constructor, remove the declaration of a void return value. If you had accidently defined this method, realized the mistake, defined a proper constructor but can't get rid of this method due to backwards compatibility, deprecate the method. + +#Nm: Very confusing method names (NM_VERY_CONFUSING) +NM_VERY_CONFUSING=;SFP--1;CWE-710 +NM_VERY_CONFUSINGMsg=The referenced methods have names that differ only by capitalization. This is very confusing because if the capitalization were identical then one of the methods would override the other. + +#Nm: Method doesn't override method in superclass due to wrong package for parameter (NM_WRONG_PACKAGE) +NM_WRONG_PACKAGE=;SFP--1;CWE-710 +NM_WRONG_PACKAGEMsg=The method in the subclass doesn't override a similar method in a superclass because the type of a parameter doesn't exactly match the type of the corresponding parameter in the superclass. + +#QBA: Method assigns boolean literal in boolean expression (QBA_QUESTIONABLE_BOOLEAN_ASSIGNMENT) +QBA_QUESTIONABLE_BOOLEAN_ASSIGNMENT=;SFP-1;CWE-481 +QBA_QUESTIONABLE_BOOLEAN_ASSIGNMENTMsg=This method assigns a literal boolean value (true or false) to a boolean variable inside an if or while expression. Most probably this was supposed to be a boolean comparison using ==, not an assignment using =. + +#RC: Suspicious reference comparison (RC_REF_COMPARISON) +RC_REF_COMPARISON=;SFP-1;CWE-597 +RC_REF_COMPARISONMsg=This method compares two reference values using the == or != operator, where the correct way to compare instances of this type is generally with the equals() method. It is possible to create distinct instances that are equal but do not compare as == since they are different objects. Examples of classes which should generally not be compared by reference are java.lang.Integer, java.lang.Float, etc. + +#RCN: Nullcheck of value previously dereferenced (RCN_REDUNDANT_NULLCHECK_WOULD_HAVE_BEEN_A_NPE) +RCN_REDUNDANT_NULLCHECK_WOULD_HAVE_BEEN_A_NPE=;SFP-7;CWE-476 +RCN_REDUNDANT_NULLCHECK_WOULD_HAVE_BEEN_A_NPEMsg=A value is checked here to see whether it is null, but this value can't be null because it was previously dereferenced and if it were null a null pointer exception would have occurred at the earlier dereference. Essentially, this code and the previous dereference disagree as to whether this value is allowed to be null. Either the check is redundant or the previous dereference is erroneous. + +#RE: Invalid syntax for regular expression (RE_BAD_SYNTAX_FOR_REGULAR_EXPRESSION) +RE_BAD_SYNTAX_FOR_REGULAR_EXPRESSION=;SFP--1;CWE-687 +RE_BAD_SYNTAX_FOR_REGULAR_EXPRESSIONMsg=The code here uses a regular expression that is invalid according to the syntax for regular expressions. This statement will throw a PatternSyntaxException when executed. + +#RE: File.separator used for regular expression (RE_CANT_USE_FILE_SEPARATOR_AS_REGULAR_EXPRESSION) +RE_CANT_USE_FILE_SEPARATOR_AS_REGULAR_EXPRESSION=;SFP--1;CWE-687 +RE_CANT_USE_FILE_SEPARATOR_AS_REGULAR_EXPRESSIONMsg=The code here uses File.separator where a regular expression is required. This will fail on Windows platforms, where the File.separator is a backslash, which is interpreted in a regular expression as an escape character. Amoung other options, you can just use File.separatorChar=='\\' ? "\\\\" : File.separator instead of File.separator + +#RE: "." used for regular expression (;SFP--1;CWE-687 +RE_POSSIBLE_UNINTENDED_PATTERNMsg=A String function is being invoked and "." is being passed to a parameter that takes a regular expression as an argument. Is this what you intended? For example s.replaceAll(".", "/") will return a String in which every character has been replaced by a / character, and s.split(".") always returns a zero length array of String. + +#RV: Random value from 0 to 1 is coerced to the integer 0 (RV_01_TO_INT) +RV_01_TO_INT=;SFP-1;CWE-197 +RV_01_TO_INTMsg=A random value from 0 to 1 is being coerced to the integer value 0. You probably want to multiple the random value by something else before coercing it to an integer, or use the Random.nextInt(n) method. + +#RV: Bad attempt to compute absolute value of signed 32-bit hashcode (RV_ABSOLUTE_VALUE_OF_HASHCODE) +RV_ABSOLUTE_VALUE_OF_HASHCODE=;SFP-1;CWE-197 +RV_ABSOLUTE_VALUE_OF_HASHCODEMsg=This code generates a hashcode and then computes the absolute value of that hashcode. If the hashcode is Integer.MIN_VALUE, then the result will be negative as well (since Math.abs(Integer.MIN_VALUE) == Integer.MIN_VALUE). One out of 2^32 strings have a hashCode of Integer.MIN_VALUE, including "polygenelubricants" "GydZG_" and ""DESIGNING WORKHOUSES". + +#RV: Bad attempt to compute absolute value of signed 32-bit random integer (RV_ABSOLUTE_VALUE_OF_RANDOM_INT) +RV_ABSOLUTE_VALUE_OF_RANDOM_INT=;SFP-1;CWE--1 +RV_ABSOLUTE_VALUE_OF_RANDOM_INTMsg=This code generates a random signed integer and then computes the absolute value of that random integer. If the number returned by the random number generator is Integer.MIN_VALUE, then the result will be negative as well (since Math.abs(Integer.MIN_VALUE) == Integer.MIN_VALUE). + +#RV: Exception created and dropped rather than thrown (RV_EXCEPTION_NOT_THROWN) +RV_EXCEPTION_NOT_THROWN=;SFP-4;CWE-390 +RV_EXCEPTION_NOT_THROWNMsg=This code creates an exception (or error) object, but doesn't do anything with it. + +#RV: Method ignores return value (RV_RETURN_VALUE_IGNORED) +RV_RETURN_VALUE_IGNORED=;SFP-4;CWE-252 +RV_RETURN_VALUE_IGNOREDMsg=The return value of this method should be checked. One common cause of this warning is to invoke a method on an immutable object, thinking that it updates the object. + +#RpC: Repeated conditional tests (RpC_REPEATED_CONDITIONAL_TEST) +RpC_REPEATED_CONDITIONAL_TEST=;SFP--1;CWE-398 +RpC_REPEATED_CONDITIONAL_TESTMsg=The code contains a conditional test is performed twice, one right after the other (e.g., x == 0 || x == 0). Perhaps the second occurrence is intended to be something else (e.g., x == 0 || y == 0). + +#SA: Double assignment of field (SA_FIELD_DOUBLE_ASSIGNMENT) +SA_FIELD_DOUBLE_ASSIGNMENT=;SFP--1;CWE-398 +SA_FIELD_DOUBLE_ASSIGNMENTMsg=This method contains a double assignment of a field + +#SA: Self assignment of field (SA_FIELD_SELF_ASSIGNMENT) +SA_FIELD_SELF_ASSIGNMENT=;SFP--1;CWE-398 +SA_FIELD_SELF_ASSIGNMENTMsg=This method contains a self assignment of a field + +#SA: Self comparison of field with itself (SA_FIELD_SELF_COMPARISON) +SA_FIELD_SELF_COMPARISON=;SFP--1;CWE-398 +SA_FIELD_SELF_COMPARISONMsg=This method compares a field with itself, and may indicate a typo or a logic error. Make sure that you are comparing the right things. + +#SA: Nonsensical self computation involving a field (e.g., x & x) (SA_FIELD_SELF_COMPUTATION) +SA_FIELD_SELF_COMPUTATION=;SFP--1;CWE-398 +SA_FIELD_SELF_COMPUTATIONMsg=This method performs a nonsensical computation of a field with another reference to the same field (e.g., x&x or x-x). Because of the nature of the computation, this operation doesn't seem to make sense, and may indicate a typo or a logic error. Double check the computation. + +#A: Self comparison of value with itself (SA_LOCAL_SELF_COMPARISON) +SA_LOCAL_SELF_COMPARISON=;SFP--1;CWE-398 +SA_LOCAL_SELF_COMPARISONMsg=This method compares a local variable with itself, and may indicate a typo or a logic error. Make sure that you are comparing the right things. + +#SA: Nonsensical self computation involving a variable (e.g., x & x) (SA_LOCAL_SELF_COMPUTATION) +SA_LOCAL_SELF_COMPUTATION=;SFP--1;CWE-398 +SA_LOCAL_SELF_COMPUTATIONMsg=This method performs a nonsensical computation of a local variable with another reference to the same variable (e.g., x&x or x-x). Because of the nature of the computation, this operation doesn't seem to make sense, and may indicate a typo or a logic error. Double check the computation. + +#SF: Dead store due to switch statement fall through (SF_DEAD_STORE_DUE_TO_SWITCH_FALLTHROUGH) +SF_DEAD_STORE_DUE_TO_SWITCH_FALLTHROUGH=;SFP-4;CWE-484 +SF_DEAD_STORE_DUE_TO_SWITCH_FALLTHROUGHMsg=A value stored in the previous switch case is overwritten here due to a switch fall through. It is likely that you forgot to put a break or return at the end of the previous case. + +#SF: Dead store due to switch statement fall through to throw (SF_DEAD_STORE_DUE_TO_SWITCH_FALLTHROUGH_TO_THROW) +SF_DEAD_STORE_DUE_TO_SWITCH_FALLTHROUGH_TO_THROW=;SFP-4;CWE-484 +SF_DEAD_STORE_DUE_TO_SWITCH_FALLTHROUGH_TO_THROWMsg=A value stored in the previous switch case is ignored here due to a switch fall through to a place where an exception is thrown. It is likely that you forgot to put a break or return at the end of the previous case. + +#SIC: Deadly embrace of non-static inner class and thread local (SIC_THREADLOCAL_DEADLY_EMBRACE) +SIC_THREADLOCAL_DEADLY_EMBRACE=;SFP--1;CWE-398 +SIC_THREADLOCAL_DEADLY_EMBRACEMsg=This class is an inner class, but should probably be a static inner class. As it is, there is a serious danger of a deadly embrace between the inner class and the thread local in the outer class. Because the inner class isn't static, it retains a reference to the outer class. If the thread local contains a reference to an instance of the inner class, the inner and outer instance will both be reachable and not eligible for garbage collection. + +#SIO: Unnecessary type check done using instanceof operator (SIO_SUPERFLUOUS_INSTANCEOF) +SIO_SUPERFLUOUS_INSTANCEOF=;SFP--1;CWE-398 +SIO_SUPERFLUOUS_INSTANCEOFMsg=Type check performed using the instanceof operator where it can be statically determined whether the object is of the type requested. + +#SQL: Method attempts to access a prepared statement parameter with index 0 (SQL_BAD_PREPARED_STATEMENT_ACCESS) +SQL_BAD_PREPARED_STATEMENT_ACCESS=;SFP-1;CWE-687 +SQL_BAD_PREPARED_STATEMENT_ACCESSMsg=A call to a setXXX method of a prepared statement was made where the parameter index is 0. As parameter indexes start at index 1, this is always a mistake. + +#SQL: Method attempts to access a result set field with index 0 (SQL_BAD_RESULTSET_ACCESS) +SQL_BAD_RESULTSET_ACCESS=;SFP-1;CWE-687 +SQL_BAD_RESULTSET_ACCESSMsg=A call to getXXX or updateXXX methods of a result set was made where the field index is 0. As ResultSet fields start at index 1, this is always a mistake. + +#STI: Unneeded use of currentThread() call, to call interrupted() (STI_INTERRUPTED_ON_CURRENTTHREAD) +STI_INTERRUPTED_ON_CURRENTTHREAD=;SFP--1;CWE-398 +STI_INTERRUPTED_ON_CURRENTTHREADMsg=This method invokes the Thread.currentThread() call, just to call the interrupted() method. As interrupted() is a static method, is more simple and clear to use Thread.interrupted(). + +#STI: Static Thread.interrupted() method invoked on thread instance (STI_INTERRUPTED_ON_UNKNOWNTHREAD) +STI_INTERRUPTED_ON_UNKNOWNTHREAD=;SFP--1;CWE-398 +STI_INTERRUPTED_ON_UNKNOWNTHREADMsg=This method invokes the Thread.interrupted() method on a Thread object that appears to be a Thread object that is not the current thread. As the interrupted() method is static, the interrupted method will be called on a different object than the one the author intended. + +#Se: Method must be private in order for serialization to work (SE_METHOD_MUST_BE_PRIVATE) +SE_METHOD_MUST_BE_PRIVATE=;SFP--1;CWE-710 +SE_METHOD_MUST_BE_PRIVATEMsg=This class implements the Serializable interface, and defines a method for custom serialization/deserialization. But since that method isn't declared private, it will be silently ignored by the serialization/deserialization API. + +#Se: The readResolve method must not be declared as a static method. (SE_READ_RESOLVE_IS_STATIC) +SE_READ_RESOLVE_IS_STATIC=;SFP--1;CWE-710 +SE_READ_RESOLVE_IS_STATICMsg=In order for the readResolve method to be recognized by the serialization mechanism, it must not be declared as a static method. + +#TQ: Value annotated as carrying a type qualifier used where a value that must not carry that qualifier is required +TQ_ALWAYS_VALUE_USED_WHERE_NEVER_REQUIRED=;SFP--1;CWE-710 +TQ_ALWAYS_VALUE_USED_WHERE_NEVER_REQUIRED=A value specified as carrying a type qualifier annotation is consumed in a location or locations requiring that the value not carry that annotation. More precisely, a value annotated with a type qualifier specifying when=ALWAYS is guaranteed to reach a use or uses where the same type qualifier specifies when=NEVER. + +#TQ: Value that might not carry a type qualifier is always used in a way requires that type qualifier  +TQ_MAYBE_SOURCE_VALUE_REACHES_ALWAYS_SINK=;SFP--1;CWE-710 +TQ_MAYBE_SOURCE_VALUE_REACHES_ALWAYS_SINKMsg=A value that is annotated as possibility not being an instance of the values denoted by the type qualifier, and the value is guaranteed to be used in a way that requires values denoted by that type qualifier. + +#TQ: Value that might carry a type qualifier is always used in a way prohibits it from having that type qualifier (TQ_MAYBE_SOURCE_VALUE_REACHES_NEVER_SINK) +TQ_MAYBE_SOURCE_VALUE_REACHES_NEVER_SINK=;SFP--1;CWE-710 +TQ_MAYBE_SOURCE_VALUE_REACHES_NEVER_SINKMsg=A value that is annotated as possibility being an instance of the values denoted by the type qualifier, and the value is guaranteed to be used in a way that prohibits values denoted by that type qualifier. + +#TQ: Value annotated as never carrying a type qualifier used where value carrying that qualifier is required (TQ_NEVER_VALUE_USED_WHERE_ALWAYS_REQUIRED) +TQ_NEVER_VALUE_USED_WHERE_ALWAYS_REQUIRED=;SFP--1;CWE-710 +TQ_NEVER_VALUE_USED_WHERE_ALWAYS_REQUIREDMsg=A value specified as not carrying a type qualifier annotation is guaranteed to be consumed in a location or locations requiring that the value does carry that annotation. More precisely, a value annotated with a type qualifier specifying when=NEVER is guaranteed to reach a use or uses where the same type qualifier specifies when=ALWAYS. + +#UMAC: Uncallable method defined in anonymous class (UMAC_UNCALLABLE_METHOD_OF_ANONYMOUS_CLASS) +UMAC_UNCALLABLE_METHOD_OF_ANONYMOUS_CLASS=;SFP-2;CWE-561 +UMAC_UNCALLABLE_METHOD_OF_ANONYMOUS_CLASSMsg=This anonymous class defined a method that is not directly invoked and does not override a method in a superclass. Since methods in other classes cannot directly invoke methods declared in an anonymous class, it seems that this method is uncallable. The method might simply be dead code, but it is also possible that the method is intended to override a method declared in a superclass, and due to an typo or other error the method does not, in fact, override the method it is intended to. + +#UR: Uninitialized read of field in constructor (UR_UNINIT_READ) +UR_UNINIT_READ=;SFP-1;CWE-457 +UR_UNINIT_READMsg=This constructor reads a field which has not yet been assigned a value. This is often caused when the programmer mistakenly uses the field instead of one of the constructor's parameters. + +#UR: Uninitialized read of field method called from constructor of superclass (UR_UNINIT_READ_CALLED_FROM_SUPER_CONSTRUCTOR) +UR_UNINIT_READ_CALLED_FROM_SUPER_CONSTRUCTOR=;SFP-1;CWE-457 +UR_UNINIT_READ_CALLED_FROM_SUPER_CONSTRUCTORMsg=This method is invoked in the constructor of of the superclass. At this point, the fields of the class have not yet initialized. + +#USELESS_STRING: Invocation of toString on an array (DMI_INVOKING_TOSTRING_ON_ANONYMOUS_ARRAY) +DMI_INVOKING_TOSTRING_ON_ANONYMOUS_ARRAY=;SFP--1;CWE-398 +DMI_INVOKING_TOSTRING_ON_ANONYMOUS_ARRAYMsg=The code invokes toString on an (anonymous) array. Calling toString on an array generates a fairly useless result such as [C@16f0472. Consider using Arrays.toString to convert the array into a readable String that gives the contents of the array. See Programming Puzzlers, chapter 3, puzzle 12. + +#USELESS_STRING: Invocation of toString on an array (DMI_INVOKING_TOSTRING_ON_ARRAY) +DMI_INVOKING_TOSTRING_ON_ARRAY=;SFP--1;CWE-398 +DMI_INVOKING_TOSTRING_ON_ARRAYMsg=The code invokes toString on an array, which will generate a fairly useless result such as [C@16f0472. Consider using Arrays.toString to convert the array into a readable String that gives the contents of the array. See Programming Puzzlers, chapter 3, puzzle 12. + +#USELESS_STRING: Array formatted in useless way using format string (VA_FORMAT_STRING_BAD_CONVERSION_FROM_ARRAY) +VA_FORMAT_STRING_BAD_CONVERSION_FROM_ARRAY=;SFP--1;CWE-398 +VA_FORMAT_STRING_BAD_CONVERSION_FROM_ARRAYMsg=One of the arguments being formatted with a format string is an array. This will be formatted using a fairly useless format, such as [I@304282, which doesn't actually show the contents of the array. Consider wrapping the array using Arrays.asList(...) before handling it off to a formatted. + +#UwF: Field only ever set to null (UWF_NULL_FIELD) +UWF_NULL_FIELD=;SFP--1;CWE-398 +UWF_NULL_FIELDMsg=All writes to this field are of the constant value null, and thus all reads of the field will return null. Check for errors, or remove it if it is useless. + +#This field is never written. All reads of it will return the default value. Check for errors (should it have been initialized?), or remove it if it is useless. +UWF_UNWRITTEN_FIELD=;SFP-1;CWE-456 +UWF_UNWRITTEN_FIELDMsg=This field is never written. All reads of it will return the default value. Check for errors (should it have been initialized?), or remove it if it is useless. + +#VA: Primitive array passed to function expecting a variable number of object arguments +VA_PRIMITIVE_ARRAY_PASSED_TO_OBJECT_VARARG=;SFP-1;CWE-704 +VA_PRIMITIVE_ARRAY_PASSED_TO_OBJECT_VARARGMsg=This code passes a primitive array to a function that takes a variable number of object arguments. This creates an array of length one to hold the primitive array and passes it to the function. + +#LG: Potential lost logger changes due to weak reference in OpenJDK (LG_LOST_LOGGER_DUE_TO_WEAK_REFERENCE) +LG_LOST_LOGGER_DUE_TO_WEAK_REFERENCE=;SFP-3;CWE-474 +LG_LOST_LOGGER_DUE_TO_WEAK_REFERENCEMsg=OpenJDK introduces a potential incompatibility. In particular, the java.util.logging.Logger behavior has changed. Instead of using strong references, it now uses weak references internally. That's a reasonable change, but unfortunately some code relies on the old behavior - when changing logger configuration, it simply drops the logger reference. That means that the garbage collector is free to reclaim that memory, which means that the logger configuration is lost. + +#OBL: Method may fail to clean up stream or resource (OBL_UNSATISFIED_OBLIGATION) +OBL_UNSATISFIED_OBLIGATION=;SFP-14;CWE-404 +OBL_UNSATISFIED_OBLIGATIONMsg=This method may fail to clean up (close, dispose of) a stream, database object, or other resource requiring an explicit cleanup operation. In general, if a method opens a stream or other resource, the method should use a try/finally block to ensure that the stream or resource is cleaned up before the method returns. + +#Dm: Consider using Locale parameterized version of invoked method (DM_CONVERT_CASE) +DM_CONVERT_CASE=;SFP--1;CWE-710 +DM_CONVERT_CASEMsg=A String is being converted to upper or lowercase, using the platform's default encoding. This may result in improper conversions when used with international characters. + +#EI: May expose internal representation by returning reference to mutable object (EI_EXPOSE_REP) +EI_EXPOSE_REP=;SFP-23;CWE-375 +EI_EXPOSE_REPMsg=Returning a reference to a mutable object value stored in one of the object's fields exposes the internal representation of the object. If instances are accessed by untrusted code, and unchecked changes to the mutable object would compromise security or other important properties, you will need to do something different. Returning a new copy of the object is better approach in many situations. + +#EI2: May expose internal representation by incorporating reference to mutable object (EI_EXPOSE_REP2) +EI_EXPOSE_REP2=;SFP-23;CWE-375 +EI_EXPOSE_REP2Msg=This code stores a reference to an externally mutable object into the internal representation of the object. If instances are accessed by untrusted code, and unchecked changes to the mutable object would compromise security or other important properties, you will need to do something different. Storing a copy of the object is better approach in many situations. + +#FI: Finalizer should be protected, not public (FI_PUBLIC_SHOULD_BE_PROTECTED) +FI_PUBLIC_SHOULD_BE_PROTECTED=;SFP-28;CWE-583 +FI_PUBLIC_SHOULD_BE_PROTECTEDMsg=A class's finalize() method should have protected access, not public. + +#MS: May expose internal static state by storing a mutable object into a static field (EI_EXPOSE_STATIC_REP2) +EI_EXPOSE_STATIC_REP2=;SFP-23;CWE-607 +EI_EXPOSE_STATIC_REP2Msg=This code stores a reference to an externally mutable object into a static field. If unchecked changes to the mutable object would compromise security or other important properties, you will need to do something different. Storing a copy of the object is better approach in many situations. + +#MS: Field isn't final and can't be protected from malicious code (MS_CANNOT_BE_FINAL) +MS_CANNOT_BE_FINAL=;SFP-28;CWE-500 +MS_CANNOT_BE_FINALMsg=A mutable static field could be changed by malicious code or by accident from another package. Unfortunately, the way the field is used doesn't allow any easy fix to this problem. + +#MS: Public static method may expose internal representation by returning array (MS_EXPOSE_REP) +MS_EXPOSE_REP=;SFP-23;CWE-495 +MS_EXPOSE_REPMsg=A public static method returns a reference to an array that is part of the static state of the class. Any code that calls this method can freely modify the underlying array. One fix is to return a copy of the array. + +#MS: Field should be both final and package protected (MS_FINAL_PKGPROTECT) +MS_FINAL_PKGPROTECT=;SFP-28;CWE-500 +MS_FINAL_PKGPROTECTMsg=A mutable static field could be changed by malicious code or by accident from another package. The field could be made package protected and/or made final to avoid this vulnerability. + +#MS: Field is a mutable array (MS_MUTABLE_ARRAY) +MS_MUTABLE_ARRAY=;SFP-23;CWE-607 +MS_MUTABLE_ARRAYMsg=A final static field references an array and can be accessed by malicious code or by accident from another package. This code can freely modify the contents of the array. + +#MS: Field is a mutable Hashtable (MS_MUTABLE_HASHTABLE) +MS_MUTABLE_HASHTABLE=;SFP-23;CWE-607 +MS_MUTABLE_HASHTABLEMsg=A final static field references a Hashtable and can be accessed by malicious code or by accident from another package. This code can freely modify the contents of the Hashtable. + +#MS: Field should be moved out of an interface and made package protected (MS_OOI_PKGPROTECT) +MS_OOI_PKGPROTECT=;SFP-23;CWE-607 +MS_OOI_PKGPROTECTMsg=A final static field that is defined in an interface references a mutable object such as an array or hashtable. This mutable object could be changed by malicious code or by accident from another package. To solve this, the field needs to be moved to a class and made package protected to avoid this vulnerability. + +#MS: Field should be package protected (MS_PKGPROTECT) +MS_PKGPROTECT=;SFP-23;CWE-607 +MS_PKGPROTECTMsg=A mutable static field could be changed by malicious code or by accident. The field could be made package protected to avoid this vulnerability. + +#MS: Field isn't final but should be (MS_SHOULD_BE_FINAL) +MS_SHOULD_BE_FINAL=;SFP-28;CWE-500 +MS_SHOULD_BE_FINALMsg=A mutable static field could be changed by malicious code or by accident from another package. The field could be made final to avoid this vulnerability. + +#DC: Possible double check of field (DC_DOUBLECHECK) +DC_DOUBLECHECK=;SFP-19;CWE-609 +DC_DOUBLECHECKMsg=This method may contain an instance of double-checked locking. This idiom is not correct according to the semantics of the Java memory model. For more information, see the web page http://www.cs.umd.edu/~pugh/java/memoryModel/DoubleCheckedLocking.html. + +#DL: Synchronization on Boolean could lead to deadlock (DL_SYNCHRONIZATION_ON_BOOLEAN) +DL_SYNCHRONIZATION_ON_BOOLEAN=;SFP-19;CWE-833 +DL_SYNCHRONIZATION_ON_BOOLEANMsg=The code synchronizes on a boxed primitive constant, such as an Boolean. Since there normally exist only two Boolean objects, this code could be synchronizing on the same object as other, unrelated code, leading to unresponsiveness and possible deadlock + +#DL: Synchronization on boxed primitive could lead to deadlock (DL_SYNCHRONIZATION_ON_BOXED_PRIMITIVE) +DL_SYNCHRONIZATION_ON_BOXED_PRIMITIVE=;SFP-19;CWE-833 +DL_SYNCHRONIZATION_ON_BOXED_PRIMITIVEMsg=The code synchronizes on a boxed primitive constant, such as an Integer. Since Integer objects can be cached and shared, this code could be synchronizing on the same object as other, unrelated code, leading to unresponsiveness and possible deadlock + +#DL: Synchronization on interned String could lead to deadlock (DL_SYNCHRONIZATION_ON_SHARED_CONSTANT) +DL_SYNCHRONIZATION_ON_SHARED_CONSTANT=;SFP-19;CWE-833 +DL_SYNCHRONIZATION_ON_SHARED_CONSTANTMsg=The code synchronizes on interned String. Constant Strings are interned and shared across all other classes loaded by the JVM. Thus, this could is locking on something that other code might also be locking. This could result in very strange and hard to diagnose blocking and deadlock behavior. See http://www.javalobby.org/java/forums/t96352.html and http://jira.codehaus.org/browse/JETTY-352. + +#DL: Synchronization on boxed primitive values (DL_SYNCHRONIZATION_ON_UNSHARED_BOXED_PRIMITIVE) +DL_SYNCHRONIZATION_ON_UNSHARED_BOXED_PRIMITIVE=;SFP-19;CWE-833 +DL_SYNCHRONIZATION_ON_UNSHARED_BOXED_PRIMITIVEMsg=The code synchronizes on an apparently unshared boxed primitive, such as an Integer. It would be much better, in this code, to redeclare fileLock as + +#private static final Object fileLock = new Object(); +#The existing code might be OK, but it is confusing and a future refactoring, such as the "Remove Boxing" refactoring in IntelliJ, might replace this with the use of an interned Integer object shared throughout the JVM, leading to very confusing behavior and potential deadlock. + +#Dm: Monitor wait() called on Condition (DM_MONITOR_WAIT_ON_CONDITION) +DM_MONITOR_WAIT_ON_CONDITION=;SFP--1;CWE-710 +DM_MONITOR_WAIT_ON_CONDITIONMsg=This method calls wait() on a java.util.concurrent.locks.Condition object. Waiting for a Condition should be done using one of the await() methods defined by the Condition interface. + +#Dm: A thread was created using the default empty run method (DM_USELESS_THREAD) +DM_USELESS_THREAD=;SFP--1;CWE-710 +DM_USELESS_THREADMsg=This method creates a thread without specifying a run method either by deriving from the Thread class, or by passing a Runnable object. This thread, then, does nothing but waste time. + +#ESync: Empty synchronized block (ESync_EMPTY_SYNC) +Esync_EMPTY_SYNC=;SFP-21;CWE-585 +Esync_EMPTY_SYNCMsg=The code contains an empty synchronized block: synchronized() {} Empty synchronized blocks are far more subtle and hard to use correctly than most people recognize, and empty synchronized blocks are almost never a better solution than less contrived solutions. + +#IS: Inconsistent synchronization (IS2_INCONSISTENT_SYNC) +IS2_INCONSISTENT_SYNC=;SFP-19;CWE-662 +IS2_INCONSISTENT_SYNCMsg=The fields of this class appear to be accessed inconsistently with respect to synchronization. + +#IS: Field not guarded against concurrent access (IS_FIELD_NOT_GUARDED) +IS_FIELD_NOT_GUARDED=;SFP-19;CWE-413 +IS_FIELD_NOT_GUARDEDMsg=This field is annotated with net.jcip.annotations.GuardedBy, but can be accessed in a way that seems to violate the annotation. + +#JLM: Synchronization performed on Lock (JLM_JSR166_LOCK_MONITORENTER) +JLM_JSR166_LOCK_MONITORENTER=;SFP--1;CWE-710 +JLM_JSR166_LOCK_MONITORENTERMsg=This method performs synchronization an object that implements java.util.concurrent.locks.Lock. Such an object is locked/unlocked using acquire()/release() rather than using the synchronized (...) construct. + +#LI: Incorrect lazy initialization of static field (LI_LAZY_INIT_STATIC) +LI_LAZY_INIT_STATIC=;SFP-19;CWE-667 +LI_LAZY_INIT_STATICMsg=This method contains an unsynchronized lazy initialization of a non-volatile static field. Because the compiler or processor may reorder instructions, threads are not guaranteed to see a completely initialized object, if the method can be called by multiple threads. You can make the field volatile to correct the problem. For more information, see the Java Memory Model web site. + +#LI: Incorrect lazy initialization and update of static field (LI_LAZY_INIT_UPDATE_STATIC) +LI_LAZY_INIT_UPDATE_STATIC=;SFP-19;CWE-667 +LI_LAZY_INIT_UPDATE_STATICMsg=This method contains an unsynchronized lazy initialization of a static field. After the field is set, the object stored into that location is further updated or accessed. The setting of the field is visible to other threads as soon as it is set. If the futher accesses in the method that set the field serve to initialize the object, then you have a very serious multithreading bug, unless something else prevents any other thread from accessing the stored object until it is fully initialized. Even if you feel confident that the method is never called by multiple threads, it might be better to not set the static field until the value you are setting it to is fully populated/initialized. + +#ML: Synchronization on field in futile attempt to guard that field (ML_SYNC_ON_FIELD_TO_GUARD_CHANGING_THAT_FIELD) +ML_SYNC_ON_FIELD_TO_GUARD_CHANGING_THAT_FIELD=;SFP-19;CWE-667 +ML_SYNC_ON_FIELD_TO_GUARD_CHANGING_THAT_FIELDMsg=This method synchronizes on a field in what appears to be an attempt to guard against simultaneous updates to that field. But guarding a field gets a lock on the referenced object, not on the field. This may not provide the mutual exclusion you need, and other threads might be obtaining locks on the referenced objects (for other purposes). + +#ML: Method synchronizes on an updated field (ML_SYNC_ON_UPDATED_FIELD) +ML_SYNC_ON_UPDATED_FIELD=;SFP-19;CWE-667 +ML_SYNC_ON_UPDATED_FIELDMsg=This method synchronizes on an object referenced from a mutable field. This is unlikely to have useful semantics, since different threads may be synchronizing on different objects. + +#ML: Method synchronizes on an updated field (ML_SYNC_ON_UPDATED_FIELD) +MSF_MUTABLE_SERVLET_FIELD=;SFP-19;CWE-667 +MSF_MUTABLE_SERVLET_FIELDMsg=A web server generally only creates one instance of servlet or jsp class (i.e., treats the class as a Singleton), and will have multiple threads invoke methods on that instance to service multiple simultaneous requests. Thus, having a mutable instance field generally creates race conditions. + +#MWN: Mismatched notify() (MWN_MISMATCHED_NOTIFY) +MWN_MISMATCHED_NOTIFY=;SFP-19;CWE-667 +MWN_MISMATCHED_NOTIFYMsg=This method calls Object.notify() or Object.notifyAll() without obviously holding a lock on the object. Calling notify() or notifyAll() without a lock held will result in an IllegalMonitorStateException being thrown. + +#MWN: Mismatched wait() (MWN_MISMATCHED_WAIT) +MWN_MISMATCHED_WAIT=;SFP-19;CWE-667 +MWN_MISMATCHED_WAITMsg=This method calls Object.wait() without obviously holding a lock on the object. Calling wait() without a lock held will result in an IllegalMonitorStateException being thrown. + +#NN: Naked notify (NN_NAKED_NOTIFY) +NN_NAKED_NOTIFY=;SFP--1;CWE-398 +NN_NAKED_NOTIFYMsg=A call to notify() or notifyAll() was made without any (apparent) accompanying modification to mutable object state. In general, calling a notify method on a monitor is done because some condition another thread is waiting for has become true. However, for the condition to be meaningful, it must involve a heap object that is visible to both threads. This bug does not necessarily indicate an error, since the change to mutable object state may have taken place in a method which then called the method containing the notification. + +#NP: Synchronize and null check on the same field. (NP_SYNC_AND_NULL_CHECK_FIELD) +NP_SYNC_AND_NULL_CHECK_FIELD=;SFP-7;CWE-476 +NP_SYNC_AND_NULL_CHECK_FIELDMsg=Since the field is synchronized on, it seems not likely to be null. If it is null and then synchronized on a NullPointerException will be thrown and the check would be pointless. Better to synchronize on another field. + +#No: Using notify() rather than notifyAll() (NO_NOTIFY_NOT_NOTIFYALL) +NO_NOTIFY_NOT_NOTIFYALL=;SFP--1;CWE-701 +NO_NOTIFY_NOT_NOTIFYALLMsg=This method calls notify() rather than notifyAll(). Java monitors are often used for multiple conditions. Calling notify() only wakes up one thread, meaning that the thread woken up might not be the one waiting for the condition that the caller just satisfied. + +#RS: Class's readObject() method is synchronized (RS_READOBJECT_SYNC) +RS_READOBJECT_SYNC=;SFP--1;CWE-398 +RS_READOBJECT_SYNCMsg=This serializable class defines a readObject() which is synchronized. By definition, an object created by deserialization is only reachable by one thread, and thus there is no need for readObject() to be synchronized. If the readObject() method itself is causing the object to become visible to another thread, that is an example of very dubious coding style. + +#RV: Return value of putIfAbsent ignored, value passed to putIfAbsent reused (RV_RETURN_VALUE_OF_PUTIFABSENT_IGNORED) +RV_RETURN_VALUE_OF_PUTIFABSENT_IGNORED=;SFP-4;CWE-252 +RV_RETURN_VALUE_OF_PUTIFABSENT_IGNOREDMsg=The putIfAbsent method is typically used to ensure that a single value is associated with a given key (the first value for which put if absent succeeds). If you ignore the return value and retain a reference to the value passed in, you run the risk of retaining a value that is not the one that is associated with the key in the map. If it matters which one you use and you use the one that isn't stored in the map, your program will behave incorrectly. + +#Ru: Invokes run on a thread (did you mean to start it instead?) (RU_INVOKE_RUN) +RU_INVOKE_RUN=;SFP-3;CWE-572 +RU_INVOKE_RUNMsg=This method explicitly invokes run() on an object. In general, classes implement the Runnable interface because they are going to have their run() method invoked in a new thread, in which case Thread.start() is the right method to call. + +#SC: Constructor invokes Thread.start() (SC_START_IN_CTOR) +SC_START_IN_CTOR=;SFP--1;CWE-398 +SC_START_IN_CTORMsg=The constructor starts a thread. This is likely to be wrong if the class is ever extended/subclassed, since the thread will be started before the subclass constructor is started. + +#SP: Method spins on field (SP_SPIN_ON_FIELD) +SP_SPIN_ON_FIELD=;SFP-19;CWE-667 +SP_SPIN_ON_FIELDMsg=This method spins in a loop which reads a field. The compiler may legally hoist the read out of the loop, turning the code into an infinite loop. The class should be changed so it uses proper synchronization (including wait and notify calls). + +#STCAL: Call to static Calendar (STCAL_INVOKE_ON_STATIC_CALENDAR_INSTANCE) +STCAL_INVOKE_ON_STATIC_CALENDAR_INSTANCE=;SFP-19;CWE-667 +STCAL_INVOKE_ON_STATIC_CALENDAR_INSTANCEMsg=Even though the JavaDoc does not contain a hint about it, Calendars are inherently unsafe for multihtreaded use. The detector has found a call to an instance of Calendar that has been obtained via a static field. This looks suspicous. For more information on this see Sun Bug #6231579 and Sun Bug #6178997. + +#STCAL: Call to static DateFormat (STCAL_INVOKE_ON_STATIC_DATE_FORMAT_INSTANCE) +STCAL_INVOKE_ON_STATIC_DATE_FORMAT_INSTANCE=;SFP-19;CWE-667 +STCAL_INVOKE_ON_STATIC_DATE_FORMAT_INSTANCEMsg=As the JavaDoc states, DateFormats are inherently unsafe for multithreaded use. The detector has found a call to an instance of DateFormat that has been obtained via a static field. This looks suspicous. For more information on this see Sun Bug #6231579 and Sun Bug #6178997. + +#STCAL: Static Calendar (STCAL_STATIC_CALENDAR_INSTANCE) +STCAL_STATIC_CALENDAR_INSTANCE=;SFP-19;CWE-667 +STCAL_STATIC_CALENDAR_INSTANCEMsg=Even though the JavaDoc does not contain a hint about it, Calendars are inherently unsafe for multihtreaded use. Sharing a single instance across thread boundaries without proper synchronization will result in erratic behavior of the application. Under 1.4 problems seem to surface less often than under Java 5 where you will probably see random ArrayIndexOutOfBoundsExceptions or IndexOutOfBoundsExceptions in sun.util.calendar.BaseCalendar.getCalendarDateFromFixedDate(). You may also experience serialization problems. Using an instance field is recommended. For more information on this see Sun Bug #6231579 and Sun Bug #6178997. + +#STCAL: Static DateFormat (STCAL_STATIC_SIMPLE_DATE_FORMAT_INSTANCE) +STCAL_STATIC_SIMPLE_DATE_FORMAT_INSTANCE=;SFP-19;CWE-667 +STCAL_STATIC_SIMPLE_DATE_FORMAT_INSTANCEMsg=As the JavaDoc states, DateFormats are inherently unsafe for multithreaded use. Sharing a single instance across thread boundaries without proper synchronization will result in erratic behavior of the application. You may also experience serialization problems. Using an instance field is recommended. For more information on this see Sun Bug #6231579 and Sun Bug #6178997. + +#SWL: Method calls Thread.sleep() with a lock held (SWL_SLEEP_WITH_LOCK_HELD) +SWL_SLEEP_WITH_LOCK_HELD=;SFP-19;CWE-667 +SWL_SLEEP_WITH_LOCK_HELDMsg=This method calls Thread.sleep() with a lock held. This may result in very poor performance and scalability, or a deadlock, since other threads may be waiting to acquire the lock. It is a much better idea to call wait() on the lock, which releases the lock and allows other threads to run. + +#TLW: Wait with two locks held (TLW_TWO_LOCK_WAIT) +TLW_TWO_LOCK_WAIT=;SFP-19;CWE-833 +TLW_TWO_LOCK_WAITMsg=Waiting on a monitor while two locks are held may cause deadlock. Performing a wait only releases the lock on the object being waited on, not any other locks. This not necessarily a bug, but is worth examining closely. + +#UG: Unsynchronized get method, synchronized set method (UG_SYNC_SET_UNSYNC_GET) +UG_SYNC_SET_UNSYNC_GET=;SFP-19;CWE-667 +UG_SYNC_SET_UNSYNC_GETMsg=This class contains similarly-named get and set methods where the set method is synchronized and the get method is not. This may result in incorrect behavior at runtime, as callers of the get method will not necessarily see a consistent state for the object. The get method should be made synchronized. + +#UL: Method does not release lock on all paths (UL_UNRELEASED_LOCK) +UL_UNRELEASED_LOCK=;SFP-19;CWE-667 +UL_UNRELEASED_LOCKMsg=This method acquires a JSR-166 (java.util.concurrent) lock, but does not release it on all paths out of the method. + +#UL: Method does not release lock on all exception paths (UL_UNRELEASED_LOCK_EXCEPTION_PATH) +UL_UNRELEASED_LOCK_EXCEPTION_PATH=;SFP-19;CWE-667 +UL_UNRELEASED_LOCK_EXCEPTION_PATHMsg=This method acquires a JSR-166 (java.util.concurrent) lock, but does not release it on all exception paths out of the method. + +#UW: Unconditional wait (UW_UNCOND_WAIT) +UW_UNCOND_WAIT=;SFP--1;CWE-398 +UW_UNCOND_WAITMsg=This method contains a call to java.lang.Object.wait() which is not guarded by conditional control flow. The code should verify that condition it intends to wait for is not already satisfied before calling wait; any previous notifications will be ignored. + +#VO: A volatile reference to an array doesn't treat the array elements as volatile (VO_VOLATILE_REFERENCE_TO_ARRAY) +VO_VOLATILE_REFERENCE_TO_ARRAY=;SFP--1;CWE-398 +VO_VOLATILE_REFERENCE_TO_ARRAYMsg=This declares a volatile reference to an array, which might not be what you want. With a volatile reference to an array, reads and writes of the reference to the array are treated as volatile, but the array elements are non-volatile. To get volatile array elements, you will need to use one of the atomic array classes in java.util.concurrent (provided in Java 5.0). + +#WL: Sychronization on getClass rather than class literal (WL_USING_GETCLASS_RATHER_THAN_CLASS_LITERAL) +WL_USING_GETCLASS_RATHER_THAN_CLASS_LITERAL=;SFP-19;CWE-398 +WL_USING_GETCLASS_RATHER_THAN_CLASS_LITERALMsg=This instance method synchronizes on this.getClass(). If this class is subclassed, subclasses will synchronize on the class object for the subclass, which isn't likely what was intended. + +#WS: Class's writeObject() method is synchronized but nothing else is (WS_WRITEOBJECT_SYNC) +WS_WRITEOBJECT_SYNC=;SFP-19;CWE-667 +WS_WRITEOBJECT_SYNCMsg=This class has a writeObject() method which is synchronized; however, no other method of the class is synchronized. + +#Wa: Condition.await() not in loop (WA_AWAIT_NOT_IN_LOOP) +WA_AWAIT_NOT_IN_LOOP=;SFP--1;CWE-398 +WA_AWAIT_NOT_IN_LOOPMsg=This method contains a call to java.util.concurrent.await() (or variants) which is not in a loop. If the object is used for multiple conditions, the condition the caller intended to wait for might not be the one that actually occurred. + +#Wa: Wait not in loop (WA_NOT_IN_LOOP) +WA_NOT_IN_LOOP=;SFP--1;CWE-398 +WA_NOT_IN_LOOPMsg=This method contains a call to java.lang.Object.wait() which is not in a loop. If the monitor is used for multiple conditions, the condition the caller intended to wait for might not be the one that actually occurred. + +#Bx: Primitive value is boxed and then immediately unboxed (BX_BOXING_IMMEDIATELY_UNBOXED) +BX_BOXING_IMMEDIATELY_UNBOXED=;SFP--1;CWE-710 +BX_BOXING_IMMEDIATELY_UNBOXEDMsg=A primitive is boxed, and then immediately unboxed. This probably is due to a manual boxing in a place where an unboxed value is required, thus forcing the compiler to immediately undo the work of the boxing. + +#Bx: Primitive value is boxed then unboxed to perform primitive coercion (BX_BOXING_IMMEDIATELY_UNBOXED_TO_PERFORM_COERCION) +BX_BOXING_IMMEDIATELY_UNBOXED_TO_PERFORM_COERCION=;SFP--1;CWE-710 +BX_BOXING_IMMEDIATELY_UNBOXED_TO_PERFORM_COERCIONMsg=A primitive boxed value constructed and then immediately converted into a different primitive type (e.g., new Double(d).intValue()). Just perform direct primitive coercion (e.g., (int) d). + +#Bx: Method allocates a boxed primitive just to call toString (DM_BOXED_PRIMITIVE_TOSTRING) +DM_BOXED_PRIMITIVE_TOSTRING=;SFP--1;CWE-710 +DM_BOXED_PRIMITIVE_TOSTRINGMsg=A boxed primitive is allocated just to call toString(). It is more effective to just use the static form of toString which takes the primitive value. + +#Bx: Method invokes inefficient floating-point Number constructor; use static valueOf instead (DM_FP_NUMBER_CTOR) +DM_FP_NUMBER_CTOR=;SFP--1;CWE-398 +DM_FP_NUMBER_CTORMsg=Using new Double(double) is guaranteed to always result in a new object whereas Double.valueOf(double) allows caching of values to be done by the compiler, class library, or JVM. Using of cached values avoids object allocation and the code will be faster. Unless the class must be compatible with JVMs predating Java 1.5, use either autoboxing or the valueOf() method when creating instances of Double and Float. + +#Bx: Method invokes inefficient Number constructor; use static valueOf instead (DM_NUMBER_CTOR) +DM_NUMBER_CTOR=;SFP--1;CWE-398 +DM_NUMBER_CTORMsg=Using new Integer(int) is guaranteed to always result in a new object whereas Integer.valueOf(int) allows caching of values to be done by the compiler, class library, or JVM. Using of cached values avoids object allocation and the code will be faster. Values between -128 and 127 are guaranteed to have corresponding cached instances and using valueOf is approximately 3.5 times faster than using constructor. For values outside the constant range the performance of both styles is the same. Unless the class must be compatible with JVMs predating Java 1.5, use either autoboxing or the valueOf() method when creating instances of Long, Integer, Short, Character, and Byte. + +#Dm: The equals and hashCode methods of URL are blocking (DMI_BLOCKING_METHODS_ON_URL) +DMI_BLOCKING_METHODS_ON_URL=;SFP--1;CWE-398 +DMI_BLOCKING_METHODS_ON_URLMsg=The equals and hashCode method of URL perform domain name resolution, this can result in a big performance hit. See http://michaelscharf.blogspot.com/2006/11/javaneturlequals-and-hashcode-make.html for more information. Consider using java.net.URI instead. + +#Dm: Maps and sets of URLs can be performance hogs (DMI_COLLECTION_OF_URLS) +DMI_COLLECTION_OF_URLS=;SFP--1;CWE-398 +DMI_COLLECTION_OF_URLSMsg=This method or field is or uses a Map or Set of URLs. Since both the equals and hashCode method of URL perform domain name resolution, this can result in a big performance hit. See http://michaelscharf.blogspot.com/2006/11/javaneturlequals-and-hashcode-make.html for more information. Consider using java.net.URI instead. + +#Dm: Method invokes inefficient Boolean constructor; use Boolean.valueOf(...) instead (DM_BOOLEAN_CTOR) +DM_BOOLEAN_CTOR=;SFP--1;CWE-398 +DM_BOOLEAN_CTORMsg=Creating new instances of java.lang.Boolean wastes memory, since Boolean objects are immutable and there are only two useful values of this type. Use the Boolean.valueOf() method (or Java 1.5 autoboxing) to create Boolean objects instead. + +#Dm: Explicit garbage collection; extremely dubious except in benchmarking code (DM_GC) +DM_GC=;SFP--1;CWE-710 +DM_GCMsg=Code explicitly invokes garbage collection. Except for specific use in benchmarking, this is very dubious. In the past, situations where people have explicitly invoked the garbage collector in routines such as close or finalize methods has led to huge performance black holes. Garbage collection can be expensive. Any situation that forces hundreds or thousands of garbage collections will bring the machine to a crawl. + +#Dm: Method allocates an object, only to get the class object (DM_NEW_FOR_GETCLASS) +DM_NEW_FOR_GETCLASS=;SFP--1;CWE-398 +DM_NEW_FOR_GETCLASSMsg=This method allocates an object just to call getClass() on it, in order to retrieve the Class object for it. It is simpler to just access the .class property of the class. + +#Dm: Use the nextInt method of Random rather than nextDouble to generate a random integer (DM_NEXTINT_VIA_NEXTDOUBLE) +DM_NEXTINT_VIA_NEXTDOUBLE=;SFP--1;CWE-710 +DM_NEXTINT_VIA_NEXTDOUBLEMsg=If r is a java.util.Random, you can generate a random number from 0 to n-1 using r.nextInt(n), rather than using (int)(r.nextDouble() * n). + +#Dm: Method invokes inefficient new String(String) constructor (DM_STRING_CTOR) +DM_STRING_CTOR=;SFP--1;CWE-398 +DM_STRING_CTORMsg=Using the java.lang.String(String) constructor wastes memory because the object so constructed will be functionally indistinguishable from the String passed as a parameter. Just use the argument String directly. + +#Dm: Method invokes toString() method on a String (DM_STRING_TOSTRING) +DM_STRING_TOSTRING=;SFP--1;CWE-710 +DM_STRING_TOSTRINGMsg=Calling String.toString() is just a redundant operation. Just use the String. + +#Dm: Method invokes inefficient new String() constructor (DM_STRING_VOID_CTOR) +DM_STRING_VOID_CTOR=;SFP--1;CWE-398 +DM_STRING_VOID_CTORMsg=Creating a new java.lang.String object using the no-argument constructor wastes memory because the object so created will be functionally indistinguishable from the empty string constant "". Java guarantees that identical string constants will be represented by the same String object. Therefore, you should just use the empty string constant directly. + +#HSC: Huge string constants is duplicated across multiple class files (HSC_HUGE_SHARED_STRING_CONSTANT) +HSC_HUGE_SHARED_STRING_CONSTANT=;SFP--1;CWE-398 +HSC_HUGE_SHARED_STRING_CONSTANTMsg=A large String constant is duplicated across multiple class files. This is likely because a final field is initialized to a String constant, and the Java language mandates that all references to a final field from other classes be inlined into that classfile. See JDK bug 6447475 for a description of an occurrence of this bug in the JDK and how resolving it reduced the size of the JDK by 1 megabyte. + +#ITA: Method uses toArray() with zero-length array argument (ITA_INEFFICIENT_TO_ARRAY) +ITA_INEFFICIENT_TO_ARRAY=;SFP--1;CWE-398 +ITA_INEFFICIENT_TO_ARRAYMsg=This method uses the toArray() method of a collection derived class, and passes in a zero-length prototype array argument. It is more efficient to use myCollection.toArray(new Foo[myCollection.size()]) If the array passed in is big enough to store all of the elements of the collection, then it is populated and returned directly. This avoids the need to create a second array (by reflection) to return as the result. + +#SBSC: Method concatenates strings using + in a loop (SBSC_USE_STRINGBUFFER_CONCATENATION) +SBSC_USE_STRINGBUFFER_CONCATENATION=;SFP--1;CWE-398 +SBSC_USE_STRINGBUFFER_CONCATENATIONMsg=The method seems to be building a String using concatenation in a loop. In each iteration, the String is converted to a StringBuffer/StringBuilder, appended to, and converted back to a String. This can lead to a cost quadratic in the number of iterations, as the growing string is recopied in each iteration. Better performance can be obtained by using a StringBuffer (or StringBuilder in Java 1.5) explicitly. + +#SIC: Should be a static inner class (SIC_INNER_SHOULD_BE_STATIC) +SIC_INNER_SHOULD_BE_STATIC=;SFP--1;CWE-398 +SIC_INNER_SHOULD_BE_STATICMsg=This class is an inner class, but does not use its embedded reference to the object which created it. This reference makes the instances of the class larger, and may keep the reference to the creator object alive longer than necessary. If possible, the class should be made static. + +#SIC: Could be refactored into a named static inner class (SIC_INNER_SHOULD_BE_STATIC_ANON) +SIC_INNER_SHOULD_BE_STATIC_ANON=;SFP--1;CWE-398 +SIC_INNER_SHOULD_BE_STATIC_ANONMsg=This class is an inner class, but does not use its embedded reference to the object which created it. This reference makes the instances of the class larger, and may keep the reference to the creator object alive longer than necessary. If possible, the class should be made into a static inner class. Since anonymous inner classes cannot be marked as static, doing this will require refactoring the inner class so that it is a named inner class. + +#SIC: Could be refactored into a static inner class (SIC_INNER_SHOULD_BE_STATIC_NEEDS_THIS) +SIC_INNER_SHOULD_BE_STATIC_NEEDS_THIS=;SFP--1;CWE-398 +SIC_INNER_SHOULD_BE_STATIC_NEEDS_THISMsg=This class is an inner class, but does not use its embedded reference to the object which created it except during construction of the inner object. This reference makes the instances of the class larger, and may keep the reference to the creator object alive longer than necessary. If possible, the class should be made into a static inner class. Since the reference to the outer object is required during construction of the inner instance, the inner class will need to be refactored so as to pass a reference to the outer instance to the constructor for the inner class. + +#This class contains an instance final field that is initialized to a compile-time static value. Consider making the field static. +SS_SHOULD_BE_STATIC=;SFP--1;CWE-710 +SS_SHOULD_BE_STATICMsg=This class contains an instance final field that is initialized to a compile-time static value. Consider making the field static. + +#UM: Method calls static Math class method on a constant value (UM_UNNECESSARY_MATH) +UM_UNNECESSARY_MATH=;SFP--1;CWE-710 +UM_UNNECESSARY_MATHMsg=This method uses a static method from java.lang.Math on a constant value. This method's result in this case, can be determined statically, and is faster and sometimes more accurate to just use the constant. + +#UPM: Private method is never called (UPM_UNCALLED_PRIVATE_METHOD) +UPM_UNCALLED_PRIVATE_METHOD=;SFP-2;CWE-561 +UPM_UNCALLED_PRIVATE_METHODMsg=This private method is never called. Although it is possible that the method will be invoked through reflection, it is more likely that the method is never used, and should be removed. + +#This field is never read. Consider removing it from the class. +URF_UNREAD_FIELD=;SFP-2;CWE-563 +URF_UNREAD_FIELDMsg=This field is never read. Consider removing it from the class. + +#UuF: Unused field (UUF_UNUSED_FIELD) +UUF_UNUSED_FIELD=;SFP-2;CWE-563 +UUF_UNUSED_FIELDMsg=This field is never used. Consider removing it from the class. + +#WMI: Inefficient use of keySet iterator instead of entrySet iterator (WMI_WRONG_MAP_ITERATOR) +WMI_WRONG_MAP_ITERATOR=;SFP--1;CWE-710 +WMI_WRONG_MAP_ITERATORMsg=This method accesses the value of a Map entry, using a key that was retrieved from a keySet iterator. It is more efficient to use an iterator on the entrySet of the map, to avoid the Map.get(key) lookup. + +#Dm: Hardcoded constant database password (DMI_CONSTANT_DB_PASSWORD) +DMI_CONSTANT_DB_PASSWORD=;SFP-33;CWE-259 +DMI_CONSTANT_DB_PASSWORDMsg=This code creates a database connect using a hardcoded, constant password. Anyone with access to either the source code or the compiled code can easily learn the password. + +#Dm: Empty database password (DMI_EMPTY_DB_PASSWORD) +DMI_EMPTY_DB_PASSWORD=;SFP-33;CWE-259 +DMI_EMPTY_DB_PASSWORDMsg=This code creates a database connect using a blank or empty password. This indicates that the database is not protected by a password. + +#HRS: HTTP cookie formed from untrusted input (HRS_REQUEST_PARAMETER_TO_COOKIE) +HRS_REQUEST_PARAMETER_TO_COOKIE=;SFP-24;CWE-20 +HRS_REQUEST_PARAMETER_TO_COOKIEMsg=This code constructs an HTTP Cookie using an untrusted HTTP parameter. If this cookie is added to an HTTP response, it will allow a HTTP response splitting vulnerability. See http://en.wikipedia.org/wiki/HTTP_response_splitting for more information. FindBugs looks only for the most blatant, obvious cases of HTTP response splitting. If FindBugs found any, you almost certainly have more vulnerabilities that FindBugs doesn't report. If you are concerned about HTTP response splitting, you should seriously consider using a commercial static analysis or pen-testing tool. + +#HRS: HTTP Response splitting vulnerability (HRS_REQUEST_PARAMETER_TO_HTTP_HEADER) +HRS_REQUEST_PARAMETER_TO_HTTP_HEADER=;SFP-24;CWE-113 +HRS_REQUEST_PARAMETER_TO_HTTP_HEADERMsg=This code directly writes an HTTP parameter to an HTTP header, which allows for a HTTP response splitting vulnerability. See http://en.wikipedia.org/wiki/HTTP_response_splitting for more information. FindBugs looks only for the most blatant, obvious cases of HTTP response splitting. If FindBugs found any, you almost certainly have more vulnerabilities that FindBugs doesn't report. If you are concerned about HTTP response splitting, you should seriously consider using a commercial static analysis or pen-testing tool. + +#SQL: Nonconstant string passed to execute method on an SQL statement (SQL_NONCONSTANT_STRING_PASSED_TO_EXECUTE) +SQL_NONCONSTANT_STRING_PASSED_TO_EXECUTE=;SFP-24;CWE-89 +SQL_NONCONSTANT_STRING_PASSED_TO_EXECUTEMsg=The method invokes the execute method on an SQL statement with a String that seems to be dynamically generated. Consider using a prepared statement instead. It is more efficient and less vulnerable to SQL injection attacks. + +#SQL: A prepared statement is generated from a nonconstant String (SQL_PREPARED_STATEMENT_GENERATED_FROM_NONCONSTANT_STRING) +SQL_PREPARED_STATEMENT_GENERATED_FROM_NONCONSTANT_STRING=;SFP-24;CWE-89 +SQL_PREPARED_STATEMENT_GENERATED_FROM_NONCONSTANT_STRINGMsg=The code creates an SQL prepared statement from a nonconstant String. If unchecked, tainted data from a user is used in building this String, SQL injection could be used to make the prepared statement do something unexpected and undesirable. + +#XSS: JSP reflected cross site scripting vulnerability (XSS_REQUEST_PARAMETER_TO_JSP_WRITER) +XSS_REQUEST_PARAMETER_TO_JSP_WRITER=;SFP-24;CWE-80 +XSS_REQUEST_PARAMETER_TO_JSP_WRITERMsg=This code directly writes an HTTP parameter to JSP output, which allows for a cross site scripting vulnerability. See http://en.wikipedia.org/wiki/Cross-site_scripting for more information. FindBugs looks only for the most blatant, obvious cases of cross site scripting. If FindBugs found any, you almost certainly have more cross site scripting vulnerabilities that FindBugs doesn't report. If you are concerned about cross site scripting, you should seriously consider using a commercial static analysis or pen-testing tool. + +#XSS: Servlet reflected cross site scripting vulnerability (XSS_REQUEST_PARAMETER_TO_SEND_ERROR) +XSS_REQUEST_PARAMETER_TO_SEND_ERROR=;SFP-24;CWE-80 +XSS_REQUEST_PARAMETER_TO_SEND_ERRORMsg=This code directly writes an HTTP parameter to a Server error page (using HttpServletResponse.sendError). Echoing this untrusted input allows for a reflected cross site scripting vulnerability. See http://en.wikipedia.org/wiki/Cross-site_scripting for more information. FindBugs looks only for the most blatant, obvious cases of cross site scripting. If FindBugs found any, you almost certainly have more cross site scripting vulnerabilities that FindBugs doesn't report. If you are concerned about cross site scripting, you should seriously consider using a commercial static analysis or pen-testing tool. + +#XSS: Servlet reflected cross site scripting vulnerability (XSS_REQUEST_PARAMETER_TO_SERVLET_WRITER) +XSS_REQUEST_PARAMETER_TO_SERVLET_WRITER=;SFP-24;CWE-80 +XSS_REQUEST_PARAMETER_TO_SERVLET_WRITERMsg=This code directly writes an HTTP parameter to Servlet output, which allows for a reflected cross site scripting vulnerability. See http://en.wikipedia.org/wiki/Cross-site_scripting for more information. FindBugs looks only for the most blatant, obvious cases of cross site scripting. If FindBugs found any, you almost certainly have more cross site scripting vulnerabilities that FindBugs doesn't report. If you are concerned about cross site scripting, you should seriously consider using a commercial static analysis or pen-testing tool. + +#BC: Questionable cast to abstract collection (BC_BAD_CAST_TO_ABSTRACT_COLLECTION) +BC_BAD_CAST_TO_ABSTRACT_COLLECTION=;SFP-1;CWE-704 +BC_BAD_CAST_TO_ABSTRACT_COLLECTIONMsg=This code casts a Collection to an abstract collection (such as List, Set, or Map). Ensure that you are guaranteed that the object is of the type you are casting to. If all you need is to be able to iterate through a collection, you don't need to cast it to a Set or List. + +BC: Questionable cast to concrete collection (BC_BAD_CAST_TO_CONCRETE_COLLECTION) +BC_BAD_CAST_TO_CONCRETE_COLLECTION=;SFP-1;CWE-704 +BC_BAD_CAST_TO_CONCRETE_COLLECTIONMsg=This code casts an abstract collection (such as a Collection, List, or Set) to a specific concrete implementation (such as an ArrayList or HashSet). This might not be correct, and it may make your code fragile, since it makes it harder to switch to other concrete implementations at a future point. Unless you have a particular reason to do so, just use the abstract collection class. + +#BC: Unchecked/unconfirmed cast (BC_UNCONFIRMED_CAST) +BC_UNCONFIRMED_CAST=;SFP-1;CWE-704 +BC_UNCONFIRMED_CAST=This cast is unchecked, and not all instances of the type casted from can be cast to the type it is being cast to. Ensure that your program logic ensures that this cast will not fail. + +#BC: instanceof will always return true (BC_VACUOUS_INSTANCEOF) +BC_VACUOUS_INSTANCEOF=;SFP-1;CWE-570 +BC_VACUOUS_INSTANCEOFMsg=This instanceof test will always return true (unless the value being tested is null). Although this is safe, make sure it isn't an indication of some misunderstanding or some other logic error. If you really want to test the value for being null, perhaps it would be clearer to do better to do a null test rather than an instanceof test. + +#BSHIFT: Unsigned right shift cast to short/byte (ICAST_QUESTIONABLE_UNSIGNED_RIGHT_SHIFT) +ICAST_QUESTIONABLE_UNSIGNED_RIGHT_SHIFT=;SFP-1;CWE-197 +ICAST_QUESTIONABLE_UNSIGNED_RIGHT_SHIFTMsg=The code performs an unsigned right shift, whose result is then cast to a short or byte, which discards the upper bits of the result. Since the upper bits are discarded, there may be no difference between a signed and unsigned right shift (depending upon the size of the shift). + +#CI: Class is final but declares protected field (CI_CONFUSED_INHERITANCE) +CI_CONFUSED_INHERITANCE=;SFP--1;CWE-710 +CI_CONFUSED_INHERITANCEMsg=This class is declared to be final, but declares fields to be protected. Since the class is final, it can not be derived from, and the use of protected is confusing. The access modifier for the field should be changed to private or public to represent the true use for the field. + +#DB: Method uses the same code for two branches (DB_DUPLICATE_BRANCHES) +DB_DUPLICATE_BRANCHES=;SFP--1;CWE-398 +DB_DUPLICATE_BRANCHESMsg=This method uses the same code to implement two branches of a conditional branch. Check to ensure that this isn't a coding mistake. + +#DB: Method uses the same code for two switch clauses (DB_DUPLICATE_SWITCH_CLAUSES) +DB_DUPLICATE_SWITCH_CLAUSES=;SFP--1;CWE-398 +DB_DUPLICATE_SWITCH_CLAUSESMsg=This method uses the same code to implement two clauses of a switch statement. This could be a case of duplicate code, but it might also indicate a coding mistake. + +#DLS: Dead store to local variable (DLS_DEAD_LOCAL_STORE) +DLS_DEAD_LOCAL_STORE=;SFP--1;CWE-398 +DLS_DEAD_LOCAL_STOREMsg=This instruction assigns a value to a local variable, but the value is not read or used in any subsequent instruction. Often, this indicates an error, because the value computed is never used. Note that Sun's javac compiler often generates dead stores for final local variables. Because FindBugs is a bytecode-based tool, there is no easy way to eliminate these false positives. + +#DLS: Useless assignment in return statement (DLS_DEAD_LOCAL_STORE_IN_RETURN) +DLS_DEAD_LOCAL_STORE_IN_RETURN=;SFP--1;CWE-398 +DLS_DEAD_LOCAL_STORE_IN_RETURNMsg=This statement assigns to a local variable in a return statement. This assignment has effect. Please verify that this statement does the right thing. + +#DLS: Dead store of null to local variable (DLS_DEAD_LOCAL_STORE_OF_NULL) +DLS_DEAD_LOCAL_STORE_OF_NULL=;SFP--1;CWE-398 +DLS_DEAD_LOCAL_STORE_OF_NULLMsg=The code stores null into a local variable, and the stored value is not read. This store may have been introduced to assist the garbage collector, but as of Java SE 6.0, this is no longer needed or useful. + +#DMI: Code contains a hard coded reference to an absolute pathname (DMI_HARDCODED_ABSOLUTE_FILENAME) +DMI_HARDCODED_ABSOLUTE_FILENAME=;SFP--1;CWE-398 +DMI_HARDCODED_ABSOLUTE_FILENAMEMsg=This code constructs a File object using a hard coded to an absolute pathname (e.g., new File("/home/dannyc/workspace/j2ee/src/share/com/sun/enterprise/deployment"); + +#DMI: Non serializable object written to ObjectOutput (DMI_NONSERIALIZABLE_OBJECT_WRITTEN) +DMI_NONSERIALIZABLE_OBJECT_WRITTEN=;SFP-1;CWE-594 +DMI_NONSERIALIZABLE_OBJECT_WRITTENMsg=This code seems to be passing a non-serializable object to the ObjectOutput.writeObject method. If the object is, indeed, non-serializable, an error will result. + +#DMI: Invocation of substring(0), which returns the original value (DMI_USELESS_SUBSTRING) +DMI_USELESS_SUBSTRING=;SFP--1;CWE-398 +DMI_USELESS_SUBSTRINGMsg=This code invokes substring(0) on a String, which returns the original value. + +#Dm: Thread passed where Runnable expected (DMI_THREAD_PASSED_WHERE_RUNNABLE_EXPECTED) +DMI_THREAD_PASSED_WHERE_RUNNABLE_EXPECTED=;SFP-1;CWE-686 +DMI_THREAD_PASSED_WHERE_RUNNABLE_EXPECTEDMsg=A Thread object is passed as a parameter to a method where a Runnable is expected. This is rather unusual, and may indicate a logic error or cause unexpected behavior. + +#Eq: Class doesn't override equals in superclass (EQ_DOESNT_OVERRIDE_EQUALS) +EQ_DOESNT_OVERRIDE_EQUALS=;SFP--1;CWE-389 +EQ_DOESNT_OVERRIDE_EQUALSMsg=This class extends a class that defines an equals method and adds fields, but doesn't define an equals method itself. Thus, equality on instances of this class will ignore the identity of the subclass and the added fields. Be sure this is what is intended, and that you don't need to override the equals method. Even if you don't need to override the equals method, consider overriding it anyway to document the fact that the equals method for the subclass just return the result of invoking super.equals(o). + +#Eq: Unusual equals method (EQ_UNUSUAL) +EQ_UNUSUAL=;SFP--1;CWE-389 +EQ_UNUSUALMsg=This class doesn't do any of the patterns we recognize for checking that the type of the argument is compatible with the type of the this object. There might not be anything wrong with this code, but it is worth reviewing. + +#FE: Test for floating point equality (FE_FLOATING_POINT_EQUALITY) +FE_FLOATING_POINT_EQUALITY=;SFP--1;CWE-398 +FE_FLOATING_POINT_EQUALITYMsg=This operation compares two floating point values for equality. Because floating point calculations may involve rounding, calculated float and double values may not be accurate. For values that must be precise, such as monetary values, consider using a fixed-precision type such as BigDecimal. For values that need not be precise, consider comparing for equality within some range, for example: if ( Math.abs(x - y) < .0000001 ). See the Java Language Specification, section 4.2.4. + +#FS: Non-Boolean argument formatted using %b format specifier (VA_FORMAT_STRING_BAD_CONVERSION_TO_BOOLEAN) +VA_FORMAT_STRING_BAD_CONVERSION_TO_BOOLEAN=;SFP-1;CWE-686 +VA_FORMAT_STRING_BAD_CONVERSION_TO_BOOLEANMsg=An argument not of type Boolean is being formatted with a %b format specifier. This won't throw an exception; instead, it will print true for any nonnull value, and false for null. This feature of format strings is strange, and may not be what you intended. + +#IA: Ambiguous invocation of either an inherited or outer method (IA_AMBIGUOUS_INVOCATION_OF_INHERITED_OR_OUTER_METHOD) +IA_AMBIGUOUS_INVOCATION_OF_INHERITED_OR_OUTER_METHOD=;SFP--1;CWE-398 +IA_AMBIGUOUS_INVOCATION_OF_INHERITED_OR_OUTER_METHODMsg=An inner class is invoking a method that could be resolved to either a inherited method or a method defined in an outer class. By the Java semantics, it will be resolved to invoke the inherited method, but this may not be want you intend. If you really intend to invoke the inherited method, invoke it by invoking the method on super (e.g., invoke super.foo(17)), and thus it will be clear to other readers of your code and to FindBugs that you want to invoke the inherited method, not the method in the outer class. + +#IC: Initialization circularity (IC_INIT_CIRCULARITY) +IC_INIT_CIRCULARITY=;SFP--1;CWE-398 +IC_INIT_CIRCULARITYMsg=A circularity was detected in the static initializers of the two classes referenced by the bug instance. Many kinds of unexpected behavior may arise from such circularity. + +#ICAST: integral division result cast to double or float (ICAST_IDIV_CAST_TO_DOUBLE) +ICAST_IDIV_CAST_TO_DOUBLE=;SFP-1;CWE-197 +ICAST_IDIV_CAST_TO_DOUBLEMsg=This code casts the result of an integral division (e.g., int or long division) operation to double or float. Doing division on integers truncates the result to the integer value closest to zero. The fact that the result was cast to double suggests that this precision should have been retained. What was probably meant was to cast one or both of the operands to double before performing the division. + +#ICAST: Result of integer multiplication cast to long (ICAST_INTEGER_MULTIPLY_CAST_TO_LONG) +ICAST_INTEGER_MULTIPLY_CAST_TO_LONG=;SFP-1;CWE-190 +ICAST_INTEGER_MULTIPLY_CAST_TO_LONGMsg=This code performs integer multiply and then converts the result to a long, as in: long convertDaysToMilliseconds(int days) { return 1000*3600*24*days; } If the multiplication is done using long arithmetic, you can avoid the possibility that the result will overflow. + +#IM: Computation of average could overflow (IM_AVERAGE_COMPUTATION_COULD_OVERFLOW) +IM_AVERAGE_COMPUTATION_COULD_OVERFLOW=;SFP-1;CWE-190 +IM_AVERAGE_COMPUTATION_COULD_OVERFLOWMsg=The code computes the average of two integers using either division or signed right shift, and then uses the result as the index of an array. If the values being averaged are very large, this can overflow (resulting in the computation of a negative average). Assuming that the result is intended to be nonnegative, you can use an unsigned right shift instead. In other words, rather that using (low+high)/2, use (low+high) >>> 1. This bug exists in many earlier implementations of binary search and merge sort. Martin Buchholz found and fixed it in the JDK libraries, and Joshua Bloch widely publicized the bug pattern. + +#IM: Check for oddness that won't work for negative numbers (IM_BAD_CHECK_FOR_ODD) +IM_BAD_CHECK_FOR_ODD=;SFP--1;CWE-398 +IM_BAD_CHECK_FOR_ODDMsg=The code uses x % 2 == 1 to check to see if a value is odd, but this won't work for negative numbers (e.g., (-5) % 2 == -1). If this code is intending to check for oddness, consider using x & 1 == 1, or x % 2 != 0. + +#INT: Integer remainder modulo 1 (INT_BAD_REM_BY_1) +INT_BAD_REM_BY_1=;SFP--1;CWE-398 +INT_BAD_REM_BY_1Msg=Any expression (exp % 1) is guaranteed to always return zero. Did you mean (exp & 1) or (exp % 2) instead? + +#INT: Vacuous comparison of integer value (INT_VACUOUS_COMPARISON) +INT_VACUOUS_COMPARISON=;SFP--1;CWE-398 +INT_VACUOUS_COMPARISONMsg=There is an integer comparison that always returns the same value (e.g., x <= Integer.MAX_VALUE). + +#MTIA: Class extends Servlet class and uses instance variables (MTIA_SUSPECT_SERVLET_INSTANCE_FIELD) +MTIA_SUSPECT_SERVLET_INSTANCE_FIELD=;SFP--1;CWE-398 +MTIA_SUSPECT_SERVLET_INSTANCE_FIELDMsg=This class extends from a Servlet class, and uses an instance member variable. Since only one instance of a Servlet class is created by the J2EE framework, and used in a multithreaded way, this paradigm is highly discouraged and most likely problematic. Consider only using method local variables. + +#MTIA: Class extends Struts Action class and uses instance variables (MTIA_SUSPECT_STRUTS_INSTANCE_FIELD) +MTIA_SUSPECT_STRUTS_INSTANCE_FIELD=;SFP--1;CWE-398 +MTIA_SUSPECT_STRUTS_INSTANCE_FIELDMsg=This class extends from a Struts Action class, and uses an instance member variable. Since only one instance of a struts Action class is created by the Struts framework, and used in a multithreaded way, this paradigm is highly discouraged and most likely problematic. Consider only using method local variables. Only instance fields that are written outside of a monitor are reported. + +#NP: Dereference of the result of readLine() without nullcheck (NP_DEREFERENCE_OF_READLINE_VALUE) +NP_DEREFERENCE_OF_READLINE_VALUE=;SFP-7;CWE-476 +NP_DEREFERENCE_OF_READLINE_VALUEMsg=The result of invoking readLine() is dereferenced without checking to see if the result is null. If there are no more lines of text to read, readLine() will return null and dereferencing that will generate a null pointer exception. + +#NP: Immediate dereference of the result of readLine() (NP_IMMEDIATE_DEREFERENCE_OF_READLINE) +NP_IMMEDIATE_DEREFERENCE_OF_READLINE=;SFP-7;CWE-476 +NP_IMMEDIATE_DEREFERENCE_OF_READLINEMsg=The result of invoking readLine() is immediately dereferenced. If there are no more lines of text to read, readLine() will return null and dereferencing that will generate a null pointer exception. + +#NP: Load of known null value (NP_LOAD_OF_KNOWN_NULL_VALUE) +NP_LOAD_OF_KNOWN_NULL_VALUE=;SFP-7;CWE-476 +NP_LOAD_OF_KNOWN_NULL_VALUEMsg=The variable referenced at this point is known to be null due to an earlier check against null. Although this is valid, it might be a mistake (perhaps you intended to refer to a different variable, or perhaps the earlier check to see if the variable is null should have been a check to see if it was nonnull). + +#NP: Load of known null value (NP_LOAD_OF_KNOWN_NULL_VALUE) +NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE=;SFP-7;CWE-476 +NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUEMsg=The return value from a method is dereferenced without a null check, and the return value of that method is one that should generally be checked for null. This may lead to a NullPointerException when the code is executed. + +#NP: Possible null pointer dereference due to return value of called method (NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE) +NP_NULL_ON_SOME_PATH_MIGHT_BE_INFEASIBLE=;SFP-7;CWE-476 +NP_NULL_ON_SOME_PATH_MIGHT_BE_INFEASIBLEMsg=There is a branch of statement that, if executed, guarantees that a null value will be dereferenced, which would generate a NullPointerException when the code is executed. Of course, the problem might be that the branch or statement is infeasible and that the null pointer exception can't ever be executed; deciding that is beyond the ability of FindBugs. Due to the fact that this value had been previously tested for nullness, this is a definite possibility. + +#NP: Possible null pointer dereference on path that might be infeasible (NP_NULL_ON_SOME_PATH_MIGHT_BE_INFEASIBLE) +NP_PARAMETER_MUST_BE_NONNULL_BUT_MARKED_AS_NULLABLE=;SFP-7;CWE-476 +NP_PARAMETER_MUST_BE_NONNULL_BUT_MARKED_AS_NULLABLEMsg=This parameter is always used in a way that requires it to be nonnull, but the parameter is explicitly annotated as being Nullable. Either the use of the parameter or the annotation is wrong. + +#NS: Potentially dangerous use of non-short-circuit logic (NS_DANGEROUS_NON_SHORT_CIRCUIT) +NS_DANGEROUS_NON_SHORT_CIRCUIT=;SFP-1;CWE-768 +NS_DANGEROUS_NON_SHORT_CIRCUITMsg=This code seems to be using non-short-circuit logic (e.g., & or |) rather than short-circuit logic (&& or ||). In addition, it seem possible that, depending on the value of the left hand side, you might not want to evaluate the right hand side (because it would have side effects, could cause an exception or could be expensive. Non-short-circuit logic causes both sides of the expression to be evaluated even when the result can be inferred from knowing the left-hand side. This can be less efficient and can result in errors if the left-hand side guards cases when evaluating the right-hand side can generate an error. See the Java Language Specification for details + +#NS: Questionable use of non-short-circuit logic (NS_NON_SHORT_CIRCUIT) +NS_NON_SHORT_CIRCUIT=;SFP-1;CWE-768 +NS_NON_SHORT_CIRCUITMsg=This code seems to be using non-short-circuit logic (e.g., & or |) rather than short-circuit logic (&& or ||). Non-short-circuit logic causes both sides of the expression to be evaluated even when the result can be inferred from knowing the left-hand side. This can be less efficient and can result in errors if the left-hand side guards cases when evaluating the right-hand side can generate an error. See the Java Language Specification for details + +#PZLA: Consider returning a zero length array rather than null (PZLA_PREFER_ZERO_LENGTH_ARRAYS) +PZLA_PREFER_ZERO_LENGTH_ARRAYS=;SFP--1;CWE-710 +PZLA_PREFER_ZERO_LENGTH_ARRAYSMsg=It is often a better design to return a length zero array rather than a null reference to indicate that there are no results (i.e., an empty list of results). This way, no explicit check for null is needed by clients of the method. On the other hand, using null to indicate "there is no answer to this question" is probably appropriate. For example, File.listFiles() returns an empty list if given a directory containing no files, and returns null if the file is not a directory. + +#QF: Complicated, subtle or wrong increment in for-loop (QF_QUESTIONABLE_FOR_LOOP) +QF_QUESTIONABLE_FOR_LOOP=;SFP--1;CWE-389 +QF_QUESTIONABLE_FOR_LOOPMsg=Are you sure this for loop is incrementing the correct variable? It appears that another variable is being initialized and checked by the for loop. + +#RCN: Redundant comparison of non-null value to null (RCN_REDUNDANT_COMPARISON_OF_NULL_AND_NONNULL_VALUE) +RCN_REDUNDANT_COMPARISON_OF_NULL_AND_NONNULL_VALUE=;SFP--1;CWE-398 +RCN_REDUNDANT_COMPARISON_OF_NULL_AND_NONNULL_VALUEMsg=This method contains a reference known to be non-null with another reference known to be null. + +#RCN: Redundant comparison of two null values (RCN_REDUNDANT_COMPARISON_TWO_NULL_VALUES) +RCN_REDUNDANT_COMPARISON_TWO_NULL_VALUES=;SFP--1;CWE-398 +RCN_REDUNDANT_COMPARISON_TWO_NULL_VALUESMsg=This method contains a redundant comparison of two references known to both be definitely null. + +#RCN: Redundant nullcheck of value known to be non-null (RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE) +RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE=;SFP--1;CWE-398 +RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUEMsg=This method contains a redundant check of a known non-null value against the constant null. + +#RCN: Redundant nullcheck of value known to be null (RCN_REDUNDANT_NULLCHECK_OF_NULL_VALUE) +RCN_REDUNDANT_NULLCHECK_OF_NULL_VALUE=;SFP--1;CWE-398 +RCN_REDUNDANT_NULLCHECK_OF_NULL_VALUEMsg=This method contains a redundant check of a known null value against the constant null. + +#REC: Exception is caught when Exception is not thrown (REC_CATCH_EXCEPTION) +REC_CATCH_EXCEPTION=;SFP-5;CWE-396 +REC_CATCH_EXCEPTIONMsg=This method uses a try-catch block that catches Exception objects, but Exception is not thrown within the try block, and RuntimeException is not explicitly caught. It is a common bug pattern to say try { ... } catch (Exception e) { something } as a shorthand for catching a number of types of exception each of whose catch blocks is identical, but this construct also accidentally catches RuntimeException as well, masking potential bugs. + +#RI: Class implements same interface as superclass (RI_REDUNDANT_INTERFACES) +RI_REDUNDANT_INTERFACES=;SFP--1;CWE-398 +RI_REDUNDANT_INTERFACESMsg=This class declares that it implements an interface that is also implemented by a superclass. This is redundant because once a superclass implements an interface, all subclasses by default also implement this interface. It may point out that the inheritance hierarchy has changed since this class was created, and consideration should be given to the ownership of the interface's implementation. + +#RV: Method checks to see if result of String.indexOf is positive (RV_CHECK_FOR_POSITIVE_INDEXOF) +RV_CHECK_FOR_POSITIVE_INDEXOF=;SFP--1;CWE-398 +RV_CHECK_FOR_POSITIVE_INDEXOFMsg=The method invokes String.indexOf and checks to see if the result is positive or non-positive. It is much more typical to check to see if the result is negative or non-negative. It is positive only if the substring checked for occurs at some place other than at the beginning of the String. + +#RV: Method discards result of readLine after checking if it is nonnull (RV_DONT_JUST_NULL_CHECK_READLINE) +RV_DONT_JUST_NULL_CHECK_READLINE=;SFP-4;CWE-253 +RV_DONT_JUST_NULL_CHECK_READLINEMsg=The value returned by readLine is discarded after checking to see if the return value is non-null. In almost all situations, if the result is non-null, you will want to use that non-null value. Calling readLine again will give you a different line. + +#RV: Remainder of hashCode could be negative (RV_REM_OF_HASHCODE) +RV_REM_OF_HASHCODE=;SFP--1;CWE-398 +RV_REM_OF_HASHCODEMsg=This code computes a hashCode, and then computes the remainder of that value modulo another value. Since the hashCode can be negative, the result of the remainder operation can also be negative. Assuming you want to ensure that the result of your computation is nonnegative, you may need to change your code. If you know the divisor is a power of 2, you can use a bitwise and operator instead (i.e., instead of using x.hashCode()%n, use x.hashCode()&(n-1). This is probably faster than computing the remainder as well. If you don't know that the divisor is a power of 2, take the absolute value of the result of the remainder operation (i.e., use Math.abs(x.hashCode()%n) + +#RV: Remainder of 32-bit signed random integer (RV_REM_OF_RANDOM_INT) +RV_REM_OF_RANDOM_INT=;SFP--1;CWE-398 +RV_REM_OF_RANDOM_INTMsg=This code generates a random signed integer and then computes the remainder of that value modulo another value. Since the random number can be negative, the result of the remainder operation can also be negative. Be sure this is intended, and strongly consider using the Random.nextInt(int) method instead. + +#SA: Double assignment of local variable (SA_LOCAL_DOUBLE_ASSIGNMENT) +SA_LOCAL_DOUBLE_ASSIGNMENT=;SFP--1;CWE-398 +SA_LOCAL_DOUBLE_ASSIGNMENTMsg=This method contains a double assignment of a local variable + +#SA: Self assignment of local variable (SA_LOCAL_SELF_ASSIGNMENT) +SA_LOCAL_SELF_ASSIGNMENT=;SFP--1;CWE-398 +SA_LOCAL_SELF_ASSIGNMENTMsg=This method contains a self assignment of a local variable + +#SF: Switch statement found where one case falls through to the next case (SF_SWITCH_FALLTHROUGH) +SF_SWITCH_FALLTHROUGH=;SFP-4;CWE-484 +SF_SWITCH_FALLTHROUGHMsg=This method contains a switch statement where one case branch will fall through to the next case. Usually you need to end this case with a break or return. + +#SF: Switch statement found where default case is missing (SF_SWITCH_NO_DEFAULT) +SF_SWITCH_NO_DEFAULT=;SFP-4;CWE-478 +SF_SWITCH_NO_DEFAULTMsg=This method contains a switch statement where default case is missing. Usually you need to provide a default case. + +#ST: Write to static field from instance method (ST_WRITE_TO_STATIC_FROM_INSTANCE_METHOD) +ST_WRITE_TO_STATIC_FROM_INSTANCE_METHOD=;SFP--1;CWE-398 +ST_WRITE_TO_STATIC_FROM_INSTANCE_METHODMsg=This instance method writes to a static field. This is tricky to get correct if multiple instances are being manipulated, and generally bad practice. + +#Se: private readResolve method not inherited by subclasses (SE_PRIVATE_READ_RESOLVE_NOT_INHERITED) +SE_PRIVATE_READ_RESOLVE_NOT_INHERITED=;SFP--1;CWE-398 +SE_PRIVATE_READ_RESOLVE_NOT_INHERITEDMsg=This class defines a private readResolve method. Since it is private, it won't be inherited by subclasses. This might be intentional and OK, but should be reviewed to ensure it is what is intended. + +#Se: Transient field of class that isn't Serializable. (SE_TRANSIENT_FIELD_OF_NONSERIALIZABLE_CLASS) +SE_TRANSIENT_FIELD_OF_NONSERIALIZABLE_CLASS=;SFP--1;CWE-398 +SE_TRANSIENT_FIELD_OF_NONSERIALIZABLE_CLASSMsg=The field is marked as transient, but the class isn't Serializable, so marking it as transient has absolutely no effect. This may be leftover marking from a previous version of the code in which the class was transient, or it may indicate a misunderstanding of how serialization works. + +#TQ: Explicit annotation inconsistent with use (TQ_EXPLICIT_UNKNOWN_SOURCE_VALUE_REACHES_ALWAYS_SINK) +TQ_EXPLICIT_UNKNOWN_SOURCE_VALUE_REACHES_ALWAYS_SINK=;SFP--1;CWE-398 +TQ_EXPLICIT_UNKNOWN_SOURCE_VALUE_REACHES_ALWAYS_SINKMsg=A value is used in a way that requires it to be always be a value denoted by a type qualifier, but there is an explicit annotation stating that it is not known where the value is required to have that type qualifier. Either the usage or the annotation is incorrect. + +#TQ: Explicit annotation inconsistent with use (TQ_EXPLICIT_UNKNOWN_SOURCE_VALUE_REACHES_NEVER_SINK) +TQ_EXPLICIT_UNKNOWN_SOURCE_VALUE_REACHES_NEVER_SINK=;SFP--1;CWE-398 +TQ_EXPLICIT_UNKNOWN_SOURCE_VALUE_REACHES_NEVER_SINKMsg=A value is used in a way that requires it to be never be a value denoted by a type qualifier, but there is an explicit annotation stating that it is not known where the value is prohibited from having that type qualifier. Either the usage or the annotation is incorrect. + +#UCF: Useless control flow (UCF_USELESS_CONTROL_FLOW) +UCF_USELESS_CONTROL_FLOW=;SFP--1;CWE-398 +UCF_USELESS_CONTROL_FLOWMsg=This method contains a useless control flow statement, where control flow continues onto the same place regardless of whether or not the branch is taken. + +#UCF: Useless control flow to next line (UCF_USELESS_CONTROL_FLOW_NEXT_LINE) +UCF_USELESS_CONTROL_FLOW_NEXT_LINE=;SFP--1;CWE-398 +UCF_USELESS_CONTROL_FLOW_NEXT_LINEMsg=This method contains a useless control flow statement in which control flow follows to the same or following line regardless of whether or not the branch is taken. Often, this is caused by inadvertently using an empty statement as the body of an if statement + +#UwF: Field not initialized in constructor (UWF_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR) +UWF_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR=;SFP-1;CWE-456 +UWF_FIELD_NOT_INITIALIZED_IN_CONSTRUCTORMsg=This field is never initialized within any constructor, and is therefore could be null after the object is constructed. This could be a either an error or a questionable design, since it means a null pointer exception will be generated if that field is dereferenced before being initialized. + +#XFB: Method directly allocates a specific implementation of xml interfaces (XFB_XML_FACTORY_BYPASS) +XFB_XML_FACTORY_BYPASS=;SFP--1;CWE-398 +XFB_XML_FACTORY_BYPASSMsg=This method allocates a specific implementation of an xml interface. It is preferable to use the supplied factory classes to create these objects so that the implementation can be changed at runtime \ No newline at end of file diff --git a/com.kdmanalytics.toif.findbugs/build.properties b/com.kdmanalytics.toif.findbugs/build.properties new file mode 100644 index 00000000..e9863e28 --- /dev/null +++ b/com.kdmanalytics.toif.findbugs/build.properties @@ -0,0 +1,5 @@ +source.. = src/ +output.. = bin/ +bin.includes = META-INF/,\ + .,\ + plugin.xml diff --git a/com.kdmanalytics.toif.findbugs/plugin.xml b/com.kdmanalytics.toif.findbugs/plugin.xml new file mode 100644 index 00000000..64e523ee --- /dev/null +++ b/com.kdmanalytics.toif.findbugs/plugin.xml @@ -0,0 +1,11 @@ + + + + + + + + + diff --git a/com.kdmanalytics.toif.findbugs/pom.xml b/com.kdmanalytics.toif.findbugs/pom.xml new file mode 100644 index 00000000..aa1e1c15 --- /dev/null +++ b/com.kdmanalytics.toif.findbugs/pom.xml @@ -0,0 +1,21 @@ + + + + 4.0.0 + + + com.kdmanalytics.toif + plugins + 1.16.0-SNAPSHOT + + + com.kdmanalytics.toif.compile + com.kdmanalytics.toif.findbugs + + + eclipse-plugin + + Findbugs Adaptor + \ No newline at end of file diff --git a/com.kdmanalytics.toif.findbugs/src/com/kdmanalytics/toif/adaptor/FindbugsAdaptor.java b/com.kdmanalytics.toif.findbugs/src/com/kdmanalytics/toif/adaptor/FindbugsAdaptor.java new file mode 100644 index 00000000..da463f7a --- /dev/null +++ b/com.kdmanalytics.toif.findbugs/src/com/kdmanalytics/toif/adaptor/FindbugsAdaptor.java @@ -0,0 +1,368 @@ + +package com.kdmanalytics.toif.adaptor; + +/******************************************************************************* + * Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This program and + * the accompanying materials are made available under the terms of the Open + * Source Initiative OSI - Open Software License v3.0 which accompanies this + * distribution, and is available at + * http://www.opensource.org/licenses/osl-3.0.php/ + ******************************************************************************/ +import java.io.BufferedReader; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.FileInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import org.apache.log4j.Logger; +import org.xml.sax.InputSource; +import org.xml.sax.SAXException; +import org.xml.sax.XMLReader; +import org.xml.sax.helpers.XMLReaderFactory; + +import com.kdmanalytics.toif.common.exception.ToifException; +import com.kdmanalytics.toif.findbugs.FindBugsParser; +import com.kdmanalytics.toif.framework.parser.StreamGobbler; +import com.kdmanalytics.toif.framework.toolAdaptor.AbstractAdaptor; +import com.kdmanalytics.toif.framework.toolAdaptor.AdaptorOptions; +import com.kdmanalytics.toif.framework.toolAdaptor.Language; +import com.kdmanalytics.toif.framework.xmlElements.entities.Element; +import com.kdmanalytics.toif.framework.xmlElements.entities.File; + +/** + * An example of how the findbugs adaptor could be made. + * + * @author adam + * + */ +public class FindbugsAdaptor extends AbstractAdaptor +{ + private static Logger LOG = Logger.getLogger( FindbugsAdaptor.class); + /** + * the name of the adaptor + */ + @Override + public String getAdaptorName() + { + return "FindBugs Adaptor"; + } + + /** + * the description of the adaptor + */ + @Override + public String getAdaptorDescription() + { + return "Find Bugs in Java Programs"; + } + + /** + * the xml produced form the tool is parsed by a sax parser and our own + * content handler. + * @throws ToifException + */ + @Override + public ArrayList parse(java.io.File process, AdaptorOptions options, File file, boolean[] validLines, boolean unknownCWE) throws ToifException + { + try + { + final InputStream inputStream = new FileInputStream(process); + Thread stderr; + final FindBugsParser parser = new FindBugsParser(getProperties(), file, getAdaptorName(), unknownCWE); + + final ByteArrayOutputStream errStream = new ByteArrayOutputStream(); + + /* + * The two streams could probably be merged with + * redirectErrorStream(), that was we would only have to deal with + * one stream. + */ + + stderr = new Thread(new StreamGobbler(inputStream, errStream)); + + stderr.start(); + stderr.join(); + + final byte[] data = errStream.toByteArray(); + final ByteArrayInputStream in = new ByteArrayInputStream(data); + + final XMLReader rdr = XMLReaderFactory.createXMLReader("org.apache.xerces.parsers.SAXParser"); + rdr.setContentHandler(parser); + rdr.parse(new InputSource(in)); + + // return the elements gathered during the parse. + ArrayList elements = parser.getElements(); + + return elements; + + } + catch (final SAXException e) + { + + final String msg = getAdaptorName() + + ": Possibly the file the tool is run against is too large, the wrong kind of file, or not just one file."; + LOG.error( msg , e); + throw new ToifException( msg ); + } + catch (final IOException e) + { + final String msg = getAdaptorName() + + ": Possibly the file the tool is run against is too large, the wrong kind of file, or not just one file."; + + LOG.error( msg , e); + throw new ToifException( msg ); + + } + catch (final InterruptedException e) + { + final String msg = getAdaptorName() + + ": Possibly the file the tool is run against is too large, the wrong kind of file, or not just one file."; + + LOG.error( msg , e); + throw new ToifException( msg ); + + } + } + + /** + * get the commands required to run the tool. Unfortunately findbugs is a + * bat under windows. This requires that the cmd.exe be called to execute + * it. This means that we have to determine what system the adaptor is + * running on. + */ + @Override + public String[] runToolCommands(AdaptorOptions options, String[] otherOpts) + { + // if the system is linux, findugs can b eexecuted on its own. + if ("Linux".equals(System.getProperty("os.name"))) + { + // the basic command to run the tool. + final String[] commands = { "findbugs", "-xml", options.getInputFile().toString() }; + + // inserting the optional arguments into that array. + List commandList; + commandList = new ArrayList(); + commandList.addAll(Arrays.asList(commands)); + commandList.addAll(commands.length - 1, Arrays.asList(otherOpts)); + String[] s = commandList.toArray(new String[commandList.size()]); + + // return the commands. + return s; + } + /* + * if the system is windows then findbugs must be run within the + * cmd.exe. + */ + else + { + // the basic commands to run the tool + final String[] commands = { "cmd.exe", "/C", "findbugs.bat", "-textui", "-xml", options.getInputFile().toString() }; + + // inserting the optional arguments into the commands array. + List commandList; + commandList = new ArrayList(); + commandList.addAll(Arrays.asList(commands)); + commandList.addAll(commands.length - 1, Arrays.asList(otherOpts)); + String[] s = commandList.toArray(new String[commandList.size()]); + + // return the commands. + return s; + } + + } + + /** + * get the address of the adaptor's vendor. + */ + @Override + public String getAdaptorVendorAddress() + { + return "3730 Richmond Rd, Suite 204, Ottawa, ON, K2H 5B9"; + } + + /** + * get the description of the adaptor's vendor. + */ + @Override + public String getAdaptorVendorDescription() + { + return "KDM Analytics is a security assurance company providing products and services for threat risk assessment and management, due diligence assessments, and information and data assurance. Leveraging our decades of experience in static analysis, reverse engineering and formal methods, we have created breakthrough products for the automated and systematic investigation of code, data and networks."; + } + + /** + * get the email address of the adaptor's vendor. + */ + @Override + public String getAdaptorVendorEmail() + { + return "adam@kdmanalytics.com"; + } + + /** + * get the name of the adaptor's vendor. + */ + @Override + public String getAdaptorVendorName() + { + return "KDM Analytics"; + } + + /** + * get the phone number of the adaptor's vendor. + */ + @Override + public String getAdaptorVendorPhone() + { + return "613-627-1011"; + } + + /** + * get the description of the generator + */ + @Override + public String getGeneratorDescription() + { + return "Static code analysis tool that analyses Java bytecode and detects a wide range of problems."; + } + + /** + * get the name of the generator + */ + @Override + public String getGeneratorName() + { + return "findbugs"; + } + + /** + * get the address of the vendor. + */ + @Override + public String getGeneratorVendorAddress() + { + return "http://findbugs.sourceforge.net/"; + } + + /** + * get the vendors' description + */ + @Override + public String getGeneratorVendorDescription() + { + return "SourceForge is a web-based source code repository."; + } + + /** + * get email address of vendors email + */ + @Override + public String getGeneratorVendorEmail() + { + return "findbugs@cs.umd.edu"; + } + + /** + * get name of generator's vendor + */ + @Override + public String getGeneratorVendorName() + { + return "sourceforge"; + } + + /** + * get the phone number of the generator's vendor + */ + @Override + public String getGeneratorVendorPhone() + { + return ""; + } + + /** + * get the generator's version. This is done by calling the generator with + * its version options and parsing that output. Again to execute findbugs on + * windows, it has to be run from within the cmd.exe shell + */ + @Override + public String getGeneratorVersion() + { + ProcessBuilder findbugs = null; + + // if the system is linux, run normally + if ("Linux".equals(System.getProperty("os.name"))) + { + String[] commands = { "findbugs", "-version" }; + findbugs = new ProcessBuilder(commands); + } + + // if the system is windows, run the tool inside cmd.exe + else + { + String[] commands = { "cmd.exe", "/C", "findbugs.bat", "-textui", "-version" }; + findbugs = new ProcessBuilder(commands); + } + + // parse the output + try + { + Process findbugsInstance = findbugs.start(); + InputStream in = findbugsInstance.getInputStream(); + + BufferedReader br = new BufferedReader(new InputStreamReader(in)); + + String strLine; + + while ((strLine = br.readLine()) != null) + { + if (strLine.trim().equals("1.3.9")) + { + return strLine.trim(); + } + else + { + // give a warning if the versions do not match. + System.err.println(getAdaptorName() + ": Generator " + strLine + " found, only version 1.3.9 has been tested"); + return strLine.trim(); + } + } + + } + catch (Exception e) + { + System.err.println("Could not run program to gather generator version."); + } + + return ""; + } + + @Override + public String getRuntoolName() + { + return "findbugs"; + } + + @Override + public Language getLanguage() + { + return Language.JAVA; + } + + @Override + public boolean acceptsDOptions() + { + return false; + } + + @Override + public boolean acceptsIOptions() + { + return false; + } + +} diff --git a/com.kdmanalytics.toif.findbugs/src/com/kdmanalytics/toif/findbugs/Activator.java b/com.kdmanalytics.toif.findbugs/src/com/kdmanalytics/toif/findbugs/Activator.java new file mode 100644 index 00000000..cf0f1f43 --- /dev/null +++ b/com.kdmanalytics.toif.findbugs/src/com/kdmanalytics/toif/findbugs/Activator.java @@ -0,0 +1,38 @@ +/******************************************************************************* + * Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This program and the + * accompanying materials are made available under the terms of the Open Source + * Initiative OSI - Open Software License v3.0 which accompanies this + * distribution, and is available at http://www.opensource.org/licenses/osl-3.0.php/ + ******************************************************************************/ + +package com.kdmanalytics.toif.findbugs; + + +import org.osgi.framework.BundleActivator; +import org.osgi.framework.BundleContext; + +public class Activator implements BundleActivator { + + private static BundleContext context; + + static BundleContext getContext() { + return context; + } + + /* + * (non-Javadoc) + * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext) + */ + public void start(BundleContext bundleContext) throws Exception { + Activator.context = bundleContext; + } + + /* + * (non-Javadoc) + * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext) + */ + public void stop(BundleContext bundleContext) throws Exception { + Activator.context = null; + } + +} diff --git a/com.kdmanalytics.toif.findbugs/src/com/kdmanalytics/toif/findbugs/FindBugsParser.java b/com.kdmanalytics.toif.findbugs/src/com/kdmanalytics/toif/findbugs/FindBugsParser.java new file mode 100644 index 00000000..0ab3380b --- /dev/null +++ b/com.kdmanalytics.toif.findbugs/src/com/kdmanalytics/toif/findbugs/FindBugsParser.java @@ -0,0 +1,149 @@ + +package com.kdmanalytics.toif.findbugs; + +/******************************************************************************* + * Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This program and + * the accompanying materials are made available under the terms of the Open + * Source Initiative OSI - Open Software License v3.0 which accompanies this + * distribution, and is available at + * http://www.opensource.org/licenses/osl-3.0.php/ + ******************************************************************************/ +import java.util.ArrayList; +import java.util.Properties; +import java.util.Stack; + +import org.xml.sax.Attributes; +import org.xml.sax.helpers.DefaultHandler; + +import com.kdmanalytics.toif.framework.utils.FindingCreator; +import com.kdmanalytics.toif.framework.xmlElements.entities.CodeLocation; +import com.kdmanalytics.toif.framework.xmlElements.entities.Element; +import com.kdmanalytics.toif.framework.xmlElements.entities.File; + +/** + * The parser for the findbugs output. + * + * @author adam + * + */ +public class FindBugsParser extends DefaultHandler +{ + + private FindingCreator findingCreator; + + private String id; + + private Integer line; + + private Integer offset; + + private File file; + + private Properties props; + + private boolean first; + + private String description; + + private ArrayList traces = new ArrayList<>(); + + private Stack stack = new Stack<>(); + + /** + * construct a findbugs parser. + */ + public FindBugsParser(Properties props, File file, String name, boolean unknownCWE) + { + findingCreator = new FindingCreator(props, name, unknownCWE); + this.file = file; + this.props = props; + } + + /** + * start the parse. The details are handed to the findingCreator. + */ + public void startElement(String uri, String localName, String qName, Attributes attrs) + { + + if ("BugInstance".equals(qName)) + { + id = attrs.getValue("type"); + first = true; + traces.clear(); + } + + if (!"SourceLine".equals(qName)) + { + stack.push(qName); + first = true; + } + +// if ("SourceLine".equals(qName) && (attrs.getLength() >= 5)) +// { + + if ("SourceLine".equals(qName) && "BugInstance".equals(stack.peek())) { + + String startByte = attrs.getValue("startBytecode"); + if (first) + { + String start = attrs.getValue("start"); + if (start!= null) { + line = Integer.parseInt(start); + } else { + line = 1; + } + if (startByte != null) + { + offset = Integer.parseInt(startByte); + } + description = props.getProperty(id + "Msg"); + first = false; + } + else + { + String start = attrs.getValue("start"); + traces.add(new CodeLocation(Integer.parseInt(start), null, Integer.parseInt(startByte))); + } + + } else if ("SourceLine".equals(qName)) { + String startByte = attrs.getValue("startBytecode"); + String start = attrs.getValue("start"); + if (start != null) { + line = Integer.parseInt(start); + } else { + line = 1; + } + if (startByte != null) + { + offset = Integer.parseInt(startByte); + } + description = props.getProperty(id + "Msg"); + first = false; + } + } + + /** + * called on the end element. + */ + public void endElement(String uri, String localName, String qName) + { + + if (!"SourceLine".equals(qName)) + { + stack.pop(); + first = true; + } + if ("BugInstance".equals(qName)) + findingCreator.create(description, id, line, offset, null, file, null, null, traces.toArray(new CodeLocation[traces.size()])); + } + + /** + * reuturn the gathered elements. + * + * @return + */ + public ArrayList getElements() + { + return findingCreator.getElements(); + } +} diff --git a/com.kdmanalytics.toif.findbugs/src/config/FindbugsAdaptorConfiguration b/com.kdmanalytics.toif.findbugs/src/config/FindbugsAdaptorConfiguration new file mode 100644 index 00000000..063719c5 --- /dev/null +++ b/com.kdmanalytics.toif.findbugs/src/config/FindbugsAdaptorConfiguration @@ -0,0 +1,1488 @@ +# - No SFP or CWE found +# - No CWE Found +# - SFP and CWE Found + +############################################################################# +# +# http://findbugs.sourceforge.net/bugDescriptions.html +# +############################################################################# + + +#AM: Creates an empty jar file entry (AM_CREATES_EMPTY_JAR_FILE_ENTRY) +AM_CREATES_EMPTY_JAR_FILE_ENTRY=;SFP--1;CWE-398 +AM_CREATES_EMPTY_JAR_FILE_ENTRYMsg=The code calls putNextEntry(), immediately followed by a call to closeEntry(). This results in an empty JarFile entry. The contents of the entry should be written to the JarFile between the calls to putNextEntry() and closeEntry(). + +#AM: Creates an empty zip file entry (AM_CREATES_EMPTY_ZIP_FILE_ENTRY) +AM_CREATES_EMPTY_ZIP_FILE_ENTRY=;SFP--1;CWE-398 +AM_CREATES_EMPTY_ZIP_FILE_ENTRYMsg=The code calls putNextEntry(), immediately followed by a call to closeEntry(). This results in an empty ZipFile entry. The contents of the entry should be written to the ZipFile between the calls to putNextEntry() and closeEntry(). + +#BC: Equals method should not assume anything about the type of its argument (BC_EQUALS_METHOD_SHOULD_WORK_FOR_ALL_OBJECTS) +BC_EQUALS_METHOD_SHOULD_WORK_FOR_ALL_OBJECTS=;SFP--1;CWE-398 +BC_EQUALS_METHOD_SHOULD_WORK_FOR_ALL_OBJECTSMsg=The equals(Object o) method shouldn't make any assumptions about the type of o. It should simply return false if o is not the same type as this. + +#BC: Random object created and used only once (DMI_RANDOM_USED_ONLY_ONCE) +DMI_RANDOM_USED_ONLY_ONCE=;SFP--1;CWE-330 +DMI_RANDOM_USED_ONLY_ONCEMsg=This code creates a java.util.Random object, uses it to generate one random number, and then discards the Random object. This produces mediocre quality random numbers and is inefficient. If possible, rewrite the code so that the Random object is created once and saved, and each time a new random number is required invoke a method on the existing Random object to obtain it. If it is important that the generated Random numbers not be guessable, you must not create a new Random for each random number; the values are too easily guessable. You should strongly consider using a java.security.SecureRandom instead (and avoid allocating a new SecureRandom for each random number needed). + +#BIT: Check for sign of bitwise operation (BIT_SIGNED_CHECK) +BIT_SIGNED_CHECK=;SFP--1;CWE-480 +IT_SIGNED_CHECKMsg=This method compares an expression such as ((event.detail & SWT.SELECTED) > 0). Using bit arithmetic and then comparing with the greater than operator can lead to unexpected results (of course depending on the value of SWT.SELECTED). If SWT.SELECTED is a negative number, this is a candidate for a bug. Even when SWT.SELECTED is not negative, it seems good practice to use '!= 0' instead of '> 0'. + +#CN: Class implements Cloneable but does not define or use clone method (CN_IDIOM) +CN_IDIOM=;SFP--1;CWE-710 +CN_IDIOMMsg=Class implements Cloneable but does not define or use the clone method. + +#CN: clone method does not call super.clone() (CN_IDIOM_NO_SUPER_CALL) +CN_IDIOM_NO_SUPER_CALL=;SFP-28;CWE-580 +CN_IDIOM_NO_SUPER_CALLMsg=This non-final class defines a clone() method that does not call super.clone(). If this class ("A") is extended by a subclass ("B"), and the subclass B calls super.clone(), then it is likely that B's clone() method will return an object of type A, which violates the standard contract for clone(). If all clone() methods call super.clone(), then they are guaranteed to use Object.clone(), which always returns an object of the correct type. + +#CN: Class defines clone() but doesn't implement Cloneable (CN_IMPLEMENTS_CLONE_BUT_NOT_CLONEABLE) +CN_IMPLEMENTS_CLONE_BUT_NOT_CLONEABLE=;SFP--1;CWE-710 +CN_IMPLEMENTS_CLONE_BUT_NOT_CLONEABLEMsg=This class defines a clone() method but the class doesn't implement Cloneable. There are some situations in which this is OK (e.g., you want to control how subclasses can clone themselves), but just make sure that this is what you intended. + +#Co: Abstract class defines covariant compareTo() method (CO_ABSTRACT_SELF) +CO_ABSTRACT_SELF=;SFP--1;CWE-710 +CO_ABSTRACT_SELFMsg=This class defines a covariant version of compareTo(). To correctly override the compareTo() method in the Comparable interface, the parameter of compareTo() must have type java.lang.Object. + +#Co: Covariant compareTo() method defined (CO_SELF_NO_OBJECT) +CO_SELF_NO_OBJECT=;SFP--1;CWE-710 +CO_SELF_NO_OBJECTMsg=This class defines a covariant version of compareTo(). To correctly override the compareTo() method in the Comparable interface, the parameter of compareTo() must have type java.lang.Object. + +#DE: Method might drop exception (DE_MIGHT_DROP) +DE_MIGHT_DROP=;SFP-4;CWE-390 +DE_MIGHT_DROPMsg=This method might drop an exception. In general, exceptions should be handled or reported in some way, or they should be thrown out of the method. + +#DE: Method might ignore exception (DE_MIGHT_IGNORE) +DE_MIGHT_IGNORE=;SFP-4;CWE-390 +DE_MIGHT_IGNOREMsg=This method might ignore an exception. In general, exceptions should be handled or reported in some way, or they should be thrown out of the method. + +#DMI: Don't use removeAll to clear a collection (DMI_USING_REMOVEALL_TO_CLEAR_COLLECTION) +DMI_USING_REMOVEALL_TO_CLEAR_COLLECTION=;SFP-1;CWE-710 +DMI_USING_REMOVEALL_TO_CLEAR_COLLECTIONMsg=If you want to remove all elements from a collection c, use c.clear, not c.removeAll(c). Calling c.removeAll(c) to clear a collection is less clear, susceptible to errors from typos, less efficient and for some collections, might throw a ConcurrentModificationException. + +#DP: Classloaders should only be created inside doPrivileged block (DP_CREATE_CLASSLOADER_INSIDE_DO_PRIVILEGED) +DP_CREATE_CLASSLOADER_INSIDE_DO_PRIVILEGED=;SFP-27;CWE-545 +DP_CREATE_CLASSLOADER_INSIDE_DO_PRIVILEGEDMsg=This code creates a classloader, which requires a security manager. If this code will be granted security permissions, but might be invoked by code that does not have security permissions, then the classloader creation needs to occur inside a doPrivileged block. + +#DP: Method invoked that should be only be invoked inside a doPrivileged block (DP_DO_INSIDE_DO_PRIVILEGED) +DP_DO_INSIDE_DO_PRIVILEGED=;SFP--1;CWE-250 +DP_DO_INSIDE_DO_PRIVILEGEDMsg=This code invokes a method that requires a security permission check. If this code will be granted security permissions, but might be invoked by code that does not have security permissions, then the invocation needs to occur inside a doPrivileged block. + +#Dm: Method invokes System.exit(...) (DM_EXIT) +DM_EXIT=;SFP--1;CWE-710 +DM_EXITMsg=Invoking System.exit shuts down the entire Java virtual machine. This should only been done when it is appropriate. Such calls make it hard or impossible for your code to be invoked by other code. Consider throwing a RuntimeException instead. + +#Dm: Method invokes dangerous method runFinalizersOnExit (DM_RUN_FINALIZERS_ON_EXIT) +DM_RUN_FINALIZERS_ON_EXIT=;SFP-3;CWE-242 +DM_RUN_FINALIZERS_ON_EXITMsg=Never call System.runFinalizersOnExit or Runtime.runFinalizersOnExit for any reason: they are among the most dangerous methods in the Java libraries. -- Joshua Bloch + +#ES: Comparison of String parameter using == or != (ES_COMPARING_PARAMETER_STRING_WITH_EQ) +ES_COMPARING_PARAMETER_STRING_WITH_EQ=;SFP-1;CWE-597 +ES_COMPARING_PARAMETER_STRING_WITH_EQMsg=This code compares a java.lang.String parameter for reference equality using the == or != operators. Requiring callers to pass only String constants or interned strings to a method is unnecessarily fragile, and rarely leads to measurable performance gains. Consider using the equals(Object) method instead. + +#ES: Comparison of String objects using == or != (ES_COMPARING_STRINGS_WITH_EQ) +ES_COMPARING_STRINGS_WITH_EQ=;SFP-1;CWE-597 +ES_COMPARING_STRINGS_WITH_EQMsg=This code compares java.lang.String objects for reference equality using the == or != operators. Unless both strings are either constants in a source file, or have been interned using the String.intern() method, the same string value may be represented by two different String objects. Consider using the equals(Object) method instead. + +#Eq: Abstract class defines covariant equals() method (EQ_ABSTRACT_SELF) +EQ_ABSTRACT_SELF=;SFP--1;CWE-710 +EQ_ABSTRACT_SELFMsg=This class defines a covariant version of equals(). To correctly override the equals() method in java.lang.Object, the parameter of equals() must have type java.lang.Object. + +#Eq: Equals checks for noncompatible operand (EQ_CHECK_FOR_OPERAND_NOT_COMPATIBLE_WITH_THIS) +EQ_CHECK_FOR_OPERAND_NOT_COMPATIBLE_WITH_THIS=;SFP--1;CWE-710 +EQ_CHECK_FOR_OPERAND_NOT_COMPATIBLE_WITH_THISMsg=This equals method is checking to see if the argument is some incompatible type (i.e., a class that is neither a supertype nor subtype of the class that defines the equals method). + +#Eq: Class defines compareTo(...) and uses Object.equals() (EQ_COMPARETO_USE_OBJECT_EQUALS) +EQ_COMPARETO_USE_OBJECT_EQUALS=;SFP--1;CWE-710 +EQ_COMPARETO_USE_OBJECT_EQUALSMsg=This class defines a compareTo(...) method but inherits its equals() method from java.lang.Object. Generally, the value of compareTo should return zero if and only if equals returns true. If this is violated, weird and unpredictable failures will occur in classes such as PriorityQueue. In Java 5 the PriorityQueue.remove method uses the compareTo method, while in Java 6 it uses the equals method. + +#Eq: equals method fails for subtypes (EQ_GETCLASS_AND_CLASS_CONSTANT) +EQ_GETCLASS_AND_CLASS_CONSTANT=;SFP--1;CWE-710 +EQ_GETCLASS_AND_CLASS_CONSTANTMsg=This class has an equals method that will be broken if it is inherited by subclasses. It compares a class literal with the class of the argument (e.g., in class Foo it might check if Foo.class == o.getClass()). It is better to check if this.getClass() == o.getClass(). + +#Eq: Covariant equals() method defined (EQ_SELF_NO_OBJECT) +EQ_SELF_NO_OBJECT=;SFP--1;CWE-710 +EQ_SELF_NO_OBJECTMsg=This class defines a covariant version of equals(). To correctly override the equals() method in java.lang.Object, the parameter of equals() must have type java.lang.Object. + +#FI: Empty finalizer should be deleted (FI_EMPTY) +FI_EMPTY=;SFP--1;CWE-710 +FI_EMPTY=Empty finalize() methods are useless, so they should be deleted. + +#FI: Explicit invocation of finalizer (FI_EXPLICIT_INVOCATION) +FI_EXPLICIT_INVOCATION=;SFP-3;CWE-586 +FI_EXPLICIT_INVOCATIONMsg=This method contains an explicit invocation of the finalize() method on an object. Because finalizer methods are supposed to be executed once, and only by the VM, this is a bad idea. If a connected set of objects beings finalizable, then the VM will invoke the finalize method on all the finalizable object, possibly at the same time in different threads. Thus, it is a particularly bad idea, in the finalize method for a class X, invoke finalize on objects referenced by X, because they may already be getting finalized in a separate thread. + +#FI: Finalizer nulls fields (FI_FINALIZER_NULLS_FIELDS) +FI_FINALIZER_NULLS_FIELDS=;SFP--1;CWE-710 +FI_FINALIZER_NULLS_FIELDSMsg=This finalizer nulls out fields. This is usually an error, as it does not aid garbage collection, and the object is going to be garbage collected anyway. + +#FI: Finalizer only nulls fields (FI_FINALIZER_ONLY_NULLS_FIELDS) +FI_FINALIZER_ONLY_NULLS_FIELDS=;SFP--1;CWE-710 +FI_FINALIZER_ONLY_NULLS_FIELDSMsg=This finalizer does nothing except null out fields. This is completely pointless, and requires that the object be garbage collected, finalized, and then garbage collected again. You should just remove the finalize method. + +#FI: Finalizer does not call superclass finalizer (FI_MISSING_SUPER_CALL) +FI_MISSING_SUPER_CALL=;SFP-28;CWE-586 +FI_MISSING_SUPER_CALLMsg=This finalize() method does not make a call to its superclass's finalize() method. So, any finalizer actions defined for the superclass will not be performed. Add a call to super.finalize(). + +#FI: Finalizer nullifies superclass finalizer (FI_NULLIFY_SUPER) +FI_NULLIFY_SUPER=;SFP--1;CWE-710 +FI_NULLIFY_SUPERMsg=This empty finalize() method explicitly negates the effect of any finalizer defined by its superclass. Any finalizer actions defined for the superclass will not be performed. Unless this is intended, delete this method. + +#FI: Finalizer does nothing but call superclass finalizer (FI_USELESS) +FI_USELESS=;SFP--1;CWE-710 +FI_USELESSMsg=The only thing this finalize() method does is call the superclass's finalize() method, making it redundant. Delete it. + +#GC: Unchecked type in generic call (GC_UNCHECKED_TYPE_IN_GENERIC_CALL) +GC_UNCHECKED_TYPE_IN_GENERIC_CALL=;SFP--1;CWE-710 +GC_UNCHECKED_TYPE_IN_GENERIC_CALLMsg=This call to a generic collection method passes an argument while compile type Object where a specific type from the generic type parameters is expected. Thus, neither the standard Java type system nor static analysis can provide useful information on whether the object being passed as a parameter is of an appropriate type. + +#HE: Class defines equals() but not hashCode() (HE_EQUALS_NO_HASHCODE) +HE_EQUALS_NO_HASHCODE=;SFP--1;CWE-581 +HE_EQUALS_NO_HASHCODEMsg=This class overrides equals(Object), but does not override hashCode(). Therefore, the class may violate the invariant that equal objects must have equal hashcodes. + +#HE: Class defines equals() and uses Object.hashCode() (HE_EQUALS_USE_HASHCODE) +HE_EQUALS_USE_HASHCODE=;SFP--1;CWE-581 +HE_EQUALS_USE_HASHCODEMsg=This class overrides equals(Object), but does not override hashCode(), and inherits the implementation of hashCode() from java.lang.Object (which returns the identity hash code, an arbitrary value assigned to the object by the VM). Therefore, the class is very likely to violate the invariant that equal objects must have equal hashcodes. + +#HE: Class defines hashCode() but not equals() (HE_HASHCODE_NO_EQUALS) +HE_HASHCODE_NO_EQUALS=;SFP--1;CWE-581 +HE_HASHCODE_NO_EQUALSMsg=This class defines a hashCode() method but not an equals() method. Therefore, the class may violate the invariant that equal objects must have equal hashcodes. + +#HE: Class defines hashCode() and uses Object.equals() (HE_HASHCODE_USE_OBJECT_EQUALS) +HE_HASHCODE_USE_OBJECT_EQUALS=;SFP--1;CWE-581 +HE_HASHCODE_USE_OBJECT_EQUALSMsg=This class defines a hashCode() method but inherits its equals() method from java.lang.Object (which defines equality by comparing object references). Although this will probably satisfy the contract that equal objects must have equal hashcodes, it is probably not what was intended by overriding the hashCode() method. (Overriding hashCode() implies that the object's identity is based on criteria more complicated than simple reference equality.) + +#HE: Class inherits equals() and uses Object.hashCode() (HE_INHERITS_EQUALS_USE_HASHCODE) +HE_INHERITS_EQUALS_USE_HASHCODE=;SFP--1;CWE-581 +HE_INHERITS_EQUALS_USE_HASHCODEMsg=This class inherits equals(Object) from an abstract superclass, and hashCode() from java.lang.Object (which returns the identity hash code, an arbitrary value assigned to the object by the VM). Therefore, the class is very likely to violate the invariant that equal objects must have equal hashcodes. + +#IC: Superclass uses subclass during initialization (IC_SUPERCLASS_USES_SUBCLASS_DURING_INITIALIZATION) +IC_SUPERCLASS_USES_SUBCLASS_DURING_INITIALIZATION=;SFP--1;CWE-710 +IC_SUPERCLASS_USES_SUBCLASS_DURING_INITIALIZATIONMsg=During the initialization of a class, the class makes an active use of a subclass. That subclass will not yet be initialized at the time of this use. + +#IMSE: Dubious catching of IllegalMonitorStateException (IMSE_DONT_CATCH_IMSE) +IMSE_DONT_CATCH_IMSE=;SFP--1;CWE-398 +IMSE_DONT_CATCH_IMSEMsg=IllegalMonitorStateException is generally only thrown in case of a design flaw in your code (calling wait or notify on an object you do not hold a lock on). + +#ISC: Needless instantiation of class that only supplies static methods (ISC_INSTANTIATE_STATIC_CLASS) +ISC_INSTANTIATE_STATIC_CLASS=;SFP--1;CWE-710 +ISC_INSTANTIATE_STATIC_CLASSMsg=This class allocates an object that is based on a class that only supplies static methods. This object does not need to be created, just access the static methods directly using the class name as a qualifier. + +#It: Iterator next() method can't throw NoSuchElementException (IT_NO_SUCH_ELEMENT) +IT_NO_SUCH_ELEMENT=;SFP--1;CWE-710 +IT_NO_SUCH_ELEMENTMsg=This class implements the java.util.Iterator interface. However, its next() method is not capable of throwing java.util.NoSuchElementException. The next() method should be changed so it throws NoSuchElementException if is called when there are no more elements to return. + +#J2EE: Store of non serializable object into HttpSession (J2EE_STORE_OF_NON_SERIALIZABLE_OBJECT_INTO_SESSION) +J2EE_STORE_OF_NON_SERIALIZABLE_OBJECT_INTO_SESSION=;SFP-1;CWE-579 +J2EE_STORE_OF_NON_SERIALIZABLE_OBJECT_INTO_SESSIONMsg=This code seems to be storing a non-serializable object into an HttpSession. If this session is passivated or migrated, an error will result. + +#JCIP: Fields of immutable classes should be final (JCIP_FIELD_ISNT_FINAL_IN_IMMUTABLE_CLASS) +JCIP_FIELD_ISNT_FINAL_IN_IMMUTABLE_CLASS=;SFP--1;CWE-710 +JCIP_FIELD_ISNT_FINAL_IN_IMMUTABLE_CLASSMsg=The class is annotated with net.jcip.annotations.Immutable, and the rules for that annotation require that all fields are final. . + +#NP: Method with Boolean return type returns explicit null (NP_BOOLEAN_RETURN_NULL) +NP_BOOLEAN_RETURN_NULL=;SFP-4;CWE-394 +NP_BOOLEAN_RETURN_NULLMsg=A method that returns either Boolean.TRUE, Boolean.FALSE or null is an accident waiting to happen. This method can be invoked as though it returned a value of type boolean, and the compiler will insert automatic unboxing of the Boolean value. If a null value is returned, this will result in a NullPointerException. + +#NP: Clone method may return null (NP_CLONE_COULD_RETURN_NULL) +NP_CLONE_COULD_RETURN_NULL=;SFP-4;CWE-394 +NP_CLONE_COULD_RETURN_NULLMsg=This clone method seems to return null in some circumstances, but clone is never allowed to return a null value. If you are convinced this path is unreachable, throw an AssertionError instead. + +#NP: equals() method does not check for null argument (NP_EQUALS_SHOULD_HANDLE_NULL_ARGUMENT) +NP_EQUALS_SHOULD_HANDLE_NULL_ARGUMENT=API;SFP--1;CWE-227 +NP_EQUALS_SHOULD_HANDLE_NULL_ARGUMENTMsg=This implementation of equals(Object) violates the contract defined by java.lang.Object.equals() because it does not check for null being passed as the argument. All equals() methods should return false if passed a null value. + +#NP: toString method may return null (NP_TOSTRING_COULD_RETURN_NULL) +NP_TOSTRING_COULD_RETURN_NULL=API;SFP--1;CWE-227 +NP_TOSTRING_COULD_RETURN_NULLMsg=This toString method seems to return null in some circumstances. A liberal reading of the spec could be interpreted as allowing this, but it is probably a bad idea and could cause other code to break. Return the empty string or some other appropriate string rather than null. + +#Nm: Class names should start with an upper case letter (NM_CLASS_NAMING_CONVENTION) +NM_CLASS_NAMING_CONVENTION=;SFP--1;CWE-710 +NM_CLASS_NAMING_CONVENTIONMsg=Class names should be nouns, in mixed case with the first letter of each internal word capitalized. Try to keep your class names simple and descriptive. Use whole words-avoid acronyms and abbreviations (unless the abbreviation is much more widely used than the long form, such as URL or HTML). + +#Nm: Class is not derived from an Exception, even though it is named as such (NM_CLASS_NOT_EXCEPTION) +NM_CLASS_NOT_EXCEPTION=;SFP--1;CWE-710 +NM_CLASS_NOT_EXCEPTIONMsg=This class is not derived from another exception, but ends with 'Exception'. This will be confusing to users of this class. + +#Nm: Confusing method names (NM_CONFUSING) +NM_CONFUSING=;SFP--1;CWE-710 +NM_CONFUSINGMsg=The referenced methods have names that differ only by capitalization. + +#Nm: Field names should start with a lower case letter (NM_FIELD_NAMING_CONVENTION) +NM_FIELD_NAMING_CONVENTION=;SFP--1;CWE-710 +NM_FIELD_NAMING_CONVENTIONMsg=Names of fields that are not final should be in mixed case with a lowercase first letter and the first letters of subsequent words capitalized. + +#Nm: Use of identifier that is a keyword in later versions of Java (NM_FUTURE_KEYWORD_USED_AS_IDENTIFIER) +NM_FUTURE_KEYWORD_USED_AS_IDENTIFIER=;SFP--1;CWE-710 +NM_FUTURE_KEYWORD_USED_AS_IDENTIFIERMsg=The identifier is a word that is reserved as a keyword in later versions of Java, and your code will need to be changed in order to compile it in later versions of Java. + +#Nm: Use of identifier that is a keyword in later versions of Java (NM_FUTURE_KEYWORD_USED_AS_MEMBER_IDENTIFIER) +NM_FUTURE_KEYWORD_USED_AS_MEMBER_IDENTIFIER=;SFP--1;CWE-710 +NM_FUTURE_KEYWORD_USED_AS_MEMBER_IDENTIFIERMsg=This identifier is used as a keyword in later versions of Java. This code, and any code that references this API, will need to be changed in order to compile it in later versions of Java. + +#Nm: Method names should start with a lower case letter (NM_METHOD_NAMING_CONVENTION) +NM_METHOD_NAMING_CONVENTION=;SFP--1;CWE-710 +NM_METHOD_NAMING_CONVENTIONMsg=Methods should be verbs, in mixed case with the first letter lowercase, with the first letter of each internal word capitalized. + +#Nm: Class names shouldn't shadow simple name of implemented interface (NM_SAME_SIMPLE_NAME_AS_INTERFACE) +NM_SAME_SIMPLE_NAME_AS_INTERFACE=;SFP--1;CWE-710 +NM_SAME_SIMPLE_NAME_AS_INTERFACEMsg=This class/interface has a simple name that is identical to that of an implemented/extended interface, except that the interface is in a different package (e.g., alpha.Foo extends beta.Foo). This can be exceptionally confusing, create lots of situations in which you have to look at import statements to resolve references and creates many opportunities to accidently define methods that do not override methods in their superclasses. + +#Nm: Class names shouldn't shadow simple name of superclass (NM_SAME_SIMPLE_NAME_AS_SUPERCLASS) +NM_SAME_SIMPLE_NAME_AS_SUPERCLASS=;SFP--1;CWE-710 +NM_SAME_SIMPLE_NAME_AS_SUPERCLASSMsg=This class has a simple name that is identical to that of its superclass, except that its superclass is in a different package (e.g., alpha.Foo extends beta.Foo). This can be exceptionally confusing, create lots of situations in which you have to look at import statements to resolve references and creates many opportunities to accidently define methods that do not override methods in their superclasses. + +#Nm: Very confusing method names (but perhaps intentional) (NM_VERY_CONFUSING_INTENTIONAL) +NM_VERY_CONFUSING_INTENTIONAL=;SFP--1;CWE-710 +NM_VERY_CONFUSING_INTENTIONALMsg=The referenced methods have names that differ only by capitalization. This is very confusing because if the capitalization were identical then one of the methods would override the other. From the existence of other methods, it seems that the existence of both of these methods is intentional, but is sure is confusing. You should try hard to eliminate one of them, unless you are forced to have both due to frozen APIs. + +#Nm: Method doesn't override method in superclass due to wrong package for parameter (NM_WRONG_PACKAGE_INTENTIONAL) +NM_WRONG_PACKAGE_INTENTIONAL=;SFP--1;CWE-710 +NM_WRONG_PACKAGE_INTENTIONALMsg=The method in the subclass doesn't override a similar method in a superclass because the type of a parameter doesn't exactly match the type of the corresponding parameter in the superclass. + +#ODR: Method may fail to close database resource (ODR_OPEN_DATABASE_RESOURCE) +ODR_OPEN_DATABASE_RESOURCE=;SFP-14;CWE-772 +ODR_OPEN_DATABASE_RESOURCEMsg=The method creates a database resource (such as a database connection or row set), does not assign it to any fields, pass it to other methods, or return it, and does not appear to close the object on all paths out of the method. Failure to close database resources on all paths out of a method may result in poor performance, and could cause the application to have problems communicating with the database. + +#ODR: Method may fail to close database resource on exception (ODR_OPEN_DATABASE_RESOURCE_EXCEPTION_PATH) +ODR_OPEN_DATABASE_RESOURCE_EXCEPTION_PATH=;SFP-14;CWE-772 +ODR_OPEN_DATABASE_RESOURCE_EXCEPTION_PATHMsg=The method creates a database resource (such as a database connection or row set), does not assign it to any fields, pass it to other methods, or return it, and does not appear to close the object on all exception paths out of the method. Failure to close database resources on all paths out of a method may result in poor performance, and could cause the application to have problems communicating with the database. + +#OS: Method may fail to close stream (OS_OPEN_STREAM) +OS_OPEN_STREAM=;SFP-14;CWE-772 +OS_OPEN_STREAMMsg=The method creates an IO stream object, does not assign it to any fields, pass it to other methods that might close it, or return it, and does not appear to close the stream on all paths out of the method. This may result in a file descriptor leak. It is generally a good idea to use a finally block to ensure that streams are closed. + +#OS: Method may fail to close stream on exception (OS_OPEN_STREAM_EXCEPTION_PATH) +OS_OPEN_STREAM_EXCEPTION_PATH=;SFP-14;CWE-772 +OS_OPEN_STREAM_EXCEPTION_PATHMsg=The method creates an IO stream object, does not assign it to any fields, pass it to other methods, or return it, and does not appear to close it on all possible exception paths out of the method. This may result in a file descriptor leak. It is generally a good idea to use a finally block to ensure that streams are closed. + +#RC: Suspicious reference comparison to constant (RC_REF_COMPARISON_BAD_PRACTICE) +RC_REF_COMPARISON_BAD_PRACTICE=;SFP--1;CWE-480 +RC_REF_COMPARISON_BAD_PRACTICEMsg=This method compares a reference value to a constant using the == or != operator, where the correct way to compare instances of this type is generally with the equals() method. It is possible to create distinct instances that are equal but do not compare as == since they are different objects. Examples of classes which should generally not be compared by reference are java.lang.Integer, java.lang.Float, etc. + +#RC: Suspicious reference comparison of Boolean values (RC_REF_COMPARISON_BAD_PRACTICE_BOOLEAN) +RC_REF_COMPARISON_BAD_PRACTICE_BOOLEAN=;SFP--1;CWE-480 +RC_REF_COMPARISON_BAD_PRACTICE_BOOLEANMsg=This method compares two Boolean values using the == or != operator. Normally, there are only two Boolean values (Boolean.TRUE and Boolean.FALSE), but it is possible to create other Boolean objects using the new Boolean(b) constructor. It is best to avoid such objects, but if they do exist, then checking Boolean objects for equality using == or != will give results than are different than you would get using .equals(...) + +#RR: Method ignores results of InputStream.read() (RR_NOT_CHECKED) +RR_NOT_CHECKED=;SFP-4;CWE-252 +RR_NOT_CHECKEDMsg=This method ignores the return value of one of the variants of java.io.InputStream.read() which can return multiple bytes. If the return value is not checked, the caller will not be able to correctly handle the case where fewer bytes were read than the caller requested. This is a particularly insidious kind of bug, because in many programs, reads from input streams usually do read the full amount of data requested, causing the program to fail only sporadically. + +#RR: Method ignores results of InputStream.skip() (SR_NOT_CHECKED) +SR_NOT_CHECKED=;SFP-4;CWE-252 +SR_NOT_CHECKEDMsg=This method ignores the return value of java.io.InputStream.skip() which can skip multiple bytes. If the return value is not checked, the caller will not be able to correctly handle the case where fewer bytes were skipped than the caller requested. This is a particularly insidious kind of bug, because in many programs, skips from input streams usually do skip the full amount of data requested, causing the program to fail only sporadically. With Buffered streams, however, skip() will only skip data in the buffer, and will routinely fail to skip the requested number of bytes. + +#RV: Method ignores exceptional return value (RV_RETURN_VALUE_IGNORED_BAD_PRACTICE) +RV_RETURN_VALUE_IGNORED_BAD_PRACTICE=;SFP-4;CWE-252 +RV_RETURN_VALUE_IGNORED_BAD_PRACTICEMsg=This method returns a value that is not checked. The return value should be checked since it can indicate an unusual or unexpected function execution. For example, the File.delete() method returns false if the file could not be successfully deleted (rather than throwing an Exception). If you don't check the result, you won't notice if the method invocation signals unexpected behavior by returning an atypical return value. + +#SI: Static initializer creates instance before all static final fields assigned (SI_INSTANCE_BEFORE_FINALS_ASSIGNED) +SI_INSTANCE_BEFORE_FINALS_ASSIGNED=;SFP-1;CWE-456 +SI_INSTANCE_BEFORE_FINALS_ASSIGNEDMsg=The class's static initializer creates an instance of the class before all of the static final fields are assigned. + +#SW: Certain swing methods needs to be invoked in Swing thread (SW_SWING_METHODS_INVOKED_IN_SWING_THREAD) +SW_SWING_METHODS_INVOKED_IN_SWING_THREAD=API;SFP--1;CWE-684 +SW_SWING_METHODS_INVOKED_IN_SWING_THREADMsg=The Swing methods show(), setVisible(), and pack() will create the associated peer for the frame. With the creation of the peer, the system creates the event dispatch thread. This makes things problematic because the event dispatch thread could be notifying listeners while pack and validate are still processing. This situation could result in two threads going through the Swing component-based GUI -- it's a serious flaw that could result in deadlocks or other related threading issues. A pack call causes components to be realized. As they are being realized (that is, not necessarily visible), they could trigger listener notification on the event dispatch thread. + +#Se: Non-transient non-serializable instance field in serializable class (SE_BAD_FIELD) +SE_BAD_FIELD=API;SFP--1;CWE-684 +SE_BAD_FIELDMsg=This Serializable class defines a non-primitive instance field which is neither transient, Serializable, or java.lang.Object, and does not appear to implement the Externalizable interface or the readObject() and writeObject() methods. Objects of this class will not be deserialized correctly if a non-Serializable object is stored in this field. + +#Se: Non-serializable class has a serializable inner class (SE_BAD_FIELD_INNER_CLASS) +SE_BAD_FIELD_INNER_CLASS=API;SFP--1;CWE-684 +SE_BAD_FIELD_INNER_CLASSMsg=This Serializable class is an inner class of a non-serializable class. Thus, attempts to serialize it will also attempt to associate instance of the outer class with which it is associated, leading to a runtime error. If possible, making the inner class a static inner class should solve the problem. Making the outer class serializable might also work, but that would mean serializing an instance of the inner class would always also serialize the instance of the outer class, which it often not what you really want. + +#Se: Non-serializable value stored into instance field of a serializable class (SE_BAD_FIELD_STORE) +SE_BAD_FIELD_STORE=API;SFP--1;CWE-684 +SE_BAD_FIELD_STOREMsg=A non-serializable value is stored into a non-transient field of a serializable class. + +#Se: Comparator doesn't implement Serializable (SE_COMPARATOR_SHOULD_BE_SERIALIZABLE) +SE_COMPARATOR_SHOULD_BE_SERIALIZABLE=;SFP--1;CWE-710 +SE_COMPARATOR_SHOULD_BE_SERIALIZABLEMsg=This class implements the Comparator interface. You should consider whether or not it should also implement the Serializable interface. If a comparator is used to construct an ordered collection such as a TreeMap, then the TreeMap will be serializable only if the comparator is also serializable. As most comparators have little or no state, making them serializable is generally easy and good defensive programming. + +#Se: Serializable inner class (SE_INNER_CLASS) +SE_INNER_CLASS=API;SFP--1;CWE-684 +SE_INNER_CLASSMsg=This Serializable class is an inner class. Any attempt to serialize it will also serialize the associated outer instance. The outer instance is serializable, so this won't fail, but it might serialize a lot more data than intended. If possible, making the inner class a static inner class (also known as a nested class) should solve the problem. + +#Se: serialVersionUID isn't final (SE_NONFINAL_SERIALVERSIONID) +SE_NONFINAL_SERIALVERSIONID=;SFP--1;CWE-710 +SE_NONFINAL_SERIALVERSIONIDMsg=This class defines a serialVersionUID field that is not final. The field should be made final if it is intended to specify the version UID for purposes of serialization. + +#Se: serialVersionUID isn't long (SE_NONLONG_SERIALVERSIONID) +SE_NONLONG_SERIALVERSIONID=;SFP--1;CWE-710 +SE_NONLONG_SERIALVERSIONIDMsg=This class defines a serialVersionUID field that is not long. The field should be made long if it is intended to specify the version UID for purposes of serialization. + +#Se: serialVersionUID isn't static (SE_NONSTATIC_SERIALVERSIONID) +SE_NONSTATIC_SERIALVERSIONID=;SFP--1;CWE-710 +SE_NONSTATIC_SERIALVERSIONIDMsg=This class defines a serialVersionUID field that is not static. The field should be made static if it is intended to specify the version UID for purposes of serialization. + +#Se: Class is Serializable but its superclass doesn't define a void constructor (SE_NO_SUITABLE_CONSTRUCTOR) +SE_NO_SUITABLE_CONSTRUCTOR=API;SFP--1;CWE-684 +SE_NO_SUITABLE_CONSTRUCTORMsg=This class implements the Serializable interface and its superclass does not. When such an object is deserialized, the fields of the superclass need to be initialized by invoking the void constructor of the superclass. Since the superclass does not have one, serialization and deserialization will fail at runtime. + +#Se: Class is Externalizable but doesn't define a void constructor (SE_NO_SUITABLE_CONSTRUCTOR_FOR_EXTERNALIZATION) +SE_NO_SUITABLE_CONSTRUCTOR_FOR_EXTERNALIZATION=API;SFP--1;CWE-684 +SE_NO_SUITABLE_CONSTRUCTOR_FOR_EXTERNALIZATIONMsg=This class implements the Externalizable interface, but does not define a void constructor. When Externalizable objects are deserialized, they first need to be constructed by invoking the void constructor. Since this class does not have one, serialization and deserialization will fail at runtime. + +#Se: The readResolve method must be declared with a return type of Object. (SE_READ_RESOLVE_MUST_RETURN_OBJECT) +SE_READ_RESOLVE_MUST_RETURN_OBJECT=API;SFP--1;CWE-684 +SE_READ_RESOLVE_MUST_RETURN_OBJECTMsg=In order for the readResolve method to be recognized by the serialization mechanism, it must be declared to have a return type of Object. + +#Se: Transient field that isn't set by deserialization. (SE_TRANSIENT_FIELD_NOT_RESTORED) +SE_TRANSIENT_FIELD_NOT_RESTORED=API;SFP--1;CWE-684 +SE_TRANSIENT_FIELD_NOT_RESTOREDMsg=This class contains a field that is updated at multiple places in the class, thus it seems to be part of the state of the class. However, since the field is marked as transient and not set in readObject or readResolve, it will contain the default value in any deserialized instance of the class. + +#SnVI: Class is Serializable, but doesn't define serialVersionUID (SE_NO_SERIALVERSIONID) +SE_NO_SERIALVERSIONID=API;SFP--1;CWE-684 +SE_NO_SERIALVERSIONIDMsg=This class implements the Serializable interface, but does not define a serialVersionUID field. A change as simple as adding a reference to a .class object will add synthetic fields to the class, which will unfortunately change the implicit serialVersionUID (e.g., adding a reference to String.class will generate a static field class$java$lang$String). Also, different source code to bytecode compilers may use different naming conventions for synthetic variables generated for references to class objects or inner classes. To ensure interoperability of Serializable across versions, consider adding an explicit serialVersionUID. + +#UI: Usage of GetResource may be unsafe if class is extended (UI_INHERITANCE_UNSAFE_GETRESOURCE) +UI_INHERITANCE_UNSAFE_GETRESOURCE=;SFP-3;CWE-676 +UI_INHERITANCE_UNSAFE_GETRESOURCEMsg=Calling this.getClass().getResource(...) could give results other than expected if this class is extended by a class in another package. + +#BC: Impossible cast (BC_IMPOSSIBLE_CAST) +BC_IMPOSSIBLE_CAST=;SFP-1;CWE-704 +BC_IMPOSSIBLE_CASTMsg=This cast will always throw a ClassCastException. FindBugs tracks type information from instanceof checks, and also uses more precise information about the types of values returned from methods and loaded from fields. Thus, it may have more precise information that just the declared type of a variable, and can use this to determine that a cast will always throw an exception at runtime. + +#BC: Impossible downcast (BC_IMPOSSIBLE_DOWNCAST) +BC_IMPOSSIBLE_DOWNCAST=;SFP-1;CWE-704 +BC_IMPOSSIBLE_DOWNCASTMsg=This cast will always throw a ClassCastException. The analysis believes it knows the precise type of the value being cast, and the attempt to downcast it to a subtype will always fail by throwing a ClassCastException. + +BC: Impossible downcast of toArray() result (BC_IMPOSSIBLE_DOWNCAST_OF_TOARRAY) +BC_IMPOSSIBLE_DOWNCAST_OF_TOARRAY=;SFP-1;CWE-704 +BC_IMPOSSIBLE_DOWNCAST_OF_TOARRAYMsg=This code is casting the result of calling toArray() on a collection to a type more specific than Object[] + +#BC: instanceof will always return false (BC_IMPOSSIBLE_INSTANCEOF) +BC_IMPOSSIBLE_INSTANCEOF=;SFP-1;CWE-570 +BC_IMPOSSIBLE_INSTANCEOFMsg=This instanceof test will always return false. Although this is safe, make sure it isn't an indication of some misunderstanding or some other logic error. + +#BIT: Bitwise add of signed byte value (BIT_ADD_OF_SIGNED_BYTE) +BIT_ADD_OF_SIGNED_BYTE=;SFP-1;CWE-194 +BIT_ADD_OF_SIGNED_BYTEMsg=Adds a byte value and a value which is known to the 8 lower bits clear. Values loaded from a byte array are sign extended to 32 bits before any any bitwise operations are performed on the value. Thus, if b[0] contains the value 0xff, and x is initially 0, then the code ((x << 8) + b[0]) will sign extend 0xff to get 0xffffffff, and thus give the value 0xffffffff as the result. + +#BIT: Incompatible bit masks (BIT_AND) +BIT_AND=;SFP-1;CWE-570 +BIT_ANDMsg=This method compares an expression of the form (e & C) to D, which will always compare unequal due to the specific values of constants C and D. This may indicate a logic error or typo. + +#BIT: Check to see if ((...) & 0) == 0 (BIT_AND_ZZ) +BIT_AND_ZZ=;SFP-1;CWE-571 +BIT_AND_ZZMsg=This method compares an expression of the form (e & 0) to 0, which will always compare equal. This may indicate a logic error or typo. + +#BIT: Incompatible bit masks (BIT_IOR) +BIT_IOR=;SFP-1;CWE-570 +BIT_IORMsg=This method compares an expression of the form (e | C) to D. which will always compare unequal due to the specific values of constants C and D. This may indicate a logic error or typo. Typically, this bug occurs because the code wants to perform a membership test in a bit set, but uses the bitwise OR operator ("|") instead of bitwise AND ("&"). + +#BIT: Bitwise OR of signed byte value (BIT_IOR_OF_SIGNED_BYTE) +BIT_IOR_OF_SIGNED_BYTE=;SFP-1;CWE-194 +BIT_IOR_OF_SIGNED_BYTEMsg=Loads a value from a byte array and performs a bitwise OR with that value. Values loaded from a byte array are sign extended to 32 bits before any any bitwise operations are performed on the value. Thus, if b[0] contains the value 0xff, and x is initially 0, then the code ((x << 8) | b[0]) will sign extend 0xff to get 0xffffffff, and thus give the value 0xffffffff as the result. + +#BIT: Check for sign of bitwise operation (BIT_SIGNED_CHECK_HIGH_BIT) +BIT_SIGNED_CHECK_HIGH_BIT=;SFP-1;CWE-195 +BIT_SIGNED_CHECK_HIGH_BITMsg=This method compares an expression such as ((event.detail & SWT.SELECTED) > 0). Using bit arithmetic and then comparing with the greater than operator can lead to unexpected results (of course depending on the value of SWT.SELECTED). If SWT.SELECTED is a negative number, this is a candidate for a bug. Even when SWT.SELECTED is not negative, it seems good practice to use '!= 0' instead of '> 0'. + +#BOA: Class overrides a method implemented in super class Adapter wrongly (BOA_BADLY_OVERRIDDEN_ADAPTER) +BOA_BADLY_OVERRIDDEN_ADAPTER=;SFP--1;CWE-710 +BOA_BADLY_OVERRIDDEN_ADAPTERMsg=This method overrides a method found in a parent class, where that class is an Adapter that implements a listener defined in the java.awt.event or javax.swing.event package. As a result, this method will not get called when the event occurs. + +#BSHIFT: 32 bit int shifted by an amount not in the range 0..31 (ICAST_BAD_SHIFT_AMOUNT) +ICAST_BAD_SHIFT_AMOUNT=;SFP-1;CWE-682 +ICAST_BAD_SHIFT_AMOUNTMsg=The code performs shift of a 32 bit int by a constant amount outside the range 0..31. The effect of this is to use the lower 5 bits of the integer value to decide how much to shift by (e.g., shifting by 40 bits is the same as shifting by 8 bits, and shifting by 32 bits is the same as shifting by zero bits). This probably isn't want was expected, and it at least confusing. + +#Bx: Primitive value is unboxed and coerced for ternary operator (BX_UNBOXED_AND_COERCED_FOR_TERNARY_OPERATOR) +BX_UNBOXED_AND_COERCED_FOR_TERNARY_OPERATOR=;SFP--1;CWE-192 +BX_UNBOXED_AND_COERCED_FOR_TERNARY_OPERATORMsg=A wrapped primitive value is unboxed and converted to another primitive type as part of the evaluation of a conditional ternary operator (the b ? e1 : e2 operator). The semantics of Java mandate that if e1 and e2 are wrapped numeric values, the values are unboxed and converted/coerced to their common type (e.g, if e1 is of type Integer and e2 is of type Float, then e1 is unboxed, converted to a floating point value, and boxed. See JLS Section 15.25. + +#DLS: Dead store of class literal (DLS_DEAD_STORE_OF_CLASS_LITERAL) +DLS_DEAD_STORE_OF_CLASS_LITERAL=;SFP-2;CWE-563 +DLS_DEAD_STORE_OF_CLASS_LITERALMsg=This instruction assigns a class literal to a variable and then never uses it. The behavior of this differs in Java 1.4 and in Java 5. In Java 1.4 and earlier, a reference to Foo.class would force the static initializer for Foo to be executed, if it has not been executed already. In Java 5 and later, it does not.See Sun's article on Java SE compatibility for more details and examples, and suggestions on how to force class initialization in Java 5. + +#DLS: Overwritten increment (DLS_OVERWRITTEN_INCREMENT) +DLS_OVERWRITTEN_INCREMENT=;SFP--1;CWE-398 +DLS_OVERWRITTEN_INCREMENTMsg=The code performs an increment operation (e.g., i++) and then immediately overwrites it. For example, i = i++ immediately overwrites the incremented value with the original value. + +#DMI: Bad constant value for month (DMI_BAD_MONTH) +DMI_BAD_MONTH=;SFP-1;CWE-682 +DMI_BAD_MONTHMsg=This code passes a constant month value outside the expected range of 0..11 to a method. + +#DMI: hasNext method invokes next (DMI_CALLING_NEXT_FROM_HASNEXT) +DMI_CALLING_NEXT_FROM_HASNEXT=;SFP--1;CWE-398 +DMI_CALLING_NEXT_FROM_HASNEXTMsg=The hasNext() method invokes the next() method. This is almost certainly wrong, since the hasNext() method is not supposed to change the state of the iterator, and the next method is supposed to change the state of the iterator. + +#DMI: Collections should not contain themselves (DMI_COLLECTIONS_SHOULD_NOT_CONTAIN_THEMSELVES) +DMI_COLLECTIONS_SHOULD_NOT_CONTAIN_THEMSELVES=;SFP--1;CWE-687 +DMI_COLLECTIONS_SHOULD_NOT_CONTAIN_THEMSELVESMsg=This call to a generic collection's method would only make sense if a collection contained itself (e.g., if s.contains(s) were true). This is unlikely to be true and would cause problems if it were true (such as the computation of the hash code resulting in infinite recursion). It is likely that the wrong value is being passed as a parameter. + +#DMI: Invocation of hashCode on an array (DMI_INVOKING_HASHCODE_ON_ARRAY) +DMI_INVOKING_HASHCODE_ON_ARRAY=;SFP--1;CWE-398 +DMI_INVOKING_HASHCODE_ON_ARRAYMsg=The code invokes hashCode on an array. Calling hashCode on an array returns the same value as System.identityHashCode, and ingores the contents and length of the array. If you need a hashCode that depends on the contents of an array a, use java.util.Arrays.hashCode(a). + +#DMI: hasNext method invokes next (DMI_CALLING_NEXT_FROM_HASNEXT) +DMI_LONG_BITS_TO_DOUBLE_INVOKED_ON_INT=;SFP--1;CWE-686 +DMI_LONG_BITS_TO_DOUBLE_INVOKED_ON_INTMsg=The Double.longBitsToDouble method is invoked, but a 32 bit int value is passed as an argument. This almostly certainly is not intended and is unlikely to give the intended result. + +#DMI: Vacuous call to collections (DMI_VACUOUS_SELF_COLLECTION_CALL) +DMI_VACUOUS_SELF_COLLECTION_CALL=;SFP--1;CWE-687 +DMI_VACUOUS_SELF_COLLECTION_CALLMsg=This call doesn't make sense. For any collection c, calling c.containsAll(c) should always be true, and c.retainAll(c) should have no effect. + +#Dm: Can't use reflection to check for presence of annotation without runtime retention (DMI_ANNOTATION_IS_NOT_VISIBLE_TO_REFLECTION) +DMI_ANNOTATION_IS_NOT_VISIBLE_TO_REFLECTION=;SFP--1;CWE-710 +DMI_ANNOTATION_IS_NOT_VISIBLE_TO_REFLECTIONMsg=Unless an annotation has itself been annotated with @Retention(RetentionPolicy.RUNTIME), the annotation can't be observed using reflection (e.g., by using the isAnnotationPresent method). + +#Dm: Futile attempt to change max pool size of ScheduledThreadPoolExecutor (DMI_FUTILE_ATTEMPT_TO_CHANGE_MAXPOOL_SIZE_OF_SCHEDULED_THREAD_POOL_EXECUTOR) +DMI_FUTILE_ATTEMPT_TO_CHANGE_MAXPOOL_SIZE_OF_SCHEDULED_THREAD_POOL_EXECUTOR=;SFP--1;CWE-398 +DMI_FUTILE_ATTEMPT_TO_CHANGE_MAXPOOL_SIZE_OF_SCHEDULED_THREAD_POOL_EXECUTORMsg=While ScheduledThreadPoolExecutor inherits from ThreadPoolExecutor, a few of the inherited tuning methods are not useful for it. In particular, because it acts as a fixed-sized pool using corePoolSize threads and an unbounded queue, adjustments to maximumPoolSize have no useful effect. + +#Dm: Creation of ScheduledThreadPoolExecutor with zero core threads (DMI_SCHEDULED_THREAD_POOL_EXECUTOR_WITH_ZERO_CORE_THREADS) +DMI_SCHEDULED_THREAD_POOL_EXECUTOR_WITH_ZERO_CORE_THREADS=;SFP--1;CWE-398 +DMI_SCHEDULED_THREAD_POOL_EXECUTOR_WITH_ZERO_CORE_THREADSMsg=A ScheduledThreadPoolExecutor with zero core threads will never execute anything; changes to the max pool size are ignored. + +#Dm: Useless/vacuous call to EasyMock method (DMI_VACUOUS_CALL_TO_EASYMOCK_METHOD) +DMI_VACUOUS_CALL_TO_EASYMOCK_METHOD=;SFP--1;CWE-398 +DMI_VACUOUS_CALL_TO_EASYMOCK_METHODMsg=This call doesn't pass any objects to the EasyMock method, so the call doesn't do anything. + +#EC: equals() used to compare array and nonarray (EC_ARRAY_AND_NONARRAY) +EC_ARRAY_AND_NONARRAY=;SFP-1;CWE-570 +EC_ARRAY_AND_NONARRAYMsg=This method invokes the .equals(Object o) to compare an array and a reference that doesn't seem to be an array. If things being compared are of different types, they are guaranteed to be unequal and the comparison is almost certainly an error. Even if they are both arrays, the equals method on arrays only determines of the two arrays are the same object. To compare the contents of the arrays, use java.util.Arrays.equals(Object[], Object[]). + +#EC: Invocation of equals() on an array, which is equivalent to == (EC_BAD_ARRAY_COMPARE) +EC_BAD_ARRAY_COMPARE=;SFP-1;CWE-570 +EC_BAD_ARRAY_COMPAREMsg=This method invokes the .equals(Object o) method on an array. Since arrays do not override the equals method of Object, calling equals on an array is the same as comparing their addresses. To compare the contents of the arrays, use java.util.Arrays.equals(Object[], Object[]). To compare the addresses of the arrays, it would be less confusing to explicitly pointer equality using ==. + +#EC: equals(...) used to compare incompatible arrays (EC_INCOMPATIBLE_ARRAY_COMPARE) +EC_INCOMPATIBLE_ARRAY_COMPARE=;SFP-1;CWE-570 +EC_INCOMPATIBLE_ARRAY_COMPAREMsg=This method invokes the .equals(Object o) to compare two arrays, but the arrays of of incompatible types (e.g., String[] and StringBuffer[], or String[] and int[]). They will never be equal. In addition, when equals(...) is used to compare arrays it only checks to see if they are the same array, and ignores the contents of the arrays. + +#EC: Call to equals() with null argument (EC_NULL_ARG) +EC_NULL_ARG=;SFP-1;CWE-570 +EC_NULL_ARGMsg=This method calls equals(Object), passing a null value as the argument. According to the contract of the equals() method, this call should always return false. + +#EC: Call to equals() comparing unrelated class and interface (EC_UNRELATED_CLASS_AND_INTERFACE) +EC_UNRELATED_CLASS_AND_INTERFACE=;SFP-1;CWE-570 +EC_UNRELATED_CLASS_AND_INTERFACEMsg=This method calls equals(Object) on two references, one of which is a class and the other an interface, where neither the class nor any of its non-abstract subclasses implement the interface. Therefore, the objects being compared are unlikely to be members of the same class at runtime (unless some application classes were not analyzed, or dynamic class loading can occur at runtime). According to the contract of equals(), objects of different classes should always compare as unequal; therefore, according to the contract defined by java.lang.Object.equals(Object), the result of this comparison will always be false at runtime. + +#EC: Call to equals() comparing different interface types (EC_UNRELATED_INTERFACES) +EC_UNRELATED_INTERFACES=;SFP-1;CWE-570 +EC_UNRELATED_INTERFACESMsg=This method calls equals(Object) on two references of unrelated interface types, where neither is a subtype of the other, and there are no known non-abstract classes which implement both interfaces. Therefore, the objects being compared are unlikely to be members of the same class at runtime (unless some application classes were not analyzed, or dynamic class loading can occur at runtime). According to the contract of equals(), objects of different classes should always compare as unequal; therefore, according to the contract defined by java.lang.Object.equals(Object), the result of this comparison will always be false at runtime. + +#EC: Call to equals() comparing different types (EC_UNRELATED_TYPES) +EC_UNRELATED_TYPES=;SFP-1;CWE-570 +EC_UNRELATED_TYPESMsg=This method calls equals(Object) on two references of different class types with no common subclasses. Therefore, the objects being compared are unlikely to be members of the same class at runtime (unless some application classes were not analyzed, or dynamic class loading can occur at runtime). According to the contract of equals(), objects of different classes should always compare as unequal; therefore, according to the contract defined by java.lang.Object.equals(Object), the result of this comparison will always be false at runtime. + +#EC: Using pointer equality to compare different types (EC_UNRELATED_TYPES_USING_POINTER_EQUALITY) +EC_UNRELATED_TYPES_USING_POINTER_EQUALITY=;SFP-1;CWE-570 +EC_UNRELATED_TYPES_USING_POINTER_EQUALITYMsg=This method uses using pointer equality to compare two references that seem to be of different types. The result of this comparison will always be false at runtime. + +#Eq: equals method always returns false (EQ_ALWAYS_FALSE) +EQ_ALWAYS_FALSE=;SFP-1;CWE-570 +EQ_ALWAYS_FALSEMsg=This class defines an equals method that always returns false. This means that an object is not equal to itself, and it is impossible to create useful Maps or Sets of this class. More fundamentally, it means that equals is not reflexive, one of the requirements of the equals method. The likely intended semantics are object identity: that an object is equal to itself. This is the behavior inherited from class Object. If you need to override an equals inherited from a different superclass, you can use use: public boolean equals(Object o) { return this == o; } + +#Eq: equals method always returns true (EQ_ALWAYS_TRUE) +EQ_ALWAYS_TRUE=;SFP-1;CWE-571 +EQ_ALWAYS_TRUEMsg=This class defines an equals method that always returns true. This is imaginative, but not very smart. Plus, it means that the equals method is not symmetric. + +#Eq: equals method compares class names rather than class objects (EQ_COMPARING_CLASS_NAMES) +EQ_COMPARING_CLASS_NAMES=;SFP-1;CWE-486 +EQ_COMPARING_CLASS_NAMESMsg=This method checks to see if two objects are the same class by checking to see if the names of their classes are equal. You can have different classes with the same name if they are loaded by different class loaders. Just check to see if the class objects are the same. + +#Eq: Covariant equals() method defined for enum (EQ_DONT_DEFINE_EQUALS_FOR_ENUM) +EQ_DONT_DEFINE_EQUALS_FOR_ENUM=;SFP--1;CWE-710 +EQ_DONT_DEFINE_EQUALS_FOR_ENUMMsg=This class defines an enumeration, and equality on enumerations are defined using object identity. Defining a covariant equals method for an enumeration value is exceptionally bad practice, since it would likely result in having two different enumeration values that compare as equals using the covariant enum method, and as not equal when compared normally. Don't do it. + +#Eq: equals() method defined that doesn't override equals(Object) (EQ_other_NO_OBJECT) +EQ_other_NO_OBJECT=;SFP-1;CWE-581 +EQ_other_NO_OBJECTMsg=This class defines an equals() method, that doesn't override the normal equals(Object) method defined in the base java.lang.Object class. Instead, it inherits an equals(Object) method from a superclass. The class should probably define a boolean equals(Object) method. + +#Eq: equals() method defined that doesn't override Object.equals(Object) (EQ_other_USE_OBJECT) +EQ_other_USE_OBJECT=;SFP--1;CWE-710 +EQ_other_USE_OBJECTMsg=This class defines an equals() method, that doesn't override the normal equals(Object) method defined in the base java.lang.Object class. The class should probably define a boolean equals(Object) method. + +#Eq: equals method overrides equals in superclass and may not be symmetric (EQ_OVERRIDING_EQUALS_NOT_SYMMETRIC) +EQ_OVERRIDING_EQUALS_NOT_SYMMETRIC=;SFP--1;CWE-710 +EQ_OVERRIDING_EQUALS_NOT_SYMMETRICMsg=This class defines an equals method that overrides an equals method in a superclass. Both equals methods methods use instanceof in the determination of whether two objects are equal. This is fraught with peril, since it is important that the equals method is symmetrical (in other words, a.equals(b) == b.equals(a)). If B is a subtype of A, and A's equals method checks that the argument is an instanceof A, and B's equals method checks that the argument is an instanceof B, it is quite likely that the equivalence relation defined by these methods is not symmetric. + +#Eq: Covariant equals() method defined, Object.equals(Object) inherited (EQ_SELF_USE_OBJECT) +EQ_SELF_USE_OBJECT=;SFP--1;CWE-710 +EQ_SELF_USE_OBJECTMsg=This class defines a covariant version of the equals() method, but inherits the normal equals(Object) method defined in the base java.lang.Object class. The class should probably define a boolean equals(Object) method. + +#FE: Doomed test for equality to NaN (FE_TEST_IF_EQUAL_TO_NOT_A_NUMBER) +FE_TEST_IF_EQUAL_TO_NOT_A_NUMBER=;SFP-1;CWE-570 +FE_TEST_IF_EQUAL_TO_NOT_A_NUMBERMsg=This code checks to see if a floating point value is equal to the special Not A Number value (e.g., if (x == Double.NaN)). However, because of the special semantics of NaN, no value is equal to Nan, including NaN. Thus, x == Double.NaN always evaluates to false. To check to see if a value contained in x is the special Not A Number value, use Double.isNaN(x) (or Float.isNaN(x) if x is floating point precision). + +#FS: Format string placeholder incompatible with passed argument (VA_FORMAT_STRING_BAD_ARGUMENT) +VA_FORMAT_STRING_BAD_ARGUMENT=;SFP-1;CWE-687 +VA_FORMAT_STRING_BAD_ARGUMENTMsg=The format string placeholder is incompatible with the corresponding argument. For example, System.out.println("%d\n", "hello"); The %d placeholder requires a numeric argument, but a string value is passed instead. A runtime exception will occur when this statement is executed. + +#FS: The type of a supplied argument doesn't match format specifier (VA_FORMAT_STRING_BAD_CONVERSION) +VA_FORMAT_STRING_BAD_CONVERSION=;SFP-1;CWE-687 +VA_FORMAT_STRING_BAD_CONVERSIONMsg=One of the arguments is uncompatible with the corresponding format string specifier. As a result, this will generate a runtime exception when executed. For example, String.format("%d", "1") will generate an exception, since the String "1" is incompatible with the format specifier %d. + +#FS: MessageFormat supplied where printf style format expected (VA_FORMAT_STRING_EXPECTED_MESSAGE_FORMAT_SUPPLIED) +VA_FORMAT_STRING_EXPECTED_MESSAGE_FORMAT_SUPPLIED=;SFP-1;CWE-685 +VA_FORMAT_STRING_EXPECTED_MESSAGE_FORMAT_SUPPLIEDMsg=A method is called that expects a Java printf format string and a list of arguments. However, the format string doesn't contain any format specifiers (e.g., %s) but does contain message format elements (e.g., {0}). It is likely that the code is supplying a MessageFormat string when a printf-style format string is required. At runtime, all of the arguments will be ignored and the format string will be returned exactly as provided without any formatting. + +#FS: More arguments are passed than are actually used in the format string (VA_FORMAT_STRING_EXTRA_ARGUMENTS_PASSED) +VA_FORMAT_STRING_EXTRA_ARGUMENTS_PASSED=;SFP-1;CWE-685 +VA_FORMAT_STRING_EXTRA_ARGUMENTS_PASSEDMsg=A format-string method with a variable number of arguments is called, but more arguments are passed than are actually used by the format string. This won't cause a runtime exception, but the code may be silently omitting information that was intended to be included in the formatted string. + +#FS: Illegal format string (VA_FORMAT_STRING_ILLEGAL) +VA_FORMAT_STRING_ILLEGAL=;SFP-1;CWE-687 +VA_FORMAT_STRING_ILLEGALMsg=The format string is syntactically invalid, and a runtime exception will occur when this statement is executed. + +#FS: Format string references missing argument (VA_FORMAT_STRING_MISSING_ARGUMENT) +VA_FORMAT_STRING_MISSING_ARGUMENT=;SFP-1;CWE-685 +VA_FORMAT_STRING_MISSING_ARGUMENTMsg=Not enough arguments are passed to satisfy a placeholder in the format string. A runtime exception will occur when this statement is executed. + +#FS: No previous argument for format string (VA_FORMAT_STRING_NO_PREVIOUS_ARGUMENT) +VA_FORMAT_STRING_NO_PREVIOUS_ARGUMENT=;SFP-1;CWE-685 +VA_FORMAT_STRING_NO_PREVIOUS_ARGUMENTMsg=The format string specifies a relative index to request that the argument for the previous format specifier be reused. However, there is no previous argument. + +#GC: No relationship between generic parameter and method argument (GC_UNRELATED_TYPES) +GC_UNRELATED_TYPES=;SFP--1;CWE-687 +GC_UNRELATED_TYPESMsg=This call to a generic collection method contains an argument with an incompatible class from that of the collection's parameter (i.e., the type of the argument is neither a supertype nor a subtype of the corresponding generic type argument). Therefore, it is unlikely that the collection contains any objects that are equal to the method argument used here. Most likely, the wrong value is being passed to the method. In general, instances of two unrelated classes are not equal. For example, if the Foo and Bar classes are not related by subtyping, then an instance of Foo should not be equal to an instance of Bar. Among other issues, doing so will likely result in an equals method that is not symmetrical. For example, if you define the Foo class so that a Foo can be equal to a String, your equals method isn't symmetrical since a String can only be equal to a String. In rare cases, people do define nonsymmetrical equals methods and still manage to make their code work. Although none of the APIs document or guarantee it, it is typically the case that if you check if a Collection contains a Foo, the equals method of argument (e.g., the equals method of the Foo class) used to perform the equality checks. + +#HE: Signature declares use of unhashable class in hashed construct (HE_SIGNATURE_DECLARES_HASHING_OF_UNHASHABLE_CLASS) +HE_SIGNATURE_DECLARES_HASHING_OF_UNHASHABLE_CLASS=;SFP--1;CWE-581 +HE_SIGNATURE_DECLARES_HASHING_OF_UNHASHABLE_CLASSMsg=A method, field or class declares a generic signature where a non-hashable class is used in context where a hashable class is required. A class that declares an equals method but inherits a hashCode() method from Object is unhashable, since it doesn't fulfill the requirement that equal objects have equal hashCodes. + +#HE: Use of class without a hashCode() method in a hashed data structure (HE_USE_OF_UNHASHABLE_CLASS) +HE_USE_OF_UNHASHABLE_CLASS=;SFP--1;CWE-581 +HE_USE_OF_UNHASHABLE_CLASSMsg=A class defines an equals(Object) method but not a hashCode() method, and thus doesn't fulfill the requirement that equal objects have equal hashCodes. An instance of this class is used in a hash data structure, making the need to fix this problem of highest importance. + +#ICAST: integral value cast to double and then passed to Math.ceil (ICAST_INT_CAST_TO_DOUBLE_PASSED_TO_CEIL) +ICAST_INT_CAST_TO_DOUBLE_PASSED_TO_CEIL=;SFP--1;CWE-398 +ICAST_INT_CAST_TO_DOUBLE_PASSED_TO_CEILMsg=This code converts an integral value (e.g., int or long) to a double precision floating point number and then passing the result to the Math.ceil() function, which rounds a double to the next higher integer value. This operation should always be a no-op, since the converting an integer to a double should give a number with no fractional part. It is likely that the operation that generated the value to be passed to Math.ceil was intended to be performed using double precision floating point arithmetic. + +#INT: Bad comparison of signed byte (INT_BAD_COMPARISON_WITH_SIGNED_BYTE) +INT_BAD_COMPARISON_WITH_SIGNED_BYTE=;SFP--1;CWE-195 +INT_BAD_COMPARISON_WITH_SIGNED_BYTEMsg=Signed bytes can only have a value in the range -128 to 127. Comparing a signed byte with a value outside that range is vacuous and likely to be incorrect. To convert a signed byte b to an unsigned value in the range 0..255, use 0xff & b + +#ICAST: int value cast to float and then passed to Math.round (ICAST_INT_CAST_TO_FLOAT_PASSED_TO_ROUND) +ICAST_INT_CAST_TO_FLOAT_PASSED_TO_ROUND=;SFP--1;CWE-398 +ICAST_INT_CAST_TO_FLOAT_PASSED_TO_ROUNDMsg=This code converts an int value to a float precision floating point number and then passing the result to the Math.round() function, which returns the int/long closest to the argument. This operation should always be a no-op, since the converting an integer to a float should give a number with no fractional part. It is likely that the operation that generated the value to be passed to Math.round was intended to be performed using floating point arithmetic. + +#IJU: JUnit assertion in run method will not be noticed by JUnit (IJU_ASSERT_METHOD_INVOKED_FROM_RUN_METHOD) +IJU_ASSERT_METHOD_INVOKED_FROM_RUN_METHOD=;SFP--1;CWE-710 +IJU_ASSERT_METHOD_INVOKED_FROM_RUN_METHODMsg=A JUnit assertion is performed in a run method. Failed JUnit assertions just result in exceptions being thrown. Thus, if this exception occurs in a thread other than the thread that invokes the test method, the exception will terminate the thread but not result in the test failing. + +#IJU: TestCase declares a bad suite method (IJU_BAD_SUITE_METHOD) +IJU_BAD_SUITE_METHOD=;SFP--1;CWE-710 +IJU_BAD_SUITE_METHODMsg=Class is a JUnit TestCase and defines a suite() method. However, the suite method needs to be declared as either public static junit.framework.Test suite() or public static junit.framework.TestSuite suite() + +#IJU: TestCase has no tests (IJU_NO_TESTS) +IJU_NO_TESTS=;SFP--1;CWE-710 +IJU_NO_TESTSMsg=Class is a JUnit TestCase but has not implemented any test methods + +#IJU: TestCase defines setUp that doesn't call super.setUp() (IJU_SETUP_NO_SUPER) +IJU_SETUP_NO_SUPER=;SFP--1;CWE-710 +IJU_SETUP_NO_SUPERMsg=Class is a JUnit TestCase and implements the setUp method. The setUp method should call super.setUp(), but doesn't. + +#IJU: TestCase implements a non-static suite method (IJU_SUITE_NOT_STATIC) +IJU_SUITE_NOT_STATIC=;SFP--1;CWE-710 +IJU_SUITE_NOT_STATICMsg=Class is a JUnit TestCase and implements the suite() method. The suite method should be declared as being static, but isn't. + +#IJU: TestCase defines tearDown that doesn't call super.tearDown() (IJU_TEARDOWN_NO_SUPER) +IJU_TEARDOWN_NO_SUPER=;SFP--1;CWE-710 +IJU_TEARDOWN_NO_SUPERMsg=Class is a JUnit TestCase and implements the tearDown method. The tearDown method should call super.tearDown(), but doesn't. + +#IL: A collection is added to itself (IL_CONTAINER_ADDED_TO_ITSELF) +IL_CONTAINER_ADDED_TO_ITSELF=;SFP-13;CWE-674 +IL_CONTAINER_ADDED_TO_ITSELFMsg=A collection is added to itself. As a result, computing the hashCode of this set will throw a StackOverflowException + +#IL: An apparent infinite loop (IL_INFINITE_LOOP) +IL_INFINITE_LOOP=;SFP--1;CWE-835 +IL_INFINITE_LOOPMsg=This loop doesn't seem to have a way to terminate (other than by perhaps throwing an exception). + +#IL: An apparent infinite recursive loop (IL_INFINITE_RECURSIVE_LOOP) +IL_INFINITE_RECURSIVE_LOOP=;SFP-13;CWE-674 +IL_INFINITE_RECURSIVE_LOOPMsg=This method unconditionally invokes itself. This would seem to indicate an infinite recursive loop that will result in a stack overflow. + +#IM: Integer multiply of result of integer remainder (IM_MULTIPLYING_RESULT_OF_IREM) +IM_MULTIPLYING_RESULT_OF_IREM=;SFP--1;CWE-398 +IM_MULTIPLYING_RESULT_OF_IREMMsg=The code multiplies the result of an integer remaining by an integer constant. Be sure you don't have your operator precedence confused. For example i % 60 * 1000 is (i % 60) * 1000, not i % (60 * 1000). + +#INT: Bad comparison of nonnegative value with negative constant (INT_BAD_COMPARISON_WITH_NONNEGATIVE_VALUE) +INT_BAD_COMPARISON_WITH_NONNEGATIVE_VALUE=;SFP--1;CWE-398 +INT_BAD_COMPARISON_WITH_NONNEGATIVE_VALUEMsg=This code compares a value that is guaranteed to be non-negative with a negative constant. + +#IO: Doomed attempt to append to an object output stream (IO_APPENDING_TO_OBJECT_OUTPUT_STREAM) +IO_APPENDING_TO_OBJECT_OUTPUT_STREAM=;SFP--1;CWE-398 +IO_APPENDING_TO_OBJECT_OUTPUT_STREAMMsg=This code opens a file in append mode and then wraps the result in an object output stream. This won't allow you to append to an existing object output stream stored in a file. If you want to be able to append to an object output stream, you need to keep the object output stream open. The only situation in which opening a file in append mode and the writing an object output stream could work is if on reading the file you plan to open it in random access mode and seek to the byte offset where the append started. + +#IP: A parameter is dead upon entry to a method but overwritten (IP_PARAMETER_IS_DEAD_BUT_OVERWRITTEN) +IP_PARAMETER_IS_DEAD_BUT_OVERWRITTEN=;SFP--1;CWE-398 +IP_PARAMETER_IS_DEAD_BUT_OVERWRITTENMsg=The initial value of this parameter is ignored, and the parameter is overwritten here. This often indicates a mistaken belief that the write to the parameter will be conveyed back to the caller. + +#MF: Class defines field that masks a superclass field (MF_CLASS_MASKS_FIELD) +MF_CLASS_MASKS_FIELD=;SFP--1;CWE-710 +MF_CLASS_MASKS_FIELDMsg=This class defines a field with the same name as a visible instance field in a superclass. This is confusing, and may indicate an error if methods update or access one of the fields when they wanted the other. + +#MF: Method defines a variable that obscures a field (MF_METHOD_MASKS_FIELD) +MF_METHOD_MASKS_FIELD=;SFP--1;CWE-710 +MF_METHOD_MASKS_FIELDMsg=This method defines a local variable with the same name as a field in this class or a superclass. This may cause the method to read an uninitialized value from the field, leave the field uninitialized, or both. + +#NP: Null pointer dereference (NP_ALWAYS_NULL) +NP_ALWAYS_NULL=;SFP-7;CWE-476 +NP_ALWAYS_NULLMsg=A null pointer is dereferenced here. This will lead to a NullPointerException when the code is executed. + +#NP: Null pointer dereference in method on exception path (NP_ALWAYS_NULL_EXCEPTION) +NP_ALWAYS_NULL_EXCEPTION=;SFP-7;CWE-476 +NP_ALWAYS_NULL_EXCEPTIONMsg=A pointer which is null on an exception path is dereferenced here. This will lead to a NullPointerException when the code is executed. Note that because FindBugs currently does not prune infeasible exception paths, this may be a false warning. Also note that FindBugs considers the default case of a switch statement to be an exception path, since the default case is often infeasible. + +#NP: Method does not check for null argument (NP_ARGUMENT_MIGHT_BE_NULL) +NP_ARGUMENT_MIGHT_BE_NULL=;SFP-7;CWE-476 +NP_ARGUMENT_MIGHT_BE_NULLMsg=A parameter to this method has been identified as a value that should always be checked to see whether or not it is null, but it is being dereferenced without a preceding null check. + +#NP: close() invoked on a value that is always null (NP_CLOSING_NULL) +NP_CLOSING_NULL=;SFP-7;CWE-476 +NP_CLOSING_NULLMsg=close() is being invoked on a value that is always null. If this statement is executed, a null pointer exception will occur. But the big risk here you never close something that should be closed. + +#NP: Null value is guaranteed to be dereferenced (NP_GUARANTEED_DEREF) +NP_GUARANTEED_DEREF=;SFP-7;CWE-476 +NP_GUARANTEED_DEREFMsg=There is a statement or branch that if executed guarantees that a value is null at this point, and that value that is guaranteed to be dereferenced (except on forward paths involving runtime exceptions). + +#NP: Value is null and guaranteed to be dereferenced on exception path (NP_GUARANTEED_DEREF_ON_EXCEPTION_PATH) +NP_GUARANTEED_DEREF_ON_EXCEPTION_PATH=;SFP-7;CWE-476 +NP_GUARANTEED_DEREF_ON_EXCEPTION_PATHMsg=There is a statement or branch on an exception path that if executed guarantees that a value is null at this point, and that value that is guaranteed to be dereferenced (except on forward paths involving runtime exceptions). + +#NP: Method call passes null to a nonnull parameter (NP_NONNULL_PARAM_VIOLATION) +NP_NONNULL_PARAM_VIOLATION=;SFP-7;CWE-476 +NP_NONNULL_PARAM_VIOLATIONMsg=This method passes a null value as the parameter of a method which must be nonnull. Either this parameter has been explicitly marked as @Nonnull, or analysis has determined that this parameter is always dereferenced. + +#NP: Method may return null, but is declared @NonNull (NP_NONNULL_RETURN_VIOLATION) +NP_NONNULL_RETURN_VIOLATION=;SFP-7;CWE-476 +NP_NONNULL_RETURN_VIOLATIONMsg=This method may return a null value, but the method (or a superclass method which it overrides) is declared to return @NonNull. + +#NP: A known null value is checked to see if it is an instance of a type (NP_NULL_INSTANCEOF) +NP_NULL_INSTANCEOF=;SFP-1;CWE-570 +NP_NULL_INSTANCEOFMsg=This instanceof test will always return false, since the value being checked is guaranteed to be null. Although this is safe, make sure it isn't an indication of some misunderstanding or some other logic error. + +#NP: Possible null pointer dereference (NP_NULL_ON_SOME_PATH) +NP_NULL_ON_SOME_PATH=;SFP-7;CWE-476 +NP_NULL_ON_SOME_PATHMsg=There is a branch of statement that, if executed, guarantees that a null value will be dereferenced, which would generate a NullPointerException when the code is executed. Of course, the problem might be that the branch or statement is infeasible and that the null pointer exception can't ever be executed; deciding that is beyond the ability of FindBugs. + +#NP: Possible null pointer dereference in method on exception path (NP_NULL_ON_SOME_PATH_EXCEPTION) +NP_NULL_ON_SOME_PATH_EXCEPTION=;SFP-7;CWE-476 +NP_NULL_ON_SOME_PATH_EXCEPTIONMsg=A reference value which is null on some exception control path is dereferenced here. This may lead to a NullPointerException when the code is executed. Note that because FindBugs currently does not prune infeasible exception paths, this may be a false warning. Also note that FindBugs considers the default case of a switch statement to be an exception path, since the default case is often infeasible. + +#NP: Method call passes null for nonnull parameter (NP_NULL_PARAM_DEREF) +NP_NULL_PARAM_DEREF=;SFP-7;CWE-476 +NP_NULL_PARAM_DEREFMsg=This method call passes a null value for a nonnull method parameter. Either the parameter is annotated as a parameter that should always be nonnull, or analysis has shown that it will always be dereferenced. + +#NP: Method call passes null for nonnull parameter (NP_NULL_PARAM_DEREF_ALL_TARGETS_DANGEROUS) +NP_NULL_PARAM_DEREF_ALL_TARGETS_DANGEROUS=;SFP-7;CWE-476 +NP_NULL_PARAM_DEREF_ALL_TARGETS_DANGEROUSMsg=A possibly-null value is passed at a call site where all known target methods require the parameter to be nonnull. Either the parameter is annotated as a parameter that should always be nonnull, or analysis has shown that it will always be dereferenced. + +#NP: Non-virtual method call passes null for nonnull parameter (NP_NULL_PARAM_DEREF_NONVIRTUAL) +NP_NULL_PARAM_DEREF_NONVIRTUAL=;SFP-7;CWE-476 +NP_NULL_PARAM_DEREF_NONVIRTUALMsg=A possibly-null value is passed to a nonnull method parameter. Either the parameter is annotated as a parameter that should always be nonnull, or analysis has shown that it will always be dereferenced. + +#NP: Store of null value into field annotated NonNull (NP_STORE_INTO_NONNULL_FIELD) +NP_STORE_INTO_NONNULL_FIELD=;SFP-7;CWE-476 +NP_STORE_INTO_NONNULL_FIELDMsg=A value that could be null is stored into a field that has been annotated as NonNull. + +#NP: Read of unwritten field (NP_UNWRITTEN_FIELD) +NP_UNWRITTEN_FIELD=;SFP-7;CWE-476 +NP_UNWRITTEN_FIELDMsg=The program is dereferencing a field that does not seem to ever have a non-null value written to it. Dereferencing this value will generate a null pointer exception. + +#Nm: Class defines equal(Object); should it be equals(Object)? (NM_BAD_EQUAL) +NM_BAD_EQUAL=;SFP--1;CWE-710 +NM_BAD_EQUALMsg=This class defines a method equal(Object). This method does not override the equals(Object) method in java.lang.Object, which is probably what was intended. + +#Nm: Class defines hashcode(); should it be hashCode()? (NM_LCASE_HASHCODE) +NM_LCASE_HASHCODE=;SFP--1;CWE-710 +NM_LCASE_HASHCODEMsg=This class defines a method called hashcode(). This method does not override the hashCode() method in java.lang.Object, which is probably what was intended. + +#Nm: Class defines tostring(); should it be toString()? (NM_LCASE_TOSTRING) +NM_LCASE_TOSTRING=;SFP--1;CWE-710 +NM_LCASE_TOSTRINGMsg=This class defines a method called tostring(). This method does not override the toString() method in java.lang.Object, which is probably what was intended. + +#Nm: Apparent method/constructor confusion (NM_METHOD_CONSTRUCTOR_CONFUSION) +NM_METHOD_CONSTRUCTOR_CONFUSION=;SFP--1;CWE-710 +NM_METHOD_CONSTRUCTOR_CONFUSIONMsg=This regular method has the same name as the class it is defined in. It is likely that this was intended to be a constructor. If it was intended to be a constructor, remove the declaration of a void return value. If you had accidently defined this method, realized the mistake, defined a proper constructor but can't get rid of this method due to backwards compatibility, deprecate the method. + +#Nm: Very confusing method names (NM_VERY_CONFUSING) +NM_VERY_CONFUSING=;SFP--1;CWE-710 +NM_VERY_CONFUSINGMsg=The referenced methods have names that differ only by capitalization. This is very confusing because if the capitalization were identical then one of the methods would override the other. + +#Nm: Method doesn't override method in superclass due to wrong package for parameter (NM_WRONG_PACKAGE) +NM_WRONG_PACKAGE=;SFP--1;CWE-710 +NM_WRONG_PACKAGEMsg=The method in the subclass doesn't override a similar method in a superclass because the type of a parameter doesn't exactly match the type of the corresponding parameter in the superclass. + +#QBA: Method assigns boolean literal in boolean expression (QBA_QUESTIONABLE_BOOLEAN_ASSIGNMENT) +QBA_QUESTIONABLE_BOOLEAN_ASSIGNMENT=;SFP-1;CWE-481 +QBA_QUESTIONABLE_BOOLEAN_ASSIGNMENTMsg=This method assigns a literal boolean value (true or false) to a boolean variable inside an if or while expression. Most probably this was supposed to be a boolean comparison using ==, not an assignment using =. + +#RC: Suspicious reference comparison (RC_REF_COMPARISON) +RC_REF_COMPARISON=;SFP-1;CWE-597 +RC_REF_COMPARISONMsg=This method compares two reference values using the == or != operator, where the correct way to compare instances of this type is generally with the equals() method. It is possible to create distinct instances that are equal but do not compare as == since they are different objects. Examples of classes which should generally not be compared by reference are java.lang.Integer, java.lang.Float, etc. + +#RCN: Nullcheck of value previously dereferenced (RCN_REDUNDANT_NULLCHECK_WOULD_HAVE_BEEN_A_NPE) +RCN_REDUNDANT_NULLCHECK_WOULD_HAVE_BEEN_A_NPE=;SFP-7;CWE-476 +RCN_REDUNDANT_NULLCHECK_WOULD_HAVE_BEEN_A_NPEMsg=A value is checked here to see whether it is null, but this value can't be null because it was previously dereferenced and if it were null a null pointer exception would have occurred at the earlier dereference. Essentially, this code and the previous dereference disagree as to whether this value is allowed to be null. Either the check is redundant or the previous dereference is erroneous. + +#RE: Invalid syntax for regular expression (RE_BAD_SYNTAX_FOR_REGULAR_EXPRESSION) +RE_BAD_SYNTAX_FOR_REGULAR_EXPRESSION=;SFP--1;CWE-687 +RE_BAD_SYNTAX_FOR_REGULAR_EXPRESSIONMsg=The code here uses a regular expression that is invalid according to the syntax for regular expressions. This statement will throw a PatternSyntaxException when executed. + +#RE: File.separator used for regular expression (RE_CANT_USE_FILE_SEPARATOR_AS_REGULAR_EXPRESSION) +RE_CANT_USE_FILE_SEPARATOR_AS_REGULAR_EXPRESSION=;SFP--1;CWE-687 +RE_CANT_USE_FILE_SEPARATOR_AS_REGULAR_EXPRESSIONMsg=The code here uses File.separator where a regular expression is required. This will fail on Windows platforms, where the File.separator is a backslash, which is interpreted in a regular expression as an escape character. Amoung other options, you can just use File.separatorChar=='\\' ? "\\\\" : File.separator instead of File.separator + +#RE: "." used for regular expression (;SFP--1;CWE-687 +RE_POSSIBLE_UNINTENDED_PATTERNMsg=A String function is being invoked and "." is being passed to a parameter that takes a regular expression as an argument. Is this what you intended? For example s.replaceAll(".", "/") will return a String in which every character has been replaced by a / character, and s.split(".") always returns a zero length array of String. + +#RV: Random value from 0 to 1 is coerced to the integer 0 (RV_01_TO_INT) +RV_01_TO_INT=;SFP-1;CWE-197 +RV_01_TO_INTMsg=A random value from 0 to 1 is being coerced to the integer value 0. You probably want to multiple the random value by something else before coercing it to an integer, or use the Random.nextInt(n) method. + +#RV: Bad attempt to compute absolute value of signed 32-bit hashcode (RV_ABSOLUTE_VALUE_OF_HASHCODE) +RV_ABSOLUTE_VALUE_OF_HASHCODE=;SFP-1;CWE-197 +RV_ABSOLUTE_VALUE_OF_HASHCODEMsg=This code generates a hashcode and then computes the absolute value of that hashcode. If the hashcode is Integer.MIN_VALUE, then the result will be negative as well (since Math.abs(Integer.MIN_VALUE) == Integer.MIN_VALUE). One out of 2^32 strings have a hashCode of Integer.MIN_VALUE, including "polygenelubricants" "GydZG_" and ""DESIGNING WORKHOUSES". + +#RV: Bad attempt to compute absolute value of signed 32-bit random integer (RV_ABSOLUTE_VALUE_OF_RANDOM_INT) +RV_ABSOLUTE_VALUE_OF_RANDOM_INT=;SFP-1;CWE--1 +RV_ABSOLUTE_VALUE_OF_RANDOM_INTMsg=This code generates a random signed integer and then computes the absolute value of that random integer. If the number returned by the random number generator is Integer.MIN_VALUE, then the result will be negative as well (since Math.abs(Integer.MIN_VALUE) == Integer.MIN_VALUE). + +#RV: Exception created and dropped rather than thrown (RV_EXCEPTION_NOT_THROWN) +RV_EXCEPTION_NOT_THROWN=;SFP-4;CWE-390 +RV_EXCEPTION_NOT_THROWNMsg=This code creates an exception (or error) object, but doesn't do anything with it. + +#RV: Method ignores return value (RV_RETURN_VALUE_IGNORED) +RV_RETURN_VALUE_IGNORED=;SFP-4;CWE-252 +RV_RETURN_VALUE_IGNOREDMsg=The return value of this method should be checked. One common cause of this warning is to invoke a method on an immutable object, thinking that it updates the object. + +#RpC: Repeated conditional tests (RpC_REPEATED_CONDITIONAL_TEST) +RpC_REPEATED_CONDITIONAL_TEST=;SFP--1;CWE-398 +RpC_REPEATED_CONDITIONAL_TESTMsg=The code contains a conditional test is performed twice, one right after the other (e.g., x == 0 || x == 0). Perhaps the second occurrence is intended to be something else (e.g., x == 0 || y == 0). + +#SA: Double assignment of field (SA_FIELD_DOUBLE_ASSIGNMENT) +SA_FIELD_DOUBLE_ASSIGNMENT=;SFP--1;CWE-398 +SA_FIELD_DOUBLE_ASSIGNMENTMsg=This method contains a double assignment of a field + +#SA: Self assignment of field (SA_FIELD_SELF_ASSIGNMENT) +SA_FIELD_SELF_ASSIGNMENT=;SFP--1;CWE-398 +SA_FIELD_SELF_ASSIGNMENTMsg=This method contains a self assignment of a field + +#SA: Self comparison of field with itself (SA_FIELD_SELF_COMPARISON) +SA_FIELD_SELF_COMPARISON=;SFP--1;CWE-398 +SA_FIELD_SELF_COMPARISONMsg=This method compares a field with itself, and may indicate a typo or a logic error. Make sure that you are comparing the right things. + +#SA: Nonsensical self computation involving a field (e.g., x & x) (SA_FIELD_SELF_COMPUTATION) +SA_FIELD_SELF_COMPUTATION=;SFP--1;CWE-398 +SA_FIELD_SELF_COMPUTATIONMsg=This method performs a nonsensical computation of a field with another reference to the same field (e.g., x&x or x-x). Because of the nature of the computation, this operation doesn't seem to make sense, and may indicate a typo or a logic error. Double check the computation. + +#A: Self comparison of value with itself (SA_LOCAL_SELF_COMPARISON) +SA_LOCAL_SELF_COMPARISON=;SFP--1;CWE-398 +SA_LOCAL_SELF_COMPARISONMsg=This method compares a local variable with itself, and may indicate a typo or a logic error. Make sure that you are comparing the right things. + +#SA: Nonsensical self computation involving a variable (e.g., x & x) (SA_LOCAL_SELF_COMPUTATION) +SA_LOCAL_SELF_COMPUTATION=;SFP--1;CWE-398 +SA_LOCAL_SELF_COMPUTATIONMsg=This method performs a nonsensical computation of a local variable with another reference to the same variable (e.g., x&x or x-x). Because of the nature of the computation, this operation doesn't seem to make sense, and may indicate a typo or a logic error. Double check the computation. + +#SF: Dead store due to switch statement fall through (SF_DEAD_STORE_DUE_TO_SWITCH_FALLTHROUGH) +SF_DEAD_STORE_DUE_TO_SWITCH_FALLTHROUGH=;SFP-4;CWE-484 +SF_DEAD_STORE_DUE_TO_SWITCH_FALLTHROUGHMsg=A value stored in the previous switch case is overwritten here due to a switch fall through. It is likely that you forgot to put a break or return at the end of the previous case. + +#SF: Dead store due to switch statement fall through to throw (SF_DEAD_STORE_DUE_TO_SWITCH_FALLTHROUGH_TO_THROW) +SF_DEAD_STORE_DUE_TO_SWITCH_FALLTHROUGH_TO_THROW=;SFP-4;CWE-484 +SF_DEAD_STORE_DUE_TO_SWITCH_FALLTHROUGH_TO_THROWMsg=A value stored in the previous switch case is ignored here due to a switch fall through to a place where an exception is thrown. It is likely that you forgot to put a break or return at the end of the previous case. + +#SIC: Deadly embrace of non-static inner class and thread local (SIC_THREADLOCAL_DEADLY_EMBRACE) +SIC_THREADLOCAL_DEADLY_EMBRACE=;SFP--1;CWE-398 +SIC_THREADLOCAL_DEADLY_EMBRACEMsg=This class is an inner class, but should probably be a static inner class. As it is, there is a serious danger of a deadly embrace between the inner class and the thread local in the outer class. Because the inner class isn't static, it retains a reference to the outer class. If the thread local contains a reference to an instance of the inner class, the inner and outer instance will both be reachable and not eligible for garbage collection. + +#SIO: Unnecessary type check done using instanceof operator (SIO_SUPERFLUOUS_INSTANCEOF) +SIO_SUPERFLUOUS_INSTANCEOF=;SFP--1;CWE-398 +SIO_SUPERFLUOUS_INSTANCEOFMsg=Type check performed using the instanceof operator where it can be statically determined whether the object is of the type requested. + +#SQL: Method attempts to access a prepared statement parameter with index 0 (SQL_BAD_PREPARED_STATEMENT_ACCESS) +SQL_BAD_PREPARED_STATEMENT_ACCESS=;SFP-1;CWE-687 +SQL_BAD_PREPARED_STATEMENT_ACCESSMsg=A call to a setXXX method of a prepared statement was made where the parameter index is 0. As parameter indexes start at index 1, this is always a mistake. + +#SQL: Method attempts to access a result set field with index 0 (SQL_BAD_RESULTSET_ACCESS) +SQL_BAD_RESULTSET_ACCESS=;SFP-1;CWE-687 +SQL_BAD_RESULTSET_ACCESSMsg=A call to getXXX or updateXXX methods of a result set was made where the field index is 0. As ResultSet fields start at index 1, this is always a mistake. + +#STI: Unneeded use of currentThread() call, to call interrupted() (STI_INTERRUPTED_ON_CURRENTTHREAD) +STI_INTERRUPTED_ON_CURRENTTHREAD=;SFP--1;CWE-398 +STI_INTERRUPTED_ON_CURRENTTHREADMsg=This method invokes the Thread.currentThread() call, just to call the interrupted() method. As interrupted() is a static method, is more simple and clear to use Thread.interrupted(). + +#STI: Static Thread.interrupted() method invoked on thread instance (STI_INTERRUPTED_ON_UNKNOWNTHREAD) +STI_INTERRUPTED_ON_UNKNOWNTHREAD=;SFP--1;CWE-398 +STI_INTERRUPTED_ON_UNKNOWNTHREADMsg=This method invokes the Thread.interrupted() method on a Thread object that appears to be a Thread object that is not the current thread. As the interrupted() method is static, the interrupted method will be called on a different object than the one the author intended. + +#Se: Method must be private in order for serialization to work (SE_METHOD_MUST_BE_PRIVATE) +SE_METHOD_MUST_BE_PRIVATE=;SFP--1;CWE-710 +SE_METHOD_MUST_BE_PRIVATEMsg=This class implements the Serializable interface, and defines a method for custom serialization/deserialization. But since that method isn't declared private, it will be silently ignored by the serialization/deserialization API. + +#Se: The readResolve method must not be declared as a static method. (SE_READ_RESOLVE_IS_STATIC) +SE_READ_RESOLVE_IS_STATIC=;SFP--1;CWE-710 +SE_READ_RESOLVE_IS_STATICMsg=In order for the readResolve method to be recognized by the serialization mechanism, it must not be declared as a static method. + +#TQ: Value annotated as carrying a type qualifier used where a value that must not carry that qualifier is required +TQ_ALWAYS_VALUE_USED_WHERE_NEVER_REQUIRED=;SFP--1;CWE-710 +TQ_ALWAYS_VALUE_USED_WHERE_NEVER_REQUIRED=A value specified as carrying a type qualifier annotation is consumed in a location or locations requiring that the value not carry that annotation. More precisely, a value annotated with a type qualifier specifying when=ALWAYS is guaranteed to reach a use or uses where the same type qualifier specifies when=NEVER. + +#TQ: Value that might not carry a type qualifier is always used in a way requires that type qualifier  +TQ_MAYBE_SOURCE_VALUE_REACHES_ALWAYS_SINK=;SFP--1;CWE-710 +TQ_MAYBE_SOURCE_VALUE_REACHES_ALWAYS_SINKMsg=A value that is annotated as possibility not being an instance of the values denoted by the type qualifier, and the value is guaranteed to be used in a way that requires values denoted by that type qualifier. + +#TQ: Value that might carry a type qualifier is always used in a way prohibits it from having that type qualifier (TQ_MAYBE_SOURCE_VALUE_REACHES_NEVER_SINK) +TQ_MAYBE_SOURCE_VALUE_REACHES_NEVER_SINK=;SFP--1;CWE-710 +TQ_MAYBE_SOURCE_VALUE_REACHES_NEVER_SINKMsg=A value that is annotated as possibility being an instance of the values denoted by the type qualifier, and the value is guaranteed to be used in a way that prohibits values denoted by that type qualifier. + +#TQ: Value annotated as never carrying a type qualifier used where value carrying that qualifier is required (TQ_NEVER_VALUE_USED_WHERE_ALWAYS_REQUIRED) +TQ_NEVER_VALUE_USED_WHERE_ALWAYS_REQUIRED=;SFP--1;CWE-710 +TQ_NEVER_VALUE_USED_WHERE_ALWAYS_REQUIREDMsg=A value specified as not carrying a type qualifier annotation is guaranteed to be consumed in a location or locations requiring that the value does carry that annotation. More precisely, a value annotated with a type qualifier specifying when=NEVER is guaranteed to reach a use or uses where the same type qualifier specifies when=ALWAYS. + +#UMAC: Uncallable method defined in anonymous class (UMAC_UNCALLABLE_METHOD_OF_ANONYMOUS_CLASS) +UMAC_UNCALLABLE_METHOD_OF_ANONYMOUS_CLASS=;SFP-2;CWE-561 +UMAC_UNCALLABLE_METHOD_OF_ANONYMOUS_CLASSMsg=This anonymous class defined a method that is not directly invoked and does not override a method in a superclass. Since methods in other classes cannot directly invoke methods declared in an anonymous class, it seems that this method is uncallable. The method might simply be dead code, but it is also possible that the method is intended to override a method declared in a superclass, and due to an typo or other error the method does not, in fact, override the method it is intended to. + +#UR: Uninitialized read of field in constructor (UR_UNINIT_READ) +UR_UNINIT_READ=;SFP-1;CWE-457 +UR_UNINIT_READMsg=This constructor reads a field which has not yet been assigned a value. This is often caused when the programmer mistakenly uses the field instead of one of the constructor's parameters. + +#UR: Uninitialized read of field method called from constructor of superclass (UR_UNINIT_READ_CALLED_FROM_SUPER_CONSTRUCTOR) +UR_UNINIT_READ_CALLED_FROM_SUPER_CONSTRUCTOR=;SFP-1;CWE-457 +UR_UNINIT_READ_CALLED_FROM_SUPER_CONSTRUCTORMsg=This method is invoked in the constructor of of the superclass. At this point, the fields of the class have not yet initialized. + +#USELESS_STRING: Invocation of toString on an array (DMI_INVOKING_TOSTRING_ON_ANONYMOUS_ARRAY) +DMI_INVOKING_TOSTRING_ON_ANONYMOUS_ARRAY=;SFP--1;CWE-398 +DMI_INVOKING_TOSTRING_ON_ANONYMOUS_ARRAYMsg=The code invokes toString on an (anonymous) array. Calling toString on an array generates a fairly useless result such as [C@16f0472. Consider using Arrays.toString to convert the array into a readable String that gives the contents of the array. See Programming Puzzlers, chapter 3, puzzle 12. + +#USELESS_STRING: Invocation of toString on an array (DMI_INVOKING_TOSTRING_ON_ARRAY) +DMI_INVOKING_TOSTRING_ON_ARRAY=;SFP--1;CWE-398 +DMI_INVOKING_TOSTRING_ON_ARRAYMsg=The code invokes toString on an array, which will generate a fairly useless result such as [C@16f0472. Consider using Arrays.toString to convert the array into a readable String that gives the contents of the array. See Programming Puzzlers, chapter 3, puzzle 12. + +#USELESS_STRING: Array formatted in useless way using format string (VA_FORMAT_STRING_BAD_CONVERSION_FROM_ARRAY) +VA_FORMAT_STRING_BAD_CONVERSION_FROM_ARRAY=;SFP--1;CWE-398 +VA_FORMAT_STRING_BAD_CONVERSION_FROM_ARRAYMsg=One of the arguments being formatted with a format string is an array. This will be formatted using a fairly useless format, such as [I@304282, which doesn't actually show the contents of the array. Consider wrapping the array using Arrays.asList(...) before handling it off to a formatted. + +#UwF: Field only ever set to null (UWF_NULL_FIELD) +UWF_NULL_FIELD=;SFP--1;CWE-398 +UWF_NULL_FIELDMsg=All writes to this field are of the constant value null, and thus all reads of the field will return null. Check for errors, or remove it if it is useless. + +#This field is never written. All reads of it will return the default value. Check for errors (should it have been initialized?), or remove it if it is useless. +UWF_UNWRITTEN_FIELD=;SFP-1;CWE-456 +UWF_UNWRITTEN_FIELDMsg=This field is never written. All reads of it will return the default value. Check for errors (should it have been initialized?), or remove it if it is useless. + +#VA: Primitive array passed to function expecting a variable number of object arguments +VA_PRIMITIVE_ARRAY_PASSED_TO_OBJECT_VARARG=;SFP-1;CWE-704 +VA_PRIMITIVE_ARRAY_PASSED_TO_OBJECT_VARARGMsg=This code passes a primitive array to a function that takes a variable number of object arguments. This creates an array of length one to hold the primitive array and passes it to the function. + +#LG: Potential lost logger changes due to weak reference in OpenJDK (LG_LOST_LOGGER_DUE_TO_WEAK_REFERENCE) +LG_LOST_LOGGER_DUE_TO_WEAK_REFERENCE=;SFP-3;CWE-474 +LG_LOST_LOGGER_DUE_TO_WEAK_REFERENCEMsg=OpenJDK introduces a potential incompatibility. In particular, the java.util.logging.Logger behavior has changed. Instead of using strong references, it now uses weak references internally. That's a reasonable change, but unfortunately some code relies on the old behavior - when changing logger configuration, it simply drops the logger reference. That means that the garbage collector is free to reclaim that memory, which means that the logger configuration is lost. + +#OBL: Method may fail to clean up stream or resource (OBL_UNSATISFIED_OBLIGATION) +OBL_UNSATISFIED_OBLIGATION=;SFP-14;CWE-404 +OBL_UNSATISFIED_OBLIGATIONMsg=This method may fail to clean up (close, dispose of) a stream, database object, or other resource requiring an explicit cleanup operation. In general, if a method opens a stream or other resource, the method should use a try/finally block to ensure that the stream or resource is cleaned up before the method returns. + +#Dm: Consider using Locale parameterized version of invoked method (DM_CONVERT_CASE) +DM_CONVERT_CASE=;SFP--1;CWE-710 +DM_CONVERT_CASEMsg=A String is being converted to upper or lowercase, using the platform's default encoding. This may result in improper conversions when used with international characters. + +#EI: May expose internal representation by returning reference to mutable object (EI_EXPOSE_REP) +EI_EXPOSE_REP=;SFP-23;CWE-375 +EI_EXPOSE_REPMsg=Returning a reference to a mutable object value stored in one of the object's fields exposes the internal representation of the object. If instances are accessed by untrusted code, and unchecked changes to the mutable object would compromise security or other important properties, you will need to do something different. Returning a new copy of the object is better approach in many situations. + +#EI2: May expose internal representation by incorporating reference to mutable object (EI_EXPOSE_REP2) +EI_EXPOSE_REP2=;SFP-23;CWE-375 +EI_EXPOSE_REP2Msg=This code stores a reference to an externally mutable object into the internal representation of the object. If instances are accessed by untrusted code, and unchecked changes to the mutable object would compromise security or other important properties, you will need to do something different. Storing a copy of the object is better approach in many situations. + +#FI: Finalizer should be protected, not public (FI_PUBLIC_SHOULD_BE_PROTECTED) +FI_PUBLIC_SHOULD_BE_PROTECTED=;SFP-28;CWE-583 +FI_PUBLIC_SHOULD_BE_PROTECTEDMsg=A class's finalize() method should have protected access, not public. + +#MS: May expose internal static state by storing a mutable object into a static field (EI_EXPOSE_STATIC_REP2) +EI_EXPOSE_STATIC_REP2=;SFP-23;CWE-607 +EI_EXPOSE_STATIC_REP2Msg=This code stores a reference to an externally mutable object into a static field. If unchecked changes to the mutable object would compromise security or other important properties, you will need to do something different. Storing a copy of the object is better approach in many situations. + +#MS: Field isn't final and can't be protected from malicious code (MS_CANNOT_BE_FINAL) +MS_CANNOT_BE_FINAL=;SFP-28;CWE-500 +MS_CANNOT_BE_FINALMsg=A mutable static field could be changed by malicious code or by accident from another package. Unfortunately, the way the field is used doesn't allow any easy fix to this problem. + +#MS: Public static method may expose internal representation by returning array (MS_EXPOSE_REP) +MS_EXPOSE_REP=;SFP-23;CWE-495 +MS_EXPOSE_REPMsg=A public static method returns a reference to an array that is part of the static state of the class. Any code that calls this method can freely modify the underlying array. One fix is to return a copy of the array. + +#MS: Field should be both final and package protected (MS_FINAL_PKGPROTECT) +MS_FINAL_PKGPROTECT=;SFP-28;CWE-500 +MS_FINAL_PKGPROTECTMsg=A mutable static field could be changed by malicious code or by accident from another package. The field could be made package protected and/or made final to avoid this vulnerability. + +#MS: Field is a mutable array (MS_MUTABLE_ARRAY) +MS_MUTABLE_ARRAY=;SFP-23;CWE-607 +MS_MUTABLE_ARRAYMsg=A final static field references an array and can be accessed by malicious code or by accident from another package. This code can freely modify the contents of the array. + +#MS: Field is a mutable Hashtable (MS_MUTABLE_HASHTABLE) +MS_MUTABLE_HASHTABLE=;SFP-23;CWE-607 +MS_MUTABLE_HASHTABLEMsg=A final static field references a Hashtable and can be accessed by malicious code or by accident from another package. This code can freely modify the contents of the Hashtable. + +#MS: Field should be moved out of an interface and made package protected (MS_OOI_PKGPROTECT) +MS_OOI_PKGPROTECT=;SFP-23;CWE-607 +MS_OOI_PKGPROTECTMsg=A final static field that is defined in an interface references a mutable object such as an array or hashtable. This mutable object could be changed by malicious code or by accident from another package. To solve this, the field needs to be moved to a class and made package protected to avoid this vulnerability. + +#MS: Field should be package protected (MS_PKGPROTECT) +MS_PKGPROTECT=;SFP-23;CWE-607 +MS_PKGPROTECTMsg=A mutable static field could be changed by malicious code or by accident. The field could be made package protected to avoid this vulnerability. + +#MS: Field isn't final but should be (MS_SHOULD_BE_FINAL) +MS_SHOULD_BE_FINAL=;SFP-28;CWE-500 +MS_SHOULD_BE_FINALMsg=A mutable static field could be changed by malicious code or by accident from another package. The field could be made final to avoid this vulnerability. + +#DC: Possible double check of field (DC_DOUBLECHECK) +DC_DOUBLECHECK=;SFP-19;CWE-609 +DC_DOUBLECHECKMsg=This method may contain an instance of double-checked locking. This idiom is not correct according to the semantics of the Java memory model. For more information, see the web page http://www.cs.umd.edu/~pugh/java/memoryModel/DoubleCheckedLocking.html. + +#DL: Synchronization on Boolean could lead to deadlock (DL_SYNCHRONIZATION_ON_BOOLEAN) +DL_SYNCHRONIZATION_ON_BOOLEAN=;SFP-19;CWE-833 +DL_SYNCHRONIZATION_ON_BOOLEANMsg=The code synchronizes on a boxed primitive constant, such as an Boolean. Since there normally exist only two Boolean objects, this code could be synchronizing on the same object as other, unrelated code, leading to unresponsiveness and possible deadlock + +#DL: Synchronization on boxed primitive could lead to deadlock (DL_SYNCHRONIZATION_ON_BOXED_PRIMITIVE) +DL_SYNCHRONIZATION_ON_BOXED_PRIMITIVE=;SFP-19;CWE-833 +DL_SYNCHRONIZATION_ON_BOXED_PRIMITIVEMsg=The code synchronizes on a boxed primitive constant, such as an Integer. Since Integer objects can be cached and shared, this code could be synchronizing on the same object as other, unrelated code, leading to unresponsiveness and possible deadlock + +#DL: Synchronization on interned String could lead to deadlock (DL_SYNCHRONIZATION_ON_SHARED_CONSTANT) +DL_SYNCHRONIZATION_ON_SHARED_CONSTANT=;SFP-19;CWE-833 +DL_SYNCHRONIZATION_ON_SHARED_CONSTANTMsg=The code synchronizes on interned String. Constant Strings are interned and shared across all other classes loaded by the JVM. Thus, this could is locking on something that other code might also be locking. This could result in very strange and hard to diagnose blocking and deadlock behavior. See http://www.javalobby.org/java/forums/t96352.html and http://jira.codehaus.org/browse/JETTY-352. + +#DL: Synchronization on boxed primitive values (DL_SYNCHRONIZATION_ON_UNSHARED_BOXED_PRIMITIVE) +DL_SYNCHRONIZATION_ON_UNSHARED_BOXED_PRIMITIVE=;SFP-19;CWE-833 +DL_SYNCHRONIZATION_ON_UNSHARED_BOXED_PRIMITIVEMsg=The code synchronizes on an apparently unshared boxed primitive, such as an Integer. It would be much better, in this code, to redeclare fileLock as + +#private static final Object fileLock = new Object(); +#The existing code might be OK, but it is confusing and a future refactoring, such as the "Remove Boxing" refactoring in IntelliJ, might replace this with the use of an interned Integer object shared throughout the JVM, leading to very confusing behavior and potential deadlock. + +#Dm: Monitor wait() called on Condition (DM_MONITOR_WAIT_ON_CONDITION) +DM_MONITOR_WAIT_ON_CONDITION=;SFP--1;CWE-710 +DM_MONITOR_WAIT_ON_CONDITIONMsg=This method calls wait() on a java.util.concurrent.locks.Condition object. Waiting for a Condition should be done using one of the await() methods defined by the Condition interface. + +#Dm: A thread was created using the default empty run method (DM_USELESS_THREAD) +DM_USELESS_THREAD=;SFP--1;CWE-710 +DM_USELESS_THREADMsg=This method creates a thread without specifying a run method either by deriving from the Thread class, or by passing a Runnable object. This thread, then, does nothing but waste time. + +#ESync: Empty synchronized block (ESync_EMPTY_SYNC) +Esync_EMPTY_SYNC=;SFP-21;CWE-585 +Esync_EMPTY_SYNCMsg=The code contains an empty synchronized block: synchronized() {} Empty synchronized blocks are far more subtle and hard to use correctly than most people recognize, and empty synchronized blocks are almost never a better solution than less contrived solutions. + +#IS: Inconsistent synchronization (IS2_INCONSISTENT_SYNC) +IS2_INCONSISTENT_SYNC=;SFP-19;CWE-662 +IS2_INCONSISTENT_SYNCMsg=The fields of this class appear to be accessed inconsistently with respect to synchronization. + +#IS: Field not guarded against concurrent access (IS_FIELD_NOT_GUARDED) +IS_FIELD_NOT_GUARDED=;SFP-19;CWE-413 +IS_FIELD_NOT_GUARDEDMsg=This field is annotated with net.jcip.annotations.GuardedBy, but can be accessed in a way that seems to violate the annotation. + +#JLM: Synchronization performed on Lock (JLM_JSR166_LOCK_MONITORENTER) +JLM_JSR166_LOCK_MONITORENTER=;SFP--1;CWE-710 +JLM_JSR166_LOCK_MONITORENTERMsg=This method performs synchronization an object that implements java.util.concurrent.locks.Lock. Such an object is locked/unlocked using acquire()/release() rather than using the synchronized (...) construct. + +#LI: Incorrect lazy initialization of static field (LI_LAZY_INIT_STATIC) +LI_LAZY_INIT_STATIC=;SFP-19;CWE-667 +LI_LAZY_INIT_STATICMsg=This method contains an unsynchronized lazy initialization of a non-volatile static field. Because the compiler or processor may reorder instructions, threads are not guaranteed to see a completely initialized object, if the method can be called by multiple threads. You can make the field volatile to correct the problem. For more information, see the Java Memory Model web site. + +#LI: Incorrect lazy initialization and update of static field (LI_LAZY_INIT_UPDATE_STATIC) +LI_LAZY_INIT_UPDATE_STATIC=;SFP-19;CWE-667 +LI_LAZY_INIT_UPDATE_STATICMsg=This method contains an unsynchronized lazy initialization of a static field. After the field is set, the object stored into that location is further updated or accessed. The setting of the field is visible to other threads as soon as it is set. If the futher accesses in the method that set the field serve to initialize the object, then you have a very serious multithreading bug, unless something else prevents any other thread from accessing the stored object until it is fully initialized. Even if you feel confident that the method is never called by multiple threads, it might be better to not set the static field until the value you are setting it to is fully populated/initialized. + +#ML: Synchronization on field in futile attempt to guard that field (ML_SYNC_ON_FIELD_TO_GUARD_CHANGING_THAT_FIELD) +ML_SYNC_ON_FIELD_TO_GUARD_CHANGING_THAT_FIELD=;SFP-19;CWE-667 +ML_SYNC_ON_FIELD_TO_GUARD_CHANGING_THAT_FIELDMsg=This method synchronizes on a field in what appears to be an attempt to guard against simultaneous updates to that field. But guarding a field gets a lock on the referenced object, not on the field. This may not provide the mutual exclusion you need, and other threads might be obtaining locks on the referenced objects (for other purposes). + +#ML: Method synchronizes on an updated field (ML_SYNC_ON_UPDATED_FIELD) +ML_SYNC_ON_UPDATED_FIELD=;SFP-19;CWE-667 +ML_SYNC_ON_UPDATED_FIELDMsg=This method synchronizes on an object referenced from a mutable field. This is unlikely to have useful semantics, since different threads may be synchronizing on different objects. + +#ML: Method synchronizes on an updated field (ML_SYNC_ON_UPDATED_FIELD) +MSF_MUTABLE_SERVLET_FIELD=;SFP-19;CWE-667 +MSF_MUTABLE_SERVLET_FIELDMsg=A web server generally only creates one instance of servlet or jsp class (i.e., treats the class as a Singleton), and will have multiple threads invoke methods on that instance to service multiple simultaneous requests. Thus, having a mutable instance field generally creates race conditions. + +#MWN: Mismatched notify() (MWN_MISMATCHED_NOTIFY) +MWN_MISMATCHED_NOTIFY=;SFP-19;CWE-667 +MWN_MISMATCHED_NOTIFYMsg=This method calls Object.notify() or Object.notifyAll() without obviously holding a lock on the object. Calling notify() or notifyAll() without a lock held will result in an IllegalMonitorStateException being thrown. + +#MWN: Mismatched wait() (MWN_MISMATCHED_WAIT) +MWN_MISMATCHED_WAIT=;SFP-19;CWE-667 +MWN_MISMATCHED_WAITMsg=This method calls Object.wait() without obviously holding a lock on the object. Calling wait() without a lock held will result in an IllegalMonitorStateException being thrown. + +#NN: Naked notify (NN_NAKED_NOTIFY) +NN_NAKED_NOTIFY=;SFP--1;CWE-398 +NN_NAKED_NOTIFYMsg=A call to notify() or notifyAll() was made without any (apparent) accompanying modification to mutable object state. In general, calling a notify method on a monitor is done because some condition another thread is waiting for has become true. However, for the condition to be meaningful, it must involve a heap object that is visible to both threads. This bug does not necessarily indicate an error, since the change to mutable object state may have taken place in a method which then called the method containing the notification. + +#NP: Synchronize and null check on the same field. (NP_SYNC_AND_NULL_CHECK_FIELD) +NP_SYNC_AND_NULL_CHECK_FIELD=;SFP-7;CWE-476 +NP_SYNC_AND_NULL_CHECK_FIELDMsg=Since the field is synchronized on, it seems not likely to be null. If it is null and then synchronized on a NullPointerException will be thrown and the check would be pointless. Better to synchronize on another field. + +#No: Using notify() rather than notifyAll() (NO_NOTIFY_NOT_NOTIFYALL) +NO_NOTIFY_NOT_NOTIFYALL=;SFP--1;CWE-701 +NO_NOTIFY_NOT_NOTIFYALLMsg=This method calls notify() rather than notifyAll(). Java monitors are often used for multiple conditions. Calling notify() only wakes up one thread, meaning that the thread woken up might not be the one waiting for the condition that the caller just satisfied. + +#RS: Class's readObject() method is synchronized (RS_READOBJECT_SYNC) +RS_READOBJECT_SYNC=;SFP--1;CWE-398 +RS_READOBJECT_SYNCMsg=This serializable class defines a readObject() which is synchronized. By definition, an object created by deserialization is only reachable by one thread, and thus there is no need for readObject() to be synchronized. If the readObject() method itself is causing the object to become visible to another thread, that is an example of very dubious coding style. + +#RV: Return value of putIfAbsent ignored, value passed to putIfAbsent reused (RV_RETURN_VALUE_OF_PUTIFABSENT_IGNORED) +RV_RETURN_VALUE_OF_PUTIFABSENT_IGNORED=;SFP-4;CWE-252 +RV_RETURN_VALUE_OF_PUTIFABSENT_IGNOREDMsg=The putIfAbsent method is typically used to ensure that a single value is associated with a given key (the first value for which put if absent succeeds). If you ignore the return value and retain a reference to the value passed in, you run the risk of retaining a value that is not the one that is associated with the key in the map. If it matters which one you use and you use the one that isn't stored in the map, your program will behave incorrectly. + +#Ru: Invokes run on a thread (did you mean to start it instead?) (RU_INVOKE_RUN) +RU_INVOKE_RUN=;SFP-3;CWE-572 +RU_INVOKE_RUNMsg=This method explicitly invokes run() on an object. In general, classes implement the Runnable interface because they are going to have their run() method invoked in a new thread, in which case Thread.start() is the right method to call. + +#SC: Constructor invokes Thread.start() (SC_START_IN_CTOR) +SC_START_IN_CTOR=;SFP--1;CWE-398 +SC_START_IN_CTORMsg=The constructor starts a thread. This is likely to be wrong if the class is ever extended/subclassed, since the thread will be started before the subclass constructor is started. + +#SP: Method spins on field (SP_SPIN_ON_FIELD) +SP_SPIN_ON_FIELD=;SFP-19;CWE-667 +SP_SPIN_ON_FIELDMsg=This method spins in a loop which reads a field. The compiler may legally hoist the read out of the loop, turning the code into an infinite loop. The class should be changed so it uses proper synchronization (including wait and notify calls). + +#STCAL: Call to static Calendar (STCAL_INVOKE_ON_STATIC_CALENDAR_INSTANCE) +STCAL_INVOKE_ON_STATIC_CALENDAR_INSTANCE=;SFP-19;CWE-667 +STCAL_INVOKE_ON_STATIC_CALENDAR_INSTANCEMsg=Even though the JavaDoc does not contain a hint about it, Calendars are inherently unsafe for multihtreaded use. The detector has found a call to an instance of Calendar that has been obtained via a static field. This looks suspicous. For more information on this see Sun Bug #6231579 and Sun Bug #6178997. + +#STCAL: Call to static DateFormat (STCAL_INVOKE_ON_STATIC_DATE_FORMAT_INSTANCE) +STCAL_INVOKE_ON_STATIC_DATE_FORMAT_INSTANCE=;SFP-19;CWE-667 +STCAL_INVOKE_ON_STATIC_DATE_FORMAT_INSTANCEMsg=As the JavaDoc states, DateFormats are inherently unsafe for multithreaded use. The detector has found a call to an instance of DateFormat that has been obtained via a static field. This looks suspicous. For more information on this see Sun Bug #6231579 and Sun Bug #6178997. + +#STCAL: Static Calendar (STCAL_STATIC_CALENDAR_INSTANCE) +STCAL_STATIC_CALENDAR_INSTANCE=;SFP-19;CWE-667 +STCAL_STATIC_CALENDAR_INSTANCEMsg=Even though the JavaDoc does not contain a hint about it, Calendars are inherently unsafe for multihtreaded use. Sharing a single instance across thread boundaries without proper synchronization will result in erratic behavior of the application. Under 1.4 problems seem to surface less often than under Java 5 where you will probably see random ArrayIndexOutOfBoundsExceptions or IndexOutOfBoundsExceptions in sun.util.calendar.BaseCalendar.getCalendarDateFromFixedDate(). You may also experience serialization problems. Using an instance field is recommended. For more information on this see Sun Bug #6231579 and Sun Bug #6178997. + +#STCAL: Static DateFormat (STCAL_STATIC_SIMPLE_DATE_FORMAT_INSTANCE) +STCAL_STATIC_SIMPLE_DATE_FORMAT_INSTANCE=;SFP-19;CWE-667 +STCAL_STATIC_SIMPLE_DATE_FORMAT_INSTANCEMsg=As the JavaDoc states, DateFormats are inherently unsafe for multithreaded use. Sharing a single instance across thread boundaries without proper synchronization will result in erratic behavior of the application. You may also experience serialization problems. Using an instance field is recommended. For more information on this see Sun Bug #6231579 and Sun Bug #6178997. + +#SWL: Method calls Thread.sleep() with a lock held (SWL_SLEEP_WITH_LOCK_HELD) +SWL_SLEEP_WITH_LOCK_HELD=;SFP-19;CWE-667 +SWL_SLEEP_WITH_LOCK_HELDMsg=This method calls Thread.sleep() with a lock held. This may result in very poor performance and scalability, or a deadlock, since other threads may be waiting to acquire the lock. It is a much better idea to call wait() on the lock, which releases the lock and allows other threads to run. + +#TLW: Wait with two locks held (TLW_TWO_LOCK_WAIT) +TLW_TWO_LOCK_WAIT=;SFP-19;CWE-833 +TLW_TWO_LOCK_WAITMsg=Waiting on a monitor while two locks are held may cause deadlock. Performing a wait only releases the lock on the object being waited on, not any other locks. This not necessarily a bug, but is worth examining closely. + +#UG: Unsynchronized get method, synchronized set method (UG_SYNC_SET_UNSYNC_GET) +UG_SYNC_SET_UNSYNC_GET=;SFP-19;CWE-667 +UG_SYNC_SET_UNSYNC_GETMsg=This class contains similarly-named get and set methods where the set method is synchronized and the get method is not. This may result in incorrect behavior at runtime, as callers of the get method will not necessarily see a consistent state for the object. The get method should be made synchronized. + +#UL: Method does not release lock on all paths (UL_UNRELEASED_LOCK) +UL_UNRELEASED_LOCK=;SFP-19;CWE-667 +UL_UNRELEASED_LOCKMsg=This method acquires a JSR-166 (java.util.concurrent) lock, but does not release it on all paths out of the method. + +#UL: Method does not release lock on all exception paths (UL_UNRELEASED_LOCK_EXCEPTION_PATH) +UL_UNRELEASED_LOCK_EXCEPTION_PATH=;SFP-19;CWE-667 +UL_UNRELEASED_LOCK_EXCEPTION_PATHMsg=This method acquires a JSR-166 (java.util.concurrent) lock, but does not release it on all exception paths out of the method. + +#UW: Unconditional wait (UW_UNCOND_WAIT) +UW_UNCOND_WAIT=;SFP--1;CWE-398 +UW_UNCOND_WAITMsg=This method contains a call to java.lang.Object.wait() which is not guarded by conditional control flow. The code should verify that condition it intends to wait for is not already satisfied before calling wait; any previous notifications will be ignored. + +#VO: A volatile reference to an array doesn't treat the array elements as volatile (VO_VOLATILE_REFERENCE_TO_ARRAY) +VO_VOLATILE_REFERENCE_TO_ARRAY=;SFP--1;CWE-398 +VO_VOLATILE_REFERENCE_TO_ARRAYMsg=This declares a volatile reference to an array, which might not be what you want. With a volatile reference to an array, reads and writes of the reference to the array are treated as volatile, but the array elements are non-volatile. To get volatile array elements, you will need to use one of the atomic array classes in java.util.concurrent (provided in Java 5.0). + +#WL: Sychronization on getClass rather than class literal (WL_USING_GETCLASS_RATHER_THAN_CLASS_LITERAL) +WL_USING_GETCLASS_RATHER_THAN_CLASS_LITERAL=;SFP-19;CWE-398 +WL_USING_GETCLASS_RATHER_THAN_CLASS_LITERALMsg=This instance method synchronizes on this.getClass(). If this class is subclassed, subclasses will synchronize on the class object for the subclass, which isn't likely what was intended. + +#WS: Class's writeObject() method is synchronized but nothing else is (WS_WRITEOBJECT_SYNC) +WS_WRITEOBJECT_SYNC=;SFP-19;CWE-667 +WS_WRITEOBJECT_SYNCMsg=This class has a writeObject() method which is synchronized; however, no other method of the class is synchronized. + +#Wa: Condition.await() not in loop (WA_AWAIT_NOT_IN_LOOP) +WA_AWAIT_NOT_IN_LOOP=;SFP--1;CWE-398 +WA_AWAIT_NOT_IN_LOOPMsg=This method contains a call to java.util.concurrent.await() (or variants) which is not in a loop. If the object is used for multiple conditions, the condition the caller intended to wait for might not be the one that actually occurred. + +#Wa: Wait not in loop (WA_NOT_IN_LOOP) +WA_NOT_IN_LOOP=;SFP--1;CWE-398 +WA_NOT_IN_LOOPMsg=This method contains a call to java.lang.Object.wait() which is not in a loop. If the monitor is used for multiple conditions, the condition the caller intended to wait for might not be the one that actually occurred. + +#Bx: Primitive value is boxed and then immediately unboxed (BX_BOXING_IMMEDIATELY_UNBOXED) +BX_BOXING_IMMEDIATELY_UNBOXED=;SFP--1;CWE-710 +BX_BOXING_IMMEDIATELY_UNBOXEDMsg=A primitive is boxed, and then immediately unboxed. This probably is due to a manual boxing in a place where an unboxed value is required, thus forcing the compiler to immediately undo the work of the boxing. + +#Bx: Primitive value is boxed then unboxed to perform primitive coercion (BX_BOXING_IMMEDIATELY_UNBOXED_TO_PERFORM_COERCION) +BX_BOXING_IMMEDIATELY_UNBOXED_TO_PERFORM_COERCION=;SFP--1;CWE-710 +BX_BOXING_IMMEDIATELY_UNBOXED_TO_PERFORM_COERCIONMsg=A primitive boxed value constructed and then immediately converted into a different primitive type (e.g., new Double(d).intValue()). Just perform direct primitive coercion (e.g., (int) d). + +#Bx: Method allocates a boxed primitive just to call toString (DM_BOXED_PRIMITIVE_TOSTRING) +DM_BOXED_PRIMITIVE_TOSTRING=;SFP--1;CWE-710 +DM_BOXED_PRIMITIVE_TOSTRINGMsg=A boxed primitive is allocated just to call toString(). It is more effective to just use the static form of toString which takes the primitive value. + +#Bx: Method invokes inefficient floating-point Number constructor; use static valueOf instead (DM_FP_NUMBER_CTOR) +DM_FP_NUMBER_CTOR=;SFP--1;CWE-398 +DM_FP_NUMBER_CTORMsg=Using new Double(double) is guaranteed to always result in a new object whereas Double.valueOf(double) allows caching of values to be done by the compiler, class library, or JVM. Using of cached values avoids object allocation and the code will be faster. Unless the class must be compatible with JVMs predating Java 1.5, use either autoboxing or the valueOf() method when creating instances of Double and Float. + +#Bx: Method invokes inefficient Number constructor; use static valueOf instead (DM_NUMBER_CTOR) +DM_NUMBER_CTOR=;SFP--1;CWE-398 +DM_NUMBER_CTORMsg=Using new Integer(int) is guaranteed to always result in a new object whereas Integer.valueOf(int) allows caching of values to be done by the compiler, class library, or JVM. Using of cached values avoids object allocation and the code will be faster. Values between -128 and 127 are guaranteed to have corresponding cached instances and using valueOf is approximately 3.5 times faster than using constructor. For values outside the constant range the performance of both styles is the same. Unless the class must be compatible with JVMs predating Java 1.5, use either autoboxing or the valueOf() method when creating instances of Long, Integer, Short, Character, and Byte. + +#Dm: The equals and hashCode methods of URL are blocking (DMI_BLOCKING_METHODS_ON_URL) +DMI_BLOCKING_METHODS_ON_URL=;SFP--1;CWE-398 +DMI_BLOCKING_METHODS_ON_URLMsg=The equals and hashCode method of URL perform domain name resolution, this can result in a big performance hit. See http://michaelscharf.blogspot.com/2006/11/javaneturlequals-and-hashcode-make.html for more information. Consider using java.net.URI instead. + +#Dm: Maps and sets of URLs can be performance hogs (DMI_COLLECTION_OF_URLS) +DMI_COLLECTION_OF_URLS=;SFP--1;CWE-398 +DMI_COLLECTION_OF_URLSMsg=This method or field is or uses a Map or Set of URLs. Since both the equals and hashCode method of URL perform domain name resolution, this can result in a big performance hit. See http://michaelscharf.blogspot.com/2006/11/javaneturlequals-and-hashcode-make.html for more information. Consider using java.net.URI instead. + +#Dm: Method invokes inefficient Boolean constructor; use Boolean.valueOf(...) instead (DM_BOOLEAN_CTOR) +DM_BOOLEAN_CTOR=;SFP--1;CWE-398 +DM_BOOLEAN_CTORMsg=Creating new instances of java.lang.Boolean wastes memory, since Boolean objects are immutable and there are only two useful values of this type. Use the Boolean.valueOf() method (or Java 1.5 autoboxing) to create Boolean objects instead. + +#Dm: Explicit garbage collection; extremely dubious except in benchmarking code (DM_GC) +DM_GC=;SFP--1;CWE-710 +DM_GCMsg=Code explicitly invokes garbage collection. Except for specific use in benchmarking, this is very dubious. In the past, situations where people have explicitly invoked the garbage collector in routines such as close or finalize methods has led to huge performance black holes. Garbage collection can be expensive. Any situation that forces hundreds or thousands of garbage collections will bring the machine to a crawl. + +#Dm: Method allocates an object, only to get the class object (DM_NEW_FOR_GETCLASS) +DM_NEW_FOR_GETCLASS=;SFP--1;CWE-398 +DM_NEW_FOR_GETCLASSMsg=This method allocates an object just to call getClass() on it, in order to retrieve the Class object for it. It is simpler to just access the .class property of the class. + +#Dm: Use the nextInt method of Random rather than nextDouble to generate a random integer (DM_NEXTINT_VIA_NEXTDOUBLE) +DM_NEXTINT_VIA_NEXTDOUBLE=;SFP--1;CWE-710 +DM_NEXTINT_VIA_NEXTDOUBLEMsg=If r is a java.util.Random, you can generate a random number from 0 to n-1 using r.nextInt(n), rather than using (int)(r.nextDouble() * n). + +#Dm: Method invokes inefficient new String(String) constructor (DM_STRING_CTOR) +DM_STRING_CTOR=;SFP--1;CWE-398 +DM_STRING_CTORMsg=Using the java.lang.String(String) constructor wastes memory because the object so constructed will be functionally indistinguishable from the String passed as a parameter. Just use the argument String directly. + +#Dm: Method invokes toString() method on a String (DM_STRING_TOSTRING) +DM_STRING_TOSTRING=;SFP--1;CWE-710 +DM_STRING_TOSTRINGMsg=Calling String.toString() is just a redundant operation. Just use the String. + +#Dm: Method invokes inefficient new String() constructor (DM_STRING_VOID_CTOR) +DM_STRING_VOID_CTOR=;SFP--1;CWE-398 +DM_STRING_VOID_CTORMsg=Creating a new java.lang.String object using the no-argument constructor wastes memory because the object so created will be functionally indistinguishable from the empty string constant "". Java guarantees that identical string constants will be represented by the same String object. Therefore, you should just use the empty string constant directly. + +#HSC: Huge string constants is duplicated across multiple class files (HSC_HUGE_SHARED_STRING_CONSTANT) +HSC_HUGE_SHARED_STRING_CONSTANT=;SFP--1;CWE-398 +HSC_HUGE_SHARED_STRING_CONSTANTMsg=A large String constant is duplicated across multiple class files. This is likely because a final field is initialized to a String constant, and the Java language mandates that all references to a final field from other classes be inlined into that classfile. See JDK bug 6447475 for a description of an occurrence of this bug in the JDK and how resolving it reduced the size of the JDK by 1 megabyte. + +#ITA: Method uses toArray() with zero-length array argument (ITA_INEFFICIENT_TO_ARRAY) +ITA_INEFFICIENT_TO_ARRAY=;SFP--1;CWE-398 +ITA_INEFFICIENT_TO_ARRAYMsg=This method uses the toArray() method of a collection derived class, and passes in a zero-length prototype array argument. It is more efficient to use myCollection.toArray(new Foo[myCollection.size()]) If the array passed in is big enough to store all of the elements of the collection, then it is populated and returned directly. This avoids the need to create a second array (by reflection) to return as the result. + +#SBSC: Method concatenates strings using + in a loop (SBSC_USE_STRINGBUFFER_CONCATENATION) +SBSC_USE_STRINGBUFFER_CONCATENATION=;SFP--1;CWE-398 +SBSC_USE_STRINGBUFFER_CONCATENATIONMsg=The method seems to be building a String using concatenation in a loop. In each iteration, the String is converted to a StringBuffer/StringBuilder, appended to, and converted back to a String. This can lead to a cost quadratic in the number of iterations, as the growing string is recopied in each iteration. Better performance can be obtained by using a StringBuffer (or StringBuilder in Java 1.5) explicitly. + +#SIC: Should be a static inner class (SIC_INNER_SHOULD_BE_STATIC) +SIC_INNER_SHOULD_BE_STATIC=;SFP--1;CWE-398 +SIC_INNER_SHOULD_BE_STATICMsg=This class is an inner class, but does not use its embedded reference to the object which created it. This reference makes the instances of the class larger, and may keep the reference to the creator object alive longer than necessary. If possible, the class should be made static. + +#SIC: Could be refactored into a named static inner class (SIC_INNER_SHOULD_BE_STATIC_ANON) +SIC_INNER_SHOULD_BE_STATIC_ANON=;SFP--1;CWE-398 +SIC_INNER_SHOULD_BE_STATIC_ANONMsg=This class is an inner class, but does not use its embedded reference to the object which created it. This reference makes the instances of the class larger, and may keep the reference to the creator object alive longer than necessary. If possible, the class should be made into a static inner class. Since anonymous inner classes cannot be marked as static, doing this will require refactoring the inner class so that it is a named inner class. + +#SIC: Could be refactored into a static inner class (SIC_INNER_SHOULD_BE_STATIC_NEEDS_THIS) +SIC_INNER_SHOULD_BE_STATIC_NEEDS_THIS=;SFP--1;CWE-398 +SIC_INNER_SHOULD_BE_STATIC_NEEDS_THISMsg=This class is an inner class, but does not use its embedded reference to the object which created it except during construction of the inner object. This reference makes the instances of the class larger, and may keep the reference to the creator object alive longer than necessary. If possible, the class should be made into a static inner class. Since the reference to the outer object is required during construction of the inner instance, the inner class will need to be refactored so as to pass a reference to the outer instance to the constructor for the inner class. + +#This class contains an instance final field that is initialized to a compile-time static value. Consider making the field static. +SS_SHOULD_BE_STATIC=;SFP--1;CWE-710 +SS_SHOULD_BE_STATICMsg=This class contains an instance final field that is initialized to a compile-time static value. Consider making the field static. + +#UM: Method calls static Math class method on a constant value (UM_UNNECESSARY_MATH) +UM_UNNECESSARY_MATH=;SFP--1;CWE-710 +UM_UNNECESSARY_MATHMsg=This method uses a static method from java.lang.Math on a constant value. This method's result in this case, can be determined statically, and is faster and sometimes more accurate to just use the constant. + +#UPM: Private method is never called (UPM_UNCALLED_PRIVATE_METHOD) +UPM_UNCALLED_PRIVATE_METHOD=;SFP-2;CWE-561 +UPM_UNCALLED_PRIVATE_METHODMsg=This private method is never called. Although it is possible that the method will be invoked through reflection, it is more likely that the method is never used, and should be removed. + +#This field is never read. Consider removing it from the class. +URF_UNREAD_FIELD=;SFP-2;CWE-563 +URF_UNREAD_FIELDMsg=This field is never read. Consider removing it from the class. + +#UuF: Unused field (UUF_UNUSED_FIELD) +UUF_UNUSED_FIELD=;SFP-2;CWE-563 +UUF_UNUSED_FIELDMsg=This field is never used. Consider removing it from the class. + +#WMI: Inefficient use of keySet iterator instead of entrySet iterator (WMI_WRONG_MAP_ITERATOR) +WMI_WRONG_MAP_ITERATOR=;SFP--1;CWE-710 +WMI_WRONG_MAP_ITERATORMsg=This method accesses the value of a Map entry, using a key that was retrieved from a keySet iterator. It is more efficient to use an iterator on the entrySet of the map, to avoid the Map.get(key) lookup. + +#Dm: Hardcoded constant database password (DMI_CONSTANT_DB_PASSWORD) +DMI_CONSTANT_DB_PASSWORD=;SFP-33;CWE-259 +DMI_CONSTANT_DB_PASSWORDMsg=This code creates a database connect using a hardcoded, constant password. Anyone with access to either the source code or the compiled code can easily learn the password. + +#Dm: Empty database password (DMI_EMPTY_DB_PASSWORD) +DMI_EMPTY_DB_PASSWORD=;SFP-33;CWE-259 +DMI_EMPTY_DB_PASSWORDMsg=This code creates a database connect using a blank or empty password. This indicates that the database is not protected by a password. + +#HRS: HTTP cookie formed from untrusted input (HRS_REQUEST_PARAMETER_TO_COOKIE) +HRS_REQUEST_PARAMETER_TO_COOKIE=;SFP-24;CWE-20 +HRS_REQUEST_PARAMETER_TO_COOKIEMsg=This code constructs an HTTP Cookie using an untrusted HTTP parameter. If this cookie is added to an HTTP response, it will allow a HTTP response splitting vulnerability. See http://en.wikipedia.org/wiki/HTTP_response_splitting for more information. FindBugs looks only for the most blatant, obvious cases of HTTP response splitting. If FindBugs found any, you almost certainly have more vulnerabilities that FindBugs doesn't report. If you are concerned about HTTP response splitting, you should seriously consider using a commercial static analysis or pen-testing tool. + +#HRS: HTTP Response splitting vulnerability (HRS_REQUEST_PARAMETER_TO_HTTP_HEADER) +HRS_REQUEST_PARAMETER_TO_HTTP_HEADER=;SFP-24;CWE-113 +HRS_REQUEST_PARAMETER_TO_HTTP_HEADERMsg=This code directly writes an HTTP parameter to an HTTP header, which allows for a HTTP response splitting vulnerability. See http://en.wikipedia.org/wiki/HTTP_response_splitting for more information. FindBugs looks only for the most blatant, obvious cases of HTTP response splitting. If FindBugs found any, you almost certainly have more vulnerabilities that FindBugs doesn't report. If you are concerned about HTTP response splitting, you should seriously consider using a commercial static analysis or pen-testing tool. + +#SQL: Nonconstant string passed to execute method on an SQL statement (SQL_NONCONSTANT_STRING_PASSED_TO_EXECUTE) +SQL_NONCONSTANT_STRING_PASSED_TO_EXECUTE=;SFP-24;CWE-89 +SQL_NONCONSTANT_STRING_PASSED_TO_EXECUTEMsg=The method invokes the execute method on an SQL statement with a String that seems to be dynamically generated. Consider using a prepared statement instead. It is more efficient and less vulnerable to SQL injection attacks. + +#SQL: A prepared statement is generated from a nonconstant String (SQL_PREPARED_STATEMENT_GENERATED_FROM_NONCONSTANT_STRING) +SQL_PREPARED_STATEMENT_GENERATED_FROM_NONCONSTANT_STRING=;SFP-24;CWE-89 +SQL_PREPARED_STATEMENT_GENERATED_FROM_NONCONSTANT_STRINGMsg=The code creates an SQL prepared statement from a nonconstant String. If unchecked, tainted data from a user is used in building this String, SQL injection could be used to make the prepared statement do something unexpected and undesirable. + +#XSS: JSP reflected cross site scripting vulnerability (XSS_REQUEST_PARAMETER_TO_JSP_WRITER) +XSS_REQUEST_PARAMETER_TO_JSP_WRITER=;SFP-24;CWE-80 +XSS_REQUEST_PARAMETER_TO_JSP_WRITERMsg=This code directly writes an HTTP parameter to JSP output, which allows for a cross site scripting vulnerability. See http://en.wikipedia.org/wiki/Cross-site_scripting for more information. FindBugs looks only for the most blatant, obvious cases of cross site scripting. If FindBugs found any, you almost certainly have more cross site scripting vulnerabilities that FindBugs doesn't report. If you are concerned about cross site scripting, you should seriously consider using a commercial static analysis or pen-testing tool. + +#XSS: Servlet reflected cross site scripting vulnerability (XSS_REQUEST_PARAMETER_TO_SEND_ERROR) +XSS_REQUEST_PARAMETER_TO_SEND_ERROR=;SFP-24;CWE-80 +XSS_REQUEST_PARAMETER_TO_SEND_ERRORMsg=This code directly writes an HTTP parameter to a Server error page (using HttpServletResponse.sendError). Echoing this untrusted input allows for a reflected cross site scripting vulnerability. See http://en.wikipedia.org/wiki/Cross-site_scripting for more information. FindBugs looks only for the most blatant, obvious cases of cross site scripting. If FindBugs found any, you almost certainly have more cross site scripting vulnerabilities that FindBugs doesn't report. If you are concerned about cross site scripting, you should seriously consider using a commercial static analysis or pen-testing tool. + +#XSS: Servlet reflected cross site scripting vulnerability (XSS_REQUEST_PARAMETER_TO_SERVLET_WRITER) +XSS_REQUEST_PARAMETER_TO_SERVLET_WRITER=;SFP-24;CWE-80 +XSS_REQUEST_PARAMETER_TO_SERVLET_WRITERMsg=This code directly writes an HTTP parameter to Servlet output, which allows for a reflected cross site scripting vulnerability. See http://en.wikipedia.org/wiki/Cross-site_scripting for more information. FindBugs looks only for the most blatant, obvious cases of cross site scripting. If FindBugs found any, you almost certainly have more cross site scripting vulnerabilities that FindBugs doesn't report. If you are concerned about cross site scripting, you should seriously consider using a commercial static analysis or pen-testing tool. + +#BC: Questionable cast to abstract collection (BC_BAD_CAST_TO_ABSTRACT_COLLECTION) +BC_BAD_CAST_TO_ABSTRACT_COLLECTION=;SFP-1;CWE-704 +BC_BAD_CAST_TO_ABSTRACT_COLLECTIONMsg=This code casts a Collection to an abstract collection (such as List, Set, or Map). Ensure that you are guaranteed that the object is of the type you are casting to. If all you need is to be able to iterate through a collection, you don't need to cast it to a Set or List. + +BC: Questionable cast to concrete collection (BC_BAD_CAST_TO_CONCRETE_COLLECTION) +BC_BAD_CAST_TO_CONCRETE_COLLECTION=;SFP-1;CWE-704 +BC_BAD_CAST_TO_CONCRETE_COLLECTIONMsg=This code casts an abstract collection (such as a Collection, List, or Set) to a specific concrete implementation (such as an ArrayList or HashSet). This might not be correct, and it may make your code fragile, since it makes it harder to switch to other concrete implementations at a future point. Unless you have a particular reason to do so, just use the abstract collection class. + +#BC: Unchecked/unconfirmed cast (BC_UNCONFIRMED_CAST) +BC_UNCONFIRMED_CAST=;SFP-1;CWE-704 +BC_UNCONFIRMED_CAST=This cast is unchecked, and not all instances of the type casted from can be cast to the type it is being cast to. Ensure that your program logic ensures that this cast will not fail. + +#BC: instanceof will always return true (BC_VACUOUS_INSTANCEOF) +BC_VACUOUS_INSTANCEOF=;SFP-1;CWE-570 +BC_VACUOUS_INSTANCEOFMsg=This instanceof test will always return true (unless the value being tested is null). Although this is safe, make sure it isn't an indication of some misunderstanding or some other logic error. If you really want to test the value for being null, perhaps it would be clearer to do better to do a null test rather than an instanceof test. + +#BSHIFT: Unsigned right shift cast to short/byte (ICAST_QUESTIONABLE_UNSIGNED_RIGHT_SHIFT) +ICAST_QUESTIONABLE_UNSIGNED_RIGHT_SHIFT=;SFP-1;CWE-197 +ICAST_QUESTIONABLE_UNSIGNED_RIGHT_SHIFTMsg=The code performs an unsigned right shift, whose result is then cast to a short or byte, which discards the upper bits of the result. Since the upper bits are discarded, there may be no difference between a signed and unsigned right shift (depending upon the size of the shift). + +#CI: Class is final but declares protected field (CI_CONFUSED_INHERITANCE) +CI_CONFUSED_INHERITANCE=;SFP--1;CWE-710 +CI_CONFUSED_INHERITANCEMsg=This class is declared to be final, but declares fields to be protected. Since the class is final, it can not be derived from, and the use of protected is confusing. The access modifier for the field should be changed to private or public to represent the true use for the field. + +#DB: Method uses the same code for two branches (DB_DUPLICATE_BRANCHES) +DB_DUPLICATE_BRANCHES=;SFP--1;CWE-398 +DB_DUPLICATE_BRANCHESMsg=This method uses the same code to implement two branches of a conditional branch. Check to ensure that this isn't a coding mistake. + +#DB: Method uses the same code for two switch clauses (DB_DUPLICATE_SWITCH_CLAUSES) +DB_DUPLICATE_SWITCH_CLAUSES=;SFP--1;CWE-398 +DB_DUPLICATE_SWITCH_CLAUSESMsg=This method uses the same code to implement two clauses of a switch statement. This could be a case of duplicate code, but it might also indicate a coding mistake. + +#DLS: Dead store to local variable (DLS_DEAD_LOCAL_STORE) +DLS_DEAD_LOCAL_STORE=;SFP--1;CWE-398 +DLS_DEAD_LOCAL_STOREMsg=This instruction assigns a value to a local variable, but the value is not read or used in any subsequent instruction. Often, this indicates an error, because the value computed is never used. Note that Sun's javac compiler often generates dead stores for final local variables. Because FindBugs is a bytecode-based tool, there is no easy way to eliminate these false positives. + +#DLS: Useless assignment in return statement (DLS_DEAD_LOCAL_STORE_IN_RETURN) +DLS_DEAD_LOCAL_STORE_IN_RETURN=;SFP--1;CWE-398 +DLS_DEAD_LOCAL_STORE_IN_RETURNMsg=This statement assigns to a local variable in a return statement. This assignment has effect. Please verify that this statement does the right thing. + +#DLS: Dead store of null to local variable (DLS_DEAD_LOCAL_STORE_OF_NULL) +DLS_DEAD_LOCAL_STORE_OF_NULL=;SFP--1;CWE-398 +DLS_DEAD_LOCAL_STORE_OF_NULLMsg=The code stores null into a local variable, and the stored value is not read. This store may have been introduced to assist the garbage collector, but as of Java SE 6.0, this is no longer needed or useful. + +#DMI: Code contains a hard coded reference to an absolute pathname (DMI_HARDCODED_ABSOLUTE_FILENAME) +DMI_HARDCODED_ABSOLUTE_FILENAME=;SFP--1;CWE-398 +DMI_HARDCODED_ABSOLUTE_FILENAMEMsg=This code constructs a File object using a hard coded to an absolute pathname (e.g., new File("/home/dannyc/workspace/j2ee/src/share/com/sun/enterprise/deployment"); + +#DMI: Non serializable object written to ObjectOutput (DMI_NONSERIALIZABLE_OBJECT_WRITTEN) +DMI_NONSERIALIZABLE_OBJECT_WRITTEN=;SFP-1;CWE-594 +DMI_NONSERIALIZABLE_OBJECT_WRITTENMsg=This code seems to be passing a non-serializable object to the ObjectOutput.writeObject method. If the object is, indeed, non-serializable, an error will result. + +#DMI: Invocation of substring(0), which returns the original value (DMI_USELESS_SUBSTRING) +DMI_USELESS_SUBSTRING=;SFP--1;CWE-398 +DMI_USELESS_SUBSTRINGMsg=This code invokes substring(0) on a String, which returns the original value. + +#Dm: Thread passed where Runnable expected (DMI_THREAD_PASSED_WHERE_RUNNABLE_EXPECTED) +DMI_THREAD_PASSED_WHERE_RUNNABLE_EXPECTED=;SFP-1;CWE-686 +DMI_THREAD_PASSED_WHERE_RUNNABLE_EXPECTEDMsg=A Thread object is passed as a parameter to a method where a Runnable is expected. This is rather unusual, and may indicate a logic error or cause unexpected behavior. + +#Eq: Class doesn't override equals in superclass (EQ_DOESNT_OVERRIDE_EQUALS) +EQ_DOESNT_OVERRIDE_EQUALS=;SFP--1;CWE-389 +EQ_DOESNT_OVERRIDE_EQUALSMsg=This class extends a class that defines an equals method and adds fields, but doesn't define an equals method itself. Thus, equality on instances of this class will ignore the identity of the subclass and the added fields. Be sure this is what is intended, and that you don't need to override the equals method. Even if you don't need to override the equals method, consider overriding it anyway to document the fact that the equals method for the subclass just return the result of invoking super.equals(o). + +#Eq: Unusual equals method (EQ_UNUSUAL) +EQ_UNUSUAL=;SFP--1;CWE-389 +EQ_UNUSUALMsg=This class doesn't do any of the patterns we recognize for checking that the type of the argument is compatible with the type of the this object. There might not be anything wrong with this code, but it is worth reviewing. + +#FE: Test for floating point equality (FE_FLOATING_POINT_EQUALITY) +FE_FLOATING_POINT_EQUALITY=;SFP--1;CWE-398 +FE_FLOATING_POINT_EQUALITYMsg=This operation compares two floating point values for equality. Because floating point calculations may involve rounding, calculated float and double values may not be accurate. For values that must be precise, such as monetary values, consider using a fixed-precision type such as BigDecimal. For values that need not be precise, consider comparing for equality within some range, for example: if ( Math.abs(x - y) < .0000001 ). See the Java Language Specification, section 4.2.4. + +#FS: Non-Boolean argument formatted using %b format specifier (VA_FORMAT_STRING_BAD_CONVERSION_TO_BOOLEAN) +VA_FORMAT_STRING_BAD_CONVERSION_TO_BOOLEAN=;SFP-1;CWE-686 +VA_FORMAT_STRING_BAD_CONVERSION_TO_BOOLEANMsg=An argument not of type Boolean is being formatted with a %b format specifier. This won't throw an exception; instead, it will print true for any nonnull value, and false for null. This feature of format strings is strange, and may not be what you intended. + +#IA: Ambiguous invocation of either an inherited or outer method (IA_AMBIGUOUS_INVOCATION_OF_INHERITED_OR_OUTER_METHOD) +IA_AMBIGUOUS_INVOCATION_OF_INHERITED_OR_OUTER_METHOD=;SFP--1;CWE-398 +IA_AMBIGUOUS_INVOCATION_OF_INHERITED_OR_OUTER_METHODMsg=An inner class is invoking a method that could be resolved to either a inherited method or a method defined in an outer class. By the Java semantics, it will be resolved to invoke the inherited method, but this may not be want you intend. If you really intend to invoke the inherited method, invoke it by invoking the method on super (e.g., invoke super.foo(17)), and thus it will be clear to other readers of your code and to FindBugs that you want to invoke the inherited method, not the method in the outer class. + +#IC: Initialization circularity (IC_INIT_CIRCULARITY) +IC_INIT_CIRCULARITY=;SFP--1;CWE-398 +IC_INIT_CIRCULARITYMsg=A circularity was detected in the static initializers of the two classes referenced by the bug instance. Many kinds of unexpected behavior may arise from such circularity. + +#ICAST: integral division result cast to double or float (ICAST_IDIV_CAST_TO_DOUBLE) +ICAST_IDIV_CAST_TO_DOUBLE=;SFP-1;CWE-197 +ICAST_IDIV_CAST_TO_DOUBLEMsg=This code casts the result of an integral division (e.g., int or long division) operation to double or float. Doing division on integers truncates the result to the integer value closest to zero. The fact that the result was cast to double suggests that this precision should have been retained. What was probably meant was to cast one or both of the operands to double before performing the division. + +#ICAST: Result of integer multiplication cast to long (ICAST_INTEGER_MULTIPLY_CAST_TO_LONG) +ICAST_INTEGER_MULTIPLY_CAST_TO_LONG=;SFP-1;CWE-190 +ICAST_INTEGER_MULTIPLY_CAST_TO_LONGMsg=This code performs integer multiply and then converts the result to a long, as in: long convertDaysToMilliseconds(int days) { return 1000*3600*24*days; } If the multiplication is done using long arithmetic, you can avoid the possibility that the result will overflow. + +#IM: Computation of average could overflow (IM_AVERAGE_COMPUTATION_COULD_OVERFLOW) +IM_AVERAGE_COMPUTATION_COULD_OVERFLOW=;SFP-1;CWE-190 +IM_AVERAGE_COMPUTATION_COULD_OVERFLOWMsg=The code computes the average of two integers using either division or signed right shift, and then uses the result as the index of an array. If the values being averaged are very large, this can overflow (resulting in the computation of a negative average). Assuming that the result is intended to be nonnegative, you can use an unsigned right shift instead. In other words, rather that using (low+high)/2, use (low+high) >>> 1. This bug exists in many earlier implementations of binary search and merge sort. Martin Buchholz found and fixed it in the JDK libraries, and Joshua Bloch widely publicized the bug pattern. + +#IM: Check for oddness that won't work for negative numbers (IM_BAD_CHECK_FOR_ODD) +IM_BAD_CHECK_FOR_ODD=;SFP--1;CWE-398 +IM_BAD_CHECK_FOR_ODDMsg=The code uses x % 2 == 1 to check to see if a value is odd, but this won't work for negative numbers (e.g., (-5) % 2 == -1). If this code is intending to check for oddness, consider using x & 1 == 1, or x % 2 != 0. + +#INT: Integer remainder modulo 1 (INT_BAD_REM_BY_1) +INT_BAD_REM_BY_1=;SFP--1;CWE-398 +INT_BAD_REM_BY_1Msg=Any expression (exp % 1) is guaranteed to always return zero. Did you mean (exp & 1) or (exp % 2) instead? + +#INT: Vacuous comparison of integer value (INT_VACUOUS_COMPARISON) +INT_VACUOUS_COMPARISON=;SFP--1;CWE-398 +INT_VACUOUS_COMPARISONMsg=There is an integer comparison that always returns the same value (e.g., x <= Integer.MAX_VALUE). + +#MTIA: Class extends Servlet class and uses instance variables (MTIA_SUSPECT_SERVLET_INSTANCE_FIELD) +MTIA_SUSPECT_SERVLET_INSTANCE_FIELD=;SFP--1;CWE-398 +MTIA_SUSPECT_SERVLET_INSTANCE_FIELDMsg=This class extends from a Servlet class, and uses an instance member variable. Since only one instance of a Servlet class is created by the J2EE framework, and used in a multithreaded way, this paradigm is highly discouraged and most likely problematic. Consider only using method local variables. + +#MTIA: Class extends Struts Action class and uses instance variables (MTIA_SUSPECT_STRUTS_INSTANCE_FIELD) +MTIA_SUSPECT_STRUTS_INSTANCE_FIELD=;SFP--1;CWE-398 +MTIA_SUSPECT_STRUTS_INSTANCE_FIELDMsg=This class extends from a Struts Action class, and uses an instance member variable. Since only one instance of a struts Action class is created by the Struts framework, and used in a multithreaded way, this paradigm is highly discouraged and most likely problematic. Consider only using method local variables. Only instance fields that are written outside of a monitor are reported. + +#NP: Dereference of the result of readLine() without nullcheck (NP_DEREFERENCE_OF_READLINE_VALUE) +NP_DEREFERENCE_OF_READLINE_VALUE=;SFP-7;CWE-476 +NP_DEREFERENCE_OF_READLINE_VALUEMsg=The result of invoking readLine() is dereferenced without checking to see if the result is null. If there are no more lines of text to read, readLine() will return null and dereferencing that will generate a null pointer exception. + +#NP: Immediate dereference of the result of readLine() (NP_IMMEDIATE_DEREFERENCE_OF_READLINE) +NP_IMMEDIATE_DEREFERENCE_OF_READLINE=;SFP-7;CWE-476 +NP_IMMEDIATE_DEREFERENCE_OF_READLINEMsg=The result of invoking readLine() is immediately dereferenced. If there are no more lines of text to read, readLine() will return null and dereferencing that will generate a null pointer exception. + +#NP: Load of known null value (NP_LOAD_OF_KNOWN_NULL_VALUE) +NP_LOAD_OF_KNOWN_NULL_VALUE=;SFP-7;CWE-476 +NP_LOAD_OF_KNOWN_NULL_VALUEMsg=The variable referenced at this point is known to be null due to an earlier check against null. Although this is valid, it might be a mistake (perhaps you intended to refer to a different variable, or perhaps the earlier check to see if the variable is null should have been a check to see if it was nonnull). + +#NP: Load of known null value (NP_LOAD_OF_KNOWN_NULL_VALUE) +NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE=;SFP-7;CWE-476 +NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUEMsg=The return value from a method is dereferenced without a null check, and the return value of that method is one that should generally be checked for null. This may lead to a NullPointerException when the code is executed. + +#NP: Possible null pointer dereference due to return value of called method (NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE) +NP_NULL_ON_SOME_PATH_MIGHT_BE_INFEASIBLE=;SFP-7;CWE-476 +NP_NULL_ON_SOME_PATH_MIGHT_BE_INFEASIBLEMsg=There is a branch of statement that, if executed, guarantees that a null value will be dereferenced, which would generate a NullPointerException when the code is executed. Of course, the problem might be that the branch or statement is infeasible and that the null pointer exception can't ever be executed; deciding that is beyond the ability of FindBugs. Due to the fact that this value had been previously tested for nullness, this is a definite possibility. + +#NP: Possible null pointer dereference on path that might be infeasible (NP_NULL_ON_SOME_PATH_MIGHT_BE_INFEASIBLE) +NP_PARAMETER_MUST_BE_NONNULL_BUT_MARKED_AS_NULLABLE=;SFP-7;CWE-476 +NP_PARAMETER_MUST_BE_NONNULL_BUT_MARKED_AS_NULLABLEMsg=This parameter is always used in a way that requires it to be nonnull, but the parameter is explicitly annotated as being Nullable. Either the use of the parameter or the annotation is wrong. + +#NS: Potentially dangerous use of non-short-circuit logic (NS_DANGEROUS_NON_SHORT_CIRCUIT) +NS_DANGEROUS_NON_SHORT_CIRCUIT=;SFP-1;CWE-768 +NS_DANGEROUS_NON_SHORT_CIRCUITMsg=This code seems to be using non-short-circuit logic (e.g., & or |) rather than short-circuit logic (&& or ||). In addition, it seem possible that, depending on the value of the left hand side, you might not want to evaluate the right hand side (because it would have side effects, could cause an exception or could be expensive. Non-short-circuit logic causes both sides of the expression to be evaluated even when the result can be inferred from knowing the left-hand side. This can be less efficient and can result in errors if the left-hand side guards cases when evaluating the right-hand side can generate an error. See the Java Language Specification for details + +#NS: Questionable use of non-short-circuit logic (NS_NON_SHORT_CIRCUIT) +NS_NON_SHORT_CIRCUIT=;SFP-1;CWE-768 +NS_NON_SHORT_CIRCUITMsg=This code seems to be using non-short-circuit logic (e.g., & or |) rather than short-circuit logic (&& or ||). Non-short-circuit logic causes both sides of the expression to be evaluated even when the result can be inferred from knowing the left-hand side. This can be less efficient and can result in errors if the left-hand side guards cases when evaluating the right-hand side can generate an error. See the Java Language Specification for details + +#PZLA: Consider returning a zero length array rather than null (PZLA_PREFER_ZERO_LENGTH_ARRAYS) +PZLA_PREFER_ZERO_LENGTH_ARRAYS=;SFP--1;CWE-710 +PZLA_PREFER_ZERO_LENGTH_ARRAYSMsg=It is often a better design to return a length zero array rather than a null reference to indicate that there are no results (i.e., an empty list of results). This way, no explicit check for null is needed by clients of the method. On the other hand, using null to indicate "there is no answer to this question" is probably appropriate. For example, File.listFiles() returns an empty list if given a directory containing no files, and returns null if the file is not a directory. + +#QF: Complicated, subtle or wrong increment in for-loop (QF_QUESTIONABLE_FOR_LOOP) +QF_QUESTIONABLE_FOR_LOOP=;SFP--1;CWE-389 +QF_QUESTIONABLE_FOR_LOOPMsg=Are you sure this for loop is incrementing the correct variable? It appears that another variable is being initialized and checked by the for loop. + +#RCN: Redundant comparison of non-null value to null (RCN_REDUNDANT_COMPARISON_OF_NULL_AND_NONNULL_VALUE) +RCN_REDUNDANT_COMPARISON_OF_NULL_AND_NONNULL_VALUE=;SFP--1;CWE-398 +RCN_REDUNDANT_COMPARISON_OF_NULL_AND_NONNULL_VALUEMsg=This method contains a reference known to be non-null with another reference known to be null. + +#RCN: Redundant comparison of two null values (RCN_REDUNDANT_COMPARISON_TWO_NULL_VALUES) +RCN_REDUNDANT_COMPARISON_TWO_NULL_VALUES=;SFP--1;CWE-398 +RCN_REDUNDANT_COMPARISON_TWO_NULL_VALUESMsg=This method contains a redundant comparison of two references known to both be definitely null. + +#RCN: Redundant nullcheck of value known to be non-null (RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE) +RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE=;SFP--1;CWE-398 +RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUEMsg=This method contains a redundant check of a known non-null value against the constant null. + +#RCN: Redundant nullcheck of value known to be null (RCN_REDUNDANT_NULLCHECK_OF_NULL_VALUE) +RCN_REDUNDANT_NULLCHECK_OF_NULL_VALUE=;SFP--1;CWE-398 +RCN_REDUNDANT_NULLCHECK_OF_NULL_VALUEMsg=This method contains a redundant check of a known null value against the constant null. + +#REC: Exception is caught when Exception is not thrown (REC_CATCH_EXCEPTION) +REC_CATCH_EXCEPTION=;SFP-5;CWE-396 +REC_CATCH_EXCEPTIONMsg=This method uses a try-catch block that catches Exception objects, but Exception is not thrown within the try block, and RuntimeException is not explicitly caught. It is a common bug pattern to say try { ... } catch (Exception e) { something } as a shorthand for catching a number of types of exception each of whose catch blocks is identical, but this construct also accidentally catches RuntimeException as well, masking potential bugs. + +#RI: Class implements same interface as superclass (RI_REDUNDANT_INTERFACES) +RI_REDUNDANT_INTERFACES=;SFP--1;CWE-398 +RI_REDUNDANT_INTERFACESMsg=This class declares that it implements an interface that is also implemented by a superclass. This is redundant because once a superclass implements an interface, all subclasses by default also implement this interface. It may point out that the inheritance hierarchy has changed since this class was created, and consideration should be given to the ownership of the interface's implementation. + +#RV: Method checks to see if result of String.indexOf is positive (RV_CHECK_FOR_POSITIVE_INDEXOF) +RV_CHECK_FOR_POSITIVE_INDEXOF=;SFP--1;CWE-398 +RV_CHECK_FOR_POSITIVE_INDEXOFMsg=The method invokes String.indexOf and checks to see if the result is positive or non-positive. It is much more typical to check to see if the result is negative or non-negative. It is positive only if the substring checked for occurs at some place other than at the beginning of the String. + +#RV: Method discards result of readLine after checking if it is nonnull (RV_DONT_JUST_NULL_CHECK_READLINE) +RV_DONT_JUST_NULL_CHECK_READLINE=;SFP-4;CWE-253 +RV_DONT_JUST_NULL_CHECK_READLINEMsg=The value returned by readLine is discarded after checking to see if the return value is non-null. In almost all situations, if the result is non-null, you will want to use that non-null value. Calling readLine again will give you a different line. + +#RV: Remainder of hashCode could be negative (RV_REM_OF_HASHCODE) +RV_REM_OF_HASHCODE=;SFP--1;CWE-398 +RV_REM_OF_HASHCODEMsg=This code computes a hashCode, and then computes the remainder of that value modulo another value. Since the hashCode can be negative, the result of the remainder operation can also be negative. Assuming you want to ensure that the result of your computation is nonnegative, you may need to change your code. If you know the divisor is a power of 2, you can use a bitwise and operator instead (i.e., instead of using x.hashCode()%n, use x.hashCode()&(n-1). This is probably faster than computing the remainder as well. If you don't know that the divisor is a power of 2, take the absolute value of the result of the remainder operation (i.e., use Math.abs(x.hashCode()%n) + +#RV: Remainder of 32-bit signed random integer (RV_REM_OF_RANDOM_INT) +RV_REM_OF_RANDOM_INT=;SFP--1;CWE-398 +RV_REM_OF_RANDOM_INTMsg=This code generates a random signed integer and then computes the remainder of that value modulo another value. Since the random number can be negative, the result of the remainder operation can also be negative. Be sure this is intended, and strongly consider using the Random.nextInt(int) method instead. + +#SA: Double assignment of local variable (SA_LOCAL_DOUBLE_ASSIGNMENT) +SA_LOCAL_DOUBLE_ASSIGNMENT=;SFP--1;CWE-398 +SA_LOCAL_DOUBLE_ASSIGNMENTMsg=This method contains a double assignment of a local variable + +#SA: Self assignment of local variable (SA_LOCAL_SELF_ASSIGNMENT) +SA_LOCAL_SELF_ASSIGNMENT=;SFP--1;CWE-398 +SA_LOCAL_SELF_ASSIGNMENTMsg=This method contains a self assignment of a local variable + +#SF: Switch statement found where one case falls through to the next case (SF_SWITCH_FALLTHROUGH) +SF_SWITCH_FALLTHROUGH=;SFP-4;CWE-484 +SF_SWITCH_FALLTHROUGHMsg=This method contains a switch statement where one case branch will fall through to the next case. Usually you need to end this case with a break or return. + +#SF: Switch statement found where default case is missing (SF_SWITCH_NO_DEFAULT) +SF_SWITCH_NO_DEFAULT=;SFP-4;CWE-478 +SF_SWITCH_NO_DEFAULTMsg=This method contains a switch statement where default case is missing. Usually you need to provide a default case. + +#ST: Write to static field from instance method (ST_WRITE_TO_STATIC_FROM_INSTANCE_METHOD) +ST_WRITE_TO_STATIC_FROM_INSTANCE_METHOD=;SFP--1;CWE-398 +ST_WRITE_TO_STATIC_FROM_INSTANCE_METHODMsg=This instance method writes to a static field. This is tricky to get correct if multiple instances are being manipulated, and generally bad practice. + +#Se: private readResolve method not inherited by subclasses (SE_PRIVATE_READ_RESOLVE_NOT_INHERITED) +SE_PRIVATE_READ_RESOLVE_NOT_INHERITED=;SFP--1;CWE-398 +SE_PRIVATE_READ_RESOLVE_NOT_INHERITEDMsg=This class defines a private readResolve method. Since it is private, it won't be inherited by subclasses. This might be intentional and OK, but should be reviewed to ensure it is what is intended. + +#Se: Transient field of class that isn't Serializable. (SE_TRANSIENT_FIELD_OF_NONSERIALIZABLE_CLASS) +SE_TRANSIENT_FIELD_OF_NONSERIALIZABLE_CLASS=;SFP--1;CWE-398 +SE_TRANSIENT_FIELD_OF_NONSERIALIZABLE_CLASSMsg=The field is marked as transient, but the class isn't Serializable, so marking it as transient has absolutely no effect. This may be leftover marking from a previous version of the code in which the class was transient, or it may indicate a misunderstanding of how serialization works. + +#TQ: Explicit annotation inconsistent with use (TQ_EXPLICIT_UNKNOWN_SOURCE_VALUE_REACHES_ALWAYS_SINK) +TQ_EXPLICIT_UNKNOWN_SOURCE_VALUE_REACHES_ALWAYS_SINK=;SFP--1;CWE-398 +TQ_EXPLICIT_UNKNOWN_SOURCE_VALUE_REACHES_ALWAYS_SINKMsg=A value is used in a way that requires it to be always be a value denoted by a type qualifier, but there is an explicit annotation stating that it is not known where the value is required to have that type qualifier. Either the usage or the annotation is incorrect. + +#TQ: Explicit annotation inconsistent with use (TQ_EXPLICIT_UNKNOWN_SOURCE_VALUE_REACHES_NEVER_SINK) +TQ_EXPLICIT_UNKNOWN_SOURCE_VALUE_REACHES_NEVER_SINK=;SFP--1;CWE-398 +TQ_EXPLICIT_UNKNOWN_SOURCE_VALUE_REACHES_NEVER_SINKMsg=A value is used in a way that requires it to be never be a value denoted by a type qualifier, but there is an explicit annotation stating that it is not known where the value is prohibited from having that type qualifier. Either the usage or the annotation is incorrect. + +#UCF: Useless control flow (UCF_USELESS_CONTROL_FLOW) +UCF_USELESS_CONTROL_FLOW=;SFP--1;CWE-398 +UCF_USELESS_CONTROL_FLOWMsg=This method contains a useless control flow statement, where control flow continues onto the same place regardless of whether or not the branch is taken. + +#UCF: Useless control flow to next line (UCF_USELESS_CONTROL_FLOW_NEXT_LINE) +UCF_USELESS_CONTROL_FLOW_NEXT_LINE=;SFP--1;CWE-398 +UCF_USELESS_CONTROL_FLOW_NEXT_LINEMsg=This method contains a useless control flow statement in which control flow follows to the same or following line regardless of whether or not the branch is taken. Often, this is caused by inadvertently using an empty statement as the body of an if statement + +#UwF: Field not initialized in constructor (UWF_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR) +UWF_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR=;SFP-1;CWE-456 +UWF_FIELD_NOT_INITIALIZED_IN_CONSTRUCTORMsg=This field is never initialized within any constructor, and is therefore could be null after the object is constructed. This could be a either an error or a questionable design, since it means a null pointer exception will be generated if that field is dereferenced before being initialized. + +#XFB: Method directly allocates a specific implementation of xml interfaces (XFB_XML_FACTORY_BYPASS) +XFB_XML_FACTORY_BYPASS=;SFP--1;CWE-398 +XFB_XML_FACTORY_BYPASSMsg=This method allocates a specific implementation of an xml interface. It is preferable to use the supplied factory classes to create these objects so that the implementation can be changed at runtime \ No newline at end of file diff --git a/com.kdmanalytics.toif.findbugs/target/MANIFEST.MF b/com.kdmanalytics.toif.findbugs/target/MANIFEST.MF new file mode 100644 index 00000000..5bd02860 --- /dev/null +++ b/com.kdmanalytics.toif.findbugs/target/MANIFEST.MF @@ -0,0 +1,14 @@ +Manifest-Version: 1.0 +Export-Package: com.kdmanalytics.toif.adaptor +Require-Bundle: org.apache.xerces;bundle-version="[2.11.0,3.0.0)",org. + eclipse.core.runtime,com.kdmanalytics.toif.framework;bundle-version=" + 1.15.0",com.kdmanalytics.toif.common;bundle-version="1.15.0",org.apac + he.log4j;bundle-version="[1.2.15,1.3.0)" +Bundle-Vendor: KDM Analytics Inc. +Bundle-Version: 1.15.5 +Bundle-Name: TOIF Findbugs +Bundle-Activator: com.kdmanalytics.toif.findbugs.Activator +Bundle-ManifestVersion: 2 +Bundle-SymbolicName: com.kdmanalytics.toif.findbugs;singleton:=true +Bundle-RequiredExecutionEnvironment: JavaSE-1.7 + diff --git a/com.kdmanalytics.toif.findbugs/target/classes/com/kdmanalytics/toif/adaptor/FindbugsAdaptor.class b/com.kdmanalytics.toif.findbugs/target/classes/com/kdmanalytics/toif/adaptor/FindbugsAdaptor.class new file mode 100644 index 00000000..b230309e Binary files /dev/null and b/com.kdmanalytics.toif.findbugs/target/classes/com/kdmanalytics/toif/adaptor/FindbugsAdaptor.class differ diff --git a/com.kdmanalytics.toif.findbugs/target/classes/com/kdmanalytics/toif/findbugs/Activator.class b/com.kdmanalytics.toif.findbugs/target/classes/com/kdmanalytics/toif/findbugs/Activator.class new file mode 100644 index 00000000..8a550352 Binary files /dev/null and b/com.kdmanalytics.toif.findbugs/target/classes/com/kdmanalytics/toif/findbugs/Activator.class differ diff --git a/com.kdmanalytics.toif.findbugs/target/classes/com/kdmanalytics/toif/findbugs/FindBugsParser.class b/com.kdmanalytics.toif.findbugs/target/classes/com/kdmanalytics/toif/findbugs/FindBugsParser.class new file mode 100644 index 00000000..f48c49b1 Binary files /dev/null and b/com.kdmanalytics.toif.findbugs/target/classes/com/kdmanalytics/toif/findbugs/FindBugsParser.class differ diff --git a/com.kdmanalytics.toif.findbugs/target/classes/config/FindbugsAdaptorConfiguration b/com.kdmanalytics.toif.findbugs/target/classes/config/FindbugsAdaptorConfiguration new file mode 100644 index 00000000..063719c5 --- /dev/null +++ b/com.kdmanalytics.toif.findbugs/target/classes/config/FindbugsAdaptorConfiguration @@ -0,0 +1,1488 @@ +# - No SFP or CWE found +# - No CWE Found +# - SFP and CWE Found + +############################################################################# +# +# http://findbugs.sourceforge.net/bugDescriptions.html +# +############################################################################# + + +#AM: Creates an empty jar file entry (AM_CREATES_EMPTY_JAR_FILE_ENTRY) +AM_CREATES_EMPTY_JAR_FILE_ENTRY=;SFP--1;CWE-398 +AM_CREATES_EMPTY_JAR_FILE_ENTRYMsg=The code calls putNextEntry(), immediately followed by a call to closeEntry(). This results in an empty JarFile entry. The contents of the entry should be written to the JarFile between the calls to putNextEntry() and closeEntry(). + +#AM: Creates an empty zip file entry (AM_CREATES_EMPTY_ZIP_FILE_ENTRY) +AM_CREATES_EMPTY_ZIP_FILE_ENTRY=;SFP--1;CWE-398 +AM_CREATES_EMPTY_ZIP_FILE_ENTRYMsg=The code calls putNextEntry(), immediately followed by a call to closeEntry(). This results in an empty ZipFile entry. The contents of the entry should be written to the ZipFile between the calls to putNextEntry() and closeEntry(). + +#BC: Equals method should not assume anything about the type of its argument (BC_EQUALS_METHOD_SHOULD_WORK_FOR_ALL_OBJECTS) +BC_EQUALS_METHOD_SHOULD_WORK_FOR_ALL_OBJECTS=;SFP--1;CWE-398 +BC_EQUALS_METHOD_SHOULD_WORK_FOR_ALL_OBJECTSMsg=The equals(Object o) method shouldn't make any assumptions about the type of o. It should simply return false if o is not the same type as this. + +#BC: Random object created and used only once (DMI_RANDOM_USED_ONLY_ONCE) +DMI_RANDOM_USED_ONLY_ONCE=;SFP--1;CWE-330 +DMI_RANDOM_USED_ONLY_ONCEMsg=This code creates a java.util.Random object, uses it to generate one random number, and then discards the Random object. This produces mediocre quality random numbers and is inefficient. If possible, rewrite the code so that the Random object is created once and saved, and each time a new random number is required invoke a method on the existing Random object to obtain it. If it is important that the generated Random numbers not be guessable, you must not create a new Random for each random number; the values are too easily guessable. You should strongly consider using a java.security.SecureRandom instead (and avoid allocating a new SecureRandom for each random number needed). + +#BIT: Check for sign of bitwise operation (BIT_SIGNED_CHECK) +BIT_SIGNED_CHECK=;SFP--1;CWE-480 +IT_SIGNED_CHECKMsg=This method compares an expression such as ((event.detail & SWT.SELECTED) > 0). Using bit arithmetic and then comparing with the greater than operator can lead to unexpected results (of course depending on the value of SWT.SELECTED). If SWT.SELECTED is a negative number, this is a candidate for a bug. Even when SWT.SELECTED is not negative, it seems good practice to use '!= 0' instead of '> 0'. + +#CN: Class implements Cloneable but does not define or use clone method (CN_IDIOM) +CN_IDIOM=;SFP--1;CWE-710 +CN_IDIOMMsg=Class implements Cloneable but does not define or use the clone method. + +#CN: clone method does not call super.clone() (CN_IDIOM_NO_SUPER_CALL) +CN_IDIOM_NO_SUPER_CALL=;SFP-28;CWE-580 +CN_IDIOM_NO_SUPER_CALLMsg=This non-final class defines a clone() method that does not call super.clone(). If this class ("A") is extended by a subclass ("B"), and the subclass B calls super.clone(), then it is likely that B's clone() method will return an object of type A, which violates the standard contract for clone(). If all clone() methods call super.clone(), then they are guaranteed to use Object.clone(), which always returns an object of the correct type. + +#CN: Class defines clone() but doesn't implement Cloneable (CN_IMPLEMENTS_CLONE_BUT_NOT_CLONEABLE) +CN_IMPLEMENTS_CLONE_BUT_NOT_CLONEABLE=;SFP--1;CWE-710 +CN_IMPLEMENTS_CLONE_BUT_NOT_CLONEABLEMsg=This class defines a clone() method but the class doesn't implement Cloneable. There are some situations in which this is OK (e.g., you want to control how subclasses can clone themselves), but just make sure that this is what you intended. + +#Co: Abstract class defines covariant compareTo() method (CO_ABSTRACT_SELF) +CO_ABSTRACT_SELF=;SFP--1;CWE-710 +CO_ABSTRACT_SELFMsg=This class defines a covariant version of compareTo(). To correctly override the compareTo() method in the Comparable interface, the parameter of compareTo() must have type java.lang.Object. + +#Co: Covariant compareTo() method defined (CO_SELF_NO_OBJECT) +CO_SELF_NO_OBJECT=;SFP--1;CWE-710 +CO_SELF_NO_OBJECTMsg=This class defines a covariant version of compareTo(). To correctly override the compareTo() method in the Comparable interface, the parameter of compareTo() must have type java.lang.Object. + +#DE: Method might drop exception (DE_MIGHT_DROP) +DE_MIGHT_DROP=;SFP-4;CWE-390 +DE_MIGHT_DROPMsg=This method might drop an exception. In general, exceptions should be handled or reported in some way, or they should be thrown out of the method. + +#DE: Method might ignore exception (DE_MIGHT_IGNORE) +DE_MIGHT_IGNORE=;SFP-4;CWE-390 +DE_MIGHT_IGNOREMsg=This method might ignore an exception. In general, exceptions should be handled or reported in some way, or they should be thrown out of the method. + +#DMI: Don't use removeAll to clear a collection (DMI_USING_REMOVEALL_TO_CLEAR_COLLECTION) +DMI_USING_REMOVEALL_TO_CLEAR_COLLECTION=;SFP-1;CWE-710 +DMI_USING_REMOVEALL_TO_CLEAR_COLLECTIONMsg=If you want to remove all elements from a collection c, use c.clear, not c.removeAll(c). Calling c.removeAll(c) to clear a collection is less clear, susceptible to errors from typos, less efficient and for some collections, might throw a ConcurrentModificationException. + +#DP: Classloaders should only be created inside doPrivileged block (DP_CREATE_CLASSLOADER_INSIDE_DO_PRIVILEGED) +DP_CREATE_CLASSLOADER_INSIDE_DO_PRIVILEGED=;SFP-27;CWE-545 +DP_CREATE_CLASSLOADER_INSIDE_DO_PRIVILEGEDMsg=This code creates a classloader, which requires a security manager. If this code will be granted security permissions, but might be invoked by code that does not have security permissions, then the classloader creation needs to occur inside a doPrivileged block. + +#DP: Method invoked that should be only be invoked inside a doPrivileged block (DP_DO_INSIDE_DO_PRIVILEGED) +DP_DO_INSIDE_DO_PRIVILEGED=;SFP--1;CWE-250 +DP_DO_INSIDE_DO_PRIVILEGEDMsg=This code invokes a method that requires a security permission check. If this code will be granted security permissions, but might be invoked by code that does not have security permissions, then the invocation needs to occur inside a doPrivileged block. + +#Dm: Method invokes System.exit(...) (DM_EXIT) +DM_EXIT=;SFP--1;CWE-710 +DM_EXITMsg=Invoking System.exit shuts down the entire Java virtual machine. This should only been done when it is appropriate. Such calls make it hard or impossible for your code to be invoked by other code. Consider throwing a RuntimeException instead. + +#Dm: Method invokes dangerous method runFinalizersOnExit (DM_RUN_FINALIZERS_ON_EXIT) +DM_RUN_FINALIZERS_ON_EXIT=;SFP-3;CWE-242 +DM_RUN_FINALIZERS_ON_EXITMsg=Never call System.runFinalizersOnExit or Runtime.runFinalizersOnExit for any reason: they are among the most dangerous methods in the Java libraries. -- Joshua Bloch + +#ES: Comparison of String parameter using == or != (ES_COMPARING_PARAMETER_STRING_WITH_EQ) +ES_COMPARING_PARAMETER_STRING_WITH_EQ=;SFP-1;CWE-597 +ES_COMPARING_PARAMETER_STRING_WITH_EQMsg=This code compares a java.lang.String parameter for reference equality using the == or != operators. Requiring callers to pass only String constants or interned strings to a method is unnecessarily fragile, and rarely leads to measurable performance gains. Consider using the equals(Object) method instead. + +#ES: Comparison of String objects using == or != (ES_COMPARING_STRINGS_WITH_EQ) +ES_COMPARING_STRINGS_WITH_EQ=;SFP-1;CWE-597 +ES_COMPARING_STRINGS_WITH_EQMsg=This code compares java.lang.String objects for reference equality using the == or != operators. Unless both strings are either constants in a source file, or have been interned using the String.intern() method, the same string value may be represented by two different String objects. Consider using the equals(Object) method instead. + +#Eq: Abstract class defines covariant equals() method (EQ_ABSTRACT_SELF) +EQ_ABSTRACT_SELF=;SFP--1;CWE-710 +EQ_ABSTRACT_SELFMsg=This class defines a covariant version of equals(). To correctly override the equals() method in java.lang.Object, the parameter of equals() must have type java.lang.Object. + +#Eq: Equals checks for noncompatible operand (EQ_CHECK_FOR_OPERAND_NOT_COMPATIBLE_WITH_THIS) +EQ_CHECK_FOR_OPERAND_NOT_COMPATIBLE_WITH_THIS=;SFP--1;CWE-710 +EQ_CHECK_FOR_OPERAND_NOT_COMPATIBLE_WITH_THISMsg=This equals method is checking to see if the argument is some incompatible type (i.e., a class that is neither a supertype nor subtype of the class that defines the equals method). + +#Eq: Class defines compareTo(...) and uses Object.equals() (EQ_COMPARETO_USE_OBJECT_EQUALS) +EQ_COMPARETO_USE_OBJECT_EQUALS=;SFP--1;CWE-710 +EQ_COMPARETO_USE_OBJECT_EQUALSMsg=This class defines a compareTo(...) method but inherits its equals() method from java.lang.Object. Generally, the value of compareTo should return zero if and only if equals returns true. If this is violated, weird and unpredictable failures will occur in classes such as PriorityQueue. In Java 5 the PriorityQueue.remove method uses the compareTo method, while in Java 6 it uses the equals method. + +#Eq: equals method fails for subtypes (EQ_GETCLASS_AND_CLASS_CONSTANT) +EQ_GETCLASS_AND_CLASS_CONSTANT=;SFP--1;CWE-710 +EQ_GETCLASS_AND_CLASS_CONSTANTMsg=This class has an equals method that will be broken if it is inherited by subclasses. It compares a class literal with the class of the argument (e.g., in class Foo it might check if Foo.class == o.getClass()). It is better to check if this.getClass() == o.getClass(). + +#Eq: Covariant equals() method defined (EQ_SELF_NO_OBJECT) +EQ_SELF_NO_OBJECT=;SFP--1;CWE-710 +EQ_SELF_NO_OBJECTMsg=This class defines a covariant version of equals(). To correctly override the equals() method in java.lang.Object, the parameter of equals() must have type java.lang.Object. + +#FI: Empty finalizer should be deleted (FI_EMPTY) +FI_EMPTY=;SFP--1;CWE-710 +FI_EMPTY=Empty finalize() methods are useless, so they should be deleted. + +#FI: Explicit invocation of finalizer (FI_EXPLICIT_INVOCATION) +FI_EXPLICIT_INVOCATION=;SFP-3;CWE-586 +FI_EXPLICIT_INVOCATIONMsg=This method contains an explicit invocation of the finalize() method on an object. Because finalizer methods are supposed to be executed once, and only by the VM, this is a bad idea. If a connected set of objects beings finalizable, then the VM will invoke the finalize method on all the finalizable object, possibly at the same time in different threads. Thus, it is a particularly bad idea, in the finalize method for a class X, invoke finalize on objects referenced by X, because they may already be getting finalized in a separate thread. + +#FI: Finalizer nulls fields (FI_FINALIZER_NULLS_FIELDS) +FI_FINALIZER_NULLS_FIELDS=;SFP--1;CWE-710 +FI_FINALIZER_NULLS_FIELDSMsg=This finalizer nulls out fields. This is usually an error, as it does not aid garbage collection, and the object is going to be garbage collected anyway. + +#FI: Finalizer only nulls fields (FI_FINALIZER_ONLY_NULLS_FIELDS) +FI_FINALIZER_ONLY_NULLS_FIELDS=;SFP--1;CWE-710 +FI_FINALIZER_ONLY_NULLS_FIELDSMsg=This finalizer does nothing except null out fields. This is completely pointless, and requires that the object be garbage collected, finalized, and then garbage collected again. You should just remove the finalize method. + +#FI: Finalizer does not call superclass finalizer (FI_MISSING_SUPER_CALL) +FI_MISSING_SUPER_CALL=;SFP-28;CWE-586 +FI_MISSING_SUPER_CALLMsg=This finalize() method does not make a call to its superclass's finalize() method. So, any finalizer actions defined for the superclass will not be performed. Add a call to super.finalize(). + +#FI: Finalizer nullifies superclass finalizer (FI_NULLIFY_SUPER) +FI_NULLIFY_SUPER=;SFP--1;CWE-710 +FI_NULLIFY_SUPERMsg=This empty finalize() method explicitly negates the effect of any finalizer defined by its superclass. Any finalizer actions defined for the superclass will not be performed. Unless this is intended, delete this method. + +#FI: Finalizer does nothing but call superclass finalizer (FI_USELESS) +FI_USELESS=;SFP--1;CWE-710 +FI_USELESSMsg=The only thing this finalize() method does is call the superclass's finalize() method, making it redundant. Delete it. + +#GC: Unchecked type in generic call (GC_UNCHECKED_TYPE_IN_GENERIC_CALL) +GC_UNCHECKED_TYPE_IN_GENERIC_CALL=;SFP--1;CWE-710 +GC_UNCHECKED_TYPE_IN_GENERIC_CALLMsg=This call to a generic collection method passes an argument while compile type Object where a specific type from the generic type parameters is expected. Thus, neither the standard Java type system nor static analysis can provide useful information on whether the object being passed as a parameter is of an appropriate type. + +#HE: Class defines equals() but not hashCode() (HE_EQUALS_NO_HASHCODE) +HE_EQUALS_NO_HASHCODE=;SFP--1;CWE-581 +HE_EQUALS_NO_HASHCODEMsg=This class overrides equals(Object), but does not override hashCode(). Therefore, the class may violate the invariant that equal objects must have equal hashcodes. + +#HE: Class defines equals() and uses Object.hashCode() (HE_EQUALS_USE_HASHCODE) +HE_EQUALS_USE_HASHCODE=;SFP--1;CWE-581 +HE_EQUALS_USE_HASHCODEMsg=This class overrides equals(Object), but does not override hashCode(), and inherits the implementation of hashCode() from java.lang.Object (which returns the identity hash code, an arbitrary value assigned to the object by the VM). Therefore, the class is very likely to violate the invariant that equal objects must have equal hashcodes. + +#HE: Class defines hashCode() but not equals() (HE_HASHCODE_NO_EQUALS) +HE_HASHCODE_NO_EQUALS=;SFP--1;CWE-581 +HE_HASHCODE_NO_EQUALSMsg=This class defines a hashCode() method but not an equals() method. Therefore, the class may violate the invariant that equal objects must have equal hashcodes. + +#HE: Class defines hashCode() and uses Object.equals() (HE_HASHCODE_USE_OBJECT_EQUALS) +HE_HASHCODE_USE_OBJECT_EQUALS=;SFP--1;CWE-581 +HE_HASHCODE_USE_OBJECT_EQUALSMsg=This class defines a hashCode() method but inherits its equals() method from java.lang.Object (which defines equality by comparing object references). Although this will probably satisfy the contract that equal objects must have equal hashcodes, it is probably not what was intended by overriding the hashCode() method. (Overriding hashCode() implies that the object's identity is based on criteria more complicated than simple reference equality.) + +#HE: Class inherits equals() and uses Object.hashCode() (HE_INHERITS_EQUALS_USE_HASHCODE) +HE_INHERITS_EQUALS_USE_HASHCODE=;SFP--1;CWE-581 +HE_INHERITS_EQUALS_USE_HASHCODEMsg=This class inherits equals(Object) from an abstract superclass, and hashCode() from java.lang.Object (which returns the identity hash code, an arbitrary value assigned to the object by the VM). Therefore, the class is very likely to violate the invariant that equal objects must have equal hashcodes. + +#IC: Superclass uses subclass during initialization (IC_SUPERCLASS_USES_SUBCLASS_DURING_INITIALIZATION) +IC_SUPERCLASS_USES_SUBCLASS_DURING_INITIALIZATION=;SFP--1;CWE-710 +IC_SUPERCLASS_USES_SUBCLASS_DURING_INITIALIZATIONMsg=During the initialization of a class, the class makes an active use of a subclass. That subclass will not yet be initialized at the time of this use. + +#IMSE: Dubious catching of IllegalMonitorStateException (IMSE_DONT_CATCH_IMSE) +IMSE_DONT_CATCH_IMSE=;SFP--1;CWE-398 +IMSE_DONT_CATCH_IMSEMsg=IllegalMonitorStateException is generally only thrown in case of a design flaw in your code (calling wait or notify on an object you do not hold a lock on). + +#ISC: Needless instantiation of class that only supplies static methods (ISC_INSTANTIATE_STATIC_CLASS) +ISC_INSTANTIATE_STATIC_CLASS=;SFP--1;CWE-710 +ISC_INSTANTIATE_STATIC_CLASSMsg=This class allocates an object that is based on a class that only supplies static methods. This object does not need to be created, just access the static methods directly using the class name as a qualifier. + +#It: Iterator next() method can't throw NoSuchElementException (IT_NO_SUCH_ELEMENT) +IT_NO_SUCH_ELEMENT=;SFP--1;CWE-710 +IT_NO_SUCH_ELEMENTMsg=This class implements the java.util.Iterator interface. However, its next() method is not capable of throwing java.util.NoSuchElementException. The next() method should be changed so it throws NoSuchElementException if is called when there are no more elements to return. + +#J2EE: Store of non serializable object into HttpSession (J2EE_STORE_OF_NON_SERIALIZABLE_OBJECT_INTO_SESSION) +J2EE_STORE_OF_NON_SERIALIZABLE_OBJECT_INTO_SESSION=;SFP-1;CWE-579 +J2EE_STORE_OF_NON_SERIALIZABLE_OBJECT_INTO_SESSIONMsg=This code seems to be storing a non-serializable object into an HttpSession. If this session is passivated or migrated, an error will result. + +#JCIP: Fields of immutable classes should be final (JCIP_FIELD_ISNT_FINAL_IN_IMMUTABLE_CLASS) +JCIP_FIELD_ISNT_FINAL_IN_IMMUTABLE_CLASS=;SFP--1;CWE-710 +JCIP_FIELD_ISNT_FINAL_IN_IMMUTABLE_CLASSMsg=The class is annotated with net.jcip.annotations.Immutable, and the rules for that annotation require that all fields are final. . + +#NP: Method with Boolean return type returns explicit null (NP_BOOLEAN_RETURN_NULL) +NP_BOOLEAN_RETURN_NULL=;SFP-4;CWE-394 +NP_BOOLEAN_RETURN_NULLMsg=A method that returns either Boolean.TRUE, Boolean.FALSE or null is an accident waiting to happen. This method can be invoked as though it returned a value of type boolean, and the compiler will insert automatic unboxing of the Boolean value. If a null value is returned, this will result in a NullPointerException. + +#NP: Clone method may return null (NP_CLONE_COULD_RETURN_NULL) +NP_CLONE_COULD_RETURN_NULL=;SFP-4;CWE-394 +NP_CLONE_COULD_RETURN_NULLMsg=This clone method seems to return null in some circumstances, but clone is never allowed to return a null value. If you are convinced this path is unreachable, throw an AssertionError instead. + +#NP: equals() method does not check for null argument (NP_EQUALS_SHOULD_HANDLE_NULL_ARGUMENT) +NP_EQUALS_SHOULD_HANDLE_NULL_ARGUMENT=API;SFP--1;CWE-227 +NP_EQUALS_SHOULD_HANDLE_NULL_ARGUMENTMsg=This implementation of equals(Object) violates the contract defined by java.lang.Object.equals() because it does not check for null being passed as the argument. All equals() methods should return false if passed a null value. + +#NP: toString method may return null (NP_TOSTRING_COULD_RETURN_NULL) +NP_TOSTRING_COULD_RETURN_NULL=API;SFP--1;CWE-227 +NP_TOSTRING_COULD_RETURN_NULLMsg=This toString method seems to return null in some circumstances. A liberal reading of the spec could be interpreted as allowing this, but it is probably a bad idea and could cause other code to break. Return the empty string or some other appropriate string rather than null. + +#Nm: Class names should start with an upper case letter (NM_CLASS_NAMING_CONVENTION) +NM_CLASS_NAMING_CONVENTION=;SFP--1;CWE-710 +NM_CLASS_NAMING_CONVENTIONMsg=Class names should be nouns, in mixed case with the first letter of each internal word capitalized. Try to keep your class names simple and descriptive. Use whole words-avoid acronyms and abbreviations (unless the abbreviation is much more widely used than the long form, such as URL or HTML). + +#Nm: Class is not derived from an Exception, even though it is named as such (NM_CLASS_NOT_EXCEPTION) +NM_CLASS_NOT_EXCEPTION=;SFP--1;CWE-710 +NM_CLASS_NOT_EXCEPTIONMsg=This class is not derived from another exception, but ends with 'Exception'. This will be confusing to users of this class. + +#Nm: Confusing method names (NM_CONFUSING) +NM_CONFUSING=;SFP--1;CWE-710 +NM_CONFUSINGMsg=The referenced methods have names that differ only by capitalization. + +#Nm: Field names should start with a lower case letter (NM_FIELD_NAMING_CONVENTION) +NM_FIELD_NAMING_CONVENTION=;SFP--1;CWE-710 +NM_FIELD_NAMING_CONVENTIONMsg=Names of fields that are not final should be in mixed case with a lowercase first letter and the first letters of subsequent words capitalized. + +#Nm: Use of identifier that is a keyword in later versions of Java (NM_FUTURE_KEYWORD_USED_AS_IDENTIFIER) +NM_FUTURE_KEYWORD_USED_AS_IDENTIFIER=;SFP--1;CWE-710 +NM_FUTURE_KEYWORD_USED_AS_IDENTIFIERMsg=The identifier is a word that is reserved as a keyword in later versions of Java, and your code will need to be changed in order to compile it in later versions of Java. + +#Nm: Use of identifier that is a keyword in later versions of Java (NM_FUTURE_KEYWORD_USED_AS_MEMBER_IDENTIFIER) +NM_FUTURE_KEYWORD_USED_AS_MEMBER_IDENTIFIER=;SFP--1;CWE-710 +NM_FUTURE_KEYWORD_USED_AS_MEMBER_IDENTIFIERMsg=This identifier is used as a keyword in later versions of Java. This code, and any code that references this API, will need to be changed in order to compile it in later versions of Java. + +#Nm: Method names should start with a lower case letter (NM_METHOD_NAMING_CONVENTION) +NM_METHOD_NAMING_CONVENTION=;SFP--1;CWE-710 +NM_METHOD_NAMING_CONVENTIONMsg=Methods should be verbs, in mixed case with the first letter lowercase, with the first letter of each internal word capitalized. + +#Nm: Class names shouldn't shadow simple name of implemented interface (NM_SAME_SIMPLE_NAME_AS_INTERFACE) +NM_SAME_SIMPLE_NAME_AS_INTERFACE=;SFP--1;CWE-710 +NM_SAME_SIMPLE_NAME_AS_INTERFACEMsg=This class/interface has a simple name that is identical to that of an implemented/extended interface, except that the interface is in a different package (e.g., alpha.Foo extends beta.Foo). This can be exceptionally confusing, create lots of situations in which you have to look at import statements to resolve references and creates many opportunities to accidently define methods that do not override methods in their superclasses. + +#Nm: Class names shouldn't shadow simple name of superclass (NM_SAME_SIMPLE_NAME_AS_SUPERCLASS) +NM_SAME_SIMPLE_NAME_AS_SUPERCLASS=;SFP--1;CWE-710 +NM_SAME_SIMPLE_NAME_AS_SUPERCLASSMsg=This class has a simple name that is identical to that of its superclass, except that its superclass is in a different package (e.g., alpha.Foo extends beta.Foo). This can be exceptionally confusing, create lots of situations in which you have to look at import statements to resolve references and creates many opportunities to accidently define methods that do not override methods in their superclasses. + +#Nm: Very confusing method names (but perhaps intentional) (NM_VERY_CONFUSING_INTENTIONAL) +NM_VERY_CONFUSING_INTENTIONAL=;SFP--1;CWE-710 +NM_VERY_CONFUSING_INTENTIONALMsg=The referenced methods have names that differ only by capitalization. This is very confusing because if the capitalization were identical then one of the methods would override the other. From the existence of other methods, it seems that the existence of both of these methods is intentional, but is sure is confusing. You should try hard to eliminate one of them, unless you are forced to have both due to frozen APIs. + +#Nm: Method doesn't override method in superclass due to wrong package for parameter (NM_WRONG_PACKAGE_INTENTIONAL) +NM_WRONG_PACKAGE_INTENTIONAL=;SFP--1;CWE-710 +NM_WRONG_PACKAGE_INTENTIONALMsg=The method in the subclass doesn't override a similar method in a superclass because the type of a parameter doesn't exactly match the type of the corresponding parameter in the superclass. + +#ODR: Method may fail to close database resource (ODR_OPEN_DATABASE_RESOURCE) +ODR_OPEN_DATABASE_RESOURCE=;SFP-14;CWE-772 +ODR_OPEN_DATABASE_RESOURCEMsg=The method creates a database resource (such as a database connection or row set), does not assign it to any fields, pass it to other methods, or return it, and does not appear to close the object on all paths out of the method. Failure to close database resources on all paths out of a method may result in poor performance, and could cause the application to have problems communicating with the database. + +#ODR: Method may fail to close database resource on exception (ODR_OPEN_DATABASE_RESOURCE_EXCEPTION_PATH) +ODR_OPEN_DATABASE_RESOURCE_EXCEPTION_PATH=;SFP-14;CWE-772 +ODR_OPEN_DATABASE_RESOURCE_EXCEPTION_PATHMsg=The method creates a database resource (such as a database connection or row set), does not assign it to any fields, pass it to other methods, or return it, and does not appear to close the object on all exception paths out of the method. Failure to close database resources on all paths out of a method may result in poor performance, and could cause the application to have problems communicating with the database. + +#OS: Method may fail to close stream (OS_OPEN_STREAM) +OS_OPEN_STREAM=;SFP-14;CWE-772 +OS_OPEN_STREAMMsg=The method creates an IO stream object, does not assign it to any fields, pass it to other methods that might close it, or return it, and does not appear to close the stream on all paths out of the method. This may result in a file descriptor leak. It is generally a good idea to use a finally block to ensure that streams are closed. + +#OS: Method may fail to close stream on exception (OS_OPEN_STREAM_EXCEPTION_PATH) +OS_OPEN_STREAM_EXCEPTION_PATH=;SFP-14;CWE-772 +OS_OPEN_STREAM_EXCEPTION_PATHMsg=The method creates an IO stream object, does not assign it to any fields, pass it to other methods, or return it, and does not appear to close it on all possible exception paths out of the method. This may result in a file descriptor leak. It is generally a good idea to use a finally block to ensure that streams are closed. + +#RC: Suspicious reference comparison to constant (RC_REF_COMPARISON_BAD_PRACTICE) +RC_REF_COMPARISON_BAD_PRACTICE=;SFP--1;CWE-480 +RC_REF_COMPARISON_BAD_PRACTICEMsg=This method compares a reference value to a constant using the == or != operator, where the correct way to compare instances of this type is generally with the equals() method. It is possible to create distinct instances that are equal but do not compare as == since they are different objects. Examples of classes which should generally not be compared by reference are java.lang.Integer, java.lang.Float, etc. + +#RC: Suspicious reference comparison of Boolean values (RC_REF_COMPARISON_BAD_PRACTICE_BOOLEAN) +RC_REF_COMPARISON_BAD_PRACTICE_BOOLEAN=;SFP--1;CWE-480 +RC_REF_COMPARISON_BAD_PRACTICE_BOOLEANMsg=This method compares two Boolean values using the == or != operator. Normally, there are only two Boolean values (Boolean.TRUE and Boolean.FALSE), but it is possible to create other Boolean objects using the new Boolean(b) constructor. It is best to avoid such objects, but if they do exist, then checking Boolean objects for equality using == or != will give results than are different than you would get using .equals(...) + +#RR: Method ignores results of InputStream.read() (RR_NOT_CHECKED) +RR_NOT_CHECKED=;SFP-4;CWE-252 +RR_NOT_CHECKEDMsg=This method ignores the return value of one of the variants of java.io.InputStream.read() which can return multiple bytes. If the return value is not checked, the caller will not be able to correctly handle the case where fewer bytes were read than the caller requested. This is a particularly insidious kind of bug, because in many programs, reads from input streams usually do read the full amount of data requested, causing the program to fail only sporadically. + +#RR: Method ignores results of InputStream.skip() (SR_NOT_CHECKED) +SR_NOT_CHECKED=;SFP-4;CWE-252 +SR_NOT_CHECKEDMsg=This method ignores the return value of java.io.InputStream.skip() which can skip multiple bytes. If the return value is not checked, the caller will not be able to correctly handle the case where fewer bytes were skipped than the caller requested. This is a particularly insidious kind of bug, because in many programs, skips from input streams usually do skip the full amount of data requested, causing the program to fail only sporadically. With Buffered streams, however, skip() will only skip data in the buffer, and will routinely fail to skip the requested number of bytes. + +#RV: Method ignores exceptional return value (RV_RETURN_VALUE_IGNORED_BAD_PRACTICE) +RV_RETURN_VALUE_IGNORED_BAD_PRACTICE=;SFP-4;CWE-252 +RV_RETURN_VALUE_IGNORED_BAD_PRACTICEMsg=This method returns a value that is not checked. The return value should be checked since it can indicate an unusual or unexpected function execution. For example, the File.delete() method returns false if the file could not be successfully deleted (rather than throwing an Exception). If you don't check the result, you won't notice if the method invocation signals unexpected behavior by returning an atypical return value. + +#SI: Static initializer creates instance before all static final fields assigned (SI_INSTANCE_BEFORE_FINALS_ASSIGNED) +SI_INSTANCE_BEFORE_FINALS_ASSIGNED=;SFP-1;CWE-456 +SI_INSTANCE_BEFORE_FINALS_ASSIGNEDMsg=The class's static initializer creates an instance of the class before all of the static final fields are assigned. + +#SW: Certain swing methods needs to be invoked in Swing thread (SW_SWING_METHODS_INVOKED_IN_SWING_THREAD) +SW_SWING_METHODS_INVOKED_IN_SWING_THREAD=API;SFP--1;CWE-684 +SW_SWING_METHODS_INVOKED_IN_SWING_THREADMsg=The Swing methods show(), setVisible(), and pack() will create the associated peer for the frame. With the creation of the peer, the system creates the event dispatch thread. This makes things problematic because the event dispatch thread could be notifying listeners while pack and validate are still processing. This situation could result in two threads going through the Swing component-based GUI -- it's a serious flaw that could result in deadlocks or other related threading issues. A pack call causes components to be realized. As they are being realized (that is, not necessarily visible), they could trigger listener notification on the event dispatch thread. + +#Se: Non-transient non-serializable instance field in serializable class (SE_BAD_FIELD) +SE_BAD_FIELD=API;SFP--1;CWE-684 +SE_BAD_FIELDMsg=This Serializable class defines a non-primitive instance field which is neither transient, Serializable, or java.lang.Object, and does not appear to implement the Externalizable interface or the readObject() and writeObject() methods. Objects of this class will not be deserialized correctly if a non-Serializable object is stored in this field. + +#Se: Non-serializable class has a serializable inner class (SE_BAD_FIELD_INNER_CLASS) +SE_BAD_FIELD_INNER_CLASS=API;SFP--1;CWE-684 +SE_BAD_FIELD_INNER_CLASSMsg=This Serializable class is an inner class of a non-serializable class. Thus, attempts to serialize it will also attempt to associate instance of the outer class with which it is associated, leading to a runtime error. If possible, making the inner class a static inner class should solve the problem. Making the outer class serializable might also work, but that would mean serializing an instance of the inner class would always also serialize the instance of the outer class, which it often not what you really want. + +#Se: Non-serializable value stored into instance field of a serializable class (SE_BAD_FIELD_STORE) +SE_BAD_FIELD_STORE=API;SFP--1;CWE-684 +SE_BAD_FIELD_STOREMsg=A non-serializable value is stored into a non-transient field of a serializable class. + +#Se: Comparator doesn't implement Serializable (SE_COMPARATOR_SHOULD_BE_SERIALIZABLE) +SE_COMPARATOR_SHOULD_BE_SERIALIZABLE=;SFP--1;CWE-710 +SE_COMPARATOR_SHOULD_BE_SERIALIZABLEMsg=This class implements the Comparator interface. You should consider whether or not it should also implement the Serializable interface. If a comparator is used to construct an ordered collection such as a TreeMap, then the TreeMap will be serializable only if the comparator is also serializable. As most comparators have little or no state, making them serializable is generally easy and good defensive programming. + +#Se: Serializable inner class (SE_INNER_CLASS) +SE_INNER_CLASS=API;SFP--1;CWE-684 +SE_INNER_CLASSMsg=This Serializable class is an inner class. Any attempt to serialize it will also serialize the associated outer instance. The outer instance is serializable, so this won't fail, but it might serialize a lot more data than intended. If possible, making the inner class a static inner class (also known as a nested class) should solve the problem. + +#Se: serialVersionUID isn't final (SE_NONFINAL_SERIALVERSIONID) +SE_NONFINAL_SERIALVERSIONID=;SFP--1;CWE-710 +SE_NONFINAL_SERIALVERSIONIDMsg=This class defines a serialVersionUID field that is not final. The field should be made final if it is intended to specify the version UID for purposes of serialization. + +#Se: serialVersionUID isn't long (SE_NONLONG_SERIALVERSIONID) +SE_NONLONG_SERIALVERSIONID=;SFP--1;CWE-710 +SE_NONLONG_SERIALVERSIONIDMsg=This class defines a serialVersionUID field that is not long. The field should be made long if it is intended to specify the version UID for purposes of serialization. + +#Se: serialVersionUID isn't static (SE_NONSTATIC_SERIALVERSIONID) +SE_NONSTATIC_SERIALVERSIONID=;SFP--1;CWE-710 +SE_NONSTATIC_SERIALVERSIONIDMsg=This class defines a serialVersionUID field that is not static. The field should be made static if it is intended to specify the version UID for purposes of serialization. + +#Se: Class is Serializable but its superclass doesn't define a void constructor (SE_NO_SUITABLE_CONSTRUCTOR) +SE_NO_SUITABLE_CONSTRUCTOR=API;SFP--1;CWE-684 +SE_NO_SUITABLE_CONSTRUCTORMsg=This class implements the Serializable interface and its superclass does not. When such an object is deserialized, the fields of the superclass need to be initialized by invoking the void constructor of the superclass. Since the superclass does not have one, serialization and deserialization will fail at runtime. + +#Se: Class is Externalizable but doesn't define a void constructor (SE_NO_SUITABLE_CONSTRUCTOR_FOR_EXTERNALIZATION) +SE_NO_SUITABLE_CONSTRUCTOR_FOR_EXTERNALIZATION=API;SFP--1;CWE-684 +SE_NO_SUITABLE_CONSTRUCTOR_FOR_EXTERNALIZATIONMsg=This class implements the Externalizable interface, but does not define a void constructor. When Externalizable objects are deserialized, they first need to be constructed by invoking the void constructor. Since this class does not have one, serialization and deserialization will fail at runtime. + +#Se: The readResolve method must be declared with a return type of Object. (SE_READ_RESOLVE_MUST_RETURN_OBJECT) +SE_READ_RESOLVE_MUST_RETURN_OBJECT=API;SFP--1;CWE-684 +SE_READ_RESOLVE_MUST_RETURN_OBJECTMsg=In order for the readResolve method to be recognized by the serialization mechanism, it must be declared to have a return type of Object. + +#Se: Transient field that isn't set by deserialization. (SE_TRANSIENT_FIELD_NOT_RESTORED) +SE_TRANSIENT_FIELD_NOT_RESTORED=API;SFP--1;CWE-684 +SE_TRANSIENT_FIELD_NOT_RESTOREDMsg=This class contains a field that is updated at multiple places in the class, thus it seems to be part of the state of the class. However, since the field is marked as transient and not set in readObject or readResolve, it will contain the default value in any deserialized instance of the class. + +#SnVI: Class is Serializable, but doesn't define serialVersionUID (SE_NO_SERIALVERSIONID) +SE_NO_SERIALVERSIONID=API;SFP--1;CWE-684 +SE_NO_SERIALVERSIONIDMsg=This class implements the Serializable interface, but does not define a serialVersionUID field. A change as simple as adding a reference to a .class object will add synthetic fields to the class, which will unfortunately change the implicit serialVersionUID (e.g., adding a reference to String.class will generate a static field class$java$lang$String). Also, different source code to bytecode compilers may use different naming conventions for synthetic variables generated for references to class objects or inner classes. To ensure interoperability of Serializable across versions, consider adding an explicit serialVersionUID. + +#UI: Usage of GetResource may be unsafe if class is extended (UI_INHERITANCE_UNSAFE_GETRESOURCE) +UI_INHERITANCE_UNSAFE_GETRESOURCE=;SFP-3;CWE-676 +UI_INHERITANCE_UNSAFE_GETRESOURCEMsg=Calling this.getClass().getResource(...) could give results other than expected if this class is extended by a class in another package. + +#BC: Impossible cast (BC_IMPOSSIBLE_CAST) +BC_IMPOSSIBLE_CAST=;SFP-1;CWE-704 +BC_IMPOSSIBLE_CASTMsg=This cast will always throw a ClassCastException. FindBugs tracks type information from instanceof checks, and also uses more precise information about the types of values returned from methods and loaded from fields. Thus, it may have more precise information that just the declared type of a variable, and can use this to determine that a cast will always throw an exception at runtime. + +#BC: Impossible downcast (BC_IMPOSSIBLE_DOWNCAST) +BC_IMPOSSIBLE_DOWNCAST=;SFP-1;CWE-704 +BC_IMPOSSIBLE_DOWNCASTMsg=This cast will always throw a ClassCastException. The analysis believes it knows the precise type of the value being cast, and the attempt to downcast it to a subtype will always fail by throwing a ClassCastException. + +BC: Impossible downcast of toArray() result (BC_IMPOSSIBLE_DOWNCAST_OF_TOARRAY) +BC_IMPOSSIBLE_DOWNCAST_OF_TOARRAY=;SFP-1;CWE-704 +BC_IMPOSSIBLE_DOWNCAST_OF_TOARRAYMsg=This code is casting the result of calling toArray() on a collection to a type more specific than Object[] + +#BC: instanceof will always return false (BC_IMPOSSIBLE_INSTANCEOF) +BC_IMPOSSIBLE_INSTANCEOF=;SFP-1;CWE-570 +BC_IMPOSSIBLE_INSTANCEOFMsg=This instanceof test will always return false. Although this is safe, make sure it isn't an indication of some misunderstanding or some other logic error. + +#BIT: Bitwise add of signed byte value (BIT_ADD_OF_SIGNED_BYTE) +BIT_ADD_OF_SIGNED_BYTE=;SFP-1;CWE-194 +BIT_ADD_OF_SIGNED_BYTEMsg=Adds a byte value and a value which is known to the 8 lower bits clear. Values loaded from a byte array are sign extended to 32 bits before any any bitwise operations are performed on the value. Thus, if b[0] contains the value 0xff, and x is initially 0, then the code ((x << 8) + b[0]) will sign extend 0xff to get 0xffffffff, and thus give the value 0xffffffff as the result. + +#BIT: Incompatible bit masks (BIT_AND) +BIT_AND=;SFP-1;CWE-570 +BIT_ANDMsg=This method compares an expression of the form (e & C) to D, which will always compare unequal due to the specific values of constants C and D. This may indicate a logic error or typo. + +#BIT: Check to see if ((...) & 0) == 0 (BIT_AND_ZZ) +BIT_AND_ZZ=;SFP-1;CWE-571 +BIT_AND_ZZMsg=This method compares an expression of the form (e & 0) to 0, which will always compare equal. This may indicate a logic error or typo. + +#BIT: Incompatible bit masks (BIT_IOR) +BIT_IOR=;SFP-1;CWE-570 +BIT_IORMsg=This method compares an expression of the form (e | C) to D. which will always compare unequal due to the specific values of constants C and D. This may indicate a logic error or typo. Typically, this bug occurs because the code wants to perform a membership test in a bit set, but uses the bitwise OR operator ("|") instead of bitwise AND ("&"). + +#BIT: Bitwise OR of signed byte value (BIT_IOR_OF_SIGNED_BYTE) +BIT_IOR_OF_SIGNED_BYTE=;SFP-1;CWE-194 +BIT_IOR_OF_SIGNED_BYTEMsg=Loads a value from a byte array and performs a bitwise OR with that value. Values loaded from a byte array are sign extended to 32 bits before any any bitwise operations are performed on the value. Thus, if b[0] contains the value 0xff, and x is initially 0, then the code ((x << 8) | b[0]) will sign extend 0xff to get 0xffffffff, and thus give the value 0xffffffff as the result. + +#BIT: Check for sign of bitwise operation (BIT_SIGNED_CHECK_HIGH_BIT) +BIT_SIGNED_CHECK_HIGH_BIT=;SFP-1;CWE-195 +BIT_SIGNED_CHECK_HIGH_BITMsg=This method compares an expression such as ((event.detail & SWT.SELECTED) > 0). Using bit arithmetic and then comparing with the greater than operator can lead to unexpected results (of course depending on the value of SWT.SELECTED). If SWT.SELECTED is a negative number, this is a candidate for a bug. Even when SWT.SELECTED is not negative, it seems good practice to use '!= 0' instead of '> 0'. + +#BOA: Class overrides a method implemented in super class Adapter wrongly (BOA_BADLY_OVERRIDDEN_ADAPTER) +BOA_BADLY_OVERRIDDEN_ADAPTER=;SFP--1;CWE-710 +BOA_BADLY_OVERRIDDEN_ADAPTERMsg=This method overrides a method found in a parent class, where that class is an Adapter that implements a listener defined in the java.awt.event or javax.swing.event package. As a result, this method will not get called when the event occurs. + +#BSHIFT: 32 bit int shifted by an amount not in the range 0..31 (ICAST_BAD_SHIFT_AMOUNT) +ICAST_BAD_SHIFT_AMOUNT=;SFP-1;CWE-682 +ICAST_BAD_SHIFT_AMOUNTMsg=The code performs shift of a 32 bit int by a constant amount outside the range 0..31. The effect of this is to use the lower 5 bits of the integer value to decide how much to shift by (e.g., shifting by 40 bits is the same as shifting by 8 bits, and shifting by 32 bits is the same as shifting by zero bits). This probably isn't want was expected, and it at least confusing. + +#Bx: Primitive value is unboxed and coerced for ternary operator (BX_UNBOXED_AND_COERCED_FOR_TERNARY_OPERATOR) +BX_UNBOXED_AND_COERCED_FOR_TERNARY_OPERATOR=;SFP--1;CWE-192 +BX_UNBOXED_AND_COERCED_FOR_TERNARY_OPERATORMsg=A wrapped primitive value is unboxed and converted to another primitive type as part of the evaluation of a conditional ternary operator (the b ? e1 : e2 operator). The semantics of Java mandate that if e1 and e2 are wrapped numeric values, the values are unboxed and converted/coerced to their common type (e.g, if e1 is of type Integer and e2 is of type Float, then e1 is unboxed, converted to a floating point value, and boxed. See JLS Section 15.25. + +#DLS: Dead store of class literal (DLS_DEAD_STORE_OF_CLASS_LITERAL) +DLS_DEAD_STORE_OF_CLASS_LITERAL=;SFP-2;CWE-563 +DLS_DEAD_STORE_OF_CLASS_LITERALMsg=This instruction assigns a class literal to a variable and then never uses it. The behavior of this differs in Java 1.4 and in Java 5. In Java 1.4 and earlier, a reference to Foo.class would force the static initializer for Foo to be executed, if it has not been executed already. In Java 5 and later, it does not.See Sun's article on Java SE compatibility for more details and examples, and suggestions on how to force class initialization in Java 5. + +#DLS: Overwritten increment (DLS_OVERWRITTEN_INCREMENT) +DLS_OVERWRITTEN_INCREMENT=;SFP--1;CWE-398 +DLS_OVERWRITTEN_INCREMENTMsg=The code performs an increment operation (e.g., i++) and then immediately overwrites it. For example, i = i++ immediately overwrites the incremented value with the original value. + +#DMI: Bad constant value for month (DMI_BAD_MONTH) +DMI_BAD_MONTH=;SFP-1;CWE-682 +DMI_BAD_MONTHMsg=This code passes a constant month value outside the expected range of 0..11 to a method. + +#DMI: hasNext method invokes next (DMI_CALLING_NEXT_FROM_HASNEXT) +DMI_CALLING_NEXT_FROM_HASNEXT=;SFP--1;CWE-398 +DMI_CALLING_NEXT_FROM_HASNEXTMsg=The hasNext() method invokes the next() method. This is almost certainly wrong, since the hasNext() method is not supposed to change the state of the iterator, and the next method is supposed to change the state of the iterator. + +#DMI: Collections should not contain themselves (DMI_COLLECTIONS_SHOULD_NOT_CONTAIN_THEMSELVES) +DMI_COLLECTIONS_SHOULD_NOT_CONTAIN_THEMSELVES=;SFP--1;CWE-687 +DMI_COLLECTIONS_SHOULD_NOT_CONTAIN_THEMSELVESMsg=This call to a generic collection's method would only make sense if a collection contained itself (e.g., if s.contains(s) were true). This is unlikely to be true and would cause problems if it were true (such as the computation of the hash code resulting in infinite recursion). It is likely that the wrong value is being passed as a parameter. + +#DMI: Invocation of hashCode on an array (DMI_INVOKING_HASHCODE_ON_ARRAY) +DMI_INVOKING_HASHCODE_ON_ARRAY=;SFP--1;CWE-398 +DMI_INVOKING_HASHCODE_ON_ARRAYMsg=The code invokes hashCode on an array. Calling hashCode on an array returns the same value as System.identityHashCode, and ingores the contents and length of the array. If you need a hashCode that depends on the contents of an array a, use java.util.Arrays.hashCode(a). + +#DMI: hasNext method invokes next (DMI_CALLING_NEXT_FROM_HASNEXT) +DMI_LONG_BITS_TO_DOUBLE_INVOKED_ON_INT=;SFP--1;CWE-686 +DMI_LONG_BITS_TO_DOUBLE_INVOKED_ON_INTMsg=The Double.longBitsToDouble method is invoked, but a 32 bit int value is passed as an argument. This almostly certainly is not intended and is unlikely to give the intended result. + +#DMI: Vacuous call to collections (DMI_VACUOUS_SELF_COLLECTION_CALL) +DMI_VACUOUS_SELF_COLLECTION_CALL=;SFP--1;CWE-687 +DMI_VACUOUS_SELF_COLLECTION_CALLMsg=This call doesn't make sense. For any collection c, calling c.containsAll(c) should always be true, and c.retainAll(c) should have no effect. + +#Dm: Can't use reflection to check for presence of annotation without runtime retention (DMI_ANNOTATION_IS_NOT_VISIBLE_TO_REFLECTION) +DMI_ANNOTATION_IS_NOT_VISIBLE_TO_REFLECTION=;SFP--1;CWE-710 +DMI_ANNOTATION_IS_NOT_VISIBLE_TO_REFLECTIONMsg=Unless an annotation has itself been annotated with @Retention(RetentionPolicy.RUNTIME), the annotation can't be observed using reflection (e.g., by using the isAnnotationPresent method). + +#Dm: Futile attempt to change max pool size of ScheduledThreadPoolExecutor (DMI_FUTILE_ATTEMPT_TO_CHANGE_MAXPOOL_SIZE_OF_SCHEDULED_THREAD_POOL_EXECUTOR) +DMI_FUTILE_ATTEMPT_TO_CHANGE_MAXPOOL_SIZE_OF_SCHEDULED_THREAD_POOL_EXECUTOR=;SFP--1;CWE-398 +DMI_FUTILE_ATTEMPT_TO_CHANGE_MAXPOOL_SIZE_OF_SCHEDULED_THREAD_POOL_EXECUTORMsg=While ScheduledThreadPoolExecutor inherits from ThreadPoolExecutor, a few of the inherited tuning methods are not useful for it. In particular, because it acts as a fixed-sized pool using corePoolSize threads and an unbounded queue, adjustments to maximumPoolSize have no useful effect. + +#Dm: Creation of ScheduledThreadPoolExecutor with zero core threads (DMI_SCHEDULED_THREAD_POOL_EXECUTOR_WITH_ZERO_CORE_THREADS) +DMI_SCHEDULED_THREAD_POOL_EXECUTOR_WITH_ZERO_CORE_THREADS=;SFP--1;CWE-398 +DMI_SCHEDULED_THREAD_POOL_EXECUTOR_WITH_ZERO_CORE_THREADSMsg=A ScheduledThreadPoolExecutor with zero core threads will never execute anything; changes to the max pool size are ignored. + +#Dm: Useless/vacuous call to EasyMock method (DMI_VACUOUS_CALL_TO_EASYMOCK_METHOD) +DMI_VACUOUS_CALL_TO_EASYMOCK_METHOD=;SFP--1;CWE-398 +DMI_VACUOUS_CALL_TO_EASYMOCK_METHODMsg=This call doesn't pass any objects to the EasyMock method, so the call doesn't do anything. + +#EC: equals() used to compare array and nonarray (EC_ARRAY_AND_NONARRAY) +EC_ARRAY_AND_NONARRAY=;SFP-1;CWE-570 +EC_ARRAY_AND_NONARRAYMsg=This method invokes the .equals(Object o) to compare an array and a reference that doesn't seem to be an array. If things being compared are of different types, they are guaranteed to be unequal and the comparison is almost certainly an error. Even if they are both arrays, the equals method on arrays only determines of the two arrays are the same object. To compare the contents of the arrays, use java.util.Arrays.equals(Object[], Object[]). + +#EC: Invocation of equals() on an array, which is equivalent to == (EC_BAD_ARRAY_COMPARE) +EC_BAD_ARRAY_COMPARE=;SFP-1;CWE-570 +EC_BAD_ARRAY_COMPAREMsg=This method invokes the .equals(Object o) method on an array. Since arrays do not override the equals method of Object, calling equals on an array is the same as comparing their addresses. To compare the contents of the arrays, use java.util.Arrays.equals(Object[], Object[]). To compare the addresses of the arrays, it would be less confusing to explicitly pointer equality using ==. + +#EC: equals(...) used to compare incompatible arrays (EC_INCOMPATIBLE_ARRAY_COMPARE) +EC_INCOMPATIBLE_ARRAY_COMPARE=;SFP-1;CWE-570 +EC_INCOMPATIBLE_ARRAY_COMPAREMsg=This method invokes the .equals(Object o) to compare two arrays, but the arrays of of incompatible types (e.g., String[] and StringBuffer[], or String[] and int[]). They will never be equal. In addition, when equals(...) is used to compare arrays it only checks to see if they are the same array, and ignores the contents of the arrays. + +#EC: Call to equals() with null argument (EC_NULL_ARG) +EC_NULL_ARG=;SFP-1;CWE-570 +EC_NULL_ARGMsg=This method calls equals(Object), passing a null value as the argument. According to the contract of the equals() method, this call should always return false. + +#EC: Call to equals() comparing unrelated class and interface (EC_UNRELATED_CLASS_AND_INTERFACE) +EC_UNRELATED_CLASS_AND_INTERFACE=;SFP-1;CWE-570 +EC_UNRELATED_CLASS_AND_INTERFACEMsg=This method calls equals(Object) on two references, one of which is a class and the other an interface, where neither the class nor any of its non-abstract subclasses implement the interface. Therefore, the objects being compared are unlikely to be members of the same class at runtime (unless some application classes were not analyzed, or dynamic class loading can occur at runtime). According to the contract of equals(), objects of different classes should always compare as unequal; therefore, according to the contract defined by java.lang.Object.equals(Object), the result of this comparison will always be false at runtime. + +#EC: Call to equals() comparing different interface types (EC_UNRELATED_INTERFACES) +EC_UNRELATED_INTERFACES=;SFP-1;CWE-570 +EC_UNRELATED_INTERFACESMsg=This method calls equals(Object) on two references of unrelated interface types, where neither is a subtype of the other, and there are no known non-abstract classes which implement both interfaces. Therefore, the objects being compared are unlikely to be members of the same class at runtime (unless some application classes were not analyzed, or dynamic class loading can occur at runtime). According to the contract of equals(), objects of different classes should always compare as unequal; therefore, according to the contract defined by java.lang.Object.equals(Object), the result of this comparison will always be false at runtime. + +#EC: Call to equals() comparing different types (EC_UNRELATED_TYPES) +EC_UNRELATED_TYPES=;SFP-1;CWE-570 +EC_UNRELATED_TYPESMsg=This method calls equals(Object) on two references of different class types with no common subclasses. Therefore, the objects being compared are unlikely to be members of the same class at runtime (unless some application classes were not analyzed, or dynamic class loading can occur at runtime). According to the contract of equals(), objects of different classes should always compare as unequal; therefore, according to the contract defined by java.lang.Object.equals(Object), the result of this comparison will always be false at runtime. + +#EC: Using pointer equality to compare different types (EC_UNRELATED_TYPES_USING_POINTER_EQUALITY) +EC_UNRELATED_TYPES_USING_POINTER_EQUALITY=;SFP-1;CWE-570 +EC_UNRELATED_TYPES_USING_POINTER_EQUALITYMsg=This method uses using pointer equality to compare two references that seem to be of different types. The result of this comparison will always be false at runtime. + +#Eq: equals method always returns false (EQ_ALWAYS_FALSE) +EQ_ALWAYS_FALSE=;SFP-1;CWE-570 +EQ_ALWAYS_FALSEMsg=This class defines an equals method that always returns false. This means that an object is not equal to itself, and it is impossible to create useful Maps or Sets of this class. More fundamentally, it means that equals is not reflexive, one of the requirements of the equals method. The likely intended semantics are object identity: that an object is equal to itself. This is the behavior inherited from class Object. If you need to override an equals inherited from a different superclass, you can use use: public boolean equals(Object o) { return this == o; } + +#Eq: equals method always returns true (EQ_ALWAYS_TRUE) +EQ_ALWAYS_TRUE=;SFP-1;CWE-571 +EQ_ALWAYS_TRUEMsg=This class defines an equals method that always returns true. This is imaginative, but not very smart. Plus, it means that the equals method is not symmetric. + +#Eq: equals method compares class names rather than class objects (EQ_COMPARING_CLASS_NAMES) +EQ_COMPARING_CLASS_NAMES=;SFP-1;CWE-486 +EQ_COMPARING_CLASS_NAMESMsg=This method checks to see if two objects are the same class by checking to see if the names of their classes are equal. You can have different classes with the same name if they are loaded by different class loaders. Just check to see if the class objects are the same. + +#Eq: Covariant equals() method defined for enum (EQ_DONT_DEFINE_EQUALS_FOR_ENUM) +EQ_DONT_DEFINE_EQUALS_FOR_ENUM=;SFP--1;CWE-710 +EQ_DONT_DEFINE_EQUALS_FOR_ENUMMsg=This class defines an enumeration, and equality on enumerations are defined using object identity. Defining a covariant equals method for an enumeration value is exceptionally bad practice, since it would likely result in having two different enumeration values that compare as equals using the covariant enum method, and as not equal when compared normally. Don't do it. + +#Eq: equals() method defined that doesn't override equals(Object) (EQ_other_NO_OBJECT) +EQ_other_NO_OBJECT=;SFP-1;CWE-581 +EQ_other_NO_OBJECTMsg=This class defines an equals() method, that doesn't override the normal equals(Object) method defined in the base java.lang.Object class. Instead, it inherits an equals(Object) method from a superclass. The class should probably define a boolean equals(Object) method. + +#Eq: equals() method defined that doesn't override Object.equals(Object) (EQ_other_USE_OBJECT) +EQ_other_USE_OBJECT=;SFP--1;CWE-710 +EQ_other_USE_OBJECTMsg=This class defines an equals() method, that doesn't override the normal equals(Object) method defined in the base java.lang.Object class. The class should probably define a boolean equals(Object) method. + +#Eq: equals method overrides equals in superclass and may not be symmetric (EQ_OVERRIDING_EQUALS_NOT_SYMMETRIC) +EQ_OVERRIDING_EQUALS_NOT_SYMMETRIC=;SFP--1;CWE-710 +EQ_OVERRIDING_EQUALS_NOT_SYMMETRICMsg=This class defines an equals method that overrides an equals method in a superclass. Both equals methods methods use instanceof in the determination of whether two objects are equal. This is fraught with peril, since it is important that the equals method is symmetrical (in other words, a.equals(b) == b.equals(a)). If B is a subtype of A, and A's equals method checks that the argument is an instanceof A, and B's equals method checks that the argument is an instanceof B, it is quite likely that the equivalence relation defined by these methods is not symmetric. + +#Eq: Covariant equals() method defined, Object.equals(Object) inherited (EQ_SELF_USE_OBJECT) +EQ_SELF_USE_OBJECT=;SFP--1;CWE-710 +EQ_SELF_USE_OBJECTMsg=This class defines a covariant version of the equals() method, but inherits the normal equals(Object) method defined in the base java.lang.Object class. The class should probably define a boolean equals(Object) method. + +#FE: Doomed test for equality to NaN (FE_TEST_IF_EQUAL_TO_NOT_A_NUMBER) +FE_TEST_IF_EQUAL_TO_NOT_A_NUMBER=;SFP-1;CWE-570 +FE_TEST_IF_EQUAL_TO_NOT_A_NUMBERMsg=This code checks to see if a floating point value is equal to the special Not A Number value (e.g., if (x == Double.NaN)). However, because of the special semantics of NaN, no value is equal to Nan, including NaN. Thus, x == Double.NaN always evaluates to false. To check to see if a value contained in x is the special Not A Number value, use Double.isNaN(x) (or Float.isNaN(x) if x is floating point precision). + +#FS: Format string placeholder incompatible with passed argument (VA_FORMAT_STRING_BAD_ARGUMENT) +VA_FORMAT_STRING_BAD_ARGUMENT=;SFP-1;CWE-687 +VA_FORMAT_STRING_BAD_ARGUMENTMsg=The format string placeholder is incompatible with the corresponding argument. For example, System.out.println("%d\n", "hello"); The %d placeholder requires a numeric argument, but a string value is passed instead. A runtime exception will occur when this statement is executed. + +#FS: The type of a supplied argument doesn't match format specifier (VA_FORMAT_STRING_BAD_CONVERSION) +VA_FORMAT_STRING_BAD_CONVERSION=;SFP-1;CWE-687 +VA_FORMAT_STRING_BAD_CONVERSIONMsg=One of the arguments is uncompatible with the corresponding format string specifier. As a result, this will generate a runtime exception when executed. For example, String.format("%d", "1") will generate an exception, since the String "1" is incompatible with the format specifier %d. + +#FS: MessageFormat supplied where printf style format expected (VA_FORMAT_STRING_EXPECTED_MESSAGE_FORMAT_SUPPLIED) +VA_FORMAT_STRING_EXPECTED_MESSAGE_FORMAT_SUPPLIED=;SFP-1;CWE-685 +VA_FORMAT_STRING_EXPECTED_MESSAGE_FORMAT_SUPPLIEDMsg=A method is called that expects a Java printf format string and a list of arguments. However, the format string doesn't contain any format specifiers (e.g., %s) but does contain message format elements (e.g., {0}). It is likely that the code is supplying a MessageFormat string when a printf-style format string is required. At runtime, all of the arguments will be ignored and the format string will be returned exactly as provided without any formatting. + +#FS: More arguments are passed than are actually used in the format string (VA_FORMAT_STRING_EXTRA_ARGUMENTS_PASSED) +VA_FORMAT_STRING_EXTRA_ARGUMENTS_PASSED=;SFP-1;CWE-685 +VA_FORMAT_STRING_EXTRA_ARGUMENTS_PASSEDMsg=A format-string method with a variable number of arguments is called, but more arguments are passed than are actually used by the format string. This won't cause a runtime exception, but the code may be silently omitting information that was intended to be included in the formatted string. + +#FS: Illegal format string (VA_FORMAT_STRING_ILLEGAL) +VA_FORMAT_STRING_ILLEGAL=;SFP-1;CWE-687 +VA_FORMAT_STRING_ILLEGALMsg=The format string is syntactically invalid, and a runtime exception will occur when this statement is executed. + +#FS: Format string references missing argument (VA_FORMAT_STRING_MISSING_ARGUMENT) +VA_FORMAT_STRING_MISSING_ARGUMENT=;SFP-1;CWE-685 +VA_FORMAT_STRING_MISSING_ARGUMENTMsg=Not enough arguments are passed to satisfy a placeholder in the format string. A runtime exception will occur when this statement is executed. + +#FS: No previous argument for format string (VA_FORMAT_STRING_NO_PREVIOUS_ARGUMENT) +VA_FORMAT_STRING_NO_PREVIOUS_ARGUMENT=;SFP-1;CWE-685 +VA_FORMAT_STRING_NO_PREVIOUS_ARGUMENTMsg=The format string specifies a relative index to request that the argument for the previous format specifier be reused. However, there is no previous argument. + +#GC: No relationship between generic parameter and method argument (GC_UNRELATED_TYPES) +GC_UNRELATED_TYPES=;SFP--1;CWE-687 +GC_UNRELATED_TYPESMsg=This call to a generic collection method contains an argument with an incompatible class from that of the collection's parameter (i.e., the type of the argument is neither a supertype nor a subtype of the corresponding generic type argument). Therefore, it is unlikely that the collection contains any objects that are equal to the method argument used here. Most likely, the wrong value is being passed to the method. In general, instances of two unrelated classes are not equal. For example, if the Foo and Bar classes are not related by subtyping, then an instance of Foo should not be equal to an instance of Bar. Among other issues, doing so will likely result in an equals method that is not symmetrical. For example, if you define the Foo class so that a Foo can be equal to a String, your equals method isn't symmetrical since a String can only be equal to a String. In rare cases, people do define nonsymmetrical equals methods and still manage to make their code work. Although none of the APIs document or guarantee it, it is typically the case that if you check if a Collection contains a Foo, the equals method of argument (e.g., the equals method of the Foo class) used to perform the equality checks. + +#HE: Signature declares use of unhashable class in hashed construct (HE_SIGNATURE_DECLARES_HASHING_OF_UNHASHABLE_CLASS) +HE_SIGNATURE_DECLARES_HASHING_OF_UNHASHABLE_CLASS=;SFP--1;CWE-581 +HE_SIGNATURE_DECLARES_HASHING_OF_UNHASHABLE_CLASSMsg=A method, field or class declares a generic signature where a non-hashable class is used in context where a hashable class is required. A class that declares an equals method but inherits a hashCode() method from Object is unhashable, since it doesn't fulfill the requirement that equal objects have equal hashCodes. + +#HE: Use of class without a hashCode() method in a hashed data structure (HE_USE_OF_UNHASHABLE_CLASS) +HE_USE_OF_UNHASHABLE_CLASS=;SFP--1;CWE-581 +HE_USE_OF_UNHASHABLE_CLASSMsg=A class defines an equals(Object) method but not a hashCode() method, and thus doesn't fulfill the requirement that equal objects have equal hashCodes. An instance of this class is used in a hash data structure, making the need to fix this problem of highest importance. + +#ICAST: integral value cast to double and then passed to Math.ceil (ICAST_INT_CAST_TO_DOUBLE_PASSED_TO_CEIL) +ICAST_INT_CAST_TO_DOUBLE_PASSED_TO_CEIL=;SFP--1;CWE-398 +ICAST_INT_CAST_TO_DOUBLE_PASSED_TO_CEILMsg=This code converts an integral value (e.g., int or long) to a double precision floating point number and then passing the result to the Math.ceil() function, which rounds a double to the next higher integer value. This operation should always be a no-op, since the converting an integer to a double should give a number with no fractional part. It is likely that the operation that generated the value to be passed to Math.ceil was intended to be performed using double precision floating point arithmetic. + +#INT: Bad comparison of signed byte (INT_BAD_COMPARISON_WITH_SIGNED_BYTE) +INT_BAD_COMPARISON_WITH_SIGNED_BYTE=;SFP--1;CWE-195 +INT_BAD_COMPARISON_WITH_SIGNED_BYTEMsg=Signed bytes can only have a value in the range -128 to 127. Comparing a signed byte with a value outside that range is vacuous and likely to be incorrect. To convert a signed byte b to an unsigned value in the range 0..255, use 0xff & b + +#ICAST: int value cast to float and then passed to Math.round (ICAST_INT_CAST_TO_FLOAT_PASSED_TO_ROUND) +ICAST_INT_CAST_TO_FLOAT_PASSED_TO_ROUND=;SFP--1;CWE-398 +ICAST_INT_CAST_TO_FLOAT_PASSED_TO_ROUNDMsg=This code converts an int value to a float precision floating point number and then passing the result to the Math.round() function, which returns the int/long closest to the argument. This operation should always be a no-op, since the converting an integer to a float should give a number with no fractional part. It is likely that the operation that generated the value to be passed to Math.round was intended to be performed using floating point arithmetic. + +#IJU: JUnit assertion in run method will not be noticed by JUnit (IJU_ASSERT_METHOD_INVOKED_FROM_RUN_METHOD) +IJU_ASSERT_METHOD_INVOKED_FROM_RUN_METHOD=;SFP--1;CWE-710 +IJU_ASSERT_METHOD_INVOKED_FROM_RUN_METHODMsg=A JUnit assertion is performed in a run method. Failed JUnit assertions just result in exceptions being thrown. Thus, if this exception occurs in a thread other than the thread that invokes the test method, the exception will terminate the thread but not result in the test failing. + +#IJU: TestCase declares a bad suite method (IJU_BAD_SUITE_METHOD) +IJU_BAD_SUITE_METHOD=;SFP--1;CWE-710 +IJU_BAD_SUITE_METHODMsg=Class is a JUnit TestCase and defines a suite() method. However, the suite method needs to be declared as either public static junit.framework.Test suite() or public static junit.framework.TestSuite suite() + +#IJU: TestCase has no tests (IJU_NO_TESTS) +IJU_NO_TESTS=;SFP--1;CWE-710 +IJU_NO_TESTSMsg=Class is a JUnit TestCase but has not implemented any test methods + +#IJU: TestCase defines setUp that doesn't call super.setUp() (IJU_SETUP_NO_SUPER) +IJU_SETUP_NO_SUPER=;SFP--1;CWE-710 +IJU_SETUP_NO_SUPERMsg=Class is a JUnit TestCase and implements the setUp method. The setUp method should call super.setUp(), but doesn't. + +#IJU: TestCase implements a non-static suite method (IJU_SUITE_NOT_STATIC) +IJU_SUITE_NOT_STATIC=;SFP--1;CWE-710 +IJU_SUITE_NOT_STATICMsg=Class is a JUnit TestCase and implements the suite() method. The suite method should be declared as being static, but isn't. + +#IJU: TestCase defines tearDown that doesn't call super.tearDown() (IJU_TEARDOWN_NO_SUPER) +IJU_TEARDOWN_NO_SUPER=;SFP--1;CWE-710 +IJU_TEARDOWN_NO_SUPERMsg=Class is a JUnit TestCase and implements the tearDown method. The tearDown method should call super.tearDown(), but doesn't. + +#IL: A collection is added to itself (IL_CONTAINER_ADDED_TO_ITSELF) +IL_CONTAINER_ADDED_TO_ITSELF=;SFP-13;CWE-674 +IL_CONTAINER_ADDED_TO_ITSELFMsg=A collection is added to itself. As a result, computing the hashCode of this set will throw a StackOverflowException + +#IL: An apparent infinite loop (IL_INFINITE_LOOP) +IL_INFINITE_LOOP=;SFP--1;CWE-835 +IL_INFINITE_LOOPMsg=This loop doesn't seem to have a way to terminate (other than by perhaps throwing an exception). + +#IL: An apparent infinite recursive loop (IL_INFINITE_RECURSIVE_LOOP) +IL_INFINITE_RECURSIVE_LOOP=;SFP-13;CWE-674 +IL_INFINITE_RECURSIVE_LOOPMsg=This method unconditionally invokes itself. This would seem to indicate an infinite recursive loop that will result in a stack overflow. + +#IM: Integer multiply of result of integer remainder (IM_MULTIPLYING_RESULT_OF_IREM) +IM_MULTIPLYING_RESULT_OF_IREM=;SFP--1;CWE-398 +IM_MULTIPLYING_RESULT_OF_IREMMsg=The code multiplies the result of an integer remaining by an integer constant. Be sure you don't have your operator precedence confused. For example i % 60 * 1000 is (i % 60) * 1000, not i % (60 * 1000). + +#INT: Bad comparison of nonnegative value with negative constant (INT_BAD_COMPARISON_WITH_NONNEGATIVE_VALUE) +INT_BAD_COMPARISON_WITH_NONNEGATIVE_VALUE=;SFP--1;CWE-398 +INT_BAD_COMPARISON_WITH_NONNEGATIVE_VALUEMsg=This code compares a value that is guaranteed to be non-negative with a negative constant. + +#IO: Doomed attempt to append to an object output stream (IO_APPENDING_TO_OBJECT_OUTPUT_STREAM) +IO_APPENDING_TO_OBJECT_OUTPUT_STREAM=;SFP--1;CWE-398 +IO_APPENDING_TO_OBJECT_OUTPUT_STREAMMsg=This code opens a file in append mode and then wraps the result in an object output stream. This won't allow you to append to an existing object output stream stored in a file. If you want to be able to append to an object output stream, you need to keep the object output stream open. The only situation in which opening a file in append mode and the writing an object output stream could work is if on reading the file you plan to open it in random access mode and seek to the byte offset where the append started. + +#IP: A parameter is dead upon entry to a method but overwritten (IP_PARAMETER_IS_DEAD_BUT_OVERWRITTEN) +IP_PARAMETER_IS_DEAD_BUT_OVERWRITTEN=;SFP--1;CWE-398 +IP_PARAMETER_IS_DEAD_BUT_OVERWRITTENMsg=The initial value of this parameter is ignored, and the parameter is overwritten here. This often indicates a mistaken belief that the write to the parameter will be conveyed back to the caller. + +#MF: Class defines field that masks a superclass field (MF_CLASS_MASKS_FIELD) +MF_CLASS_MASKS_FIELD=;SFP--1;CWE-710 +MF_CLASS_MASKS_FIELDMsg=This class defines a field with the same name as a visible instance field in a superclass. This is confusing, and may indicate an error if methods update or access one of the fields when they wanted the other. + +#MF: Method defines a variable that obscures a field (MF_METHOD_MASKS_FIELD) +MF_METHOD_MASKS_FIELD=;SFP--1;CWE-710 +MF_METHOD_MASKS_FIELDMsg=This method defines a local variable with the same name as a field in this class or a superclass. This may cause the method to read an uninitialized value from the field, leave the field uninitialized, or both. + +#NP: Null pointer dereference (NP_ALWAYS_NULL) +NP_ALWAYS_NULL=;SFP-7;CWE-476 +NP_ALWAYS_NULLMsg=A null pointer is dereferenced here. This will lead to a NullPointerException when the code is executed. + +#NP: Null pointer dereference in method on exception path (NP_ALWAYS_NULL_EXCEPTION) +NP_ALWAYS_NULL_EXCEPTION=;SFP-7;CWE-476 +NP_ALWAYS_NULL_EXCEPTIONMsg=A pointer which is null on an exception path is dereferenced here. This will lead to a NullPointerException when the code is executed. Note that because FindBugs currently does not prune infeasible exception paths, this may be a false warning. Also note that FindBugs considers the default case of a switch statement to be an exception path, since the default case is often infeasible. + +#NP: Method does not check for null argument (NP_ARGUMENT_MIGHT_BE_NULL) +NP_ARGUMENT_MIGHT_BE_NULL=;SFP-7;CWE-476 +NP_ARGUMENT_MIGHT_BE_NULLMsg=A parameter to this method has been identified as a value that should always be checked to see whether or not it is null, but it is being dereferenced without a preceding null check. + +#NP: close() invoked on a value that is always null (NP_CLOSING_NULL) +NP_CLOSING_NULL=;SFP-7;CWE-476 +NP_CLOSING_NULLMsg=close() is being invoked on a value that is always null. If this statement is executed, a null pointer exception will occur. But the big risk here you never close something that should be closed. + +#NP: Null value is guaranteed to be dereferenced (NP_GUARANTEED_DEREF) +NP_GUARANTEED_DEREF=;SFP-7;CWE-476 +NP_GUARANTEED_DEREFMsg=There is a statement or branch that if executed guarantees that a value is null at this point, and that value that is guaranteed to be dereferenced (except on forward paths involving runtime exceptions). + +#NP: Value is null and guaranteed to be dereferenced on exception path (NP_GUARANTEED_DEREF_ON_EXCEPTION_PATH) +NP_GUARANTEED_DEREF_ON_EXCEPTION_PATH=;SFP-7;CWE-476 +NP_GUARANTEED_DEREF_ON_EXCEPTION_PATHMsg=There is a statement or branch on an exception path that if executed guarantees that a value is null at this point, and that value that is guaranteed to be dereferenced (except on forward paths involving runtime exceptions). + +#NP: Method call passes null to a nonnull parameter (NP_NONNULL_PARAM_VIOLATION) +NP_NONNULL_PARAM_VIOLATION=;SFP-7;CWE-476 +NP_NONNULL_PARAM_VIOLATIONMsg=This method passes a null value as the parameter of a method which must be nonnull. Either this parameter has been explicitly marked as @Nonnull, or analysis has determined that this parameter is always dereferenced. + +#NP: Method may return null, but is declared @NonNull (NP_NONNULL_RETURN_VIOLATION) +NP_NONNULL_RETURN_VIOLATION=;SFP-7;CWE-476 +NP_NONNULL_RETURN_VIOLATIONMsg=This method may return a null value, but the method (or a superclass method which it overrides) is declared to return @NonNull. + +#NP: A known null value is checked to see if it is an instance of a type (NP_NULL_INSTANCEOF) +NP_NULL_INSTANCEOF=;SFP-1;CWE-570 +NP_NULL_INSTANCEOFMsg=This instanceof test will always return false, since the value being checked is guaranteed to be null. Although this is safe, make sure it isn't an indication of some misunderstanding or some other logic error. + +#NP: Possible null pointer dereference (NP_NULL_ON_SOME_PATH) +NP_NULL_ON_SOME_PATH=;SFP-7;CWE-476 +NP_NULL_ON_SOME_PATHMsg=There is a branch of statement that, if executed, guarantees that a null value will be dereferenced, which would generate a NullPointerException when the code is executed. Of course, the problem might be that the branch or statement is infeasible and that the null pointer exception can't ever be executed; deciding that is beyond the ability of FindBugs. + +#NP: Possible null pointer dereference in method on exception path (NP_NULL_ON_SOME_PATH_EXCEPTION) +NP_NULL_ON_SOME_PATH_EXCEPTION=;SFP-7;CWE-476 +NP_NULL_ON_SOME_PATH_EXCEPTIONMsg=A reference value which is null on some exception control path is dereferenced here. This may lead to a NullPointerException when the code is executed. Note that because FindBugs currently does not prune infeasible exception paths, this may be a false warning. Also note that FindBugs considers the default case of a switch statement to be an exception path, since the default case is often infeasible. + +#NP: Method call passes null for nonnull parameter (NP_NULL_PARAM_DEREF) +NP_NULL_PARAM_DEREF=;SFP-7;CWE-476 +NP_NULL_PARAM_DEREFMsg=This method call passes a null value for a nonnull method parameter. Either the parameter is annotated as a parameter that should always be nonnull, or analysis has shown that it will always be dereferenced. + +#NP: Method call passes null for nonnull parameter (NP_NULL_PARAM_DEREF_ALL_TARGETS_DANGEROUS) +NP_NULL_PARAM_DEREF_ALL_TARGETS_DANGEROUS=;SFP-7;CWE-476 +NP_NULL_PARAM_DEREF_ALL_TARGETS_DANGEROUSMsg=A possibly-null value is passed at a call site where all known target methods require the parameter to be nonnull. Either the parameter is annotated as a parameter that should always be nonnull, or analysis has shown that it will always be dereferenced. + +#NP: Non-virtual method call passes null for nonnull parameter (NP_NULL_PARAM_DEREF_NONVIRTUAL) +NP_NULL_PARAM_DEREF_NONVIRTUAL=;SFP-7;CWE-476 +NP_NULL_PARAM_DEREF_NONVIRTUALMsg=A possibly-null value is passed to a nonnull method parameter. Either the parameter is annotated as a parameter that should always be nonnull, or analysis has shown that it will always be dereferenced. + +#NP: Store of null value into field annotated NonNull (NP_STORE_INTO_NONNULL_FIELD) +NP_STORE_INTO_NONNULL_FIELD=;SFP-7;CWE-476 +NP_STORE_INTO_NONNULL_FIELDMsg=A value that could be null is stored into a field that has been annotated as NonNull. + +#NP: Read of unwritten field (NP_UNWRITTEN_FIELD) +NP_UNWRITTEN_FIELD=;SFP-7;CWE-476 +NP_UNWRITTEN_FIELDMsg=The program is dereferencing a field that does not seem to ever have a non-null value written to it. Dereferencing this value will generate a null pointer exception. + +#Nm: Class defines equal(Object); should it be equals(Object)? (NM_BAD_EQUAL) +NM_BAD_EQUAL=;SFP--1;CWE-710 +NM_BAD_EQUALMsg=This class defines a method equal(Object). This method does not override the equals(Object) method in java.lang.Object, which is probably what was intended. + +#Nm: Class defines hashcode(); should it be hashCode()? (NM_LCASE_HASHCODE) +NM_LCASE_HASHCODE=;SFP--1;CWE-710 +NM_LCASE_HASHCODEMsg=This class defines a method called hashcode(). This method does not override the hashCode() method in java.lang.Object, which is probably what was intended. + +#Nm: Class defines tostring(); should it be toString()? (NM_LCASE_TOSTRING) +NM_LCASE_TOSTRING=;SFP--1;CWE-710 +NM_LCASE_TOSTRINGMsg=This class defines a method called tostring(). This method does not override the toString() method in java.lang.Object, which is probably what was intended. + +#Nm: Apparent method/constructor confusion (NM_METHOD_CONSTRUCTOR_CONFUSION) +NM_METHOD_CONSTRUCTOR_CONFUSION=;SFP--1;CWE-710 +NM_METHOD_CONSTRUCTOR_CONFUSIONMsg=This regular method has the same name as the class it is defined in. It is likely that this was intended to be a constructor. If it was intended to be a constructor, remove the declaration of a void return value. If you had accidently defined this method, realized the mistake, defined a proper constructor but can't get rid of this method due to backwards compatibility, deprecate the method. + +#Nm: Very confusing method names (NM_VERY_CONFUSING) +NM_VERY_CONFUSING=;SFP--1;CWE-710 +NM_VERY_CONFUSINGMsg=The referenced methods have names that differ only by capitalization. This is very confusing because if the capitalization were identical then one of the methods would override the other. + +#Nm: Method doesn't override method in superclass due to wrong package for parameter (NM_WRONG_PACKAGE) +NM_WRONG_PACKAGE=;SFP--1;CWE-710 +NM_WRONG_PACKAGEMsg=The method in the subclass doesn't override a similar method in a superclass because the type of a parameter doesn't exactly match the type of the corresponding parameter in the superclass. + +#QBA: Method assigns boolean literal in boolean expression (QBA_QUESTIONABLE_BOOLEAN_ASSIGNMENT) +QBA_QUESTIONABLE_BOOLEAN_ASSIGNMENT=;SFP-1;CWE-481 +QBA_QUESTIONABLE_BOOLEAN_ASSIGNMENTMsg=This method assigns a literal boolean value (true or false) to a boolean variable inside an if or while expression. Most probably this was supposed to be a boolean comparison using ==, not an assignment using =. + +#RC: Suspicious reference comparison (RC_REF_COMPARISON) +RC_REF_COMPARISON=;SFP-1;CWE-597 +RC_REF_COMPARISONMsg=This method compares two reference values using the == or != operator, where the correct way to compare instances of this type is generally with the equals() method. It is possible to create distinct instances that are equal but do not compare as == since they are different objects. Examples of classes which should generally not be compared by reference are java.lang.Integer, java.lang.Float, etc. + +#RCN: Nullcheck of value previously dereferenced (RCN_REDUNDANT_NULLCHECK_WOULD_HAVE_BEEN_A_NPE) +RCN_REDUNDANT_NULLCHECK_WOULD_HAVE_BEEN_A_NPE=;SFP-7;CWE-476 +RCN_REDUNDANT_NULLCHECK_WOULD_HAVE_BEEN_A_NPEMsg=A value is checked here to see whether it is null, but this value can't be null because it was previously dereferenced and if it were null a null pointer exception would have occurred at the earlier dereference. Essentially, this code and the previous dereference disagree as to whether this value is allowed to be null. Either the check is redundant or the previous dereference is erroneous. + +#RE: Invalid syntax for regular expression (RE_BAD_SYNTAX_FOR_REGULAR_EXPRESSION) +RE_BAD_SYNTAX_FOR_REGULAR_EXPRESSION=;SFP--1;CWE-687 +RE_BAD_SYNTAX_FOR_REGULAR_EXPRESSIONMsg=The code here uses a regular expression that is invalid according to the syntax for regular expressions. This statement will throw a PatternSyntaxException when executed. + +#RE: File.separator used for regular expression (RE_CANT_USE_FILE_SEPARATOR_AS_REGULAR_EXPRESSION) +RE_CANT_USE_FILE_SEPARATOR_AS_REGULAR_EXPRESSION=;SFP--1;CWE-687 +RE_CANT_USE_FILE_SEPARATOR_AS_REGULAR_EXPRESSIONMsg=The code here uses File.separator where a regular expression is required. This will fail on Windows platforms, where the File.separator is a backslash, which is interpreted in a regular expression as an escape character. Amoung other options, you can just use File.separatorChar=='\\' ? "\\\\" : File.separator instead of File.separator + +#RE: "." used for regular expression (;SFP--1;CWE-687 +RE_POSSIBLE_UNINTENDED_PATTERNMsg=A String function is being invoked and "." is being passed to a parameter that takes a regular expression as an argument. Is this what you intended? For example s.replaceAll(".", "/") will return a String in which every character has been replaced by a / character, and s.split(".") always returns a zero length array of String. + +#RV: Random value from 0 to 1 is coerced to the integer 0 (RV_01_TO_INT) +RV_01_TO_INT=;SFP-1;CWE-197 +RV_01_TO_INTMsg=A random value from 0 to 1 is being coerced to the integer value 0. You probably want to multiple the random value by something else before coercing it to an integer, or use the Random.nextInt(n) method. + +#RV: Bad attempt to compute absolute value of signed 32-bit hashcode (RV_ABSOLUTE_VALUE_OF_HASHCODE) +RV_ABSOLUTE_VALUE_OF_HASHCODE=;SFP-1;CWE-197 +RV_ABSOLUTE_VALUE_OF_HASHCODEMsg=This code generates a hashcode and then computes the absolute value of that hashcode. If the hashcode is Integer.MIN_VALUE, then the result will be negative as well (since Math.abs(Integer.MIN_VALUE) == Integer.MIN_VALUE). One out of 2^32 strings have a hashCode of Integer.MIN_VALUE, including "polygenelubricants" "GydZG_" and ""DESIGNING WORKHOUSES". + +#RV: Bad attempt to compute absolute value of signed 32-bit random integer (RV_ABSOLUTE_VALUE_OF_RANDOM_INT) +RV_ABSOLUTE_VALUE_OF_RANDOM_INT=;SFP-1;CWE--1 +RV_ABSOLUTE_VALUE_OF_RANDOM_INTMsg=This code generates a random signed integer and then computes the absolute value of that random integer. If the number returned by the random number generator is Integer.MIN_VALUE, then the result will be negative as well (since Math.abs(Integer.MIN_VALUE) == Integer.MIN_VALUE). + +#RV: Exception created and dropped rather than thrown (RV_EXCEPTION_NOT_THROWN) +RV_EXCEPTION_NOT_THROWN=;SFP-4;CWE-390 +RV_EXCEPTION_NOT_THROWNMsg=This code creates an exception (or error) object, but doesn't do anything with it. + +#RV: Method ignores return value (RV_RETURN_VALUE_IGNORED) +RV_RETURN_VALUE_IGNORED=;SFP-4;CWE-252 +RV_RETURN_VALUE_IGNOREDMsg=The return value of this method should be checked. One common cause of this warning is to invoke a method on an immutable object, thinking that it updates the object. + +#RpC: Repeated conditional tests (RpC_REPEATED_CONDITIONAL_TEST) +RpC_REPEATED_CONDITIONAL_TEST=;SFP--1;CWE-398 +RpC_REPEATED_CONDITIONAL_TESTMsg=The code contains a conditional test is performed twice, one right after the other (e.g., x == 0 || x == 0). Perhaps the second occurrence is intended to be something else (e.g., x == 0 || y == 0). + +#SA: Double assignment of field (SA_FIELD_DOUBLE_ASSIGNMENT) +SA_FIELD_DOUBLE_ASSIGNMENT=;SFP--1;CWE-398 +SA_FIELD_DOUBLE_ASSIGNMENTMsg=This method contains a double assignment of a field + +#SA: Self assignment of field (SA_FIELD_SELF_ASSIGNMENT) +SA_FIELD_SELF_ASSIGNMENT=;SFP--1;CWE-398 +SA_FIELD_SELF_ASSIGNMENTMsg=This method contains a self assignment of a field + +#SA: Self comparison of field with itself (SA_FIELD_SELF_COMPARISON) +SA_FIELD_SELF_COMPARISON=;SFP--1;CWE-398 +SA_FIELD_SELF_COMPARISONMsg=This method compares a field with itself, and may indicate a typo or a logic error. Make sure that you are comparing the right things. + +#SA: Nonsensical self computation involving a field (e.g., x & x) (SA_FIELD_SELF_COMPUTATION) +SA_FIELD_SELF_COMPUTATION=;SFP--1;CWE-398 +SA_FIELD_SELF_COMPUTATIONMsg=This method performs a nonsensical computation of a field with another reference to the same field (e.g., x&x or x-x). Because of the nature of the computation, this operation doesn't seem to make sense, and may indicate a typo or a logic error. Double check the computation. + +#A: Self comparison of value with itself (SA_LOCAL_SELF_COMPARISON) +SA_LOCAL_SELF_COMPARISON=;SFP--1;CWE-398 +SA_LOCAL_SELF_COMPARISONMsg=This method compares a local variable with itself, and may indicate a typo or a logic error. Make sure that you are comparing the right things. + +#SA: Nonsensical self computation involving a variable (e.g., x & x) (SA_LOCAL_SELF_COMPUTATION) +SA_LOCAL_SELF_COMPUTATION=;SFP--1;CWE-398 +SA_LOCAL_SELF_COMPUTATIONMsg=This method performs a nonsensical computation of a local variable with another reference to the same variable (e.g., x&x or x-x). Because of the nature of the computation, this operation doesn't seem to make sense, and may indicate a typo or a logic error. Double check the computation. + +#SF: Dead store due to switch statement fall through (SF_DEAD_STORE_DUE_TO_SWITCH_FALLTHROUGH) +SF_DEAD_STORE_DUE_TO_SWITCH_FALLTHROUGH=;SFP-4;CWE-484 +SF_DEAD_STORE_DUE_TO_SWITCH_FALLTHROUGHMsg=A value stored in the previous switch case is overwritten here due to a switch fall through. It is likely that you forgot to put a break or return at the end of the previous case. + +#SF: Dead store due to switch statement fall through to throw (SF_DEAD_STORE_DUE_TO_SWITCH_FALLTHROUGH_TO_THROW) +SF_DEAD_STORE_DUE_TO_SWITCH_FALLTHROUGH_TO_THROW=;SFP-4;CWE-484 +SF_DEAD_STORE_DUE_TO_SWITCH_FALLTHROUGH_TO_THROWMsg=A value stored in the previous switch case is ignored here due to a switch fall through to a place where an exception is thrown. It is likely that you forgot to put a break or return at the end of the previous case. + +#SIC: Deadly embrace of non-static inner class and thread local (SIC_THREADLOCAL_DEADLY_EMBRACE) +SIC_THREADLOCAL_DEADLY_EMBRACE=;SFP--1;CWE-398 +SIC_THREADLOCAL_DEADLY_EMBRACEMsg=This class is an inner class, but should probably be a static inner class. As it is, there is a serious danger of a deadly embrace between the inner class and the thread local in the outer class. Because the inner class isn't static, it retains a reference to the outer class. If the thread local contains a reference to an instance of the inner class, the inner and outer instance will both be reachable and not eligible for garbage collection. + +#SIO: Unnecessary type check done using instanceof operator (SIO_SUPERFLUOUS_INSTANCEOF) +SIO_SUPERFLUOUS_INSTANCEOF=;SFP--1;CWE-398 +SIO_SUPERFLUOUS_INSTANCEOFMsg=Type check performed using the instanceof operator where it can be statically determined whether the object is of the type requested. + +#SQL: Method attempts to access a prepared statement parameter with index 0 (SQL_BAD_PREPARED_STATEMENT_ACCESS) +SQL_BAD_PREPARED_STATEMENT_ACCESS=;SFP-1;CWE-687 +SQL_BAD_PREPARED_STATEMENT_ACCESSMsg=A call to a setXXX method of a prepared statement was made where the parameter index is 0. As parameter indexes start at index 1, this is always a mistake. + +#SQL: Method attempts to access a result set field with index 0 (SQL_BAD_RESULTSET_ACCESS) +SQL_BAD_RESULTSET_ACCESS=;SFP-1;CWE-687 +SQL_BAD_RESULTSET_ACCESSMsg=A call to getXXX or updateXXX methods of a result set was made where the field index is 0. As ResultSet fields start at index 1, this is always a mistake. + +#STI: Unneeded use of currentThread() call, to call interrupted() (STI_INTERRUPTED_ON_CURRENTTHREAD) +STI_INTERRUPTED_ON_CURRENTTHREAD=;SFP--1;CWE-398 +STI_INTERRUPTED_ON_CURRENTTHREADMsg=This method invokes the Thread.currentThread() call, just to call the interrupted() method. As interrupted() is a static method, is more simple and clear to use Thread.interrupted(). + +#STI: Static Thread.interrupted() method invoked on thread instance (STI_INTERRUPTED_ON_UNKNOWNTHREAD) +STI_INTERRUPTED_ON_UNKNOWNTHREAD=;SFP--1;CWE-398 +STI_INTERRUPTED_ON_UNKNOWNTHREADMsg=This method invokes the Thread.interrupted() method on a Thread object that appears to be a Thread object that is not the current thread. As the interrupted() method is static, the interrupted method will be called on a different object than the one the author intended. + +#Se: Method must be private in order for serialization to work (SE_METHOD_MUST_BE_PRIVATE) +SE_METHOD_MUST_BE_PRIVATE=;SFP--1;CWE-710 +SE_METHOD_MUST_BE_PRIVATEMsg=This class implements the Serializable interface, and defines a method for custom serialization/deserialization. But since that method isn't declared private, it will be silently ignored by the serialization/deserialization API. + +#Se: The readResolve method must not be declared as a static method. (SE_READ_RESOLVE_IS_STATIC) +SE_READ_RESOLVE_IS_STATIC=;SFP--1;CWE-710 +SE_READ_RESOLVE_IS_STATICMsg=In order for the readResolve method to be recognized by the serialization mechanism, it must not be declared as a static method. + +#TQ: Value annotated as carrying a type qualifier used where a value that must not carry that qualifier is required +TQ_ALWAYS_VALUE_USED_WHERE_NEVER_REQUIRED=;SFP--1;CWE-710 +TQ_ALWAYS_VALUE_USED_WHERE_NEVER_REQUIRED=A value specified as carrying a type qualifier annotation is consumed in a location or locations requiring that the value not carry that annotation. More precisely, a value annotated with a type qualifier specifying when=ALWAYS is guaranteed to reach a use or uses where the same type qualifier specifies when=NEVER. + +#TQ: Value that might not carry a type qualifier is always used in a way requires that type qualifier  +TQ_MAYBE_SOURCE_VALUE_REACHES_ALWAYS_SINK=;SFP--1;CWE-710 +TQ_MAYBE_SOURCE_VALUE_REACHES_ALWAYS_SINKMsg=A value that is annotated as possibility not being an instance of the values denoted by the type qualifier, and the value is guaranteed to be used in a way that requires values denoted by that type qualifier. + +#TQ: Value that might carry a type qualifier is always used in a way prohibits it from having that type qualifier (TQ_MAYBE_SOURCE_VALUE_REACHES_NEVER_SINK) +TQ_MAYBE_SOURCE_VALUE_REACHES_NEVER_SINK=;SFP--1;CWE-710 +TQ_MAYBE_SOURCE_VALUE_REACHES_NEVER_SINKMsg=A value that is annotated as possibility being an instance of the values denoted by the type qualifier, and the value is guaranteed to be used in a way that prohibits values denoted by that type qualifier. + +#TQ: Value annotated as never carrying a type qualifier used where value carrying that qualifier is required (TQ_NEVER_VALUE_USED_WHERE_ALWAYS_REQUIRED) +TQ_NEVER_VALUE_USED_WHERE_ALWAYS_REQUIRED=;SFP--1;CWE-710 +TQ_NEVER_VALUE_USED_WHERE_ALWAYS_REQUIREDMsg=A value specified as not carrying a type qualifier annotation is guaranteed to be consumed in a location or locations requiring that the value does carry that annotation. More precisely, a value annotated with a type qualifier specifying when=NEVER is guaranteed to reach a use or uses where the same type qualifier specifies when=ALWAYS. + +#UMAC: Uncallable method defined in anonymous class (UMAC_UNCALLABLE_METHOD_OF_ANONYMOUS_CLASS) +UMAC_UNCALLABLE_METHOD_OF_ANONYMOUS_CLASS=;SFP-2;CWE-561 +UMAC_UNCALLABLE_METHOD_OF_ANONYMOUS_CLASSMsg=This anonymous class defined a method that is not directly invoked and does not override a method in a superclass. Since methods in other classes cannot directly invoke methods declared in an anonymous class, it seems that this method is uncallable. The method might simply be dead code, but it is also possible that the method is intended to override a method declared in a superclass, and due to an typo or other error the method does not, in fact, override the method it is intended to. + +#UR: Uninitialized read of field in constructor (UR_UNINIT_READ) +UR_UNINIT_READ=;SFP-1;CWE-457 +UR_UNINIT_READMsg=This constructor reads a field which has not yet been assigned a value. This is often caused when the programmer mistakenly uses the field instead of one of the constructor's parameters. + +#UR: Uninitialized read of field method called from constructor of superclass (UR_UNINIT_READ_CALLED_FROM_SUPER_CONSTRUCTOR) +UR_UNINIT_READ_CALLED_FROM_SUPER_CONSTRUCTOR=;SFP-1;CWE-457 +UR_UNINIT_READ_CALLED_FROM_SUPER_CONSTRUCTORMsg=This method is invoked in the constructor of of the superclass. At this point, the fields of the class have not yet initialized. + +#USELESS_STRING: Invocation of toString on an array (DMI_INVOKING_TOSTRING_ON_ANONYMOUS_ARRAY) +DMI_INVOKING_TOSTRING_ON_ANONYMOUS_ARRAY=;SFP--1;CWE-398 +DMI_INVOKING_TOSTRING_ON_ANONYMOUS_ARRAYMsg=The code invokes toString on an (anonymous) array. Calling toString on an array generates a fairly useless result such as [C@16f0472. Consider using Arrays.toString to convert the array into a readable String that gives the contents of the array. See Programming Puzzlers, chapter 3, puzzle 12. + +#USELESS_STRING: Invocation of toString on an array (DMI_INVOKING_TOSTRING_ON_ARRAY) +DMI_INVOKING_TOSTRING_ON_ARRAY=;SFP--1;CWE-398 +DMI_INVOKING_TOSTRING_ON_ARRAYMsg=The code invokes toString on an array, which will generate a fairly useless result such as [C@16f0472. Consider using Arrays.toString to convert the array into a readable String that gives the contents of the array. See Programming Puzzlers, chapter 3, puzzle 12. + +#USELESS_STRING: Array formatted in useless way using format string (VA_FORMAT_STRING_BAD_CONVERSION_FROM_ARRAY) +VA_FORMAT_STRING_BAD_CONVERSION_FROM_ARRAY=;SFP--1;CWE-398 +VA_FORMAT_STRING_BAD_CONVERSION_FROM_ARRAYMsg=One of the arguments being formatted with a format string is an array. This will be formatted using a fairly useless format, such as [I@304282, which doesn't actually show the contents of the array. Consider wrapping the array using Arrays.asList(...) before handling it off to a formatted. + +#UwF: Field only ever set to null (UWF_NULL_FIELD) +UWF_NULL_FIELD=;SFP--1;CWE-398 +UWF_NULL_FIELDMsg=All writes to this field are of the constant value null, and thus all reads of the field will return null. Check for errors, or remove it if it is useless. + +#This field is never written. All reads of it will return the default value. Check for errors (should it have been initialized?), or remove it if it is useless. +UWF_UNWRITTEN_FIELD=;SFP-1;CWE-456 +UWF_UNWRITTEN_FIELDMsg=This field is never written. All reads of it will return the default value. Check for errors (should it have been initialized?), or remove it if it is useless. + +#VA: Primitive array passed to function expecting a variable number of object arguments +VA_PRIMITIVE_ARRAY_PASSED_TO_OBJECT_VARARG=;SFP-1;CWE-704 +VA_PRIMITIVE_ARRAY_PASSED_TO_OBJECT_VARARGMsg=This code passes a primitive array to a function that takes a variable number of object arguments. This creates an array of length one to hold the primitive array and passes it to the function. + +#LG: Potential lost logger changes due to weak reference in OpenJDK (LG_LOST_LOGGER_DUE_TO_WEAK_REFERENCE) +LG_LOST_LOGGER_DUE_TO_WEAK_REFERENCE=;SFP-3;CWE-474 +LG_LOST_LOGGER_DUE_TO_WEAK_REFERENCEMsg=OpenJDK introduces a potential incompatibility. In particular, the java.util.logging.Logger behavior has changed. Instead of using strong references, it now uses weak references internally. That's a reasonable change, but unfortunately some code relies on the old behavior - when changing logger configuration, it simply drops the logger reference. That means that the garbage collector is free to reclaim that memory, which means that the logger configuration is lost. + +#OBL: Method may fail to clean up stream or resource (OBL_UNSATISFIED_OBLIGATION) +OBL_UNSATISFIED_OBLIGATION=;SFP-14;CWE-404 +OBL_UNSATISFIED_OBLIGATIONMsg=This method may fail to clean up (close, dispose of) a stream, database object, or other resource requiring an explicit cleanup operation. In general, if a method opens a stream or other resource, the method should use a try/finally block to ensure that the stream or resource is cleaned up before the method returns. + +#Dm: Consider using Locale parameterized version of invoked method (DM_CONVERT_CASE) +DM_CONVERT_CASE=;SFP--1;CWE-710 +DM_CONVERT_CASEMsg=A String is being converted to upper or lowercase, using the platform's default encoding. This may result in improper conversions when used with international characters. + +#EI: May expose internal representation by returning reference to mutable object (EI_EXPOSE_REP) +EI_EXPOSE_REP=;SFP-23;CWE-375 +EI_EXPOSE_REPMsg=Returning a reference to a mutable object value stored in one of the object's fields exposes the internal representation of the object. If instances are accessed by untrusted code, and unchecked changes to the mutable object would compromise security or other important properties, you will need to do something different. Returning a new copy of the object is better approach in many situations. + +#EI2: May expose internal representation by incorporating reference to mutable object (EI_EXPOSE_REP2) +EI_EXPOSE_REP2=;SFP-23;CWE-375 +EI_EXPOSE_REP2Msg=This code stores a reference to an externally mutable object into the internal representation of the object. If instances are accessed by untrusted code, and unchecked changes to the mutable object would compromise security or other important properties, you will need to do something different. Storing a copy of the object is better approach in many situations. + +#FI: Finalizer should be protected, not public (FI_PUBLIC_SHOULD_BE_PROTECTED) +FI_PUBLIC_SHOULD_BE_PROTECTED=;SFP-28;CWE-583 +FI_PUBLIC_SHOULD_BE_PROTECTEDMsg=A class's finalize() method should have protected access, not public. + +#MS: May expose internal static state by storing a mutable object into a static field (EI_EXPOSE_STATIC_REP2) +EI_EXPOSE_STATIC_REP2=;SFP-23;CWE-607 +EI_EXPOSE_STATIC_REP2Msg=This code stores a reference to an externally mutable object into a static field. If unchecked changes to the mutable object would compromise security or other important properties, you will need to do something different. Storing a copy of the object is better approach in many situations. + +#MS: Field isn't final and can't be protected from malicious code (MS_CANNOT_BE_FINAL) +MS_CANNOT_BE_FINAL=;SFP-28;CWE-500 +MS_CANNOT_BE_FINALMsg=A mutable static field could be changed by malicious code or by accident from another package. Unfortunately, the way the field is used doesn't allow any easy fix to this problem. + +#MS: Public static method may expose internal representation by returning array (MS_EXPOSE_REP) +MS_EXPOSE_REP=;SFP-23;CWE-495 +MS_EXPOSE_REPMsg=A public static method returns a reference to an array that is part of the static state of the class. Any code that calls this method can freely modify the underlying array. One fix is to return a copy of the array. + +#MS: Field should be both final and package protected (MS_FINAL_PKGPROTECT) +MS_FINAL_PKGPROTECT=;SFP-28;CWE-500 +MS_FINAL_PKGPROTECTMsg=A mutable static field could be changed by malicious code or by accident from another package. The field could be made package protected and/or made final to avoid this vulnerability. + +#MS: Field is a mutable array (MS_MUTABLE_ARRAY) +MS_MUTABLE_ARRAY=;SFP-23;CWE-607 +MS_MUTABLE_ARRAYMsg=A final static field references an array and can be accessed by malicious code or by accident from another package. This code can freely modify the contents of the array. + +#MS: Field is a mutable Hashtable (MS_MUTABLE_HASHTABLE) +MS_MUTABLE_HASHTABLE=;SFP-23;CWE-607 +MS_MUTABLE_HASHTABLEMsg=A final static field references a Hashtable and can be accessed by malicious code or by accident from another package. This code can freely modify the contents of the Hashtable. + +#MS: Field should be moved out of an interface and made package protected (MS_OOI_PKGPROTECT) +MS_OOI_PKGPROTECT=;SFP-23;CWE-607 +MS_OOI_PKGPROTECTMsg=A final static field that is defined in an interface references a mutable object such as an array or hashtable. This mutable object could be changed by malicious code or by accident from another package. To solve this, the field needs to be moved to a class and made package protected to avoid this vulnerability. + +#MS: Field should be package protected (MS_PKGPROTECT) +MS_PKGPROTECT=;SFP-23;CWE-607 +MS_PKGPROTECTMsg=A mutable static field could be changed by malicious code or by accident. The field could be made package protected to avoid this vulnerability. + +#MS: Field isn't final but should be (MS_SHOULD_BE_FINAL) +MS_SHOULD_BE_FINAL=;SFP-28;CWE-500 +MS_SHOULD_BE_FINALMsg=A mutable static field could be changed by malicious code or by accident from another package. The field could be made final to avoid this vulnerability. + +#DC: Possible double check of field (DC_DOUBLECHECK) +DC_DOUBLECHECK=;SFP-19;CWE-609 +DC_DOUBLECHECKMsg=This method may contain an instance of double-checked locking. This idiom is not correct according to the semantics of the Java memory model. For more information, see the web page http://www.cs.umd.edu/~pugh/java/memoryModel/DoubleCheckedLocking.html. + +#DL: Synchronization on Boolean could lead to deadlock (DL_SYNCHRONIZATION_ON_BOOLEAN) +DL_SYNCHRONIZATION_ON_BOOLEAN=;SFP-19;CWE-833 +DL_SYNCHRONIZATION_ON_BOOLEANMsg=The code synchronizes on a boxed primitive constant, such as an Boolean. Since there normally exist only two Boolean objects, this code could be synchronizing on the same object as other, unrelated code, leading to unresponsiveness and possible deadlock + +#DL: Synchronization on boxed primitive could lead to deadlock (DL_SYNCHRONIZATION_ON_BOXED_PRIMITIVE) +DL_SYNCHRONIZATION_ON_BOXED_PRIMITIVE=;SFP-19;CWE-833 +DL_SYNCHRONIZATION_ON_BOXED_PRIMITIVEMsg=The code synchronizes on a boxed primitive constant, such as an Integer. Since Integer objects can be cached and shared, this code could be synchronizing on the same object as other, unrelated code, leading to unresponsiveness and possible deadlock + +#DL: Synchronization on interned String could lead to deadlock (DL_SYNCHRONIZATION_ON_SHARED_CONSTANT) +DL_SYNCHRONIZATION_ON_SHARED_CONSTANT=;SFP-19;CWE-833 +DL_SYNCHRONIZATION_ON_SHARED_CONSTANTMsg=The code synchronizes on interned String. Constant Strings are interned and shared across all other classes loaded by the JVM. Thus, this could is locking on something that other code might also be locking. This could result in very strange and hard to diagnose blocking and deadlock behavior. See http://www.javalobby.org/java/forums/t96352.html and http://jira.codehaus.org/browse/JETTY-352. + +#DL: Synchronization on boxed primitive values (DL_SYNCHRONIZATION_ON_UNSHARED_BOXED_PRIMITIVE) +DL_SYNCHRONIZATION_ON_UNSHARED_BOXED_PRIMITIVE=;SFP-19;CWE-833 +DL_SYNCHRONIZATION_ON_UNSHARED_BOXED_PRIMITIVEMsg=The code synchronizes on an apparently unshared boxed primitive, such as an Integer. It would be much better, in this code, to redeclare fileLock as + +#private static final Object fileLock = new Object(); +#The existing code might be OK, but it is confusing and a future refactoring, such as the "Remove Boxing" refactoring in IntelliJ, might replace this with the use of an interned Integer object shared throughout the JVM, leading to very confusing behavior and potential deadlock. + +#Dm: Monitor wait() called on Condition (DM_MONITOR_WAIT_ON_CONDITION) +DM_MONITOR_WAIT_ON_CONDITION=;SFP--1;CWE-710 +DM_MONITOR_WAIT_ON_CONDITIONMsg=This method calls wait() on a java.util.concurrent.locks.Condition object. Waiting for a Condition should be done using one of the await() methods defined by the Condition interface. + +#Dm: A thread was created using the default empty run method (DM_USELESS_THREAD) +DM_USELESS_THREAD=;SFP--1;CWE-710 +DM_USELESS_THREADMsg=This method creates a thread without specifying a run method either by deriving from the Thread class, or by passing a Runnable object. This thread, then, does nothing but waste time. + +#ESync: Empty synchronized block (ESync_EMPTY_SYNC) +Esync_EMPTY_SYNC=;SFP-21;CWE-585 +Esync_EMPTY_SYNCMsg=The code contains an empty synchronized block: synchronized() {} Empty synchronized blocks are far more subtle and hard to use correctly than most people recognize, and empty synchronized blocks are almost never a better solution than less contrived solutions. + +#IS: Inconsistent synchronization (IS2_INCONSISTENT_SYNC) +IS2_INCONSISTENT_SYNC=;SFP-19;CWE-662 +IS2_INCONSISTENT_SYNCMsg=The fields of this class appear to be accessed inconsistently with respect to synchronization. + +#IS: Field not guarded against concurrent access (IS_FIELD_NOT_GUARDED) +IS_FIELD_NOT_GUARDED=;SFP-19;CWE-413 +IS_FIELD_NOT_GUARDEDMsg=This field is annotated with net.jcip.annotations.GuardedBy, but can be accessed in a way that seems to violate the annotation. + +#JLM: Synchronization performed on Lock (JLM_JSR166_LOCK_MONITORENTER) +JLM_JSR166_LOCK_MONITORENTER=;SFP--1;CWE-710 +JLM_JSR166_LOCK_MONITORENTERMsg=This method performs synchronization an object that implements java.util.concurrent.locks.Lock. Such an object is locked/unlocked using acquire()/release() rather than using the synchronized (...) construct. + +#LI: Incorrect lazy initialization of static field (LI_LAZY_INIT_STATIC) +LI_LAZY_INIT_STATIC=;SFP-19;CWE-667 +LI_LAZY_INIT_STATICMsg=This method contains an unsynchronized lazy initialization of a non-volatile static field. Because the compiler or processor may reorder instructions, threads are not guaranteed to see a completely initialized object, if the method can be called by multiple threads. You can make the field volatile to correct the problem. For more information, see the Java Memory Model web site. + +#LI: Incorrect lazy initialization and update of static field (LI_LAZY_INIT_UPDATE_STATIC) +LI_LAZY_INIT_UPDATE_STATIC=;SFP-19;CWE-667 +LI_LAZY_INIT_UPDATE_STATICMsg=This method contains an unsynchronized lazy initialization of a static field. After the field is set, the object stored into that location is further updated or accessed. The setting of the field is visible to other threads as soon as it is set. If the futher accesses in the method that set the field serve to initialize the object, then you have a very serious multithreading bug, unless something else prevents any other thread from accessing the stored object until it is fully initialized. Even if you feel confident that the method is never called by multiple threads, it might be better to not set the static field until the value you are setting it to is fully populated/initialized. + +#ML: Synchronization on field in futile attempt to guard that field (ML_SYNC_ON_FIELD_TO_GUARD_CHANGING_THAT_FIELD) +ML_SYNC_ON_FIELD_TO_GUARD_CHANGING_THAT_FIELD=;SFP-19;CWE-667 +ML_SYNC_ON_FIELD_TO_GUARD_CHANGING_THAT_FIELDMsg=This method synchronizes on a field in what appears to be an attempt to guard against simultaneous updates to that field. But guarding a field gets a lock on the referenced object, not on the field. This may not provide the mutual exclusion you need, and other threads might be obtaining locks on the referenced objects (for other purposes). + +#ML: Method synchronizes on an updated field (ML_SYNC_ON_UPDATED_FIELD) +ML_SYNC_ON_UPDATED_FIELD=;SFP-19;CWE-667 +ML_SYNC_ON_UPDATED_FIELDMsg=This method synchronizes on an object referenced from a mutable field. This is unlikely to have useful semantics, since different threads may be synchronizing on different objects. + +#ML: Method synchronizes on an updated field (ML_SYNC_ON_UPDATED_FIELD) +MSF_MUTABLE_SERVLET_FIELD=;SFP-19;CWE-667 +MSF_MUTABLE_SERVLET_FIELDMsg=A web server generally only creates one instance of servlet or jsp class (i.e., treats the class as a Singleton), and will have multiple threads invoke methods on that instance to service multiple simultaneous requests. Thus, having a mutable instance field generally creates race conditions. + +#MWN: Mismatched notify() (MWN_MISMATCHED_NOTIFY) +MWN_MISMATCHED_NOTIFY=;SFP-19;CWE-667 +MWN_MISMATCHED_NOTIFYMsg=This method calls Object.notify() or Object.notifyAll() without obviously holding a lock on the object. Calling notify() or notifyAll() without a lock held will result in an IllegalMonitorStateException being thrown. + +#MWN: Mismatched wait() (MWN_MISMATCHED_WAIT) +MWN_MISMATCHED_WAIT=;SFP-19;CWE-667 +MWN_MISMATCHED_WAITMsg=This method calls Object.wait() without obviously holding a lock on the object. Calling wait() without a lock held will result in an IllegalMonitorStateException being thrown. + +#NN: Naked notify (NN_NAKED_NOTIFY) +NN_NAKED_NOTIFY=;SFP--1;CWE-398 +NN_NAKED_NOTIFYMsg=A call to notify() or notifyAll() was made without any (apparent) accompanying modification to mutable object state. In general, calling a notify method on a monitor is done because some condition another thread is waiting for has become true. However, for the condition to be meaningful, it must involve a heap object that is visible to both threads. This bug does not necessarily indicate an error, since the change to mutable object state may have taken place in a method which then called the method containing the notification. + +#NP: Synchronize and null check on the same field. (NP_SYNC_AND_NULL_CHECK_FIELD) +NP_SYNC_AND_NULL_CHECK_FIELD=;SFP-7;CWE-476 +NP_SYNC_AND_NULL_CHECK_FIELDMsg=Since the field is synchronized on, it seems not likely to be null. If it is null and then synchronized on a NullPointerException will be thrown and the check would be pointless. Better to synchronize on another field. + +#No: Using notify() rather than notifyAll() (NO_NOTIFY_NOT_NOTIFYALL) +NO_NOTIFY_NOT_NOTIFYALL=;SFP--1;CWE-701 +NO_NOTIFY_NOT_NOTIFYALLMsg=This method calls notify() rather than notifyAll(). Java monitors are often used for multiple conditions. Calling notify() only wakes up one thread, meaning that the thread woken up might not be the one waiting for the condition that the caller just satisfied. + +#RS: Class's readObject() method is synchronized (RS_READOBJECT_SYNC) +RS_READOBJECT_SYNC=;SFP--1;CWE-398 +RS_READOBJECT_SYNCMsg=This serializable class defines a readObject() which is synchronized. By definition, an object created by deserialization is only reachable by one thread, and thus there is no need for readObject() to be synchronized. If the readObject() method itself is causing the object to become visible to another thread, that is an example of very dubious coding style. + +#RV: Return value of putIfAbsent ignored, value passed to putIfAbsent reused (RV_RETURN_VALUE_OF_PUTIFABSENT_IGNORED) +RV_RETURN_VALUE_OF_PUTIFABSENT_IGNORED=;SFP-4;CWE-252 +RV_RETURN_VALUE_OF_PUTIFABSENT_IGNOREDMsg=The putIfAbsent method is typically used to ensure that a single value is associated with a given key (the first value for which put if absent succeeds). If you ignore the return value and retain a reference to the value passed in, you run the risk of retaining a value that is not the one that is associated with the key in the map. If it matters which one you use and you use the one that isn't stored in the map, your program will behave incorrectly. + +#Ru: Invokes run on a thread (did you mean to start it instead?) (RU_INVOKE_RUN) +RU_INVOKE_RUN=;SFP-3;CWE-572 +RU_INVOKE_RUNMsg=This method explicitly invokes run() on an object. In general, classes implement the Runnable interface because they are going to have their run() method invoked in a new thread, in which case Thread.start() is the right method to call. + +#SC: Constructor invokes Thread.start() (SC_START_IN_CTOR) +SC_START_IN_CTOR=;SFP--1;CWE-398 +SC_START_IN_CTORMsg=The constructor starts a thread. This is likely to be wrong if the class is ever extended/subclassed, since the thread will be started before the subclass constructor is started. + +#SP: Method spins on field (SP_SPIN_ON_FIELD) +SP_SPIN_ON_FIELD=;SFP-19;CWE-667 +SP_SPIN_ON_FIELDMsg=This method spins in a loop which reads a field. The compiler may legally hoist the read out of the loop, turning the code into an infinite loop. The class should be changed so it uses proper synchronization (including wait and notify calls). + +#STCAL: Call to static Calendar (STCAL_INVOKE_ON_STATIC_CALENDAR_INSTANCE) +STCAL_INVOKE_ON_STATIC_CALENDAR_INSTANCE=;SFP-19;CWE-667 +STCAL_INVOKE_ON_STATIC_CALENDAR_INSTANCEMsg=Even though the JavaDoc does not contain a hint about it, Calendars are inherently unsafe for multihtreaded use. The detector has found a call to an instance of Calendar that has been obtained via a static field. This looks suspicous. For more information on this see Sun Bug #6231579 and Sun Bug #6178997. + +#STCAL: Call to static DateFormat (STCAL_INVOKE_ON_STATIC_DATE_FORMAT_INSTANCE) +STCAL_INVOKE_ON_STATIC_DATE_FORMAT_INSTANCE=;SFP-19;CWE-667 +STCAL_INVOKE_ON_STATIC_DATE_FORMAT_INSTANCEMsg=As the JavaDoc states, DateFormats are inherently unsafe for multithreaded use. The detector has found a call to an instance of DateFormat that has been obtained via a static field. This looks suspicous. For more information on this see Sun Bug #6231579 and Sun Bug #6178997. + +#STCAL: Static Calendar (STCAL_STATIC_CALENDAR_INSTANCE) +STCAL_STATIC_CALENDAR_INSTANCE=;SFP-19;CWE-667 +STCAL_STATIC_CALENDAR_INSTANCEMsg=Even though the JavaDoc does not contain a hint about it, Calendars are inherently unsafe for multihtreaded use. Sharing a single instance across thread boundaries without proper synchronization will result in erratic behavior of the application. Under 1.4 problems seem to surface less often than under Java 5 where you will probably see random ArrayIndexOutOfBoundsExceptions or IndexOutOfBoundsExceptions in sun.util.calendar.BaseCalendar.getCalendarDateFromFixedDate(). You may also experience serialization problems. Using an instance field is recommended. For more information on this see Sun Bug #6231579 and Sun Bug #6178997. + +#STCAL: Static DateFormat (STCAL_STATIC_SIMPLE_DATE_FORMAT_INSTANCE) +STCAL_STATIC_SIMPLE_DATE_FORMAT_INSTANCE=;SFP-19;CWE-667 +STCAL_STATIC_SIMPLE_DATE_FORMAT_INSTANCEMsg=As the JavaDoc states, DateFormats are inherently unsafe for multithreaded use. Sharing a single instance across thread boundaries without proper synchronization will result in erratic behavior of the application. You may also experience serialization problems. Using an instance field is recommended. For more information on this see Sun Bug #6231579 and Sun Bug #6178997. + +#SWL: Method calls Thread.sleep() with a lock held (SWL_SLEEP_WITH_LOCK_HELD) +SWL_SLEEP_WITH_LOCK_HELD=;SFP-19;CWE-667 +SWL_SLEEP_WITH_LOCK_HELDMsg=This method calls Thread.sleep() with a lock held. This may result in very poor performance and scalability, or a deadlock, since other threads may be waiting to acquire the lock. It is a much better idea to call wait() on the lock, which releases the lock and allows other threads to run. + +#TLW: Wait with two locks held (TLW_TWO_LOCK_WAIT) +TLW_TWO_LOCK_WAIT=;SFP-19;CWE-833 +TLW_TWO_LOCK_WAITMsg=Waiting on a monitor while two locks are held may cause deadlock. Performing a wait only releases the lock on the object being waited on, not any other locks. This not necessarily a bug, but is worth examining closely. + +#UG: Unsynchronized get method, synchronized set method (UG_SYNC_SET_UNSYNC_GET) +UG_SYNC_SET_UNSYNC_GET=;SFP-19;CWE-667 +UG_SYNC_SET_UNSYNC_GETMsg=This class contains similarly-named get and set methods where the set method is synchronized and the get method is not. This may result in incorrect behavior at runtime, as callers of the get method will not necessarily see a consistent state for the object. The get method should be made synchronized. + +#UL: Method does not release lock on all paths (UL_UNRELEASED_LOCK) +UL_UNRELEASED_LOCK=;SFP-19;CWE-667 +UL_UNRELEASED_LOCKMsg=This method acquires a JSR-166 (java.util.concurrent) lock, but does not release it on all paths out of the method. + +#UL: Method does not release lock on all exception paths (UL_UNRELEASED_LOCK_EXCEPTION_PATH) +UL_UNRELEASED_LOCK_EXCEPTION_PATH=;SFP-19;CWE-667 +UL_UNRELEASED_LOCK_EXCEPTION_PATHMsg=This method acquires a JSR-166 (java.util.concurrent) lock, but does not release it on all exception paths out of the method. + +#UW: Unconditional wait (UW_UNCOND_WAIT) +UW_UNCOND_WAIT=;SFP--1;CWE-398 +UW_UNCOND_WAITMsg=This method contains a call to java.lang.Object.wait() which is not guarded by conditional control flow. The code should verify that condition it intends to wait for is not already satisfied before calling wait; any previous notifications will be ignored. + +#VO: A volatile reference to an array doesn't treat the array elements as volatile (VO_VOLATILE_REFERENCE_TO_ARRAY) +VO_VOLATILE_REFERENCE_TO_ARRAY=;SFP--1;CWE-398 +VO_VOLATILE_REFERENCE_TO_ARRAYMsg=This declares a volatile reference to an array, which might not be what you want. With a volatile reference to an array, reads and writes of the reference to the array are treated as volatile, but the array elements are non-volatile. To get volatile array elements, you will need to use one of the atomic array classes in java.util.concurrent (provided in Java 5.0). + +#WL: Sychronization on getClass rather than class literal (WL_USING_GETCLASS_RATHER_THAN_CLASS_LITERAL) +WL_USING_GETCLASS_RATHER_THAN_CLASS_LITERAL=;SFP-19;CWE-398 +WL_USING_GETCLASS_RATHER_THAN_CLASS_LITERALMsg=This instance method synchronizes on this.getClass(). If this class is subclassed, subclasses will synchronize on the class object for the subclass, which isn't likely what was intended. + +#WS: Class's writeObject() method is synchronized but nothing else is (WS_WRITEOBJECT_SYNC) +WS_WRITEOBJECT_SYNC=;SFP-19;CWE-667 +WS_WRITEOBJECT_SYNCMsg=This class has a writeObject() method which is synchronized; however, no other method of the class is synchronized. + +#Wa: Condition.await() not in loop (WA_AWAIT_NOT_IN_LOOP) +WA_AWAIT_NOT_IN_LOOP=;SFP--1;CWE-398 +WA_AWAIT_NOT_IN_LOOPMsg=This method contains a call to java.util.concurrent.await() (or variants) which is not in a loop. If the object is used for multiple conditions, the condition the caller intended to wait for might not be the one that actually occurred. + +#Wa: Wait not in loop (WA_NOT_IN_LOOP) +WA_NOT_IN_LOOP=;SFP--1;CWE-398 +WA_NOT_IN_LOOPMsg=This method contains a call to java.lang.Object.wait() which is not in a loop. If the monitor is used for multiple conditions, the condition the caller intended to wait for might not be the one that actually occurred. + +#Bx: Primitive value is boxed and then immediately unboxed (BX_BOXING_IMMEDIATELY_UNBOXED) +BX_BOXING_IMMEDIATELY_UNBOXED=;SFP--1;CWE-710 +BX_BOXING_IMMEDIATELY_UNBOXEDMsg=A primitive is boxed, and then immediately unboxed. This probably is due to a manual boxing in a place where an unboxed value is required, thus forcing the compiler to immediately undo the work of the boxing. + +#Bx: Primitive value is boxed then unboxed to perform primitive coercion (BX_BOXING_IMMEDIATELY_UNBOXED_TO_PERFORM_COERCION) +BX_BOXING_IMMEDIATELY_UNBOXED_TO_PERFORM_COERCION=;SFP--1;CWE-710 +BX_BOXING_IMMEDIATELY_UNBOXED_TO_PERFORM_COERCIONMsg=A primitive boxed value constructed and then immediately converted into a different primitive type (e.g., new Double(d).intValue()). Just perform direct primitive coercion (e.g., (int) d). + +#Bx: Method allocates a boxed primitive just to call toString (DM_BOXED_PRIMITIVE_TOSTRING) +DM_BOXED_PRIMITIVE_TOSTRING=;SFP--1;CWE-710 +DM_BOXED_PRIMITIVE_TOSTRINGMsg=A boxed primitive is allocated just to call toString(). It is more effective to just use the static form of toString which takes the primitive value. + +#Bx: Method invokes inefficient floating-point Number constructor; use static valueOf instead (DM_FP_NUMBER_CTOR) +DM_FP_NUMBER_CTOR=;SFP--1;CWE-398 +DM_FP_NUMBER_CTORMsg=Using new Double(double) is guaranteed to always result in a new object whereas Double.valueOf(double) allows caching of values to be done by the compiler, class library, or JVM. Using of cached values avoids object allocation and the code will be faster. Unless the class must be compatible with JVMs predating Java 1.5, use either autoboxing or the valueOf() method when creating instances of Double and Float. + +#Bx: Method invokes inefficient Number constructor; use static valueOf instead (DM_NUMBER_CTOR) +DM_NUMBER_CTOR=;SFP--1;CWE-398 +DM_NUMBER_CTORMsg=Using new Integer(int) is guaranteed to always result in a new object whereas Integer.valueOf(int) allows caching of values to be done by the compiler, class library, or JVM. Using of cached values avoids object allocation and the code will be faster. Values between -128 and 127 are guaranteed to have corresponding cached instances and using valueOf is approximately 3.5 times faster than using constructor. For values outside the constant range the performance of both styles is the same. Unless the class must be compatible with JVMs predating Java 1.5, use either autoboxing or the valueOf() method when creating instances of Long, Integer, Short, Character, and Byte. + +#Dm: The equals and hashCode methods of URL are blocking (DMI_BLOCKING_METHODS_ON_URL) +DMI_BLOCKING_METHODS_ON_URL=;SFP--1;CWE-398 +DMI_BLOCKING_METHODS_ON_URLMsg=The equals and hashCode method of URL perform domain name resolution, this can result in a big performance hit. See http://michaelscharf.blogspot.com/2006/11/javaneturlequals-and-hashcode-make.html for more information. Consider using java.net.URI instead. + +#Dm: Maps and sets of URLs can be performance hogs (DMI_COLLECTION_OF_URLS) +DMI_COLLECTION_OF_URLS=;SFP--1;CWE-398 +DMI_COLLECTION_OF_URLSMsg=This method or field is or uses a Map or Set of URLs. Since both the equals and hashCode method of URL perform domain name resolution, this can result in a big performance hit. See http://michaelscharf.blogspot.com/2006/11/javaneturlequals-and-hashcode-make.html for more information. Consider using java.net.URI instead. + +#Dm: Method invokes inefficient Boolean constructor; use Boolean.valueOf(...) instead (DM_BOOLEAN_CTOR) +DM_BOOLEAN_CTOR=;SFP--1;CWE-398 +DM_BOOLEAN_CTORMsg=Creating new instances of java.lang.Boolean wastes memory, since Boolean objects are immutable and there are only two useful values of this type. Use the Boolean.valueOf() method (or Java 1.5 autoboxing) to create Boolean objects instead. + +#Dm: Explicit garbage collection; extremely dubious except in benchmarking code (DM_GC) +DM_GC=;SFP--1;CWE-710 +DM_GCMsg=Code explicitly invokes garbage collection. Except for specific use in benchmarking, this is very dubious. In the past, situations where people have explicitly invoked the garbage collector in routines such as close or finalize methods has led to huge performance black holes. Garbage collection can be expensive. Any situation that forces hundreds or thousands of garbage collections will bring the machine to a crawl. + +#Dm: Method allocates an object, only to get the class object (DM_NEW_FOR_GETCLASS) +DM_NEW_FOR_GETCLASS=;SFP--1;CWE-398 +DM_NEW_FOR_GETCLASSMsg=This method allocates an object just to call getClass() on it, in order to retrieve the Class object for it. It is simpler to just access the .class property of the class. + +#Dm: Use the nextInt method of Random rather than nextDouble to generate a random integer (DM_NEXTINT_VIA_NEXTDOUBLE) +DM_NEXTINT_VIA_NEXTDOUBLE=;SFP--1;CWE-710 +DM_NEXTINT_VIA_NEXTDOUBLEMsg=If r is a java.util.Random, you can generate a random number from 0 to n-1 using r.nextInt(n), rather than using (int)(r.nextDouble() * n). + +#Dm: Method invokes inefficient new String(String) constructor (DM_STRING_CTOR) +DM_STRING_CTOR=;SFP--1;CWE-398 +DM_STRING_CTORMsg=Using the java.lang.String(String) constructor wastes memory because the object so constructed will be functionally indistinguishable from the String passed as a parameter. Just use the argument String directly. + +#Dm: Method invokes toString() method on a String (DM_STRING_TOSTRING) +DM_STRING_TOSTRING=;SFP--1;CWE-710 +DM_STRING_TOSTRINGMsg=Calling String.toString() is just a redundant operation. Just use the String. + +#Dm: Method invokes inefficient new String() constructor (DM_STRING_VOID_CTOR) +DM_STRING_VOID_CTOR=;SFP--1;CWE-398 +DM_STRING_VOID_CTORMsg=Creating a new java.lang.String object using the no-argument constructor wastes memory because the object so created will be functionally indistinguishable from the empty string constant "". Java guarantees that identical string constants will be represented by the same String object. Therefore, you should just use the empty string constant directly. + +#HSC: Huge string constants is duplicated across multiple class files (HSC_HUGE_SHARED_STRING_CONSTANT) +HSC_HUGE_SHARED_STRING_CONSTANT=;SFP--1;CWE-398 +HSC_HUGE_SHARED_STRING_CONSTANTMsg=A large String constant is duplicated across multiple class files. This is likely because a final field is initialized to a String constant, and the Java language mandates that all references to a final field from other classes be inlined into that classfile. See JDK bug 6447475 for a description of an occurrence of this bug in the JDK and how resolving it reduced the size of the JDK by 1 megabyte. + +#ITA: Method uses toArray() with zero-length array argument (ITA_INEFFICIENT_TO_ARRAY) +ITA_INEFFICIENT_TO_ARRAY=;SFP--1;CWE-398 +ITA_INEFFICIENT_TO_ARRAYMsg=This method uses the toArray() method of a collection derived class, and passes in a zero-length prototype array argument. It is more efficient to use myCollection.toArray(new Foo[myCollection.size()]) If the array passed in is big enough to store all of the elements of the collection, then it is populated and returned directly. This avoids the need to create a second array (by reflection) to return as the result. + +#SBSC: Method concatenates strings using + in a loop (SBSC_USE_STRINGBUFFER_CONCATENATION) +SBSC_USE_STRINGBUFFER_CONCATENATION=;SFP--1;CWE-398 +SBSC_USE_STRINGBUFFER_CONCATENATIONMsg=The method seems to be building a String using concatenation in a loop. In each iteration, the String is converted to a StringBuffer/StringBuilder, appended to, and converted back to a String. This can lead to a cost quadratic in the number of iterations, as the growing string is recopied in each iteration. Better performance can be obtained by using a StringBuffer (or StringBuilder in Java 1.5) explicitly. + +#SIC: Should be a static inner class (SIC_INNER_SHOULD_BE_STATIC) +SIC_INNER_SHOULD_BE_STATIC=;SFP--1;CWE-398 +SIC_INNER_SHOULD_BE_STATICMsg=This class is an inner class, but does not use its embedded reference to the object which created it. This reference makes the instances of the class larger, and may keep the reference to the creator object alive longer than necessary. If possible, the class should be made static. + +#SIC: Could be refactored into a named static inner class (SIC_INNER_SHOULD_BE_STATIC_ANON) +SIC_INNER_SHOULD_BE_STATIC_ANON=;SFP--1;CWE-398 +SIC_INNER_SHOULD_BE_STATIC_ANONMsg=This class is an inner class, but does not use its embedded reference to the object which created it. This reference makes the instances of the class larger, and may keep the reference to the creator object alive longer than necessary. If possible, the class should be made into a static inner class. Since anonymous inner classes cannot be marked as static, doing this will require refactoring the inner class so that it is a named inner class. + +#SIC: Could be refactored into a static inner class (SIC_INNER_SHOULD_BE_STATIC_NEEDS_THIS) +SIC_INNER_SHOULD_BE_STATIC_NEEDS_THIS=;SFP--1;CWE-398 +SIC_INNER_SHOULD_BE_STATIC_NEEDS_THISMsg=This class is an inner class, but does not use its embedded reference to the object which created it except during construction of the inner object. This reference makes the instances of the class larger, and may keep the reference to the creator object alive longer than necessary. If possible, the class should be made into a static inner class. Since the reference to the outer object is required during construction of the inner instance, the inner class will need to be refactored so as to pass a reference to the outer instance to the constructor for the inner class. + +#This class contains an instance final field that is initialized to a compile-time static value. Consider making the field static. +SS_SHOULD_BE_STATIC=;SFP--1;CWE-710 +SS_SHOULD_BE_STATICMsg=This class contains an instance final field that is initialized to a compile-time static value. Consider making the field static. + +#UM: Method calls static Math class method on a constant value (UM_UNNECESSARY_MATH) +UM_UNNECESSARY_MATH=;SFP--1;CWE-710 +UM_UNNECESSARY_MATHMsg=This method uses a static method from java.lang.Math on a constant value. This method's result in this case, can be determined statically, and is faster and sometimes more accurate to just use the constant. + +#UPM: Private method is never called (UPM_UNCALLED_PRIVATE_METHOD) +UPM_UNCALLED_PRIVATE_METHOD=;SFP-2;CWE-561 +UPM_UNCALLED_PRIVATE_METHODMsg=This private method is never called. Although it is possible that the method will be invoked through reflection, it is more likely that the method is never used, and should be removed. + +#This field is never read. Consider removing it from the class. +URF_UNREAD_FIELD=;SFP-2;CWE-563 +URF_UNREAD_FIELDMsg=This field is never read. Consider removing it from the class. + +#UuF: Unused field (UUF_UNUSED_FIELD) +UUF_UNUSED_FIELD=;SFP-2;CWE-563 +UUF_UNUSED_FIELDMsg=This field is never used. Consider removing it from the class. + +#WMI: Inefficient use of keySet iterator instead of entrySet iterator (WMI_WRONG_MAP_ITERATOR) +WMI_WRONG_MAP_ITERATOR=;SFP--1;CWE-710 +WMI_WRONG_MAP_ITERATORMsg=This method accesses the value of a Map entry, using a key that was retrieved from a keySet iterator. It is more efficient to use an iterator on the entrySet of the map, to avoid the Map.get(key) lookup. + +#Dm: Hardcoded constant database password (DMI_CONSTANT_DB_PASSWORD) +DMI_CONSTANT_DB_PASSWORD=;SFP-33;CWE-259 +DMI_CONSTANT_DB_PASSWORDMsg=This code creates a database connect using a hardcoded, constant password. Anyone with access to either the source code or the compiled code can easily learn the password. + +#Dm: Empty database password (DMI_EMPTY_DB_PASSWORD) +DMI_EMPTY_DB_PASSWORD=;SFP-33;CWE-259 +DMI_EMPTY_DB_PASSWORDMsg=This code creates a database connect using a blank or empty password. This indicates that the database is not protected by a password. + +#HRS: HTTP cookie formed from untrusted input (HRS_REQUEST_PARAMETER_TO_COOKIE) +HRS_REQUEST_PARAMETER_TO_COOKIE=;SFP-24;CWE-20 +HRS_REQUEST_PARAMETER_TO_COOKIEMsg=This code constructs an HTTP Cookie using an untrusted HTTP parameter. If this cookie is added to an HTTP response, it will allow a HTTP response splitting vulnerability. See http://en.wikipedia.org/wiki/HTTP_response_splitting for more information. FindBugs looks only for the most blatant, obvious cases of HTTP response splitting. If FindBugs found any, you almost certainly have more vulnerabilities that FindBugs doesn't report. If you are concerned about HTTP response splitting, you should seriously consider using a commercial static analysis or pen-testing tool. + +#HRS: HTTP Response splitting vulnerability (HRS_REQUEST_PARAMETER_TO_HTTP_HEADER) +HRS_REQUEST_PARAMETER_TO_HTTP_HEADER=;SFP-24;CWE-113 +HRS_REQUEST_PARAMETER_TO_HTTP_HEADERMsg=This code directly writes an HTTP parameter to an HTTP header, which allows for a HTTP response splitting vulnerability. See http://en.wikipedia.org/wiki/HTTP_response_splitting for more information. FindBugs looks only for the most blatant, obvious cases of HTTP response splitting. If FindBugs found any, you almost certainly have more vulnerabilities that FindBugs doesn't report. If you are concerned about HTTP response splitting, you should seriously consider using a commercial static analysis or pen-testing tool. + +#SQL: Nonconstant string passed to execute method on an SQL statement (SQL_NONCONSTANT_STRING_PASSED_TO_EXECUTE) +SQL_NONCONSTANT_STRING_PASSED_TO_EXECUTE=;SFP-24;CWE-89 +SQL_NONCONSTANT_STRING_PASSED_TO_EXECUTEMsg=The method invokes the execute method on an SQL statement with a String that seems to be dynamically generated. Consider using a prepared statement instead. It is more efficient and less vulnerable to SQL injection attacks. + +#SQL: A prepared statement is generated from a nonconstant String (SQL_PREPARED_STATEMENT_GENERATED_FROM_NONCONSTANT_STRING) +SQL_PREPARED_STATEMENT_GENERATED_FROM_NONCONSTANT_STRING=;SFP-24;CWE-89 +SQL_PREPARED_STATEMENT_GENERATED_FROM_NONCONSTANT_STRINGMsg=The code creates an SQL prepared statement from a nonconstant String. If unchecked, tainted data from a user is used in building this String, SQL injection could be used to make the prepared statement do something unexpected and undesirable. + +#XSS: JSP reflected cross site scripting vulnerability (XSS_REQUEST_PARAMETER_TO_JSP_WRITER) +XSS_REQUEST_PARAMETER_TO_JSP_WRITER=;SFP-24;CWE-80 +XSS_REQUEST_PARAMETER_TO_JSP_WRITERMsg=This code directly writes an HTTP parameter to JSP output, which allows for a cross site scripting vulnerability. See http://en.wikipedia.org/wiki/Cross-site_scripting for more information. FindBugs looks only for the most blatant, obvious cases of cross site scripting. If FindBugs found any, you almost certainly have more cross site scripting vulnerabilities that FindBugs doesn't report. If you are concerned about cross site scripting, you should seriously consider using a commercial static analysis or pen-testing tool. + +#XSS: Servlet reflected cross site scripting vulnerability (XSS_REQUEST_PARAMETER_TO_SEND_ERROR) +XSS_REQUEST_PARAMETER_TO_SEND_ERROR=;SFP-24;CWE-80 +XSS_REQUEST_PARAMETER_TO_SEND_ERRORMsg=This code directly writes an HTTP parameter to a Server error page (using HttpServletResponse.sendError). Echoing this untrusted input allows for a reflected cross site scripting vulnerability. See http://en.wikipedia.org/wiki/Cross-site_scripting for more information. FindBugs looks only for the most blatant, obvious cases of cross site scripting. If FindBugs found any, you almost certainly have more cross site scripting vulnerabilities that FindBugs doesn't report. If you are concerned about cross site scripting, you should seriously consider using a commercial static analysis or pen-testing tool. + +#XSS: Servlet reflected cross site scripting vulnerability (XSS_REQUEST_PARAMETER_TO_SERVLET_WRITER) +XSS_REQUEST_PARAMETER_TO_SERVLET_WRITER=;SFP-24;CWE-80 +XSS_REQUEST_PARAMETER_TO_SERVLET_WRITERMsg=This code directly writes an HTTP parameter to Servlet output, which allows for a reflected cross site scripting vulnerability. See http://en.wikipedia.org/wiki/Cross-site_scripting for more information. FindBugs looks only for the most blatant, obvious cases of cross site scripting. If FindBugs found any, you almost certainly have more cross site scripting vulnerabilities that FindBugs doesn't report. If you are concerned about cross site scripting, you should seriously consider using a commercial static analysis or pen-testing tool. + +#BC: Questionable cast to abstract collection (BC_BAD_CAST_TO_ABSTRACT_COLLECTION) +BC_BAD_CAST_TO_ABSTRACT_COLLECTION=;SFP-1;CWE-704 +BC_BAD_CAST_TO_ABSTRACT_COLLECTIONMsg=This code casts a Collection to an abstract collection (such as List, Set, or Map). Ensure that you are guaranteed that the object is of the type you are casting to. If all you need is to be able to iterate through a collection, you don't need to cast it to a Set or List. + +BC: Questionable cast to concrete collection (BC_BAD_CAST_TO_CONCRETE_COLLECTION) +BC_BAD_CAST_TO_CONCRETE_COLLECTION=;SFP-1;CWE-704 +BC_BAD_CAST_TO_CONCRETE_COLLECTIONMsg=This code casts an abstract collection (such as a Collection, List, or Set) to a specific concrete implementation (such as an ArrayList or HashSet). This might not be correct, and it may make your code fragile, since it makes it harder to switch to other concrete implementations at a future point. Unless you have a particular reason to do so, just use the abstract collection class. + +#BC: Unchecked/unconfirmed cast (BC_UNCONFIRMED_CAST) +BC_UNCONFIRMED_CAST=;SFP-1;CWE-704 +BC_UNCONFIRMED_CAST=This cast is unchecked, and not all instances of the type casted from can be cast to the type it is being cast to. Ensure that your program logic ensures that this cast will not fail. + +#BC: instanceof will always return true (BC_VACUOUS_INSTANCEOF) +BC_VACUOUS_INSTANCEOF=;SFP-1;CWE-570 +BC_VACUOUS_INSTANCEOFMsg=This instanceof test will always return true (unless the value being tested is null). Although this is safe, make sure it isn't an indication of some misunderstanding or some other logic error. If you really want to test the value for being null, perhaps it would be clearer to do better to do a null test rather than an instanceof test. + +#BSHIFT: Unsigned right shift cast to short/byte (ICAST_QUESTIONABLE_UNSIGNED_RIGHT_SHIFT) +ICAST_QUESTIONABLE_UNSIGNED_RIGHT_SHIFT=;SFP-1;CWE-197 +ICAST_QUESTIONABLE_UNSIGNED_RIGHT_SHIFTMsg=The code performs an unsigned right shift, whose result is then cast to a short or byte, which discards the upper bits of the result. Since the upper bits are discarded, there may be no difference between a signed and unsigned right shift (depending upon the size of the shift). + +#CI: Class is final but declares protected field (CI_CONFUSED_INHERITANCE) +CI_CONFUSED_INHERITANCE=;SFP--1;CWE-710 +CI_CONFUSED_INHERITANCEMsg=This class is declared to be final, but declares fields to be protected. Since the class is final, it can not be derived from, and the use of protected is confusing. The access modifier for the field should be changed to private or public to represent the true use for the field. + +#DB: Method uses the same code for two branches (DB_DUPLICATE_BRANCHES) +DB_DUPLICATE_BRANCHES=;SFP--1;CWE-398 +DB_DUPLICATE_BRANCHESMsg=This method uses the same code to implement two branches of a conditional branch. Check to ensure that this isn't a coding mistake. + +#DB: Method uses the same code for two switch clauses (DB_DUPLICATE_SWITCH_CLAUSES) +DB_DUPLICATE_SWITCH_CLAUSES=;SFP--1;CWE-398 +DB_DUPLICATE_SWITCH_CLAUSESMsg=This method uses the same code to implement two clauses of a switch statement. This could be a case of duplicate code, but it might also indicate a coding mistake. + +#DLS: Dead store to local variable (DLS_DEAD_LOCAL_STORE) +DLS_DEAD_LOCAL_STORE=;SFP--1;CWE-398 +DLS_DEAD_LOCAL_STOREMsg=This instruction assigns a value to a local variable, but the value is not read or used in any subsequent instruction. Often, this indicates an error, because the value computed is never used. Note that Sun's javac compiler often generates dead stores for final local variables. Because FindBugs is a bytecode-based tool, there is no easy way to eliminate these false positives. + +#DLS: Useless assignment in return statement (DLS_DEAD_LOCAL_STORE_IN_RETURN) +DLS_DEAD_LOCAL_STORE_IN_RETURN=;SFP--1;CWE-398 +DLS_DEAD_LOCAL_STORE_IN_RETURNMsg=This statement assigns to a local variable in a return statement. This assignment has effect. Please verify that this statement does the right thing. + +#DLS: Dead store of null to local variable (DLS_DEAD_LOCAL_STORE_OF_NULL) +DLS_DEAD_LOCAL_STORE_OF_NULL=;SFP--1;CWE-398 +DLS_DEAD_LOCAL_STORE_OF_NULLMsg=The code stores null into a local variable, and the stored value is not read. This store may have been introduced to assist the garbage collector, but as of Java SE 6.0, this is no longer needed or useful. + +#DMI: Code contains a hard coded reference to an absolute pathname (DMI_HARDCODED_ABSOLUTE_FILENAME) +DMI_HARDCODED_ABSOLUTE_FILENAME=;SFP--1;CWE-398 +DMI_HARDCODED_ABSOLUTE_FILENAMEMsg=This code constructs a File object using a hard coded to an absolute pathname (e.g., new File("/home/dannyc/workspace/j2ee/src/share/com/sun/enterprise/deployment"); + +#DMI: Non serializable object written to ObjectOutput (DMI_NONSERIALIZABLE_OBJECT_WRITTEN) +DMI_NONSERIALIZABLE_OBJECT_WRITTEN=;SFP-1;CWE-594 +DMI_NONSERIALIZABLE_OBJECT_WRITTENMsg=This code seems to be passing a non-serializable object to the ObjectOutput.writeObject method. If the object is, indeed, non-serializable, an error will result. + +#DMI: Invocation of substring(0), which returns the original value (DMI_USELESS_SUBSTRING) +DMI_USELESS_SUBSTRING=;SFP--1;CWE-398 +DMI_USELESS_SUBSTRINGMsg=This code invokes substring(0) on a String, which returns the original value. + +#Dm: Thread passed where Runnable expected (DMI_THREAD_PASSED_WHERE_RUNNABLE_EXPECTED) +DMI_THREAD_PASSED_WHERE_RUNNABLE_EXPECTED=;SFP-1;CWE-686 +DMI_THREAD_PASSED_WHERE_RUNNABLE_EXPECTEDMsg=A Thread object is passed as a parameter to a method where a Runnable is expected. This is rather unusual, and may indicate a logic error or cause unexpected behavior. + +#Eq: Class doesn't override equals in superclass (EQ_DOESNT_OVERRIDE_EQUALS) +EQ_DOESNT_OVERRIDE_EQUALS=;SFP--1;CWE-389 +EQ_DOESNT_OVERRIDE_EQUALSMsg=This class extends a class that defines an equals method and adds fields, but doesn't define an equals method itself. Thus, equality on instances of this class will ignore the identity of the subclass and the added fields. Be sure this is what is intended, and that you don't need to override the equals method. Even if you don't need to override the equals method, consider overriding it anyway to document the fact that the equals method for the subclass just return the result of invoking super.equals(o). + +#Eq: Unusual equals method (EQ_UNUSUAL) +EQ_UNUSUAL=;SFP--1;CWE-389 +EQ_UNUSUALMsg=This class doesn't do any of the patterns we recognize for checking that the type of the argument is compatible with the type of the this object. There might not be anything wrong with this code, but it is worth reviewing. + +#FE: Test for floating point equality (FE_FLOATING_POINT_EQUALITY) +FE_FLOATING_POINT_EQUALITY=;SFP--1;CWE-398 +FE_FLOATING_POINT_EQUALITYMsg=This operation compares two floating point values for equality. Because floating point calculations may involve rounding, calculated float and double values may not be accurate. For values that must be precise, such as monetary values, consider using a fixed-precision type such as BigDecimal. For values that need not be precise, consider comparing for equality within some range, for example: if ( Math.abs(x - y) < .0000001 ). See the Java Language Specification, section 4.2.4. + +#FS: Non-Boolean argument formatted using %b format specifier (VA_FORMAT_STRING_BAD_CONVERSION_TO_BOOLEAN) +VA_FORMAT_STRING_BAD_CONVERSION_TO_BOOLEAN=;SFP-1;CWE-686 +VA_FORMAT_STRING_BAD_CONVERSION_TO_BOOLEANMsg=An argument not of type Boolean is being formatted with a %b format specifier. This won't throw an exception; instead, it will print true for any nonnull value, and false for null. This feature of format strings is strange, and may not be what you intended. + +#IA: Ambiguous invocation of either an inherited or outer method (IA_AMBIGUOUS_INVOCATION_OF_INHERITED_OR_OUTER_METHOD) +IA_AMBIGUOUS_INVOCATION_OF_INHERITED_OR_OUTER_METHOD=;SFP--1;CWE-398 +IA_AMBIGUOUS_INVOCATION_OF_INHERITED_OR_OUTER_METHODMsg=An inner class is invoking a method that could be resolved to either a inherited method or a method defined in an outer class. By the Java semantics, it will be resolved to invoke the inherited method, but this may not be want you intend. If you really intend to invoke the inherited method, invoke it by invoking the method on super (e.g., invoke super.foo(17)), and thus it will be clear to other readers of your code and to FindBugs that you want to invoke the inherited method, not the method in the outer class. + +#IC: Initialization circularity (IC_INIT_CIRCULARITY) +IC_INIT_CIRCULARITY=;SFP--1;CWE-398 +IC_INIT_CIRCULARITYMsg=A circularity was detected in the static initializers of the two classes referenced by the bug instance. Many kinds of unexpected behavior may arise from such circularity. + +#ICAST: integral division result cast to double or float (ICAST_IDIV_CAST_TO_DOUBLE) +ICAST_IDIV_CAST_TO_DOUBLE=;SFP-1;CWE-197 +ICAST_IDIV_CAST_TO_DOUBLEMsg=This code casts the result of an integral division (e.g., int or long division) operation to double or float. Doing division on integers truncates the result to the integer value closest to zero. The fact that the result was cast to double suggests that this precision should have been retained. What was probably meant was to cast one or both of the operands to double before performing the division. + +#ICAST: Result of integer multiplication cast to long (ICAST_INTEGER_MULTIPLY_CAST_TO_LONG) +ICAST_INTEGER_MULTIPLY_CAST_TO_LONG=;SFP-1;CWE-190 +ICAST_INTEGER_MULTIPLY_CAST_TO_LONGMsg=This code performs integer multiply and then converts the result to a long, as in: long convertDaysToMilliseconds(int days) { return 1000*3600*24*days; } If the multiplication is done using long arithmetic, you can avoid the possibility that the result will overflow. + +#IM: Computation of average could overflow (IM_AVERAGE_COMPUTATION_COULD_OVERFLOW) +IM_AVERAGE_COMPUTATION_COULD_OVERFLOW=;SFP-1;CWE-190 +IM_AVERAGE_COMPUTATION_COULD_OVERFLOWMsg=The code computes the average of two integers using either division or signed right shift, and then uses the result as the index of an array. If the values being averaged are very large, this can overflow (resulting in the computation of a negative average). Assuming that the result is intended to be nonnegative, you can use an unsigned right shift instead. In other words, rather that using (low+high)/2, use (low+high) >>> 1. This bug exists in many earlier implementations of binary search and merge sort. Martin Buchholz found and fixed it in the JDK libraries, and Joshua Bloch widely publicized the bug pattern. + +#IM: Check for oddness that won't work for negative numbers (IM_BAD_CHECK_FOR_ODD) +IM_BAD_CHECK_FOR_ODD=;SFP--1;CWE-398 +IM_BAD_CHECK_FOR_ODDMsg=The code uses x % 2 == 1 to check to see if a value is odd, but this won't work for negative numbers (e.g., (-5) % 2 == -1). If this code is intending to check for oddness, consider using x & 1 == 1, or x % 2 != 0. + +#INT: Integer remainder modulo 1 (INT_BAD_REM_BY_1) +INT_BAD_REM_BY_1=;SFP--1;CWE-398 +INT_BAD_REM_BY_1Msg=Any expression (exp % 1) is guaranteed to always return zero. Did you mean (exp & 1) or (exp % 2) instead? + +#INT: Vacuous comparison of integer value (INT_VACUOUS_COMPARISON) +INT_VACUOUS_COMPARISON=;SFP--1;CWE-398 +INT_VACUOUS_COMPARISONMsg=There is an integer comparison that always returns the same value (e.g., x <= Integer.MAX_VALUE). + +#MTIA: Class extends Servlet class and uses instance variables (MTIA_SUSPECT_SERVLET_INSTANCE_FIELD) +MTIA_SUSPECT_SERVLET_INSTANCE_FIELD=;SFP--1;CWE-398 +MTIA_SUSPECT_SERVLET_INSTANCE_FIELDMsg=This class extends from a Servlet class, and uses an instance member variable. Since only one instance of a Servlet class is created by the J2EE framework, and used in a multithreaded way, this paradigm is highly discouraged and most likely problematic. Consider only using method local variables. + +#MTIA: Class extends Struts Action class and uses instance variables (MTIA_SUSPECT_STRUTS_INSTANCE_FIELD) +MTIA_SUSPECT_STRUTS_INSTANCE_FIELD=;SFP--1;CWE-398 +MTIA_SUSPECT_STRUTS_INSTANCE_FIELDMsg=This class extends from a Struts Action class, and uses an instance member variable. Since only one instance of a struts Action class is created by the Struts framework, and used in a multithreaded way, this paradigm is highly discouraged and most likely problematic. Consider only using method local variables. Only instance fields that are written outside of a monitor are reported. + +#NP: Dereference of the result of readLine() without nullcheck (NP_DEREFERENCE_OF_READLINE_VALUE) +NP_DEREFERENCE_OF_READLINE_VALUE=;SFP-7;CWE-476 +NP_DEREFERENCE_OF_READLINE_VALUEMsg=The result of invoking readLine() is dereferenced without checking to see if the result is null. If there are no more lines of text to read, readLine() will return null and dereferencing that will generate a null pointer exception. + +#NP: Immediate dereference of the result of readLine() (NP_IMMEDIATE_DEREFERENCE_OF_READLINE) +NP_IMMEDIATE_DEREFERENCE_OF_READLINE=;SFP-7;CWE-476 +NP_IMMEDIATE_DEREFERENCE_OF_READLINEMsg=The result of invoking readLine() is immediately dereferenced. If there are no more lines of text to read, readLine() will return null and dereferencing that will generate a null pointer exception. + +#NP: Load of known null value (NP_LOAD_OF_KNOWN_NULL_VALUE) +NP_LOAD_OF_KNOWN_NULL_VALUE=;SFP-7;CWE-476 +NP_LOAD_OF_KNOWN_NULL_VALUEMsg=The variable referenced at this point is known to be null due to an earlier check against null. Although this is valid, it might be a mistake (perhaps you intended to refer to a different variable, or perhaps the earlier check to see if the variable is null should have been a check to see if it was nonnull). + +#NP: Load of known null value (NP_LOAD_OF_KNOWN_NULL_VALUE) +NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE=;SFP-7;CWE-476 +NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUEMsg=The return value from a method is dereferenced without a null check, and the return value of that method is one that should generally be checked for null. This may lead to a NullPointerException when the code is executed. + +#NP: Possible null pointer dereference due to return value of called method (NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE) +NP_NULL_ON_SOME_PATH_MIGHT_BE_INFEASIBLE=;SFP-7;CWE-476 +NP_NULL_ON_SOME_PATH_MIGHT_BE_INFEASIBLEMsg=There is a branch of statement that, if executed, guarantees that a null value will be dereferenced, which would generate a NullPointerException when the code is executed. Of course, the problem might be that the branch or statement is infeasible and that the null pointer exception can't ever be executed; deciding that is beyond the ability of FindBugs. Due to the fact that this value had been previously tested for nullness, this is a definite possibility. + +#NP: Possible null pointer dereference on path that might be infeasible (NP_NULL_ON_SOME_PATH_MIGHT_BE_INFEASIBLE) +NP_PARAMETER_MUST_BE_NONNULL_BUT_MARKED_AS_NULLABLE=;SFP-7;CWE-476 +NP_PARAMETER_MUST_BE_NONNULL_BUT_MARKED_AS_NULLABLEMsg=This parameter is always used in a way that requires it to be nonnull, but the parameter is explicitly annotated as being Nullable. Either the use of the parameter or the annotation is wrong. + +#NS: Potentially dangerous use of non-short-circuit logic (NS_DANGEROUS_NON_SHORT_CIRCUIT) +NS_DANGEROUS_NON_SHORT_CIRCUIT=;SFP-1;CWE-768 +NS_DANGEROUS_NON_SHORT_CIRCUITMsg=This code seems to be using non-short-circuit logic (e.g., & or |) rather than short-circuit logic (&& or ||). In addition, it seem possible that, depending on the value of the left hand side, you might not want to evaluate the right hand side (because it would have side effects, could cause an exception or could be expensive. Non-short-circuit logic causes both sides of the expression to be evaluated even when the result can be inferred from knowing the left-hand side. This can be less efficient and can result in errors if the left-hand side guards cases when evaluating the right-hand side can generate an error. See the Java Language Specification for details + +#NS: Questionable use of non-short-circuit logic (NS_NON_SHORT_CIRCUIT) +NS_NON_SHORT_CIRCUIT=;SFP-1;CWE-768 +NS_NON_SHORT_CIRCUITMsg=This code seems to be using non-short-circuit logic (e.g., & or |) rather than short-circuit logic (&& or ||). Non-short-circuit logic causes both sides of the expression to be evaluated even when the result can be inferred from knowing the left-hand side. This can be less efficient and can result in errors if the left-hand side guards cases when evaluating the right-hand side can generate an error. See the Java Language Specification for details + +#PZLA: Consider returning a zero length array rather than null (PZLA_PREFER_ZERO_LENGTH_ARRAYS) +PZLA_PREFER_ZERO_LENGTH_ARRAYS=;SFP--1;CWE-710 +PZLA_PREFER_ZERO_LENGTH_ARRAYSMsg=It is often a better design to return a length zero array rather than a null reference to indicate that there are no results (i.e., an empty list of results). This way, no explicit check for null is needed by clients of the method. On the other hand, using null to indicate "there is no answer to this question" is probably appropriate. For example, File.listFiles() returns an empty list if given a directory containing no files, and returns null if the file is not a directory. + +#QF: Complicated, subtle or wrong increment in for-loop (QF_QUESTIONABLE_FOR_LOOP) +QF_QUESTIONABLE_FOR_LOOP=;SFP--1;CWE-389 +QF_QUESTIONABLE_FOR_LOOPMsg=Are you sure this for loop is incrementing the correct variable? It appears that another variable is being initialized and checked by the for loop. + +#RCN: Redundant comparison of non-null value to null (RCN_REDUNDANT_COMPARISON_OF_NULL_AND_NONNULL_VALUE) +RCN_REDUNDANT_COMPARISON_OF_NULL_AND_NONNULL_VALUE=;SFP--1;CWE-398 +RCN_REDUNDANT_COMPARISON_OF_NULL_AND_NONNULL_VALUEMsg=This method contains a reference known to be non-null with another reference known to be null. + +#RCN: Redundant comparison of two null values (RCN_REDUNDANT_COMPARISON_TWO_NULL_VALUES) +RCN_REDUNDANT_COMPARISON_TWO_NULL_VALUES=;SFP--1;CWE-398 +RCN_REDUNDANT_COMPARISON_TWO_NULL_VALUESMsg=This method contains a redundant comparison of two references known to both be definitely null. + +#RCN: Redundant nullcheck of value known to be non-null (RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE) +RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE=;SFP--1;CWE-398 +RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUEMsg=This method contains a redundant check of a known non-null value against the constant null. + +#RCN: Redundant nullcheck of value known to be null (RCN_REDUNDANT_NULLCHECK_OF_NULL_VALUE) +RCN_REDUNDANT_NULLCHECK_OF_NULL_VALUE=;SFP--1;CWE-398 +RCN_REDUNDANT_NULLCHECK_OF_NULL_VALUEMsg=This method contains a redundant check of a known null value against the constant null. + +#REC: Exception is caught when Exception is not thrown (REC_CATCH_EXCEPTION) +REC_CATCH_EXCEPTION=;SFP-5;CWE-396 +REC_CATCH_EXCEPTIONMsg=This method uses a try-catch block that catches Exception objects, but Exception is not thrown within the try block, and RuntimeException is not explicitly caught. It is a common bug pattern to say try { ... } catch (Exception e) { something } as a shorthand for catching a number of types of exception each of whose catch blocks is identical, but this construct also accidentally catches RuntimeException as well, masking potential bugs. + +#RI: Class implements same interface as superclass (RI_REDUNDANT_INTERFACES) +RI_REDUNDANT_INTERFACES=;SFP--1;CWE-398 +RI_REDUNDANT_INTERFACESMsg=This class declares that it implements an interface that is also implemented by a superclass. This is redundant because once a superclass implements an interface, all subclasses by default also implement this interface. It may point out that the inheritance hierarchy has changed since this class was created, and consideration should be given to the ownership of the interface's implementation. + +#RV: Method checks to see if result of String.indexOf is positive (RV_CHECK_FOR_POSITIVE_INDEXOF) +RV_CHECK_FOR_POSITIVE_INDEXOF=;SFP--1;CWE-398 +RV_CHECK_FOR_POSITIVE_INDEXOFMsg=The method invokes String.indexOf and checks to see if the result is positive or non-positive. It is much more typical to check to see if the result is negative or non-negative. It is positive only if the substring checked for occurs at some place other than at the beginning of the String. + +#RV: Method discards result of readLine after checking if it is nonnull (RV_DONT_JUST_NULL_CHECK_READLINE) +RV_DONT_JUST_NULL_CHECK_READLINE=;SFP-4;CWE-253 +RV_DONT_JUST_NULL_CHECK_READLINEMsg=The value returned by readLine is discarded after checking to see if the return value is non-null. In almost all situations, if the result is non-null, you will want to use that non-null value. Calling readLine again will give you a different line. + +#RV: Remainder of hashCode could be negative (RV_REM_OF_HASHCODE) +RV_REM_OF_HASHCODE=;SFP--1;CWE-398 +RV_REM_OF_HASHCODEMsg=This code computes a hashCode, and then computes the remainder of that value modulo another value. Since the hashCode can be negative, the result of the remainder operation can also be negative. Assuming you want to ensure that the result of your computation is nonnegative, you may need to change your code. If you know the divisor is a power of 2, you can use a bitwise and operator instead (i.e., instead of using x.hashCode()%n, use x.hashCode()&(n-1). This is probably faster than computing the remainder as well. If you don't know that the divisor is a power of 2, take the absolute value of the result of the remainder operation (i.e., use Math.abs(x.hashCode()%n) + +#RV: Remainder of 32-bit signed random integer (RV_REM_OF_RANDOM_INT) +RV_REM_OF_RANDOM_INT=;SFP--1;CWE-398 +RV_REM_OF_RANDOM_INTMsg=This code generates a random signed integer and then computes the remainder of that value modulo another value. Since the random number can be negative, the result of the remainder operation can also be negative. Be sure this is intended, and strongly consider using the Random.nextInt(int) method instead. + +#SA: Double assignment of local variable (SA_LOCAL_DOUBLE_ASSIGNMENT) +SA_LOCAL_DOUBLE_ASSIGNMENT=;SFP--1;CWE-398 +SA_LOCAL_DOUBLE_ASSIGNMENTMsg=This method contains a double assignment of a local variable + +#SA: Self assignment of local variable (SA_LOCAL_SELF_ASSIGNMENT) +SA_LOCAL_SELF_ASSIGNMENT=;SFP--1;CWE-398 +SA_LOCAL_SELF_ASSIGNMENTMsg=This method contains a self assignment of a local variable + +#SF: Switch statement found where one case falls through to the next case (SF_SWITCH_FALLTHROUGH) +SF_SWITCH_FALLTHROUGH=;SFP-4;CWE-484 +SF_SWITCH_FALLTHROUGHMsg=This method contains a switch statement where one case branch will fall through to the next case. Usually you need to end this case with a break or return. + +#SF: Switch statement found where default case is missing (SF_SWITCH_NO_DEFAULT) +SF_SWITCH_NO_DEFAULT=;SFP-4;CWE-478 +SF_SWITCH_NO_DEFAULTMsg=This method contains a switch statement where default case is missing. Usually you need to provide a default case. + +#ST: Write to static field from instance method (ST_WRITE_TO_STATIC_FROM_INSTANCE_METHOD) +ST_WRITE_TO_STATIC_FROM_INSTANCE_METHOD=;SFP--1;CWE-398 +ST_WRITE_TO_STATIC_FROM_INSTANCE_METHODMsg=This instance method writes to a static field. This is tricky to get correct if multiple instances are being manipulated, and generally bad practice. + +#Se: private readResolve method not inherited by subclasses (SE_PRIVATE_READ_RESOLVE_NOT_INHERITED) +SE_PRIVATE_READ_RESOLVE_NOT_INHERITED=;SFP--1;CWE-398 +SE_PRIVATE_READ_RESOLVE_NOT_INHERITEDMsg=This class defines a private readResolve method. Since it is private, it won't be inherited by subclasses. This might be intentional and OK, but should be reviewed to ensure it is what is intended. + +#Se: Transient field of class that isn't Serializable. (SE_TRANSIENT_FIELD_OF_NONSERIALIZABLE_CLASS) +SE_TRANSIENT_FIELD_OF_NONSERIALIZABLE_CLASS=;SFP--1;CWE-398 +SE_TRANSIENT_FIELD_OF_NONSERIALIZABLE_CLASSMsg=The field is marked as transient, but the class isn't Serializable, so marking it as transient has absolutely no effect. This may be leftover marking from a previous version of the code in which the class was transient, or it may indicate a misunderstanding of how serialization works. + +#TQ: Explicit annotation inconsistent with use (TQ_EXPLICIT_UNKNOWN_SOURCE_VALUE_REACHES_ALWAYS_SINK) +TQ_EXPLICIT_UNKNOWN_SOURCE_VALUE_REACHES_ALWAYS_SINK=;SFP--1;CWE-398 +TQ_EXPLICIT_UNKNOWN_SOURCE_VALUE_REACHES_ALWAYS_SINKMsg=A value is used in a way that requires it to be always be a value denoted by a type qualifier, but there is an explicit annotation stating that it is not known where the value is required to have that type qualifier. Either the usage or the annotation is incorrect. + +#TQ: Explicit annotation inconsistent with use (TQ_EXPLICIT_UNKNOWN_SOURCE_VALUE_REACHES_NEVER_SINK) +TQ_EXPLICIT_UNKNOWN_SOURCE_VALUE_REACHES_NEVER_SINK=;SFP--1;CWE-398 +TQ_EXPLICIT_UNKNOWN_SOURCE_VALUE_REACHES_NEVER_SINKMsg=A value is used in a way that requires it to be never be a value denoted by a type qualifier, but there is an explicit annotation stating that it is not known where the value is prohibited from having that type qualifier. Either the usage or the annotation is incorrect. + +#UCF: Useless control flow (UCF_USELESS_CONTROL_FLOW) +UCF_USELESS_CONTROL_FLOW=;SFP--1;CWE-398 +UCF_USELESS_CONTROL_FLOWMsg=This method contains a useless control flow statement, where control flow continues onto the same place regardless of whether or not the branch is taken. + +#UCF: Useless control flow to next line (UCF_USELESS_CONTROL_FLOW_NEXT_LINE) +UCF_USELESS_CONTROL_FLOW_NEXT_LINE=;SFP--1;CWE-398 +UCF_USELESS_CONTROL_FLOW_NEXT_LINEMsg=This method contains a useless control flow statement in which control flow follows to the same or following line regardless of whether or not the branch is taken. Often, this is caused by inadvertently using an empty statement as the body of an if statement + +#UwF: Field not initialized in constructor (UWF_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR) +UWF_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR=;SFP-1;CWE-456 +UWF_FIELD_NOT_INITIALIZED_IN_CONSTRUCTORMsg=This field is never initialized within any constructor, and is therefore could be null after the object is constructed. This could be a either an error or a questionable design, since it means a null pointer exception will be generated if that field is dereferenced before being initialized. + +#XFB: Method directly allocates a specific implementation of xml interfaces (XFB_XML_FACTORY_BYPASS) +XFB_XML_FACTORY_BYPASS=;SFP--1;CWE-398 +XFB_XML_FACTORY_BYPASSMsg=This method allocates a specific implementation of an xml interface. It is preferable to use the supplied factory classes to create these objects so that the implementation can be changed at runtime \ No newline at end of file diff --git a/com.kdmanalytics.toif.findbugs/target/com.kdmanalytics.toif.findbugs-1.15.5.jar b/com.kdmanalytics.toif.findbugs/target/com.kdmanalytics.toif.findbugs-1.15.5.jar new file mode 100644 index 00000000..cb348c24 Binary files /dev/null and b/com.kdmanalytics.toif.findbugs/target/com.kdmanalytics.toif.findbugs-1.15.5.jar differ diff --git a/com.kdmanalytics.toif.findbugs/target/local-artifacts.properties b/com.kdmanalytics.toif.findbugs/target/local-artifacts.properties new file mode 100644 index 00000000..675c24d3 --- /dev/null +++ b/com.kdmanalytics.toif.findbugs/target/local-artifacts.properties @@ -0,0 +1,4 @@ +#Thu May 29 09:56:39 EDT 2014 +artifact.attached.p2metadata=/home/adam/git/toif/plugins/com.kdmanalytics.toif.findbugs/target/p2content.xml +artifact.main=/home/adam/git/toif/plugins/com.kdmanalytics.toif.findbugs/target/com.kdmanalytics.toif.findbugs-1.15.5.jar +artifact.attached.p2artifacts=/home/adam/git/toif/plugins/com.kdmanalytics.toif.findbugs/target/p2artifacts.xml diff --git a/com.kdmanalytics.toif.findbugs/target/maven-archiver/pom.properties b/com.kdmanalytics.toif.findbugs/target/maven-archiver/pom.properties new file mode 100644 index 00000000..68057c29 --- /dev/null +++ b/com.kdmanalytics.toif.findbugs/target/maven-archiver/pom.properties @@ -0,0 +1,5 @@ +#Generated by Maven +#Thu May 29 09:56:38 EDT 2014 +version=1.15.5 +groupId=com.kdmanalytics.toif.compile +artifactId=com.kdmanalytics.toif.findbugs diff --git a/com.kdmanalytics.toif.findbugs/target/p2artifacts.xml b/com.kdmanalytics.toif.findbugs/target/p2artifacts.xml new file mode 100644 index 00000000..307a75d9 --- /dev/null +++ b/com.kdmanalytics.toif.findbugs/target/p2artifacts.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/com.kdmanalytics.toif.findbugs/target/p2content.xml b/com.kdmanalytics.toif.findbugs/target/p2content.xml new file mode 100644 index 00000000..baf7ae0d --- /dev/null +++ b/com.kdmanalytics.toif.findbugs/target/p2content.xml @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Bundle-SymbolicName: com.kdmanalytics.toif.findbugs;singleton:=true Bundle-Version: 1.15.5 + + + + + diff --git a/com.kdmanalytics.toif.framework/.classpath b/com.kdmanalytics.toif.framework/.classpath new file mode 100644 index 00000000..2691f334 --- /dev/null +++ b/com.kdmanalytics.toif.framework/.classpath @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/com.kdmanalytics.toif.framework/.fatjar b/com.kdmanalytics.toif.framework/.fatjar new file mode 100644 index 00000000..a1724ac2 --- /dev/null +++ b/com.kdmanalytics.toif.framework/.fatjar @@ -0,0 +1,14 @@ +#Fat Jar Configuration File +#Wed Mar 07 15:37:22 EST 2012 +onejar.license.required=true +manifest.classpath= +manifest.removesigners=true +onejar.checkbox=false +jarname=com.kdmanalytics.toif.framework_fat.jar +manifest.mergeall=true +manifest.mainclass= +manifest.file= +jarname.isextern=false +onejar.expand= +excludes= +includes= diff --git a/com.kdmanalytics.toif.framework/.project b/com.kdmanalytics.toif.framework/.project new file mode 100644 index 00000000..ac94bfe3 --- /dev/null +++ b/com.kdmanalytics.toif.framework/.project @@ -0,0 +1,28 @@ + + + com.kdmanalytics.toif.framework + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + + org.eclipse.pde.PluginNature + org.eclipse.jdt.core.javanature + + diff --git a/com.kdmanalytics.toif.framework/.settings/com.wdev91.eclipse.copyright.xml b/com.kdmanalytics.toif.framework/.settings/com.wdev91.eclipse.copyright.xml new file mode 100644 index 00000000..8d11112f --- /dev/null +++ b/com.kdmanalytics.toif.framework/.settings/com.wdev91.eclipse.copyright.xml @@ -0,0 +1,10 @@ + + + + + diff --git a/com.kdmanalytics.toif.framework/.settings/org.eclipse.jdt.core.prefs b/com.kdmanalytics.toif.framework/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 00000000..0f58df9b --- /dev/null +++ b/com.kdmanalytics.toif.framework/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,287 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 +org.eclipse.jdt.core.compiler.compliance=1.7 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.7 +org.eclipse.jdt.core.formatter.align_type_members_on_columns=false +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16 +org.eclipse.jdt.core.formatter.alignment_for_assignment=0 +org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16 +org.eclipse.jdt.core.formatter.alignment_for_compact_if=16 +org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80 +org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0 +org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16 +org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0 +org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16 +org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80 +org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16 +org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16 +org.eclipse.jdt.core.formatter.blank_lines_after_imports=1 +org.eclipse.jdt.core.formatter.blank_lines_after_package=1 +org.eclipse.jdt.core.formatter.blank_lines_before_field=1 +org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=1 +org.eclipse.jdt.core.formatter.blank_lines_before_imports=1 +org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1 +org.eclipse.jdt.core.formatter.blank_lines_before_method=1 +org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1 +org.eclipse.jdt.core.formatter.blank_lines_before_package=1 +org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1 +org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1 +org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=next_line +org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_block=next_line +org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=next_line +org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=next_line +org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=next_line +org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=next_line +org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=next_line +org.eclipse.jdt.core.formatter.brace_position_for_switch=next_line +org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=next_line +org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false +org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false +org.eclipse.jdt.core.formatter.comment.format_block_comments=true +org.eclipse.jdt.core.formatter.comment.format_header=true +org.eclipse.jdt.core.formatter.comment.format_html=true +org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true +org.eclipse.jdt.core.formatter.comment.format_line_comments=true +org.eclipse.jdt.core.formatter.comment.format_source_code=true +org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true +org.eclipse.jdt.core.formatter.comment.indent_root_tags=true +org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert +org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert +org.eclipse.jdt.core.formatter.comment.line_length=80 +org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true +org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true +org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false +org.eclipse.jdt.core.formatter.compact_else_if=true +org.eclipse.jdt.core.formatter.continuation_indentation=2 +org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2 +org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off +org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on +org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false +org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true +org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true +org.eclipse.jdt.core.formatter.indent_empty_lines=true +org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true +org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true +org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true +org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=true +org.eclipse.jdt.core.formatter.indentation.size=4 +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=insert +org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=insert +org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=insert +org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=insert +org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert +org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert +org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert +org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert +org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert +org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert +org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.join_lines_in_comments=true +org.eclipse.jdt.core.formatter.join_wrapped_lines=true +org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=true +org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false +org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false +org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false +org.eclipse.jdt.core.formatter.lineSplit=150 +org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false +org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false +org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0 +org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1 +org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true +org.eclipse.jdt.core.formatter.tabulation.char=space +org.eclipse.jdt.core.formatter.tabulation.size=4 +org.eclipse.jdt.core.formatter.use_on_off_tags=false +org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false +org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true +org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true +org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true diff --git a/com.kdmanalytics.toif.framework/.settings/org.eclipse.jdt.ui.prefs b/com.kdmanalytics.toif.framework/.settings/org.eclipse.jdt.ui.prefs new file mode 100644 index 00000000..ffd09d5b --- /dev/null +++ b/com.kdmanalytics.toif.framework/.settings/org.eclipse.jdt.ui.prefs @@ -0,0 +1,55 @@ +cleanup.add_default_serial_version_id=true +cleanup.add_generated_serial_version_id=false +cleanup.add_missing_annotations=true +cleanup.add_missing_deprecated_annotations=true +cleanup.add_missing_methods=true +cleanup.add_missing_nls_tags=false +cleanup.add_missing_override_annotations=true +cleanup.add_missing_override_annotations_interface_methods=true +cleanup.add_serial_version_id=true +cleanup.always_use_blocks=true +cleanup.always_use_parentheses_in_expressions=true +cleanup.always_use_this_for_non_static_field_access=false +cleanup.always_use_this_for_non_static_method_access=false +cleanup.convert_to_enhanced_for_loop=true +cleanup.correct_indentation=true +cleanup.format_source_code=true +cleanup.format_source_code_changes_only=false +cleanup.make_local_variable_final=true +cleanup.make_parameters_final=true +cleanup.make_private_fields_final=true +cleanup.make_type_abstract_if_missing_method=false +cleanup.make_variable_declarations_final=true +cleanup.never_use_blocks=false +cleanup.never_use_parentheses_in_expressions=false +cleanup.organize_imports=true +cleanup.qualify_static_field_accesses_with_declaring_class=false +cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true +cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true +cleanup.qualify_static_member_accesses_with_declaring_class=true +cleanup.qualify_static_method_accesses_with_declaring_class=false +cleanup.remove_private_constructors=true +cleanup.remove_trailing_whitespaces=true +cleanup.remove_trailing_whitespaces_all=true +cleanup.remove_trailing_whitespaces_ignore_empty=false +cleanup.remove_unnecessary_casts=true +cleanup.remove_unnecessary_nls_tags=true +cleanup.remove_unused_imports=true +cleanup.remove_unused_local_variables=true +cleanup.remove_unused_private_fields=true +cleanup.remove_unused_private_members=true +cleanup.remove_unused_private_methods=true +cleanup.remove_unused_private_types=true +cleanup.sort_members=false +cleanup.sort_members_all=false +cleanup.use_blocks=true +cleanup.use_blocks_only_for_return_and_throw=false +cleanup.use_parentheses_in_expressions=true +cleanup.use_this_for_non_static_field_access=true +cleanup.use_this_for_non_static_field_access_only_if_necessary=true +cleanup.use_this_for_non_static_method_access=false +cleanup.use_this_for_non_static_method_access_only_if_necessary=true +cleanup_profile=_KDM +cleanup_settings_version=2 +eclipse.preferences.version=1 +formatter_settings_version=12 diff --git a/com.kdmanalytics.toif.framework/META-INF/MANIFEST.MF b/com.kdmanalytics.toif.framework/META-INF/MANIFEST.MF new file mode 100644 index 00000000..5d1b1b59 --- /dev/null +++ b/com.kdmanalytics.toif.framework/META-INF/MANIFEST.MF @@ -0,0 +1,20 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: TOIF Adaptor +Bundle-SymbolicName: com.kdmanalytics.toif.framework;singleton:=true +Bundle-Version: 1.16.0.qualifier +Bundle-Activator: com.kdmanalytics.toif.framework.Activator +Bundle-Vendor: KDM Analytics Inc. +Eclipse-RegisterBuddy: com.lexicalscope.jewelcli +Require-Bundle: org.eclipse.core.runtime, + com.lexicalscope.jewelcli;bundle-version="[0.8.5,1.0.0)", + org.apache.commons.lang3;bundle-version="[3.1.0,4.0.0)", + com.kdmanalytics.toif.common;bundle-version="1.14.0", + org.apache.log4j;bundle-version="[1.2.15,1.3.0)" +Bundle-RequiredExecutionEnvironment: JavaSE-1.7 +Bundle-ActivationPolicy: lazy +Import-Package: org.apache.xerces.parsers +Export-Package: com.kdmanalytics.toif.framework.parser,com.kdmanalytic + s.toif.framework.toolAdaptor,com.kdmanalytics.toif.framework.utils,co + m.kdmanalytics.toif.framework.xmlElements.entities,com.kdmanalytics.t + oif.framework.xmlElements.facts diff --git a/com.kdmanalytics.toif.framework/bin/HouseKeepingXMLSchema.xsd b/com.kdmanalytics.toif.framework/bin/HouseKeepingXMLSchema.xsd new file mode 100644 index 00000000..5a31523b --- /dev/null +++ b/com.kdmanalytics.toif.framework/bin/HouseKeepingXMLSchema.xsd @@ -0,0 +1,630 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/com.kdmanalytics.toif.framework/bin/TOIFSchema.xsd b/com.kdmanalytics.toif.framework/bin/TOIFSchema.xsd new file mode 100644 index 00000000..a8824954 --- /dev/null +++ b/com.kdmanalytics.toif.framework/bin/TOIFSchema.xsd @@ -0,0 +1,716 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/Activator.class b/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/Activator.class new file mode 100644 index 00000000..7dad50a9 Binary files /dev/null and b/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/Activator.class differ diff --git a/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/config/houseKeeping b/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/config/houseKeeping new file mode 100644 index 00000000..59ece675 --- /dev/null +++ b/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/config/houseKeeping @@ -0,0 +1,44 @@ +########################### +# Facts +########################### + +TOIFSegmentIsRelatedToProject=project1 +TOIFSegmentIsProducedByOrganization=org1 +TOIFSegmentIsOwnedByOrganization=org2 +TOIFSegmentIsGeneratedByGenerator=generator1 +TOIFSegmentIsGeneratedByPerson=person1 +TOIFSegmentIsSupervisedByPerson=person2 + +PersonIsInvolvedInProjectAsRole=person1;project1;role1 +OrganizationIsInvolvedInProjectAsRole=org1;project1;role2 +AdaptorSupportsGenerator=generator1 +AdaptorIsSuppliedByVendor=vendor1 +GeneratorIsSuppliedByVendor=generator1;vendor1 +OrganizationIsPartOfOrganizationAsRole=org1;org2;role2 +PersonIsEmployedByOrganizationAsRole=person1;org1;role1 + +########################### +# Entities +########################### + +#projectId=name;description +project1=Test Project;The test project during development + +#generatorId=name;description;version +generator1=jlint;java checking;2.3 + +#personId=name;email;phone +person1=Adam Nunn;adam@kdmanalytics.com;555-1234 +person2=Joe Bloggs;blogs@kdmanalytics.com;555-1234 + +#organizationId=name;description;address;email;phone +org1=KDM;Kdm Analytics;Richmond;kdm@kdmanalytics.com;555-5555 + +#organizationId=name;description;address;email;phone +org2=Acme;Acme Analytics;blah;thingamy@thingamy.com;555-5555 + +#roleId=name;description +role1=developer;programmer +role2=company;employer + +vendor1=Me;Kdm Analytics;Richmond;kdm@kdmanalytics.com;555-5555 \ No newline at end of file diff --git a/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/parser/StreamGobbler.class b/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/parser/StreamGobbler.class new file mode 100644 index 00000000..5a052a1c Binary files /dev/null and b/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/parser/StreamGobbler.class differ diff --git a/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/toolAdaptor/AbstractAdaptor.class b/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/toolAdaptor/AbstractAdaptor.class new file mode 100644 index 00000000..0f7d9d7b Binary files /dev/null and b/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/toolAdaptor/AbstractAdaptor.class differ diff --git a/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/toolAdaptor/AdaptorOptions.class b/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/toolAdaptor/AdaptorOptions.class new file mode 100644 index 00000000..f78c8112 Binary files /dev/null and b/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/toolAdaptor/AdaptorOptions.class differ diff --git a/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/toolAdaptor/Language.class b/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/toolAdaptor/Language.class new file mode 100644 index 00000000..46dedd4d Binary files /dev/null and b/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/toolAdaptor/Language.class differ diff --git a/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/toolAdaptor/ToolAdaptor.class b/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/toolAdaptor/ToolAdaptor.class new file mode 100644 index 00000000..46c77a0d Binary files /dev/null and b/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/toolAdaptor/ToolAdaptor.class differ diff --git a/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/toolAdaptor/ToolAdaptorUtil.class b/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/toolAdaptor/ToolAdaptorUtil.class new file mode 100644 index 00000000..b83fc5a7 Binary files /dev/null and b/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/toolAdaptor/ToolAdaptorUtil.class differ diff --git a/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/utils/ClusterMapping.class b/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/utils/ClusterMapping.class new file mode 100644 index 00000000..d97c3f17 Binary files /dev/null and b/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/utils/ClusterMapping.class differ diff --git a/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/utils/DirectToifInput.class b/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/utils/DirectToifInput.class new file mode 100644 index 00000000..1247b37a Binary files /dev/null and b/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/utils/DirectToifInput.class differ diff --git a/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/utils/ElementComparator.class b/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/utils/ElementComparator.class new file mode 100644 index 00000000..c3ba7e69 Binary files /dev/null and b/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/utils/ElementComparator.class differ diff --git a/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/utils/FindingCreator.class b/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/utils/FindingCreator.class new file mode 100644 index 00000000..8e256a27 Binary files /dev/null and b/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/utils/FindingCreator.class differ diff --git a/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/entities/Adaptor.class b/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/entities/Adaptor.class new file mode 100644 index 00000000..2ff33b50 Binary files /dev/null and b/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/entities/Adaptor.class differ diff --git a/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/entities/Address.class b/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/entities/Address.class new file mode 100644 index 00000000..d9fd8e75 Binary files /dev/null and b/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/entities/Address.class differ diff --git a/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/entities/CWEIdentifier.class b/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/entities/CWEIdentifier.class new file mode 100644 index 00000000..6422c5ba Binary files /dev/null and b/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/entities/CWEIdentifier.class differ diff --git a/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/entities/Checksum.class b/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/entities/Checksum.class new file mode 100644 index 00000000..772e4f79 Binary files /dev/null and b/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/entities/Checksum.class differ diff --git a/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/entities/ClusterIdentifier.class b/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/entities/ClusterIdentifier.class new file mode 100644 index 00000000..9205169a Binary files /dev/null and b/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/entities/ClusterIdentifier.class differ diff --git a/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/entities/CodeLocation.class b/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/entities/CodeLocation.class new file mode 100644 index 00000000..9ea70ca0 Binary files /dev/null and b/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/entities/CodeLocation.class differ diff --git a/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/entities/DataElement.class b/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/entities/DataElement.class new file mode 100644 index 00000000..3182d816 Binary files /dev/null and b/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/entities/DataElement.class differ diff --git a/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/entities/Date.class b/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/entities/Date.class new file mode 100644 index 00000000..d8795ae8 Binary files /dev/null and b/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/entities/Date.class differ diff --git a/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/entities/Description.class b/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/entities/Description.class new file mode 100644 index 00000000..668a4e4f Binary files /dev/null and b/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/entities/Description.class differ diff --git a/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/entities/Directory.class b/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/entities/Directory.class new file mode 100644 index 00000000..e5a166bb Binary files /dev/null and b/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/entities/Directory.class differ diff --git a/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/entities/Element.class b/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/entities/Element.class new file mode 100644 index 00000000..7e9ae31f Binary files /dev/null and b/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/entities/Element.class differ diff --git a/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/entities/EmailAddress.class b/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/entities/EmailAddress.class new file mode 100644 index 00000000..70e64b2f Binary files /dev/null and b/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/entities/EmailAddress.class differ diff --git a/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/entities/Entity.class b/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/entities/Entity.class new file mode 100644 index 00000000..c584623b Binary files /dev/null and b/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/entities/Entity.class differ diff --git a/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/entities/File.class b/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/entities/File.class new file mode 100644 index 00000000..8296d695 Binary files /dev/null and b/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/entities/File.class differ diff --git a/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/entities/Finding.class b/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/entities/Finding.class new file mode 100644 index 00000000..519f04b4 Binary files /dev/null and b/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/entities/Finding.class differ diff --git a/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/entities/Generator.class b/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/entities/Generator.class new file mode 100644 index 00000000..f7f3775a Binary files /dev/null and b/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/entities/Generator.class differ diff --git a/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/entities/LineNumber.class b/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/entities/LineNumber.class new file mode 100644 index 00000000..dc445b41 Binary files /dev/null and b/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/entities/LineNumber.class differ diff --git a/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/entities/Name.class b/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/entities/Name.class new file mode 100644 index 00000000..39497f83 Binary files /dev/null and b/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/entities/Name.class differ diff --git a/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/entities/Offset.class b/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/entities/Offset.class new file mode 100644 index 00000000..1b5998cc Binary files /dev/null and b/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/entities/Offset.class differ diff --git a/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/entities/Organization.class b/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/entities/Organization.class new file mode 100644 index 00000000..7f409e44 Binary files /dev/null and b/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/entities/Organization.class differ diff --git a/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/entities/Person.class b/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/entities/Person.class new file mode 100644 index 00000000..86eb843b Binary files /dev/null and b/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/entities/Person.class differ diff --git a/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/entities/Phone.class b/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/entities/Phone.class new file mode 100644 index 00000000..cd2b4537 Binary files /dev/null and b/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/entities/Phone.class differ diff --git a/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/entities/Position.class b/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/entities/Position.class new file mode 100644 index 00000000..3a41eb5a Binary files /dev/null and b/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/entities/Position.class differ diff --git a/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/entities/Project.class b/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/entities/Project.class new file mode 100644 index 00000000..5329b094 Binary files /dev/null and b/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/entities/Project.class differ diff --git a/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/entities/Role.class b/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/entities/Role.class new file mode 100644 index 00000000..8a5ac58b Binary files /dev/null and b/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/entities/Role.class differ diff --git a/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/entities/SFPIdentifier.class b/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/entities/SFPIdentifier.class new file mode 100644 index 00000000..490c661b Binary files /dev/null and b/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/entities/SFPIdentifier.class differ diff --git a/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/entities/Segment.class b/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/entities/Segment.class new file mode 100644 index 00000000..a49df269 Binary files /dev/null and b/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/entities/Segment.class differ diff --git a/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/entities/Statement.class b/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/entities/Statement.class new file mode 100644 index 00000000..682dc5fa Binary files /dev/null and b/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/entities/Statement.class differ diff --git a/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/entities/Text.class b/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/entities/Text.class new file mode 100644 index 00000000..1f13ea7b Binary files /dev/null and b/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/entities/Text.class differ diff --git a/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/entities/Vendor.class b/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/entities/Vendor.class new file mode 100644 index 00000000..b84dfbd2 Binary files /dev/null and b/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/entities/Vendor.class differ diff --git a/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/entities/Version.class b/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/entities/Version.class new file mode 100644 index 00000000..774adeaa Binary files /dev/null and b/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/entities/Version.class differ diff --git a/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/entities/WeaknessDescription.class b/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/entities/WeaknessDescription.class new file mode 100644 index 00000000..7cbe7235 Binary files /dev/null and b/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/entities/WeaknessDescription.class differ diff --git a/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/facts/AdaptorIsSuppliedByVendor.class b/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/facts/AdaptorIsSuppliedByVendor.class new file mode 100644 index 00000000..a5490955 Binary files /dev/null and b/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/facts/AdaptorIsSuppliedByVendor.class differ diff --git a/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/facts/AdaptorSupportsGenerator.class b/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/facts/AdaptorSupportsGenerator.class new file mode 100644 index 00000000..f60fdb97 Binary files /dev/null and b/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/facts/AdaptorSupportsGenerator.class differ diff --git a/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/facts/CodeLocationReferencesFile.class b/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/facts/CodeLocationReferencesFile.class new file mode 100644 index 00000000..2f0cb4dd Binary files /dev/null and b/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/facts/CodeLocationReferencesFile.class differ diff --git a/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/facts/DataElementIsInvolvedInFinding.class b/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/facts/DataElementIsInvolvedInFinding.class new file mode 100644 index 00000000..14071f8b Binary files /dev/null and b/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/facts/DataElementIsInvolvedInFinding.class differ diff --git a/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/facts/DataElementIsInvolvedInStatement.class b/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/facts/DataElementIsInvolvedInStatement.class new file mode 100644 index 00000000..82b783ac Binary files /dev/null and b/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/facts/DataElementIsInvolvedInStatement.class differ diff --git a/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/facts/DirectoryIsContainedInDirectory.class b/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/facts/DirectoryIsContainedInDirectory.class new file mode 100644 index 00000000..8d2e4833 Binary files /dev/null and b/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/facts/DirectoryIsContainedInDirectory.class differ diff --git a/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/facts/Fact.class b/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/facts/Fact.class new file mode 100644 index 00000000..ace5fd90 Binary files /dev/null and b/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/facts/Fact.class differ diff --git a/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/facts/FileIsContainedInDirectory.class b/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/facts/FileIsContainedInDirectory.class new file mode 100644 index 00000000..76e0534b Binary files /dev/null and b/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/facts/FileIsContainedInDirectory.class differ diff --git a/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/facts/FindingHasCWEIdentifier.class b/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/facts/FindingHasCWEIdentifier.class new file mode 100644 index 00000000..ee2c0ac5 Binary files /dev/null and b/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/facts/FindingHasCWEIdentifier.class differ diff --git a/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/facts/FindingHasClusterIdentifier.class b/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/facts/FindingHasClusterIdentifier.class new file mode 100644 index 00000000..059e6028 Binary files /dev/null and b/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/facts/FindingHasClusterIdentifier.class differ diff --git a/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/facts/FindingHasCodeLocation.class b/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/facts/FindingHasCodeLocation.class new file mode 100644 index 00000000..81b238cb Binary files /dev/null and b/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/facts/FindingHasCodeLocation.class differ diff --git a/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/facts/FindingHasSFPIdentifier.class b/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/facts/FindingHasSFPIdentifier.class new file mode 100644 index 00000000..e3fd341a Binary files /dev/null and b/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/facts/FindingHasSFPIdentifier.class differ diff --git a/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/facts/FindingIsDescribedByWeaknessDescription.class b/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/facts/FindingIsDescribedByWeaknessDescription.class new file mode 100644 index 00000000..169ae818 Binary files /dev/null and b/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/facts/FindingIsDescribedByWeaknessDescription.class differ diff --git a/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/facts/GeneratorIsSuppliedByVendor.class b/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/facts/GeneratorIsSuppliedByVendor.class new file mode 100644 index 00000000..2f535ec4 Binary files /dev/null and b/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/facts/GeneratorIsSuppliedByVendor.class differ diff --git a/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/facts/OrganizationIsInvolvedInProjectAsRole.class b/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/facts/OrganizationIsInvolvedInProjectAsRole.class new file mode 100644 index 00000000..8f0f8d8b Binary files /dev/null and b/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/facts/OrganizationIsInvolvedInProjectAsRole.class differ diff --git a/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/facts/OrganizationIsPartOfOrganizationAsRole.class b/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/facts/OrganizationIsPartOfOrganizationAsRole.class new file mode 100644 index 00000000..d997a238 Binary files /dev/null and b/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/facts/OrganizationIsPartOfOrganizationAsRole.class differ diff --git a/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/facts/PersonIsEmployedByOrganizationAsRole.class b/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/facts/PersonIsEmployedByOrganizationAsRole.class new file mode 100644 index 00000000..2aa4b9c8 Binary files /dev/null and b/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/facts/PersonIsEmployedByOrganizationAsRole.class differ diff --git a/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/facts/PersonIsInvolvedInProjectAsRole.class b/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/facts/PersonIsInvolvedInProjectAsRole.class new file mode 100644 index 00000000..ca615288 Binary files /dev/null and b/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/facts/PersonIsInvolvedInProjectAsRole.class differ diff --git a/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/facts/StatementHasCodeLocation.class b/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/facts/StatementHasCodeLocation.class new file mode 100644 index 00000000..db101fd3 Binary files /dev/null and b/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/facts/StatementHasCodeLocation.class differ diff --git a/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/facts/StatementIsInvolvedInFinding.class b/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/facts/StatementIsInvolvedInFinding.class new file mode 100644 index 00000000..77e85cc1 Binary files /dev/null and b/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/facts/StatementIsInvolvedInFinding.class differ diff --git a/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/facts/StatementIsProceededByStatement.class b/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/facts/StatementIsProceededByStatement.class new file mode 100644 index 00000000..2eaf70c8 Binary files /dev/null and b/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/facts/StatementIsProceededByStatement.class differ diff --git a/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/facts/StatementIsSinkInFinding.class b/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/facts/StatementIsSinkInFinding.class new file mode 100644 index 00000000..84f03365 Binary files /dev/null and b/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/facts/StatementIsSinkInFinding.class differ diff --git a/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/facts/TOIFSegmentIsCreatedAtDate.class b/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/facts/TOIFSegmentIsCreatedAtDate.class new file mode 100644 index 00000000..ee9555f8 Binary files /dev/null and b/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/facts/TOIFSegmentIsCreatedAtDate.class differ diff --git a/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/facts/TOIFSegmentIsGeneratedByGenerator.class b/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/facts/TOIFSegmentIsGeneratedByGenerator.class new file mode 100644 index 00000000..3310979e Binary files /dev/null and b/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/facts/TOIFSegmentIsGeneratedByGenerator.class differ diff --git a/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/facts/TOIFSegmentIsGeneratedByPerson.class b/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/facts/TOIFSegmentIsGeneratedByPerson.class new file mode 100644 index 00000000..bfa44a6d Binary files /dev/null and b/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/facts/TOIFSegmentIsGeneratedByPerson.class differ diff --git a/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/facts/TOIFSegmentIsOwnedByOrganization.class b/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/facts/TOIFSegmentIsOwnedByOrganization.class new file mode 100644 index 00000000..c058da84 Binary files /dev/null and b/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/facts/TOIFSegmentIsOwnedByOrganization.class differ diff --git a/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/facts/TOIFSegmentIsProcessedByAdaptor.class b/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/facts/TOIFSegmentIsProcessedByAdaptor.class new file mode 100644 index 00000000..1967c7ad Binary files /dev/null and b/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/facts/TOIFSegmentIsProcessedByAdaptor.class differ diff --git a/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/facts/TOIFSegmentIsProducedByOrganization.class b/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/facts/TOIFSegmentIsProducedByOrganization.class new file mode 100644 index 00000000..e0af726f Binary files /dev/null and b/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/facts/TOIFSegmentIsProducedByOrganization.class differ diff --git a/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/facts/TOIFSegmentIsRelatedToProject.class b/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/facts/TOIFSegmentIsRelatedToProject.class new file mode 100644 index 00000000..d95cf831 Binary files /dev/null and b/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/facts/TOIFSegmentIsRelatedToProject.class differ diff --git a/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/facts/TOIFSegmentIsSupervisedByPerson.class b/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/facts/TOIFSegmentIsSupervisedByPerson.class new file mode 100644 index 00000000..5561c20c Binary files /dev/null and b/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/facts/TOIFSegmentIsSupervisedByPerson.class differ diff --git a/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/facts/TOIFSegmentReferencesFile.class b/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/facts/TOIFSegmentReferencesFile.class new file mode 100644 index 00000000..ec0fd40c Binary files /dev/null and b/com.kdmanalytics.toif.framework/bin/com/kdmanalytics/toif/framework/xmlElements/facts/TOIFSegmentReferencesFile.class differ diff --git a/com.kdmanalytics.toif.framework/bin/example/housekeeping b/com.kdmanalytics.toif.framework/bin/example/housekeeping new file mode 100644 index 00000000..d9a3f122 --- /dev/null +++ b/com.kdmanalytics.toif.framework/bin/example/housekeeping @@ -0,0 +1,38 @@ +########################### +# Facts +########################### + +TOIFSegmentIsRelatedToProject=project1 +TOIFSegmentIsProducedByOrganization=org1 +TOIFSegmentIsOwnedByOrganization=org1 + +TOIFSegmentIsGeneratedByPerson=person1 +TOIFSegmentIsSupervisedByPerson=person1 + +PersonIsInvolvedInProjectAsRole=person1;project1;role1 +OrganizationIsInvolvedInProjectAsRole=org1;project1;role2 +#OrganizationIsPartOfOrganizationAsRole=org1;org2;role2 +PersonIsEmployedByOrganizationAsRole=person1;org1;role1 + +########################### +# Entities +########################### + +SegmentDescription=Segment relating to the findings by the analyzer. + +#projectId=name;description +project1=The Project;The description of the project. + +#personId=name;email;phone +person1=Ken Duck;ken@kdmanalytics.com;613-627-1011 +#person2=Joe Bloggs;blogs@kdmanalytics.com;555-1234 + +#organizationId=name;description;address;phone;email +org1=KDM Analytics;KDM Analytics is a security assurance company providing products and services for threat risk assessment and management, due diligence assessments, and information and data assurance. Leveraging our decades of experience in static analysis, reverse engineering and formal methods, we have created breakthrough products for the automated and systematic investigation of code, data and networks;3730 Richmond Rd, Suite 204, Ottawa, ON K2H 5B9;613-627-1011;info@kdmanalytics.com + +#organizationId=name;description;address;phone;email +#org2=Acme Corporation;Acme Corporation;blah;555-5555;thingamy@thingamy.com + +#roleId=name;description +role1=Analyst;Analyst for KDM Analytics +role2=Analysis;Security Assurance diff --git a/com.kdmanalytics.toif.framework/bin/packet-dcerpc.c.toif.xml b/com.kdmanalytics.toif.framework/bin/packet-dcerpc.c.toif.xml new file mode 100644 index 00000000..1ebef1bc --- /dev/null +++ b/com.kdmanalytics.toif.framework/bin/packet-dcerpc.c.toif.xml @@ -0,0 +1,1241 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/com.kdmanalytics.toif.framework/bin/resources/SFP_CWE_Mapping.txt b/com.kdmanalytics.toif.framework/bin/resources/SFP_CWE_Mapping.txt new file mode 100644 index 00000000..92dd4dfa --- /dev/null +++ b/com.kdmanalytics.toif.framework/bin/resources/SFP_CWE_Mapping.txt @@ -0,0 +1,316 @@ +CWE-1=SFP-1 +CWE398=SFP-1 +CWE128=SFP1 +CWE190=SFP1 +CWE191=SFP1 +CWE194=SFP1 +CWE195=SFP1 +CWE196=SFP1 +CWE197=SFP1 +CWE681=SFP1 +CWE704=SFP1 +CWE468=SFP1 +CWE456=SFP1 +CWE457=SFP1 +CWE369=SFP1 +CWE579=SFP1 +CWE594=SFP1 +CWE475=SFP1 +CWE685=SFP1 +CWE686=SFP1 +CWE466=SFP1 +CWE562=SFP1 +CWE587=SFP1 +CWE481=SFP1 +CWE486=SFP1 +CWE570=SFP1 +CWE571=SFP1 +CWE597=SFP1 +CWE768=SFP1 +CWE482=SFP2 +CWE561=SFP2 +CWE563=SFP2 +CWE111=SFP3 +CWE242=SFP3 +CWE245=SFP3 +CWE246=SFP3 +CWE382=SFP3 +CWE383=SFP3 +CWE474=SFP3 +CWE477=SFP3 +CWE479=SFP3 +CWE558=SFP3 +CWE574=SFP3 +CWE575=SFP3 +CWE576=SFP3 +CWE577=SFP3 +CWE578=SFP3 +CWE589=SFP3 +CWE676=SFP3 +CWE617=SFP3 +CWE572=SFP3 +CWE586=SFP3 +CWE248=SFP4 +CWE252=SFP4 +CWE253=SFP4 +CWE273=SFP4 +CWE280=SFP4 +CWE390=SFP4 +CWE391=SFP4 +CWE394=SFP4 +CWE431=SFP4 +CWE600=SFP4 +CWE478=SFP4 +CWE484=SFP4 +CWE665=SFP4 +CWE396=SFP5 +CWE397=SFP5 +CWE392=SFP6 +CWE393=SFP6 +CWE584=SFP6 +CWE416=SFP7 +CWE476=SFP7 +CWE469=SFP1 +CWE588=SFP7 +CWE118=SFP8 +CWE119=SFP8 +CWE121=SFP8 +CWE122=SFP8 +CWE123=SFP8 +CWE124=SFP8 +CWE125=SFP8 +CWE126=SFP8 +CWE127=SFP8 +CWE129=SFP8 +CWE120=SFP8 +CWE785=SFP9 +CWE249=SFP9 +CWE135=SFP10 +CWE467=SFP10 +CWE251=SFP10 +CWE170=SFP11 +CWE415=SFP12 +CWE590=SFP12 +CWE761=SFP12 +CWE762=SFP12 +CWE763=SFP12 +CWE763=SFP12 +CWE763=SFP12 +CWE763=SFP12 +CWE400=SFP13 +CWE674=SFP13 +CWE774=SFP13 +CWE401=SFP14 +CWE404=SFP14 +CWE459=SFP14 +CWE771=SFP14 +CWE772=SFP14 +CWE773=SFP14 +CWE775=SFP14 +CWE672=SFP15 +CWE022=SFP16 +CWE023=SFP16 +CWE024=SFP16 +CWE025=SFP16 +CWE026=SFP16 +CWE027=SFP16 +CWE028=SFP16 +CWE029=SFP16 +CWE030=SFP16 +CWE031=SFP16 +CWE032=SFP16 +CWE033=SFP16 +CWE034=SFP16 +CWE035=SFP16 +CWE036=SFP16 +CWE037=SFP16 +CWE038=SFP16 +CWE039=SFP16 +CWE040=SFP16 +CWE042=SFP16 +CWE043=SFP16 +CWE044=SFP16 +CWE045=SFP16 +CWE046=SFP16 +CWE047=SFP16 +CWE048=SFP16 +CWE049=SFP16 +CWE050=SFP16 +CWE051=SFP16 +CWE052=SFP16 +CWE053=SFP16 +CWE054=SFP16 +CWE055=SFP16 +CWE056=SFP16 +CWE057=SFP16 +CWE058=SFP16 +CWE067=SFP16 +CWE073=SFP16 +CWE243=SFP17 +CWE059=SFP18 +CWE062=SFP18 +CWE064=SFP18 +CWE065=SFP18 +CWE364=SFP19 +CWE365=SFP19 +CWE366=SFP19 +CWE413=SFP19 +CWE414=SFP19 +CWE543=SFP19 +CWE567=SFP19 +CWE609=SFP19 +CWE662=SFP19 +CWE667=SFP19 +CWE363=SFP20 +CWE367=SFP20 +CWE370=SFP20 +CWE638=SFP20 +CWE765=SFP21 +CWE764=SFP21 +CWE585=SFP21 +CWE412=SFP22 +CWE311=SFP23 +CWE319=SFP23 +CWE523=SFP23 +CWE256=SFP23 +CWE257=SFP23 +CWE312=SFP23 +CWE313=SFP23 +CWE314=SFP23 +CWE315=SFP23 +CWE317=SFP23 +CWE642=SFP23 +CWE117=SFP23 +CWE532=SFP23 +CWE215=SFP23 +CWE497=SFP23 +CWE209=SFP23 +CWE210=SFP23 +CWE008=SFP23 +CWE214=SFP23 +CWE316=SFP23 +CWE403=SFP23 +CWE495=SFP23 +CWE498=SFP23 +CWE499=SFP23 +CWE501=SFP23 +CWE526=SFP23 +CWE591=SFP23 +CWE598=SFP23 +CWE607=SFP23 +CWE533=SFP23 +CWE534=SFP23 +CWE542=SFP23 +CWE374=SFP23 +CWE375=SFP23 +CWE014=SFP23 +CWE226=SFP23 +CWE244=SFP23 +CWE767=SFP23 +CWE093=SFP24 +CWE138=SFP24 +CWE140=SFP24 +CWE141=SFP24 +CWE142=SFP24 +CWE143=SFP24 +CWE144=SFP24 +CWE145=SFP24 +CWE146=SFP24 +CWE147=SFP24 +CWE148=SFP24 +CWE149=SFP24 +CWE150=SFP24 +CWE151=SFP24 +CWE152=SFP24 +CWE153=SFP24 +CWE154=SFP24 +CWE155=SFP24 +CWE156=SFP24 +CWE157=SFP24 +CWE158=SFP24 +CWE159=SFP24 +CWE160=SFP24 +CWE161=SFP24 +CWE162=SFP24 +CWE163=SFP24 +CWE164=SFP24 +CWE165=SFP24 +CWE641=SFP24 +CWE102=SFP24 +CWE103=SFP24 +CWE104=SFP24 +CWE105=SFP24 +CWE108=SFP24 +CWE109=SFP24 +CWE110=SFP24 +CWE554=SFP24 +CWE077=SFP24 +CWE078=SFP24 +CWE079=SFP24 +CWE080=SFP24 +CWE084=SFP24 +CWE086=SFP24 +CWE112=SFP24 +CWE113=SFP24 +CWE601=SFP24 +CWE644=SFP24 +CWE074=SFP24 +CWE081=SFP24 +CWE082=SFP24 +CWE083=SFP24 +CWE085=SFP24 +CWE087=SFP24 +CWE089=SFP24 +CWE090=SFP24 +CWE091=SFP24 +CWE095=SFP24 +CWE096=SFP24 +CWE099=SFP24 +CWE134=SFP24 +CWE564=SFP24 +CWE611=SFP24 +CWE619=SFP24 +CWE621=SFP24 +CWE624=SFP24 +CWE641=SFP24 +CWE643=SFP24 +CWE652=SFP24 +CWE015=SFP25 +CWE020=SFP25 +CWE454=SFP25 +CWE606=SFP25 +CWE496=SFP25 +CWE502=SFP25 +CWE616=SFP25 +CWE566=SFP25 +CWE494=SFP27 +CWE545=SFP27 +CWE622=SFP27 +CWE489=SFP28 +CWE531=SFP28 +CWE608=SFP28 +CWE491=SFP28 +CWE493=SFP28 +CWE500=SFP28 +CWE568=SFP28 +CWE580=SFP28 +CWE582=SFP28 +CWE583=SFP28 +CWE766=SFP28 +CWE247=SFP29 +CWE292=SFP29 +CWE293=SFP29 +CWE350=SFP29 +CWE360=SFP29 +CWE565=SFP29 +CWE422=SFP30 +CWE425=SFP30 +CWE306=SFP31 +CWE620=SFP31 +CWE605=SFP32 +CWE259=SFP33 +CWE321=SFP33 +CWE307=SFP34 +CWE285=SFP35 +CWE424=SFP35 +CWE272=SFP36 \ No newline at end of file diff --git a/com.kdmanalytics.toif.framework/bin/resources/default b/com.kdmanalytics.toif.framework/bin/resources/default new file mode 100644 index 00000000..3d690a17 --- /dev/null +++ b/com.kdmanalytics.toif.framework/bin/resources/default @@ -0,0 +1,36 @@ +########################### +# Facts +########################### + +TOIFSegmentIsRelatedToProject=project1 +TOIFSegmentIsProducedByOrganization=org1 +TOIFSegmentIsOwnedByOrganization=org1 +TOIFSegmentIsGeneratedByPerson=person1 +TOIFSegmentIsSupervisedByPerson=person1 + +PersonIsInvolvedInProjectAsRole=person1;project1;role1 +OrganizationIsInvolvedInProjectAsRole=org1;project1;role2 +OrganizationIsPartOfOrganizationAsRole=org1;org2;role2 +PersonIsEmployedByOrganizationAsRole=person1;org1;role1 + +########################### +# Entities +########################### + +SegmentDescription=Segment relating to the findings. + +#projectId=name;description +project1=project;project description. + +#personId=name;email;phone +person1=NoName;noName@domain.com;555-1234 + +#organizationId=name;description;address;phone;email +org1=Org;Org Inc;Road;555-5555;noName@domain.com + +#organizationId=name;description;address;phone;email +org2=Acme Corporation;Acme Corporation;blah;555-5555;thingamy@thingamy.com + +#roleId=name;description +role1=Software Developer;Developer +role2=company;employer diff --git a/com.kdmanalytics.toif.framework/build.properties b/com.kdmanalytics.toif.framework/build.properties new file mode 100644 index 00000000..d12be0d3 --- /dev/null +++ b/com.kdmanalytics.toif.framework/build.properties @@ -0,0 +1,10 @@ +source.. = src/,xml/ +output.. = bin/ +bin.includes = META-INF/,\ + .,\ + src/,\ + plugin.xml,\ + xml/ +src.includes = src/,\ + bin/,\ + xml/ diff --git a/com.kdmanalytics.toif.framework/plugin.xml b/com.kdmanalytics.toif.framework/plugin.xml new file mode 100644 index 00000000..ba6b38c1 --- /dev/null +++ b/com.kdmanalytics.toif.framework/plugin.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/com.kdmanalytics.toif.framework/pom.xml b/com.kdmanalytics.toif.framework/pom.xml new file mode 100644 index 00000000..383b88f9 --- /dev/null +++ b/com.kdmanalytics.toif.framework/pom.xml @@ -0,0 +1,21 @@ + + + + 4.0.0 + + + com.kdmanalytics.toif + plugins + 1.16.0-SNAPSHOT + + + com.kdmanalytics.toif.compile + com.kdmanalytics.toif.framework + + + eclipse-plugin + + Adaptor Framework + \ No newline at end of file diff --git a/com.kdmanalytics.toif.framework/schema/com.kdmanalytics.toif.adaptor.exsd b/com.kdmanalytics.toif.framework/schema/com.kdmanalytics.toif.adaptor.exsd new file mode 100644 index 00000000..db5c3223 --- /dev/null +++ b/com.kdmanalytics.toif.framework/schema/com.kdmanalytics.toif.adaptor.exsd @@ -0,0 +1,102 @@ + + + + + + + + + This extension point defines valid adaptor which supports the extraction of TOIF related data + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + [Enter the first release in which this extension point appears.] + + + + + + + + + [Enter extension point usage example here.] + + + + + + + + + [Enter API information here.] + + + + + + + + + [Enter information about supplied implementation of this extension point.] + + + + + diff --git a/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/Activator.java b/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/Activator.java new file mode 100644 index 00000000..be8d207c --- /dev/null +++ b/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/Activator.java @@ -0,0 +1,38 @@ +/******************************************************************************* + * ////////////////////////////////////////////////////////////////////////////////// + * // Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This program and the + * // accompanying materials are made available under the terms of the Open Source + * // Initiative OSI - Open Software License v3.0 which accompanies this + * // distribution, and is available at http://www.opensource.org/licenses/osl-3.0.php/ + * ////////////////////////////////////////////////////////////////////////////////// + ******************************************************************************/ +package com.kdmanalytics.toif.framework; + +import org.osgi.framework.BundleActivator; +import org.osgi.framework.BundleContext; + +public class Activator implements BundleActivator { + + private static BundleContext context; + + static BundleContext getContext() { + return context; + } + + /* + * (non-Javadoc) + * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext) + */ + public void start(BundleContext bundleContext) throws Exception { + Activator.context = bundleContext; + } + + /* + * (non-Javadoc) + * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext) + */ + public void stop(BundleContext bundleContext) throws Exception { + Activator.context = null; + } + +} diff --git a/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/config/houseKeeping b/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/config/houseKeeping new file mode 100644 index 00000000..59ece675 --- /dev/null +++ b/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/config/houseKeeping @@ -0,0 +1,44 @@ +########################### +# Facts +########################### + +TOIFSegmentIsRelatedToProject=project1 +TOIFSegmentIsProducedByOrganization=org1 +TOIFSegmentIsOwnedByOrganization=org2 +TOIFSegmentIsGeneratedByGenerator=generator1 +TOIFSegmentIsGeneratedByPerson=person1 +TOIFSegmentIsSupervisedByPerson=person2 + +PersonIsInvolvedInProjectAsRole=person1;project1;role1 +OrganizationIsInvolvedInProjectAsRole=org1;project1;role2 +AdaptorSupportsGenerator=generator1 +AdaptorIsSuppliedByVendor=vendor1 +GeneratorIsSuppliedByVendor=generator1;vendor1 +OrganizationIsPartOfOrganizationAsRole=org1;org2;role2 +PersonIsEmployedByOrganizationAsRole=person1;org1;role1 + +########################### +# Entities +########################### + +#projectId=name;description +project1=Test Project;The test project during development + +#generatorId=name;description;version +generator1=jlint;java checking;2.3 + +#personId=name;email;phone +person1=Adam Nunn;adam@kdmanalytics.com;555-1234 +person2=Joe Bloggs;blogs@kdmanalytics.com;555-1234 + +#organizationId=name;description;address;email;phone +org1=KDM;Kdm Analytics;Richmond;kdm@kdmanalytics.com;555-5555 + +#organizationId=name;description;address;email;phone +org2=Acme;Acme Analytics;blah;thingamy@thingamy.com;555-5555 + +#roleId=name;description +role1=developer;programmer +role2=company;employer + +vendor1=Me;Kdm Analytics;Richmond;kdm@kdmanalytics.com;555-5555 \ No newline at end of file diff --git a/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/parser/StreamGobbler.java b/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/parser/StreamGobbler.java new file mode 100644 index 00000000..d85c94a9 --- /dev/null +++ b/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/parser/StreamGobbler.java @@ -0,0 +1,90 @@ +/******************************************************************************* + * ///////////////////////////////////////////////////////////////////////////// + * ///// // Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This + * program and the // accompanying materials are made available under the terms + * of the Open Source // Initiative OSI - Open Software License v3.0 which + * accompanies this // distribution, and is available at + * http://www.opensource.org/licenses/osl-3.0.php/ + * ////////////////////////////// + * //////////////////////////////////////////////////// + ******************************************************************************/ + +package com.kdmanalytics.toif.framework.parser; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.OutputStream; +import java.io.PrintWriter; + +/** + * Stream gobbler example to keep the output of the tool flowing. + * + * @author Adam Nunn + */ +public class StreamGobbler implements Runnable +{ + + private BufferedReader is; + + private OutputStream os; + + /** + * stream gobbler constructor takes an input stream + * + * @param is + */ + StreamGobbler(InputStream is) + { + this(is, null); + } + + /** + * takes input and output stream. + * + * @param is + * @param redirect + */ + public StreamGobbler(InputStream is, OutputStream redirect) + { + this.is = new BufferedReader(new InputStreamReader(is)); + this.os = redirect; + } + + /** + * run the gobbler. + */ + public void run() + { + try + { + PrintWriter pw = null; + if (os != null) + { + pw = new PrintWriter(os); + } + + String line = is.readLine(); + while (line != null) + { + if (pw != null) + { + pw.println(line); + + } + line = is.readLine(); + + } + if (pw != null) + { + pw.flush(); + } + + } + catch (IOException e) + { + System.err.println(e); + } + } +} diff --git a/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/toolAdaptor/AbstractAdaptor.java b/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/toolAdaptor/AbstractAdaptor.java new file mode 100644 index 00000000..987a964b --- /dev/null +++ b/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/toolAdaptor/AbstractAdaptor.java @@ -0,0 +1,235 @@ +/******************************************************************************* + * ///////////////////////////////////////////////////////////////////////////// + * ///// // Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This + * program and the // accompanying materials are made available under the terms + * of the Open Source // Initiative OSI - Open Software License v3.0 which + * accompanies this // distribution, and is available at + * http://www.opensource.org/licenses/osl-3.0.php/ + * ////////////////////////////// + * //////////////////////////////////////////////////// + ******************************************************************************/ + +package com.kdmanalytics.toif.framework.toolAdaptor; + +import java.io.IOException; +import java.net.URL; +import java.util.ArrayList; +import java.util.Properties; + +import com.kdmanalytics.toif.common.exception.ToifException; +import com.kdmanalytics.toif.framework.xmlElements.entities.Element; +import com.kdmanalytics.toif.framework.xmlElements.entities.File; + +/** + * abstract class outlining the adaptor classes. + * + * @author "Adam Nunn " + * + */ +public abstract class AbstractAdaptor +{ + + public ArrayList parse(AbstractAdaptor abstractAdaptor, java.io.File process, AdaptorOptions options, File file, boolean[] validLines, + boolean unknownCWE) throws ToifException + { + ArrayList elements = abstractAdaptor.parse(process, options, file, validLines, unknownCWE); + + return elements; + } + + /** + * get the language this adaptor works on. + */ + public abstract Language getLanguage(); + + /** + * get the name to be run from the command line. + * + * @return return the string of the name of the tool to be run from the + * command line. + */ + public abstract String getRuntoolName(); + + /** + * get the adaptor description for housekeeping + * + * @return + */ + public abstract String getAdaptorDescription(); + + /** + * Get the adaptor name for housekeeping + * + * @return + */ + public abstract String getAdaptorName(); + + /** + * get the address of the vendor0 + * + * @return the address of the vendor for this adaptor + */ + public abstract String getAdaptorVendorAddress(); + + /** + * get the vendor's description. + * + * @return the vendor's description for this adaptor + */ + public abstract String getAdaptorVendorDescription(); + + /** + * get the vendors email address. + * + * @return the email address for this adaptor. + */ + public abstract String getAdaptorVendorEmail(); + + /** + * get the vendor's name + * + * @return the name of the vendor for this adaptor + */ + public abstract String getAdaptorVendorName(); + + /** + * get the vendor's phone number + * + * @return the vendors phone number for this adaptor + */ + public abstract String getAdaptorVendorPhone(); + + /** + * get the adaptor version for housekeeping. + * + * @return the version + */ + public String getAdaptorVersion() { + return "1.8.7"; + } + + /** + * get the generators description. + * + * @return the description + */ + public abstract String getGeneratorDescription(); + + /** + * get the generators name + * + * @return the generators name. + */ + public abstract String getGeneratorName(); + + /** + * get the address of the generator vendor0 + * + * @return the address of the generator vendor for this adaptor + */ + public abstract String getGeneratorVendorAddress(); + + /** + * get the generator vendor's description. + * + * @return the generator vendor's description for this adaptor + */ + public abstract String getGeneratorVendorDescription(); + + /** + * get the generator vendors email address. + * + * @return the email address for this adaptor. + */ + public abstract String getGeneratorVendorEmail(); + + /** + * get the generator vendor's name + * + * @return the name of the generator vendor for this adaptor + */ + public abstract String getGeneratorVendorName(); + + /** + * get the generator vendor's phone number + * + * @return the generator vendors phone number for this adaptor + */ + public abstract String getGeneratorVendorPhone(); + + /** + * get the generators version + * + * @return the version of the generator + */ + public abstract String getGeneratorVersion(); + + /** + * Get the properties file. This needs to be given set in the + * FindingCreator. + * + * @return + */ + public Properties getProperties() + { + // get the properties. + Properties props = new Properties(); + // load the configuration into the properties + URL url = null; + try + { + props.load(getClass().getResourceAsStream("/config/" + getClass().getSimpleName() + "Configuration")); + } + catch (final IOException e) + { + System.err.println("Could not find configuration file! " + url); + e.printStackTrace(); + } + catch (Exception e) + { + System.err.println("Could not find configuration file! " + url); + e.printStackTrace(); + } + return props; + } + + /** + * Create a specific parser for the tool. It must return an arraylist of the + * elements. These can be generated using the FindingCreator. + * @param adaptorImpl + * + * @param file + * @param validLines + * @param unknownCWE + * + * @return + * @throws ToifException + */ + public abstract ArrayList parse(java.io.File process, AdaptorOptions options, File file, boolean[] validLines, boolean unknownCWE) throws ToifException; + + /** + * construct the command to run the vulnerability detection tool. + * + * @param options + * Options handed to the adaptor from the command line. Tool, + * Sources, Output. + * @param otherOpts + * @return The commands to run the tool as a String array. + */ + public abstract String[] runToolCommands(AdaptorOptions options, String[] otherOpts); + + /** + * does this adaptor accept -D options. + * + * @return true if this adaptor accepts -D options + */ + public abstract boolean acceptsDOptions(); + + /** + * does this adaptor accept -I options. + * + * @return true if this adaptor accepts -I options. + */ + public abstract boolean acceptsIOptions(); + +} diff --git a/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/toolAdaptor/AdaptorOptions.java b/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/toolAdaptor/AdaptorOptions.java new file mode 100644 index 00000000..a14c4cae --- /dev/null +++ b/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/toolAdaptor/AdaptorOptions.java @@ -0,0 +1,72 @@ +/******************************************************************************* + * ///////////////////////////////////////////////////////////////////////////// + * ///// // Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This + * program and the // accompanying materials are made available under the terms + * of the Open Source // Initiative OSI - Open Software License v3.0 which + * accompanies this // distribution, and is available at + * http://www.opensource.org/licenses/osl-3.0.php/ + * ////////////////////////////// + * //////////////////////////////////////////////////// + ******************************************************************************/ + +package com.kdmanalytics.toif.framework.toolAdaptor; + +import java.io.File; + +import com.lexicalscope.jewel.cli.CommandLineInterface; +import com.lexicalscope.jewel.cli.Option; + +/** + * Define the commands which can be used. + * + * @author adam + * + */ +@CommandLineInterface(application = "adaptor") +public interface AdaptorOptions +{ + + /** + * The output directory for the toif files. + * + * @return + */ + @Option(shortName = "o", description = "Where to output the toif files.") + File getOutputDirectory(); + + /** + * The full path to the input files. + * + * @return + */ + @Option(shortName = "i", description = "Full path to the file or files to run the vulnerability dection tool on.") + File getInputFile(); + + /** + * class name of the adaptor to run. + * + * @return + */ + @Option(shortName = "a", description = "Name of the adaptor to run.") + File getAdaptor(); + + /** + * the housekeeping file to use. + * + * @return + */ + @Option(shortName = "h", description = "The location of the house-keeping file") + File getHouseKeeping(); + + @Option(shortName = "n", description = "Rename the file as this.") + String getRename(); + boolean isRename(); + + @Option + boolean getUnknownCWE(); + boolean isUnknownCWE(); + + + + +} diff --git a/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/toolAdaptor/Language.java b/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/toolAdaptor/Language.java new file mode 100644 index 00000000..be3acfb3 --- /dev/null +++ b/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/toolAdaptor/Language.java @@ -0,0 +1,7 @@ +package com.kdmanalytics.toif.framework.toolAdaptor; + +public enum Language + { + // We treat C & C++ as the same + C, JAVA, UNKNOWN; + } diff --git a/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/toolAdaptor/ToolAdaptor.java b/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/toolAdaptor/ToolAdaptor.java new file mode 100644 index 00000000..d8f6d8c9 --- /dev/null +++ b/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/toolAdaptor/ToolAdaptor.java @@ -0,0 +1,1440 @@ +/******************************************************************************* + * ///////////////////////////////////////////////////////////////////////////// + * ///// // Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This + * program and the // accompanying materials are made available under the terms + * of the Open Source // Initiative OSI - Open Software License v3.0 which + * accompanies this // distribution, and is available at + * http://www.opensource.org/licenses/osl-3.0.php/ + * ////////////////////////////// + * //////////////////////////////////////////////////// + ******************************************************************************/ + +package com.kdmanalytics.toif.framework.toolAdaptor; + +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.FileOutputStream; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.Hashtable; +import java.util.List; +import java.util.Properties; + +import javax.xml.bind.JAXBContext; +import javax.xml.bind.JAXBException; +import javax.xml.bind.Marshaller; + +import org.apache.commons.lang3.SystemUtils; +import org.apache.log4j.Logger; + +import com.kdmanalytics.toif.common.exception.ToifException; +import com.kdmanalytics.toif.framework.utils.ElementComparator; +import com.kdmanalytics.toif.framework.xmlElements.entities.Adaptor; +import com.kdmanalytics.toif.framework.xmlElements.entities.Address; +import com.kdmanalytics.toif.framework.xmlElements.entities.CWEIdentifier; +import com.kdmanalytics.toif.framework.xmlElements.entities.Checksum; +import com.kdmanalytics.toif.framework.xmlElements.entities.ClusterIdentifier; +import com.kdmanalytics.toif.framework.xmlElements.entities.CodeLocation; +import com.kdmanalytics.toif.framework.xmlElements.entities.DataElement; +import com.kdmanalytics.toif.framework.xmlElements.entities.Date; +import com.kdmanalytics.toif.framework.xmlElements.entities.Description; +import com.kdmanalytics.toif.framework.xmlElements.entities.Directory; +import com.kdmanalytics.toif.framework.xmlElements.entities.Element; +import com.kdmanalytics.toif.framework.xmlElements.entities.EmailAddress; +import com.kdmanalytics.toif.framework.xmlElements.entities.Entity; +import com.kdmanalytics.toif.framework.xmlElements.entities.File; +import com.kdmanalytics.toif.framework.xmlElements.entities.Finding; +import com.kdmanalytics.toif.framework.xmlElements.entities.Generator; +import com.kdmanalytics.toif.framework.xmlElements.entities.LineNumber; +import com.kdmanalytics.toif.framework.xmlElements.entities.Name; +import com.kdmanalytics.toif.framework.xmlElements.entities.Offset; +import com.kdmanalytics.toif.framework.xmlElements.entities.Organization; +import com.kdmanalytics.toif.framework.xmlElements.entities.Person; +import com.kdmanalytics.toif.framework.xmlElements.entities.Position; +import com.kdmanalytics.toif.framework.xmlElements.entities.Project; +import com.kdmanalytics.toif.framework.xmlElements.entities.Role; +import com.kdmanalytics.toif.framework.xmlElements.entities.SFPIdentifier; +import com.kdmanalytics.toif.framework.xmlElements.entities.Segment; +import com.kdmanalytics.toif.framework.xmlElements.entities.Statement; +import com.kdmanalytics.toif.framework.xmlElements.entities.Text; +import com.kdmanalytics.toif.framework.xmlElements.entities.Vendor; +import com.kdmanalytics.toif.framework.xmlElements.entities.WeaknessDescription; +import com.kdmanalytics.toif.framework.xmlElements.facts.AdaptorIsSuppliedByVendor; +import com.kdmanalytics.toif.framework.xmlElements.facts.AdaptorSupportsGenerator; +import com.kdmanalytics.toif.framework.xmlElements.facts.CodeLocationReferencesFile; +import com.kdmanalytics.toif.framework.xmlElements.facts.DataElementIsInvolvedInFinding; +import com.kdmanalytics.toif.framework.xmlElements.facts.DataElementIsInvolvedInStatement; +import com.kdmanalytics.toif.framework.xmlElements.facts.DirectoryIsContainedInDirectory; +import com.kdmanalytics.toif.framework.xmlElements.facts.Fact; +import com.kdmanalytics.toif.framework.xmlElements.facts.FileIsContainedInDirectory; +import com.kdmanalytics.toif.framework.xmlElements.facts.FindingHasCWEIdentifier; +import com.kdmanalytics.toif.framework.xmlElements.facts.FindingHasClusterIdentifier; +import com.kdmanalytics.toif.framework.xmlElements.facts.FindingHasCodeLocation; +import com.kdmanalytics.toif.framework.xmlElements.facts.FindingHasSFPIdentifier; +import com.kdmanalytics.toif.framework.xmlElements.facts.FindingIsDescribedByWeaknessDescription; +import com.kdmanalytics.toif.framework.xmlElements.facts.GeneratorIsSuppliedByVendor; +import com.kdmanalytics.toif.framework.xmlElements.facts.OrganizationIsInvolvedInProjectAsRole; +import com.kdmanalytics.toif.framework.xmlElements.facts.OrganizationIsPartOfOrganizationAsRole; +import com.kdmanalytics.toif.framework.xmlElements.facts.PersonIsEmployedByOrganizationAsRole; +import com.kdmanalytics.toif.framework.xmlElements.facts.PersonIsInvolvedInProjectAsRole; +import com.kdmanalytics.toif.framework.xmlElements.facts.StatementHasCodeLocation; +import com.kdmanalytics.toif.framework.xmlElements.facts.StatementIsInvolvedInFinding; +import com.kdmanalytics.toif.framework.xmlElements.facts.StatementIsProceededByStatement; +import com.kdmanalytics.toif.framework.xmlElements.facts.StatementIsSinkInFinding; +import com.kdmanalytics.toif.framework.xmlElements.facts.TOIFSegmentIsCreatedAtDate; +import com.kdmanalytics.toif.framework.xmlElements.facts.TOIFSegmentIsGeneratedByGenerator; +import com.kdmanalytics.toif.framework.xmlElements.facts.TOIFSegmentIsGeneratedByPerson; +import com.kdmanalytics.toif.framework.xmlElements.facts.TOIFSegmentIsOwnedByOrganization; +import com.kdmanalytics.toif.framework.xmlElements.facts.TOIFSegmentIsProcessedByAdaptor; +import com.kdmanalytics.toif.framework.xmlElements.facts.TOIFSegmentIsProducedByOrganization; +import com.kdmanalytics.toif.framework.xmlElements.facts.TOIFSegmentIsRelatedToProject; +import com.kdmanalytics.toif.framework.xmlElements.facts.TOIFSegmentIsSupervisedByPerson; +import com.kdmanalytics.toif.framework.xmlElements.facts.TOIFSegmentReferencesFile; +import com.lexicalscope.jewel.cli.ArgumentValidationException; +import com.lexicalscope.jewel.cli.Cli; +import com.lexicalscope.jewel.cli.CliFactory; + +/** + * The main guts of the Adaptor. Creates much of the housekeeping and calls of + * the implementation of the specific adaptor to get the finding elements. + * + * @author Adam Nunn + * + */ + +public class ToolAdaptor +{ + /** + * the logger. + */ + private static Logger LOG = Logger.getLogger(ToolAdaptor.class); + /** + * The implementation of the specific adaptor. + */ + AbstractAdaptor adaptorImpl = null; + + /** + * the created elements + */ + ArrayList elements = new ArrayList(); + + /** + * housekeeping facts + */ + Properties houseKeeping = null; + + /** + * the table containing all the elements to be converted to xml + */ + Hashtable housekeepingElements = new Hashtable(); + + /** + * the options given to main. + */ + AdaptorOptions options = null; + + /** + * the root segment + */ + private Segment segment = new Segment(); + + /** + * additional options from command line + */ + private String[] otherOpts = null; + + private java.io.File workingDirectory = null; + + private boolean[] validLines; + + /** + * Constructor of the adaptor. Takes the arguments from main, extracts the + * options from it, generates the translation table, and runs the tool. + * + * @param args + * - The arguments from main. + */ + public ToolAdaptor() + { + } + + public ToolAdaptor(AbstractAdaptor adaptor) + { + this.adaptorImpl = adaptor; + } + + public boolean runToolAdaptor(String[] args) throws ToifException + { + // get the options provided to main. + try + { + setOptions(args); + } + catch (ArgumentValidationException e) + { + System.err.println("Incorrect arguments"); + return false; + } + + // from options + Class adaptorClass = getAdaptorClass(); + + setAdaptorImplementation(adaptorClass); + + createFacts(null); + + File file = createSegmentFile(); + + // run the tool. + final java.io.File process = runTool(); + + if (process == null) + { + System.err.println("unable to run the scan tool, or no tool needs to be run."); + return false; + } + + getElementsFromParse(process, file); + + // construct the xml. + constructXml(); + + return true; + } + + public boolean runToolAdaptor(AbstractAdaptor adaptor, List arguments, java.io.File workingDirectory, boolean[] validLines) throws ToifException + { + // spoof the adaptor option at the beginning. + arguments.add(0, "-a"); + arguments.add(1, adaptor.getAdaptorName()); + + this.validLines = validLines; + + this.workingDirectory = workingDirectory; + + String[] args = arguments.toArray(new String[arguments.size()]); + + // get the options provided to main. + try + { + setOptions(args); + } + catch (ArgumentValidationException e) + { + System.err.println("Incorrect arguments"); + return false; + } + + setAdaptorImplementation(adaptor); + + createFacts(null); + + File file = createSegmentFile(); + + // run the tool. + final java.io.File process = runTool(); + + if (process == null) + { + System.err.println("unable to run the scan tool, or no tool needs to be run."); + return false; + } + + getElementsFromParse(process, file); + + // construct the xml. + constructXml(); + + return true; + } + + /** + * Get all the elements from the parsing of the input file by the adaptor. + * + * @param process + * the scan tool process + * @param file + * The file that the segment is working on. + * @throws ToifException + */ + public void getElementsFromParse(java.io.File process, File file) throws ToifException + { + + /* + * put all the elements and facts generated from the parse phase into + * the elements hashtable. + */ + ArrayList parse = parse(process, file); + if (parse != null) + { + elements.addAll(parse); + } + } + + /** + * create the house keeping facts. + * + * @param housekeepingFile + * @throws ToifException + */ + public void createFacts(java.io.File housekeepingFile) throws ToifException + { + try + { + houseKeeping = getHousekeepingProperties(housekeepingFile); + + // creates the housekeeping facts and elements + getHouseKeepingFacts(); + + // creates the project facts and elements + getProjectFacts(); + + // creates the tool facts and elements + getToolFacts(); + + // creates the facts and elements about the organization + getOrganizationFacts(); + + // creates the facts and elements about the person + getPersonFacts(); + } + catch (final NullPointerException e) + { + if (options != null) + { + System.err.println(options.getAdaptor().toString() + ": The house-keeping file is missing some properties. "); + e.printStackTrace(); + } + else + { + System.err.println("The house-keeping file is missing some properties. "); + e.printStackTrace(); + } + } + } + + /** + * get an implementation of the adaptor class in use. + * + * @param adaptorClass + * @throws ToifException + */ + public void setAdaptorImplementation(Class adaptorClass) throws ToifException + { + // try to create an instance of the adaptor class. + try + { + adaptorImpl = (AbstractAdaptor) adaptorClass.newInstance(); + } + catch (final InstantiationException | IllegalAccessException e1) + { + final String msg = options.getAdaptor().toString() + ": Adaptor not found!"; + LOG.error( msg, e1 ); + throw new ToifException( msg ); + + } + } + + public void setAdaptor(AbstractAdaptor adaptor) + { + adaptorImpl = adaptor; + } + + /** + * set the adaptor to use. + * + * @param adaptor + */ + public void setAdaptorImplementation(AbstractAdaptor adaptor) + { + adaptorImpl = adaptor; + } + + public Class getAdaptorClass() throws ToifException + { + Class adaptorClass = null; + String adaptor = null; + try + { + // get the class name from the options. + adaptor = options.getAdaptor().toString(); + + adaptorClass = Class.forName(adaptor); + + } + catch (final ClassNotFoundException e1) + { + final String msg = adaptor + ": Adaptor not found!"; + LOG.error( msg, e1 ); + throw new ToifException( msg ); + + } + catch (Exception e) + { + final String msg = "Error reading arguments."; + LOG.error( msg, e); + throw new ToifException( msg ); + + } + return adaptorClass; + } + + /** + * Adds a description to the segment if a description is present in the + * housekeeping file. + * + * @param houseKeeping + * the housekeeping property file. + */ + private void addSegmentDescription(Properties houseKeeping) + { + final String segmentDescription = houseKeeping.getProperty("SegmentDescription"); + + if (segmentDescription != null) + { + segment.setDescription(segmentDescription); + } + + } + + /** + * Tries to find a matching element in the elements which have been created + * already. If it does find one, it returns it. Otherwise, it returns the + * elements which was passed into it. + * + * @param element + * The element you want to check is in the elements list. + * @return returns either the element or a matching element. + */ + Element addToList(Element element) + { + // check to make sure the entity is not in the table. + if (housekeepingElements.containsKey(element.hashCode())) + { + return housekeepingElements.get(element.hashCode()); + } + else + { + housekeepingElements.put(element.hashCode(), element); + return element; + } + } + + /** + * Since all the entities and facts are in the elements hashtable, we can + * add them to the root segment and generate the xml for the ouput. + * @throws ToifException + */ + public void constructXml() throws ToifException + { + // String outDirPath = options.getOutputDirectory().getPath() + + // java.io.File.separator + adaptorImpl.getAdaptorName(); + String outDirPath = options.getOutputDirectory().getPath(); + java.io.File outDir = new java.io.File(outDirPath); + outDir.mkdirs(); + + java.io.File outFile = null; + + if (options.isRename()) + { + outFile = new java.io.File(outDirPath, options.getRename() + "." + adaptorImpl.getRuntoolName() + ".toif.xml"); + } + else + { + outFile = new java.io.File(outDirPath, options.getInputFile().getName() + "." + adaptorImpl.getRuntoolName() + ".toif.xml"); + } + // java.io.File houseKeepingFile = new java.io.File(outDirPath, + // "GENERAL_INFORMATION.toif.xml"); + + // change the hashtable to an arrayList inorder to sort them. + final ArrayList results = new ArrayList(housekeepingElements.values()); + // marshall(houseKeepingFile, results); + results.addAll(elements); + + marshall(outFile, results); + // results.addAll(elements); + + } + + /** + * Since all the entities and facts are in the elements hashtable, we can + * add them to the root segment and generate the xml for the ouput. + * @throws ToifException + */ + public void constructXml(java.io.File outputDir, java.io.File outputFile) throws ToifException + { + outputDir.mkdirs(); + java.io.File houseKeepingFile = new java.io.File(outputDir, "GENERAL_INFORMATION.toif.xml"); + java.io.File outFile = new java.io.File(outputDir, outputFile.getName() + ".toif.xml"); + + // change the hashtable to an arrayList inorder to sort them. + final ArrayList results = new ArrayList(housekeepingElements.values()); + marshall(houseKeepingFile, results); + marshall(outFile, elements); + // results.addAll(elements); + + } + + /** + * Find the directories the files are in. + * + * + * @param newFile + * the file for which the containment will be determined. + */ + private void containedIn(File file) + { + if (file.getParent() == null) + { + return; + } + + Directory directory = new Directory(file.getParent()); + elements.add(directory); + + Fact fact = new FileIsContainedInDirectory(file, directory); + elements.add(fact); + + // find all the directories containing directories. + while (directory.getParent() != null) + { + // create the entities and facts. + Directory directory2 = new Directory(directory.getParent()); + elements.add(directory2); + + DirectoryIsContainedInDirectory directoryContainedInDirectory = new DirectoryIsContainedInDirectory(directory, directory2); + elements.add(directoryContainedInDirectory); + + directory = directory2; + } + } + + /** + * Create the adaptor entity and the TOIFSegmentIsProducedByAdaptor fact. + */ + private void createAdaptor() + { + final Adaptor adaptor = new Adaptor(); + adaptor.setName(adaptorImpl.getAdaptorName()); + adaptor.setDescription(adaptorImpl.getAdaptorDescription()); + adaptor.setVersion(adaptorImpl.getAdaptorVersion()); + + housekeepingElements.put(adaptor.hashCode(), adaptor); + final Fact fact = new TOIFSegmentIsProcessedByAdaptor(segment, adaptor); + housekeepingElements.put(fact.hashCode(), fact); + + } + + /** + * Create the AdaptorIsSuppliedByVendor fact and its entities. + * + * @param props + * the properties file. + */ + private void createAdaptorIsSuppliedByVendor(Properties props) + { + // create the entities for the fact. + final Adaptor adaptor = (Adaptor) addToList(new Adaptor(adaptorImpl.getAdaptorName(), adaptorImpl.getAdaptorDescription(), + adaptorImpl.getAdaptorVersion())); + final Vendor vendor = (Vendor) addToList(new Vendor(adaptorImpl.getAdaptorVendorName(), adaptorImpl.getAdaptorVendorDescription(), + adaptorImpl.getAdaptorVendorAddress(), adaptorImpl.getAdaptorVendorPhone(), adaptorImpl.getAdaptorVendorEmail())); + + // create the fact + final Fact fact = new AdaptorIsSuppliedByVendor(adaptor, vendor); + // add the fact. + housekeepingElements.put(fact.hashCode(), fact); + } + + /** + * create the AdaptorSupportsGenerator fact and its entities. + * + * @param props + * the properties file. + */ + private void createAdaptorSupportsGenerator(Properties props) throws NullPointerException + { + // create the entities. + final Generator gen = (Generator) addToList(new Generator(adaptorImpl.getGeneratorName(), adaptorImpl.getGeneratorDescription(), + adaptorImpl.getGeneratorVersion())); + final Adaptor adaptor = (Adaptor) addToList(new Adaptor(adaptorImpl.getAdaptorName(), adaptorImpl.getAdaptorDescription(), + adaptorImpl.getAdaptorVersion())); + + // create the fact + final Fact fact = new AdaptorSupportsGenerator(adaptor, gen); + // add the fact. + housekeepingElements.put(fact.hashCode(), fact); + + } + + /** + * create the date facts and entities. + */ + private void createDate() + { + final Date date = new Date(); + + elements.add(date); + final Fact fact = new TOIFSegmentIsCreatedAtDate(segment, date); + elements.add(fact); + + } + + /** + * Create the GeneratorIsSuppliedByVendor fact and its entities. + * + * @param props + * the property file + */ + private void createGeneratorIsSuppliedByVendor(Properties props) + { + // create the entities for this fact. + final Generator gen = (Generator) addToList(new Generator(adaptorImpl.getGeneratorName(), adaptorImpl.getGeneratorDescription(), + adaptorImpl.getGeneratorVersion())); + final Vendor vendor = (Vendor) addToList(new Vendor(adaptorImpl.getGeneratorVendorName(), adaptorImpl.getGeneratorVendorDescription(), + adaptorImpl.getGeneratorVendorAddress(), adaptorImpl.getGeneratorVendorPhone(), adaptorImpl.getGeneratorVendorEmail())); + + // add the fact. + final Fact fact = new GeneratorIsSuppliedByVendor(gen, vendor); + housekeepingElements.put(fact.hashCode(), fact); + } + + /** + * create the OrganizationIsInvolvedInProjectAsRole fact and its entities. + * + * @param props + * the properties file. + */ + private void createOrganizationIsInvolvedInProjectAsRole(Properties props) throws NullPointerException + { + // get the information from the properties file. + final String[] factDetails = props.getProperty("OrganizationIsInvolvedInProjectAsRole").split(";"); + final String[] organizationDetails = props.getProperty(factDetails[0]).split(";"); + final String[] projectDetails = props.getProperty(factDetails[1]).split(";"); + final String[] roleDetails = props.getProperty(factDetails[2]).split(";"); + + // create the entities. + final Organization organization = (Organization) addToList(new Organization(organizationDetails[0], organizationDetails[1], + organizationDetails[2], organizationDetails[3], organizationDetails[4])); + final Project project = (Project) addToList(new Project(projectDetails[0], projectDetails[1])); + final Role role = (Role) addToList(new Role(roleDetails[0], roleDetails[1])); + + // create the fact. + final Fact fact = new OrganizationIsInvolvedInProjectAsRole(organization, project, role); + // add the fact. + housekeepingElements.put(fact.hashCode(), fact); + + } + + /** + * Create the OrganizationIsPartOfOrganizationAsRole fact and its entities. + * + * @param props + * the properties file. + */ + private void createOrganizationIsPartOfOrganizationAsRole(Properties props) throws NullPointerException + { + // extract the information from the properties file. + final String[] factDetails = props.getProperty("OrganizationIsPartOfOrganizationAsRole").split(";"); + final String[] org1Details = props.getProperty(factDetails[0]).split(";"); + final String[] org2Details = props.getProperty(factDetails[1]).split(";"); + final String[] roleDetails = props.getProperty(factDetails[2]).split(";"); + + // create the entities relating to this fact. + final Organization org1 = (Organization) addToList(new Organization(org1Details[0], org1Details[1], org1Details[2], org1Details[3], + org1Details[4])); + final Organization org2 = (Organization) addToList(new Organization(org2Details[0], org2Details[1], org2Details[2], org2Details[3], + org2Details[4])); + final Role role = (Role) addToList(new Role(roleDetails[0], roleDetails[1])); + + // create the fact + final Fact fact = new OrganizationIsPartOfOrganizationAsRole(org1, org2, role); + // add the fact to the table. + housekeepingElements.put(fact.hashCode(), fact); + + } + + /** + * Create the PersonIsEmployedByOrganizationAsRole fact and it's entities. + * + * @param props + * The Properties file. + */ + private void createPersonIsEmployedByOrganizationAsRole(Properties props) throws NullPointerException + { + // extract the information from the properties file. + final String[] factDetails = props.getProperty("PersonIsEmployedByOrganizationAsRole").split(";"); + final String[] personDetails = props.getProperty(factDetails[0]).split(";"); + final String[] org1Details = props.getProperty(factDetails[1]).split(";"); + final String[] roleDetails = props.getProperty(factDetails[2]).split(";"); + + // create the required entities. + final Person person = (Person) addToList(new Person(personDetails[0], personDetails[1], personDetails[2])); + final Organization org1 = (Organization) addToList(new Organization(org1Details[0], org1Details[1], org1Details[2], org1Details[3], + org1Details[4])); + final Role role = (Role) addToList(new Role(roleDetails[0], roleDetails[1])); + + // create the fact, and add it to the table. + final Fact fact = new PersonIsEmployedByOrganizationAsRole(person, org1, role); + housekeepingElements.put(fact.hashCode(), fact); + + } + + /** + * create the PersonIsInvolvedInProjectAsRole fact and entities. + * + * @param props + * the properties file. + */ + private void createPersonIsInvolvedInProjectAsRole(Properties props) throws NullPointerException + { + // get the information from the properties file. + final String[] factDetails = props.getProperty("PersonIsInvolvedInProjectAsRole").split(";"); + final String[] personDetails = props.getProperty(factDetails[0]).split(";"); + final String[] projectDetails = props.getProperty(factDetails[1]).split(";"); + final String[] roleDetails = props.getProperty(factDetails[2]).split(";"); + + // create the entities. + final Person person = (Person) addToList(new Person(personDetails[0], personDetails[1], personDetails[2])); + final Project project = (Project) addToList(new Project(projectDetails[0], projectDetails[1])); + final Role role = (Role) addToList(new Role(roleDetails[0], roleDetails[1])); + + // create the fact. + final Fact fact = new PersonIsInvolvedInProjectAsRole(person, project, role); + // add the fact. + housekeepingElements.put(fact.hashCode(), fact); + } + + /** + * Creates the file that the segment is for. + * + * @return the file-element. + */ + public File createSegmentFile() + { + File file = new File(options.getInputFile().getPath()); + + return file; + } + + /** + * Creates the file that the segment is for. + * + * @return the file-element. + */ + public File createSegmentFile(java.io.File segmentFile) + { + File file = new File(segmentFile.getPath()); + elements.add(file); + + Fact fact = new TOIFSegmentReferencesFile(segment, file); + elements.add(fact); + + containedIn(file); + + return file; + } + + /** + * Create the fact and entities for the generator that generated the + * segment. + * + * @param props + * @throws NullPointerException + */ + private void createSegmentIsGeneratedByGenerator(Properties props) throws NullPointerException + { + // create a new generator. the addToList() method makes sure that there + // is only one of this generator in the list. + final Generator gen = (Generator) addToList(new Generator(adaptorImpl.getGeneratorName(), adaptorImpl.getGeneratorDescription(), + adaptorImpl.getGeneratorVersion())); + + // create the fact linking the generator and segment. + final Fact fact = new TOIFSegmentIsGeneratedByGenerator(segment, gen); + + // add the generator to the housekeeping elements. + housekeepingElements.put(fact.hashCode(), fact); + } + + /** + * create the SegmentIsGeneratedByPerson fact and its entities. + * + * @param props + * the properties file. + */ + private void createSegmentIsGeneratedByPerson(Properties props) throws NullPointerException + { + // get the information from the properties file. + final String personName = props.getProperty("TOIFSegmentIsGeneratedByPerson"); + final String[] personDetails = props.getProperty(personName).split(";"); + + // create the entity relating to this fact. + final Person person = (Person) addToList(new Person(personDetails[0], personDetails[1], personDetails[2])); + + final Fact fact = new TOIFSegmentIsGeneratedByPerson(segment, person); + + // add the fact. + housekeepingElements.put(fact.hashCode(), fact); + + } + + /** + * create the SegmentIsOwnedByOrganization fact and it's entities. + * + * @param props + * the properties file. + */ + private void createSegmentIsOwnedByOrganization(Properties props) throws NullPointerException + { + // get the information from the properties file. + final String orgName = props.getProperty("TOIFSegmentIsOwnedByOrganization"); + final String[] orgDetails = props.getProperty(orgName).split(";"); + + // create the entity + final Organization organization = (Organization) addToList(new Organization(orgDetails[0], orgDetails[1], orgDetails[2], orgDetails[3], + orgDetails[4])); + + final Fact fact = new TOIFSegmentIsOwnedByOrganization(segment, organization); + + // add the fact to the table. + housekeepingElements.put(fact.hashCode(), fact); + + } + + /** + * create the SegmentIsProducedByOrganization fact and entities. + * + * @param props + * properties file + */ + private void createSegmentIsProducedByOrganization(Properties props) throws NullPointerException + { + // get the information from the properties file. + final String orgName = props.getProperty("TOIFSegmentIsProducedByOrganization"); + final String[] orgDetails = props.getProperty(orgName).split(";"); + + // create the entity + final Organization organization = (Organization) addToList(new Organization(orgDetails[0], orgDetails[1], orgDetails[2], orgDetails[3], + orgDetails[4])); + + final Fact fact = new TOIFSegmentIsProducedByOrganization(segment, organization); + + // add the fact to the table. + housekeepingElements.put(fact.hashCode(), fact); + + } + + /** + * create the SegmentIsRelatedToProject fact and its entities. + * + * @param housekeeping + * the properties file. + * @throws ToifException + */ + private void createSegmentIsRelatedToProject(Properties housekeeping) throws NullPointerException, ToifException + { + // get the information from the properties file. + final String projectName = housekeeping.getProperty("TOIFSegmentIsRelatedToProject"); + + // project is mandatory. + if ((projectName == null) || (projectName.isEmpty())) + { + final String msg = options.getAdaptor().toString() + ": No project defined in house-keeping file."; + LOG.error( msg); + throw new ToifException( msg ); + } + + final String[] projectDetails = housekeeping.getProperty(projectName).split(";"); + + if (projectDetails == null) + { + final String msg = options.getAdaptor().toString() + ": No project details defined in house-keeping file."; + LOG.error( msg); + throw new ToifException( msg ); + + } + + // create the project entity. + final Project project = (Project) addToList(new Project(projectDetails[0], projectDetails[1])); + elements.add(project); + + // check that the elements are not in the table already. + final Fact fact = new TOIFSegmentIsRelatedToProject(segment, project); + + // add the fact to the table. + housekeepingElements.put(fact.hashCode(), fact); + elements.add(fact); + + } + + /** + * create the SegmentIsSupervisedByPerson fact and its entities. + * + * @param props + * the properties file. + */ + private void createSegmentIsSupervisedByPerson(Properties props) throws NullPointerException + { + // get the information from the properties file. + final String personName = props.getProperty("TOIFSegmentIsSupervisedByPerson"); + final String[] personDetails = props.getProperty(personName).split(";"); + + // create the person entity + final Person person = (Person) addToList(new Person(personDetails[0], personDetails[1], personDetails[2])); + + final Fact fact = new TOIFSegmentIsSupervisedByPerson(segment, person); + // add the fact to the table. + housekeepingElements.put(fact.hashCode(), fact); + + } + + /** + * get the adaptor implementation + * + * @return the adaptorImpl + */ + public AbstractAdaptor getAdaptorImpl() + { + return adaptorImpl; + } + + /** + * get the elements + * + * @return the elements + */ + public ArrayList getElements() + { + return elements; + } + + /** + * @return the houseKeeping + */ + public Properties getHouseKeeping() + { + return houseKeeping; + } + + /** + * @return the housekeepingElements + */ + public Hashtable getHousekeepingElements() + { + return housekeepingElements; + } + + /** + * Get the housekeeping facts and elements. ie, all the facts not relating + * to the finding facts and elements. + * @throws ToifException + */ + void getHouseKeepingFacts() throws NullPointerException, ToifException + { + // create the date facts and entities + createDate(); + + // create the adaptor facts and entities. + createAdaptor(); + + addSegmentDescription(houseKeeping); + + // create the SegmentIsRelatedToProject fact and its entities + createSegmentIsRelatedToProject(houseKeeping); + + // create the SegmentIsProducedByOrganization fact and its entities + createSegmentIsProducedByOrganization(houseKeeping); + + // create the SegmentIsOwnedByOrganization fact and its entities + createSegmentIsOwnedByOrganization(houseKeeping); + + // create the SegmentIsSupervisedByPerson fact and its entities + createSegmentIsSupervisedByPerson(houseKeeping); + + // create the SegmentIsGeneratedByPerson fact and its entities + createSegmentIsGeneratedByPerson(houseKeeping); + + createSegmentIsGeneratedByGenerator(houseKeeping); + + } + + /** + * get the house keeping values + * + * @return + * @throws ToifException + */ + Properties getHousekeepingProperties(java.io.File housekeepingFile) throws ToifException + { + /* + * the property file is where all the information about the housekeeping + * is stored. + */ + final Properties props = new Properties(); + + // + FileInputStream istream = null; + try + { + if (housekeepingFile != null) + { + props.load(new FileInputStream(housekeepingFile)); + } + else + { + + // load the property file + istream = new FileInputStream(options.getHouseKeeping()); + props.load( istream ); + istream.close(); + + } + } + catch (final IOException e) + { + final String msg = options.getAdaptor().toString() + ": Could not find the house-keeping file"; + LOG.error( msg, e); + throw new ToifException( msg ); + } + + + finally + { + // Always ensure that we are closing the file handle + if (istream != null) + try + { + istream.close(); + } + catch (IOException e) + { + // Just leave it be. + LOG.error( "Unable to close stream for " + options.getHouseKeeping().getAbsolutePath()); + } + } + return props; + } + + /** + * get the adaptor options + * + * @return the options + */ + public AdaptorOptions getOptions() + { + return options; + } + + /** + * create the organization fact and entities. + */ + void getOrganizationFacts() throws NullPointerException + { + /* + * go on to create the fact and elements regarding + * OrganizationIsPartOfOrganizationAsRole + */ + createOrganizationIsPartOfOrganizationAsRole(houseKeeping); + + } + + /** + * create the facts and entities about the person. + */ + void getPersonFacts() throws NullPointerException + { + /* + * go on to create the fact and elements regarding + * PersonIsEmployedByOrganizationAsRole + */ + createPersonIsEmployedByOrganizationAsRole(houseKeeping); + + } + + /** + * create the project facts and entities. + */ + void getProjectFacts() throws NullPointerException + { + // create the PersonIsInvolvedInProjectAsRole fact and it's entities + createPersonIsInvolvedInProjectAsRole(houseKeeping); + + /* + * create the OrganizationIsInvolvedInProjectAsRole fact and it's + * entities + */ + createOrganizationIsInvolvedInProjectAsRole(houseKeeping); + + } + + /** + * get the segment + * + * @return the segment + */ + public Segment getSegment() + { + return segment; + } + + /** + * create the tool facts and its entities. + */ + void getToolFacts() throws NullPointerException + { + // create the AdaptorSupportsGenerator fact and entities. + createAdaptorSupportsGenerator(houseKeeping); + + // create the AdaptorIsSuppliedByVendor fact and entities. + createAdaptorIsSuppliedByVendor(houseKeeping); + + // create the GeneratorIsSuppliedByVendor fact and entities. + createGeneratorIsSuppliedByVendor(houseKeeping); + + } + + /** + * marshall the elements to xml. + * + * @param outFile + * @param elementList + * @throws ToifException + */ + private void marshall(java.io.File outFile, final ArrayList elementList) throws ToifException + { + segment.clearSegment(); + /* + * sort according to the custom comparator. Facts should always be after + * entities. + */ + Collections.sort(elementList, new ElementComparator()); + + /* + * now that we have all the elements, now would be a good time to + * normalize and increment the id's. This could have been done when the + * element was created but would cause the id's to be all over the + * place. + */ + int id = 0; + + // give the segment it's id. + segment.setId(id++); + + // for each of the elements, increment and apply its id. + for (final Element element : elementList) + { + element.setId(id++); + } + + JAXBContext context; + + try + { + /* + * There must be a shorter way to create the context. You can + * probably do it by giving it the package all these are in. + * However, this was not working for me. + */ + context = JAXBContext.newInstance(Segment.class, Finding.class, Project.class, Organization.class, Person.class, Generator.class, + Adaptor.class, Date.class, WeaknessDescription.class, FindingIsDescribedByWeaknessDescription.class, CWEIdentifier.class, + FindingHasCWEIdentifier.class, CodeLocation.class, CodeLocationReferencesFile.class, File.class, Directory.class, + FileIsContainedInDirectory.class, DirectoryIsContainedInDirectory.class, Entity.class, Element.class, + TOIFSegmentIsGeneratedByGenerator.class, TOIFSegmentIsProcessedByAdaptor.class, TOIFSegmentIsRelatedToProject.class, + TOIFSegmentIsCreatedAtDate.class, TOIFSegmentIsProducedByOrganization.class, TOIFSegmentIsOwnedByOrganization.class, + TOIFSegmentIsGeneratedByPerson.class, TOIFSegmentIsSupervisedByPerson.class, Role.class, PersonIsInvolvedInProjectAsRole.class, + OrganizationIsInvolvedInProjectAsRole.class, AdaptorSupportsGenerator.class, Vendor.class, AdaptorIsSuppliedByVendor.class, + GeneratorIsSuppliedByVendor.class, OrganizationIsPartOfOrganizationAsRole.class, PersonIsEmployedByOrganizationAsRole.class, + DataElement.class, DataElementIsInvolvedInFinding.class, Statement.class, StatementIsInvolvedInFinding.class, + StatementIsSinkInFinding.class, StatementHasCodeLocation.class, FindingHasCodeLocation.class, LineNumber.class, Name.class, + Text.class, Description.class, Address.class, EmailAddress.class, Checksum.class, SFPIdentifier.class, + FindingHasSFPIdentifier.class, ClusterIdentifier.class, FindingHasClusterIdentifier.class, Offset.class, Position.class, + DataElementIsInvolvedInStatement.class, TOIFSegmentReferencesFile.class, StatementIsProceededByStatement.class); + + final Marshaller m = context.createMarshaller(); + + m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true); + + // Add all the elements to the segment. + for (final Element element : elementList) + { + segment.addElement(element); + } + + /* + * marshal the segment (and its contained elements) to the output + * xml. + */ + m.marshal(segment, new FileOutputStream(outFile)); + + } + catch (final JAXBException e) + { + final String msg = options.getAdaptor().toString() + ": Failed to create XML output \n"; + LOG.error( msg, e); + throw new ToifException( msg ); + } + catch (final FileNotFoundException ex) + { + final String msg = options.getAdaptor().toString() + ": Not able to write to output file " + outFile; + LOG.error( msg, ex); + throw new ToifException( msg ); + } + } + + /** + * Parse the output of the tool and generate a list of the findings. + * + * @param file + * + * @param inputStream + * - The error-stream from the running process. + * @return - An ArrayList of the found findings. + * @throws ToifException + */ + ArrayList parse(java.io.File process, File file) throws ToifException + { + options.getOutputDirectory().mkdirs(); + return adaptorImpl.parse(adaptorImpl, process, options, file, validLines, options.getUnknownCWE()); + } + + /** + * Run the tool. A command needs to be constructed, the same as you would if + * you were running it from the command line. + * + * @return return the process which was created by running the tool. + * @throws ToifException + */ + public java.io.File runTool() throws ToifException + { + + /* + * CppCheck command. Tool executable location (taken from the options + * provided to main), enable style error reporting, output in xml, + * location to run the tool on. + */ + + final String[] commands = adaptorImpl.runToolCommands(options, otherOpts); + // final String[] command = adaptorImpl.runToolCommands(options, + // options.getAdditionalArgs().toArray(new + // String[options.getAdditionalArgs().size()])); + + if (commands == null) + { + return null; + } + + List niceCommands = new ArrayList(); + + if (SystemUtils.IS_OS_WINDOWS) + { + niceCommands.add( "C:\\Windows\\System32\\cmd.exe"); + niceCommands.add( "/c"); + niceCommands.add( "start"); + niceCommands.add( "/B"); + niceCommands.add( "/BELOWNORMAL"); + niceCommands.add( "/WAIT"); + } + else + { + niceCommands.add("nice"); + } + + niceCommands.addAll(Arrays.asList(commands)); + final String[] command = niceCommands.toArray(new String[niceCommands.size()]); + final ProcessBuilder process = new ProcessBuilder(command); + + if (workingDirectory != null) + { + process.directory(workingDirectory); + } + + options.getOutputDirectory().mkdirs(); + + java.io.File file = null; + if (adaptorImpl.getAdaptorName().equals("Splint")) + { + file = new java.io.File(options.getOutputDirectory(), options.getInputFile().getName() + "." + adaptorImpl.getRuntoolName()); + + java.io.File file2 = new java.io.File(options.getOutputDirectory(), options.getInputFile().getName() + "-err." + + adaptorImpl.getRuntoolName()); + + java.io.File tmp = null; + try + { + tmp = java.io.File.createTempFile("splint", ".tmp"); + } + catch (IOException e) + { + LOG.error( e); + throw new ToifException( ); + } + if (tmp != null) + { + tmp.deleteOnExit(); + process.redirectOutput(tmp); + } + process.redirectError(file2); + } + // if (adaptorImpl.getAdaptorName().equals("Cppcheck")) + // { + // file = new java.io.File(options.getOutputDirectory(), + // options.getInputFile().getName() + "." + + // adaptorImpl.getRuntoolName()); + // java.io.File file2 = new java.io.File(options.getOutputDirectory(), + // options.getInputFile().getName() + "-err." + // + adaptorImpl.getRuntoolName()); + // + // process.redirectOutput(file2); + // process.redirectError(file); + // } + else + { + file = new java.io.File(options.getOutputDirectory(), options.getInputFile().getName() + "." + adaptorImpl.getRuntoolName()); + java.io.File file2 = new java.io.File(options.getOutputDirectory(), options.getInputFile().getName() + "-err." + + adaptorImpl.getRuntoolName()); + + process.redirectOutput(file); + process.redirectError(file2); + } + + try + { + Process p = process.start(); + + p.waitFor(); + + // Check the exit value to ensure that process did not fail + if ( p.exitValue() != 0) + { + int status = p.exitValue(); + final String msg = "Adaptor process failure detected: status=" + status + " " + + options.getAdaptor().toString(); + + LOG.error( msg); + throw new ToifException( msg); + } + return file; + } + catch (final IOException | InterruptedException e) + { + final String msg = options.getAdaptor().toString() + ": Could not write to output."; + LOG.error( msg ); + throw new ToifException( e ); + } + } + + /** + * set the adaptor implementation + * + * @param adaptorImpl + * the adaptorImpl to set + */ + public void setAdaptorImpl(AbstractAdaptor adaptorImpl) + { + this.adaptorImpl = adaptorImpl; + } + + /** + * add all the elements to elements list. + * + * @param elements + * the elements to set + */ + public void addElements(ArrayList elements) + { + this.elements.addAll(elements); + } + + /** + * @param houseKeeping + * the houseKeeping to set + */ + public void setHouseKeeping(Properties houseKeeping) + { + this.houseKeeping = houseKeeping; + } + + /** + * @param housekeepingElements + * the housekeepingElements to set + */ + public void setHousekeepingElements(Hashtable housekeepingElements) + { + this.housekeepingElements = housekeepingElements; + } + + /** + * @param options + * the options to set + */ + public void setOptions(AdaptorOptions options) + { + this.options = options; + } + + /** + * Get the options from main's arguments. Parse the arguments. + * + * @param args + * - The arguments from main. The tool, the source location, the + * output location. + */ + public void setOptions(String[] args) throws ArgumentValidationException + { + // create the command line interface. + final Cli CLI = CliFactory.createCli(AdaptorOptions.class); + + // List options = Arrays.asList(args); + String[] adaptorOpts = {}; + + int argsLimit = 8; + + for (String string : args) + { + if ("--unknownCWE".equals(string)) + { + argsLimit++; + } + if ("--rename".equals(string)) + { + argsLimit += 2; + } + if ("-n".equals(string)) + { + argsLimit += 2; + } + + } + + if (args.length >= argsLimit) + { + List argList = Arrays.asList(args); + adaptorOpts = argList.subList(0, argsLimit).toArray(new String[argsLimit]); + List argsublist = argList.subList(argsLimit, args.length); + otherOpts = argsublist.toArray(new String[args.length - argsLimit]); + for (int i = 0; i < otherOpts.length; i++) + { + String string = otherOpts[i]; + + // string = "\"" + string + "\""; + + otherOpts[i] = string; + } + } + // Collect the arguments + + options = CLI.parseArguments(adaptorOpts); + + } + + /** + * @param segment + * the segment to set + */ + public void setSegment(Segment segment) + { + this.segment = segment; + } + +} diff --git a/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/toolAdaptor/ToolAdaptorUtil.java b/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/toolAdaptor/ToolAdaptorUtil.java new file mode 100644 index 00000000..b811bd57 --- /dev/null +++ b/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/toolAdaptor/ToolAdaptorUtil.java @@ -0,0 +1,43 @@ + +package com.kdmanalytics.toif.framework.toolAdaptor; + +import java.util.HashSet; +import java.util.Set; + +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.IConfigurationElement; +import org.eclipse.core.runtime.Platform; + +public class ToolAdaptorUtil + { + private static final String ADAPTOR_EXT_POINT_ID = "com.kdmanalytics.toif.adaptor"; + + + public static Set getAdaptors() + { + Set adaptorSet = new HashSet(); + + IConfigurationElement config[] = Platform.getExtensionRegistry().getConfigurationElementsFor(ADAPTOR_EXT_POINT_ID ); + + try + { + for (IConfigurationElement element : config) + { + final Object object = element.createExecutableExtension("class"); + if (object instanceof AbstractAdaptor) + { + AbstractAdaptor adaptor = (AbstractAdaptor) object; + + adaptorSet.add( adaptor); + } + } + + } + catch( CoreException ex) + { + System.err.println("Adaptor module failure: " + ex.getMessage()); + } + return adaptorSet; + } + + } diff --git a/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/utils/ClusterMapping.java b/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/utils/ClusterMapping.java new file mode 100644 index 00000000..13c16b45 --- /dev/null +++ b/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/utils/ClusterMapping.java @@ -0,0 +1,143 @@ +/******************************************************************************* + * ////////////////////////////////////////////////////////////////////////////////// + * // Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This program and the + * // accompanying materials are made available under the terms of the Open Source + * // Initiative OSI - Open Software License v3.0 which accompanies this + * // distribution, and is available at http://www.opensource.org/licenses/osl-3.0.php/ + * ////////////////////////////////////////////////////////////////////////////////// + ******************************************************************************/ +package com.kdmanalytics.toif.framework.utils; + +/** + * Mapping clusters to sfps. + * + * @author adam + * + */ +public class ClusterMapping +{ + + /** + * Given a SFP, return the cluster it belongs to. + * + * @param sfp + * @return + */ + static String getCluster(String sfp) + { + if (sfp == null) + { + return "No Cluster Found!"; + } + + if (!sfp.startsWith("SFP-")) + { + return "No Cluster Found!"; + } + + // get the int from the SFP. Java doesn't like strings for switches. + int sfpId = 0; + try + { + sfpId = Integer.parseInt(sfp.substring(4)); + } + catch (NumberFormatException e) + { + e.printStackTrace(); + System.err.println("No SFP found. Config file may be wrong"); + } + + switch (sfpId) + { + case -1: + { + return "Observation"; + } + case 1: + { + return "Risky Values"; + } + case 2: + { + return "Entity Points"; + } + case 3: + { + return "API"; + } + case 4: + case 5: + case 6: + { + return "Exception Management"; + } + case 7: + case 8: + case 9: + case 10: + case 11: + { + return "Memory Access"; + } + case 12: + { + return "Memory Management"; + } + case 13: + case 14: + case 15: + { + return "Resource Management"; + } + case 16: + case 17: + case 18: + { + return "Path Resolution"; + } + case 19: + case 20: + case 21: + case 22: + { + return "Synchronization"; + } + case 23: + { + return "Information Leak"; + } + case 24: + case 25: + case 26: + case 27: + { + return "Tainted Input"; + } + case 28: + { + return "Entry Points"; + } + case 29: + case 30: + case 31: + case 32: + case 33: + case 34: + { + return "Authentication "; + } + case 35: + { + return "Access Control"; + } + case 36: + { + return "Privilege"; + } + + default: + return "No Cluster Found!"; + } + + } +} diff --git a/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/utils/DirectToifInput.java b/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/utils/DirectToifInput.java new file mode 100644 index 00000000..45e008ba --- /dev/null +++ b/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/utils/DirectToifInput.java @@ -0,0 +1,275 @@ +/******************************************************************************* + * ///////////////////////////////////////////////////////////////////////////// + * ///// // Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This + * program and the // accompanying materials are made available under the terms + * of the Open Source // Initiative OSI - Open Software License v3.0 which + * accompanies this // distribution, and is available at + * http://www.opensource.org/licenses/osl-3.0.php/ + * ////////////////////////////// + * //////////////////////////////////////////////////// + ******************************************************************************/ + +package com.kdmanalytics.toif.framework.utils; + +import java.io.File; +import java.util.ArrayList; + +import com.kdmanalytics.toif.common.exception.ToifException; +import com.kdmanalytics.toif.framework.toolAdaptor.AbstractAdaptor; +import com.kdmanalytics.toif.framework.toolAdaptor.AdaptorOptions; +import com.kdmanalytics.toif.framework.toolAdaptor.Language; +import com.kdmanalytics.toif.framework.toolAdaptor.ToolAdaptor; +import com.kdmanalytics.toif.framework.xmlElements.entities.Element; + +/** + * This class provides an interface by which tools can create findings and toif + * files without an adaptor. This aproach is a bit different to how the toif + * adaptor works with adaptors. Usually the ToifAdaptor Tool uses the adaptors + * as plugins -- and drives them--. In this case, this adaptor is driving the + * toifAdaptor. + * + * @author Adam Nunn + * + */ +public class DirectToifInput extends AbstractAdaptor +{ + + // adaptor name + private static final String ADAPTOR_NAME = "Direct Input"; + + // the finding creator + private FindingCreator creator; + + // the tool adaptor + private ToolAdaptor toolAdaptor; + + // the outputdirectory + private File outputDirectory; + + // the file this segment is describing. + private File segmentFile; + + /** + * Create a toif segment. + * + * @param ouputDirectory + * The directory where you wish the output files to go. + * @param housekeepingFile + * The housekeeping file. This has all the information about the + * project stored in it. It should be formatted according to the + * toif housekeeping file format + * @param segmentFile + * The source file which is being analyzed. + * @throws ToifException + */ + public DirectToifInput(File ouputDirectory, File housekeepingFile, File segmentFile) throws ToifException + { + this.outputDirectory = ouputDirectory; + this.segmentFile = segmentFile; + + // new tool adaptor + toolAdaptor = new ToolAdaptor(null); + // using the mock adaptor + toolAdaptor.setAdaptorImplementation(this); + // create the housekeeping facts + toolAdaptor.createFacts(housekeepingFile); + // create the facts regarding the file the segment is referencing. + toolAdaptor.createSegmentFile(segmentFile); + + // create a finding creator. + creator = new FindingCreator(null, ADAPTOR_NAME, false); + } + + /** + * Create a finding. For the weakness. + * + * @param msg + * The message of the weakness description + * @param id + * The Id of the weakness description. Often a shortened version + * of the description. It is unique to the weakness. + * @param lineNumber + * The line number that the weakness was found on. + * @param offset + * The offset of the weakness + * @param position + * The position of the weakness + * @param file + * The file that the weakness was found in. + * @param dataElement + * The dataElement the weakness was found on. + * @param cwe + * the CWE name. for example CWE-123. + */ + public void createFinding(String msg, String id, Integer lineNumber, Integer offset, Integer position, File file, String dataElement, String cwe) + { + // needs a toif file entity as the file. create this from the java.io + // file. + com.kdmanalytics.toif.framework.xmlElements.entities.File toifFile = new com.kdmanalytics.toif.framework.xmlElements.entities.File( + file.getPath()); + + // create the finding. + creator.create(msg, id, lineNumber, offset, position, toifFile, dataElement, cwe); + } + + /** + * construct the xml after creating all the findings. + * @throws ToifException + */ + public void constructXml() throws ToifException + { + // add the elements from the finding creator + toolAdaptor.addElements(creator.getElements()); + + // construct the toif xml. + toolAdaptor.constructXml(outputDirectory, segmentFile); + } + + /** + * Once done creating all the elements, get them. + * + * @return + */ + public ArrayList getElements() + { + return creator.getElements(); + } + + @Override + public String getAdaptorDescription() + { + return "This method uses a direct input to the TOIF Adaptor."; + } + + @Override + public String getAdaptorName() + { + return ADAPTOR_NAME; + } + + @Override + public String getAdaptorVendorAddress() + { + return "3730 Richmond Rd, Suite 204, Ottawa, ON K2H 5B9"; + } + + @Override + public String getAdaptorVendorDescription() + { + return "KDM Analytics is a security assurance company providing products and services for threat risk assessment and management, due diligence assessments, and information and data assurance. Leveraging our decades of experience in static analysis, reverse engineering and formal methods, we have created breakthrough products for the automated and systematic investigation of code, data and networks."; + } + + @Override + public String getAdaptorVendorEmail() + { + return "info@kdmanalytics.com"; + } + + @Override + public String getAdaptorVendorName() + { + return "KDM Analytics"; + } + + @Override + public String getAdaptorVendorPhone() + { + return "613-627-1011"; + } + + @Override + public String getAdaptorVersion() + { + return "0.5"; + } + + @Override + public String getGeneratorDescription() + { + return "Generated by the analyzer"; + } + + @Override + public String getGeneratorName() + { + return "Analyzer"; + } + + @Override + public String getGeneratorVendorAddress() + { + return "3730 Richmond Rd, Suite 204, Ottawa, ON K2H 5B9"; + } + + @Override + public String getGeneratorVendorDescription() + { + return "KDM Analytics is a security assurance company providing products and services for threat risk assessment and management, due diligence assessments, and information and data assurance. Leveraging our decades of experience in static analysis, reverse engineering and formal methods, we have created breakthrough products for the automated and systematic investigation of code, data and networks."; + } + + @Override + public String getGeneratorVendorEmail() + { + return "info@kdmanalytics.com"; + } + + @Override + public String getGeneratorVendorName() + { + return "KDM Analytics"; + } + + @Override + public String getGeneratorVendorPhone() + { + return "613 627 1011"; + } + + @Override + public String getGeneratorVersion() + { + return "0.5"; + } + + @Override + public String[] runToolCommands(AdaptorOptions options, String[] otherOpts) + { + // TODO Auto-generated method stub + return null; + } + + @Override + public ArrayList parse(File process, AdaptorOptions options, com.kdmanalytics.toif.framework.xmlElements.entities.File file, + boolean[] validLines, boolean unknownCWE) + { + + // TODO Auto-generated method stub + return null; + } + + @Override + public String getRuntoolName() + { + // TODO Auto-generated method stub + return null; + } + + @Override + public Language getLanguage() + { + return Language.UNKNOWN; + } + + @Override + public boolean acceptsDOptions() + { + return false; + } + + @Override + public boolean acceptsIOptions() + { + return false; + } + +} diff --git a/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/utils/ElementComparator.java b/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/utils/ElementComparator.java new file mode 100644 index 00000000..93613595 --- /dev/null +++ b/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/utils/ElementComparator.java @@ -0,0 +1,51 @@ +/******************************************************************************* + * ////////////////////////////////////////////////////////////////////////////////// + * // Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This program and the + * // accompanying materials are made available under the terms of the Open Source + * // Initiative OSI - Open Software License v3.0 which accompanies this + * // distribution, and is available at http://www.opensource.org/licenses/osl-3.0.php/ + * ////////////////////////////////////////////////////////////////////////////////// + ******************************************************************************/ +package com.kdmanalytics.toif.framework.utils; + +import java.util.Comparator; + +import com.kdmanalytics.toif.framework.xmlElements.entities.Element; +import com.kdmanalytics.toif.framework.xmlElements.entities.Entity; + +/** + * Custom comparator to compare and hense sort the elements. + * + * @author Adam Nunn + * + */ +public class ElementComparator implements Comparator +{ + + /** + * the compare method should put entities ahead of the facts. Facts should + * always be after the entities which they reference. The easiest way to do + * this is to just put all the facts at the end of the file. + */ + @Override + public int compare(Element o1, Element o2) + { + if (o1 instanceof Entity && o2 instanceof Entity) + { + return 0; + } + else if (o1 instanceof Entity) + { + return -1; + } + else if (o2 instanceof Entity) + { + return 1; + } + else + { + return 0; + } + } + +} diff --git a/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/utils/FindingCreator.java b/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/utils/FindingCreator.java new file mode 100644 index 00000000..6385f3ac --- /dev/null +++ b/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/utils/FindingCreator.java @@ -0,0 +1,610 @@ +/******************************************************************************* + * ///////////////////////////////////////////////////////////////////////////// + * ///// // Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This + * program and the // accompanying materials are made available under the terms + * of the Open Source // Initiative OSI - Open Software License v3.0 which + * accompanies this // distribution, and is available at + * http://www.opensource.org/licenses/osl-3.0.php/ + * ////////////////////////////// + * //////////////////////////////////////////////////// + ******************************************************************************/ + +package com.kdmanalytics.toif.framework.utils; + +import java.io.BufferedWriter; +import java.io.FileWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Properties; + +import com.kdmanalytics.toif.framework.xmlElements.entities.CWEIdentifier; +import com.kdmanalytics.toif.framework.xmlElements.entities.ClusterIdentifier; +import com.kdmanalytics.toif.framework.xmlElements.entities.CodeLocation; +import com.kdmanalytics.toif.framework.xmlElements.entities.DataElement; +import com.kdmanalytics.toif.framework.xmlElements.entities.Directory; +import com.kdmanalytics.toif.framework.xmlElements.entities.Element; +import com.kdmanalytics.toif.framework.xmlElements.entities.File; +import com.kdmanalytics.toif.framework.xmlElements.entities.Finding; +import com.kdmanalytics.toif.framework.xmlElements.entities.SFPIdentifier; +import com.kdmanalytics.toif.framework.xmlElements.entities.Statement; +import com.kdmanalytics.toif.framework.xmlElements.entities.WeaknessDescription; +import com.kdmanalytics.toif.framework.xmlElements.facts.CodeLocationReferencesFile; +import com.kdmanalytics.toif.framework.xmlElements.facts.DataElementIsInvolvedInFinding; +import com.kdmanalytics.toif.framework.xmlElements.facts.DataElementIsInvolvedInStatement; +import com.kdmanalytics.toif.framework.xmlElements.facts.DirectoryIsContainedInDirectory; +import com.kdmanalytics.toif.framework.xmlElements.facts.Fact; +import com.kdmanalytics.toif.framework.xmlElements.facts.FileIsContainedInDirectory; +import com.kdmanalytics.toif.framework.xmlElements.facts.FindingHasCWEIdentifier; +import com.kdmanalytics.toif.framework.xmlElements.facts.FindingHasClusterIdentifier; +import com.kdmanalytics.toif.framework.xmlElements.facts.FindingHasCodeLocation; +import com.kdmanalytics.toif.framework.xmlElements.facts.FindingHasSFPIdentifier; +import com.kdmanalytics.toif.framework.xmlElements.facts.FindingIsDescribedByWeaknessDescription; +import com.kdmanalytics.toif.framework.xmlElements.facts.StatementHasCodeLocation; +import com.kdmanalytics.toif.framework.xmlElements.facts.StatementIsInvolvedInFinding; +import com.kdmanalytics.toif.framework.xmlElements.facts.StatementIsProceededByStatement; +import com.kdmanalytics.toif.framework.xmlElements.facts.StatementIsSinkInFinding; + +/** + * Creates the finding entities and fact regarding the findings found by the + * vulnerability detection tool. + * + * @author Adam Nunn + * + */ +public class FindingCreator +{ + + // the config file properties. + Properties sfps = null; + + // the Hashtable of all the findings found. + ArrayList elements = null; + + // the adaptor name. + String adaptorName = null; + + private boolean unknownCWE; + + private Object line; + + private String sourceFile; + + private String message; + + /** + * Constructor of the findingCreator. + * + * @param unknownCWE + */ + public FindingCreator(Properties props, String adaptorName, boolean unknownCWE) + { + sfps = props; + elements = new ArrayList(); + this.adaptorName = adaptorName; + this.unknownCWE = unknownCWE; + } + + + public String getSourceFile() + { + return sourceFile; + } + + + public Object getLine() + { + return line; + } + + /** + * Creates the facts and entities relating to the findings. + * + * @param msg + * the message produced by the vulnerability detection tool. + * @param id + * the id of the error. + * @param lineNumber + * the line number where the error was found. + * @param offset + * @param position + * @param file + * the file in which the error was found. + * @param dataElement + */ + public void create(String msg, String id, Integer lineNumber, Integer offset, Integer position, File file, String dataElement, String cwe, + CodeLocation... traces) + { + sourceFile = file.getPath(); + line = lineNumber; + message = msg; + // create a finding from the output. + Finding finding = new Finding(); + + file = (File) addToElements(file); + + containedIn(file); + + boolean cont = true; + // create a CWE for the finding + if (cwe != null) + { + cont = createCwe(finding, cwe); + } + else + { + cont = createCweFromId(finding, id); + } + + if (!cont) + { + return; + } + + // add the finding to the list of elements. + // elements.add(finding); + addToElements(finding); + + // Create a weakness description for the finding + createWeaknessDescription(finding, id + ": " + msg); + + // create the entities and facts relating to the error location in the + // code. + CodeLocation location = createCodeLocation(finding, lineNumber, offset, position, file); + + Statement statement = null; + + // creates the statements for this finding. + statement = createStatementIsInvolvedInFinding(finding, location); + + // creates the dataElement for this finding. + if (dataElement != null) + createDataElement(dataElement, finding, statement); + + Statement lastStatement = statement; + + for (CodeLocation codeLocation : traces) + { + if (codeLocation == null) + { + continue; + } + + codeLocation = (CodeLocation) addToElements(codeLocation); + + // create a new statement for the finding. + Statement traceStatement = new Statement(); + elements.add(traceStatement); + + // add the fact relating it to the finding + StatementIsInvolvedInFinding involved = new StatementIsInvolvedInFinding(traceStatement, finding); + elements.add(involved); + + // create the fact describing the location of the statement. + StatementHasCodeLocation hasLocation = new StatementHasCodeLocation(traceStatement, codeLocation); + elements.add(hasLocation); + + // do the trace back. + StatementIsProceededByStatement preceedingFact = new StatementIsProceededByStatement(lastStatement, traceStatement); + elements.add(preceedingFact); + + lastStatement = traceStatement; + } + } + + + + public String getMessage() + { + return message; + } + + /** + * @param file + * @return + */ + private Element addToElements(Element element) + { + if (elements.contains(element)) + { + return elements.get(elements.indexOf(element)); + } + else + { + elements.add(element); + return element; + } + + } + + public static void writeToFile(String sb) throws IOException + { + java.io.File tempDir = new java.io.File(System.getProperty("java.io.tmpdir")); + java.io.File tempFile = new java.io.File(tempDir, "toifLog"); + FileWriter fileWriter = new FileWriter(tempFile, true); + //System.out.println(tempFile.getAbsolutePath()); + BufferedWriter bw = new BufferedWriter(fileWriter); + bw.write(sb); + bw.close(); + } + + /** + * Given that we are provided with the cwe string directly, just use it to + * create the cwe element. + * + * access level modifier missing for testing purposes + * + * @param finding + * @param cwe + */ + boolean createCwe(Finding finding, String cwe) + { + // if there is a matching cwe in the list, use it. + if (cwe != null && (cwe.startsWith("CWE-"))) + { + + if (unknownCWE) + { + if ("CWE--1".equals(cwe)) + { + try + { + writeToFile(adaptorName + " finding filtered from results: "+getSourceFile()+":"+getLine()+" "+getMessage()+"\n"); + } + catch (IOException e) + { + // TODO Auto-generated catch block + e.printStackTrace(); + } + return false; + } + } + + CWEIdentifier cweId = new CWEIdentifier(cwe); + + elements.add(cweId); + + Fact fact2 = new FindingHasCWEIdentifier(finding, cweId); + // add the fact. + elements.add(fact2); + + } + return true; + + } + + /** + * Create the elements relating to the locations of the errors in the code. + * + * access level modifier missing for testing purposes + * + * @param lineNumber + * line where the error was found + * @param offset + * @param position + * @param file + * the file where the error was found + * @return + */ + CodeLocation createCodeLocation(Finding finding, final Integer lineNumber, Integer offset, Integer position, File file) + { + // there must be a linenumber + if (lineNumber == null) + { + return null; + } + + // create the code location entity. + CodeLocation location = new CodeLocation(lineNumber, position, offset); + elements.add(location); + + // create the fact which links the location and file. + Fact fact = new CodeLocationReferencesFile(location, file); + elements.add(fact); + + // create the fact which links the finding and location. + FindingHasCodeLocation findingLocation = new FindingHasCodeLocation(finding, location); + elements.add(findingLocation); + + // return the location. + return location; + + } + + /** + * Create a CWE if it doesn't already exit. Also create the fact which + * references the CWE. + * + * access level modifier missing for testing purposes + * + * @param finding + * The finding which has to be matched to a CWE + * @param id + * The id of the error. + */ + boolean createCweFromId(Finding finding, String id) + { + // there must be an id. + if (id == null) + { + return false; + } + + // there must be a configuration file. + if (sfps == null) + { + System.err.println("No configuration file found!"); + return false; + } + + // get the string which represents the cluster, sfp, and cwe + String sfpProperty = sfps.getProperty(id); + + // if there is no SFP property for this error id, bail! + if ((sfpProperty == null) || (sfpProperty.isEmpty())) + { + try + { + writeToFile(adaptorName + ": No properties found for " + id+"\n"); + } + catch (IOException e) + { + // TODO Auto-generated catch block + e.printStackTrace(); + } + sfpProperty = ";SFP--1;CWE--1"; + // return; + } + + // split the property string into the individual properties. + String[] clusterSfpCwe = sfpProperty.split(";"); + + String cwe = "CWE--1"; + String sfp = "SFP--1"; + String cluster = null; + + // only one element in the array has to be a sfp + if (clusterSfpCwe.length == 1) + { + cluster = clusterSfpCwe[0]; + } + // two elements means that there should be a cwe too. + else if (clusterSfpCwe.length == 2) + { + cluster = clusterSfpCwe[0]; + sfp = clusterSfpCwe[1]; + } + // we have all three. + else if (clusterSfpCwe.length == 3) + { + cluster = clusterSfpCwe[0]; + sfp = clusterSfpCwe[1]; + cwe = clusterSfpCwe[2]; + } + else + { + System.err.println("Missing a configuration file or not enough values for " + id + + ". Hence, these Elements have not been created in the toif"); + + return false; + } + + /* + * now make the cwe elements. + */ + CWEIdentifier cweId = null; + // if there is a matching cwe in the list, use it. + if (cwe != null && (cwe.startsWith("CWE-") || cwe.startsWith("KDM-"))) + { + if (unknownCWE) + { + if ("CWE--1".equals(cwe)) + { + try + { + writeToFile(adaptorName + " finding filtered from results: "+getSourceFile()+":"+getLine()+" "+getMessage()+"\n"); + } + catch (IOException e) + { + // TODO Auto-generated catch block + e.printStackTrace(); + } + return false; + } + } + + cweId = new CWEIdentifier(cwe); + elements.add(cweId); + + Fact fact2 = new FindingHasCWEIdentifier(finding, cweId); + // add the fact. + elements.add(fact2); + } + + SFPIdentifier sfpId = null; + + if (sfp != null && sfp.startsWith("SFP-")) + { + // if there is a matching sfp in the list, use it. + sfpId = new SFPIdentifier(sfp); + elements.add(sfpId); + + // make the fact + Fact fact = new FindingHasSFPIdentifier(finding, sfpId); + // add the fact. + elements.add(fact); + } + + /* + * give the cluster the value mapped from the cluster/sfp mapping to + * initialize it. + */ + if (sfp != null && sfp.startsWith("SFP-")) + { + cluster = ClusterMapping.getCluster(sfp); + } + + // if an actual cluster is defined, then use that. + if (cluster != null) + { + ClusterIdentifier clusterId = new ClusterIdentifier(cluster); + elements.add(clusterId); + + if (finding != null) + { + // make the fact + Fact fact3 = new FindingHasClusterIdentifier(finding, clusterId); + // add the fact. + elements.add(fact3); + } + } + + return true; + } + + /** + * Create the dataElement. + * + * access level modifier missing for testing purposes + * + * @param name + * The name of the Element + * @param finding + * The finding the element is related to . + * @param statement + * the statement the element is involved with. + * @return + */ + DataElement createDataElement(String name, Finding finding, Statement statement) + { + // create the dataElement with this name. + DataElement dataElement = new DataElement(name); + elements.add(dataElement); + + // create the fact + Fact fact = new DataElementIsInvolvedInFinding(dataElement, finding); + // add the fact. + elements.add(fact); + + DataElementIsInvolvedInStatement involved = new DataElementIsInvolvedInStatement(dataElement, statement); + elements.add(involved); + + return dataElement; + } + + /** + * Create the statement entity and its facts. + * + * access level modifier missing for testing purposes + * + * @param finding + * The finding. + * @param location + * The line number where the statement is located. Usually it is + * assumed that this is the same as the error location, since + * there is no more information to go on. + * @param element + * @return + */ + Statement createStatementIsInvolvedInFinding(Finding finding, CodeLocation location) + { + // create a new statement for the finding. + Statement statement = new Statement(); + elements.add(statement); + + // add the fact relating it to the finding + StatementIsInvolvedInFinding involved = new StatementIsInvolvedInFinding(statement, finding); + elements.add(involved); + + // assumed that the statement is the sink in finding. + StatementIsSinkInFinding sink = new StatementIsSinkInFinding(statement, finding); + elements.add(sink); + + // create the fact describing the location of the statement. + StatementHasCodeLocation hasLocation = new StatementHasCodeLocation(statement, location); + elements.add(hasLocation); + + return statement; + } + + /** + * Create a weakness description for the finding, if it doesn't already + * exist. Create a fact pointing to the description. + * + * access level modifier missing for testing purposes + * + * @param finding + * The finding for the error. + * @param msg + * The id of the error. + */ + void createWeaknessDescription(Finding finding, String msg) + { + // create the entity + WeaknessDescription weaknessDescription = new WeaknessDescription(msg); + elements.add(weaknessDescription); + + // make the fact + Fact fact = new FindingIsDescribedByWeaknessDescription(finding, weaknessDescription); + // add the fact + elements.add(fact); + } + + /** + * Return the findings. + * + * @return - An ArrayList of the findings. + */ + public ArrayList getElements() + { + return elements; + } + + /** + * set the properties. + * + * @param properties + */ + void setProperties(Properties properties) + { + if (properties == null) + { + return; + } + sfps = properties; + } + + /** + * Find the directories the files are in. + * + * + * @param newFile + * the file for which the containment will be determined. + */ + private void containedIn(File file) + { + if (file.getParent() == null) + { + return; + } + + Directory directory = new Directory(file.getParent()); + directory = (Directory) addToElements(directory); + + Fact fact = new FileIsContainedInDirectory(file, directory); + fact = (Fact) addToElements(fact); + + // find all the directories containing directories. + while (directory.getParent() != null) + { + // create the entities and facts. + Directory directory2 = new Directory(directory.getParent()); + directory2 = (Directory) addToElements(directory2); + + DirectoryIsContainedInDirectory directoryContainedInDirectory = new DirectoryIsContainedInDirectory(directory, directory2); + directoryContainedInDirectory = (DirectoryIsContainedInDirectory) addToElements(directoryContainedInDirectory); + + directory = directory2; + } + } + +} diff --git a/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/entities/Adaptor.java b/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/entities/Adaptor.java new file mode 100644 index 00000000..e5edc179 --- /dev/null +++ b/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/entities/Adaptor.java @@ -0,0 +1,156 @@ +/******************************************************************************* + * ////////////////////////////////////////////////////////////////////////////////// + * // Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This program and the + * // accompanying materials are made available under the terms of the Open Source + * // Initiative OSI - Open Software License v3.0 which accompanies this + * // distribution, and is available at http://www.opensource.org/licenses/osl-3.0.php/ + * ////////////////////////////////////////////////////////////////////////////////// + ******************************************************************************/ +package com.kdmanalytics.toif.framework.xmlElements.entities; + +import javax.xml.bind.annotation.XmlElementRef; +import javax.xml.bind.annotation.XmlRootElement; + +/** + * Class representing the adaptor entity + * + * @author Adam Nunn + * + */ +@XmlRootElement(name = "fact") +public class Adaptor extends Entity +{ + + // the name of the adaptor + private Name name; + + // the description of the adaptor + private Description description; + + // the version of the adaptor + private Version version; + + /** + * Creates an adaptor entity from the name, description, and version. + * + * @param name + * the name of the adaptor + * @param description + * the description of the adaptor + * @param version + * the version of the adaptor + */ + public Adaptor(String name, String description, String version) + { + super(); + + // set the xml type of this entity to "toif:Adaptor" + type = "toif:Adaptor"; + + this.name = new Name(name); + this.description = new Description(description); + this.version = new Version(version); + } + + /** + * required blank constructor + */ + public Adaptor() + { + super(); + type = "toif:Adaptor"; + } + + /** + * Get the name of the adaptor + * + * @return the name + */ + @XmlElementRef(name="name") + public Name getName() + { + return name; + } + + /** + * Set the name of the adaptor. + * + * @param name + * the name to set + */ + public void setName(String name) + { + this.name = new Name(name); + } + + /** + * Get the description of the adaptor. + * + * @return the description + */ + @XmlElementRef(name="name") + public Description getDescription() + { + return description; + } + + /** + * set the description of the adaptor + * + * @param description + * the description to set + */ + public void setDescription(String description) + { + this.description = new Description(description); + } + + /** + * get the version of the adaptor + * + * @return the version + */ + @XmlElementRef(name="version") + public Version getVersion() + { + return version; + } + + /** + * set the version of the adaptor + * + * @param version + * the version to set + */ + public void setVersion(String version) + { + this.version = new Version(version); + } + + /** + * Override the equals method. Any Adaptor which has the same name, + * description, and version is equivalent. + */ + @Override + public boolean equals(Object obj) + { + + if (obj instanceof Adaptor) + { + Adaptor adaptor = (Adaptor) obj; + + return name.getName().equals(adaptor.getName().getName()) && description.getText().equals(adaptor.getDescription().getText()) && version.getVersion().equals(adaptor.getVersion().getVersion()); + } + return false; + + } + + /** + * create the hash for the object. + */ + @Override + public int hashCode() + { + return name.getName().hashCode() ^ description.getText().hashCode() ^ version.getVersion().hashCode(); + } +} diff --git a/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/entities/Address.java b/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/entities/Address.java new file mode 100644 index 00000000..93b2244d --- /dev/null +++ b/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/entities/Address.java @@ -0,0 +1,68 @@ +/******************************************************************************* + * ////////////////////////////////////////////////////////////////////////////////// + * // Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This program and the + * // accompanying materials are made available under the terms of the Open Source + * // Initiative OSI - Open Software License v3.0 which accompanies this + * // distribution, and is available at http://www.opensource.org/licenses/osl-3.0.php/ + * ////////////////////////////////////////////////////////////////////////////////// + ******************************************************************************/ +package com.kdmanalytics.toif.framework.xmlElements.entities; + +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlRootElement; + +/** + * Represents the Address entity + * + * @author adam + * + */ +@XmlRootElement(name = "address") +public class Address +{ + + // a string representing the address. + private String address; + + /** + * construct the entity + * + * @param address + */ + public Address(String address) + { + super(); + this.address = address; + } + + /** + * empty constructor. + */ + public Address() + { + super(); + } + + /** + * get the address + * + * @return the address + */ + public String getAddress() + { + return address; + } + + /** + * set the address + * + * @param address + * The address. + */ + @XmlAttribute(name = "address") + public void setAddress(String address) + { + this.address = address; + } + +} diff --git a/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/entities/CWEIdentifier.java b/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/entities/CWEIdentifier.java new file mode 100644 index 00000000..5ced9e76 --- /dev/null +++ b/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/entities/CWEIdentifier.java @@ -0,0 +1,99 @@ +/******************************************************************************* + * ////////////////////////////////////////////////////////////////////////////////// + * // Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This program and the + * // accompanying materials are made available under the terms of the Open Source + * // Initiative OSI - Open Software License v3.0 which accompanies this + * // distribution, and is available at http://www.opensource.org/licenses/osl-3.0.php/ + * ////////////////////////////////////////////////////////////////////////////////// + ******************************************************************************/ +package com.kdmanalytics.toif.framework.xmlElements.entities; + +import javax.xml.bind.annotation.XmlElementRef; +import javax.xml.bind.annotation.XmlRootElement; + +/** + * class which represents the cweindentity entity + * + * @author Adam Nunn + * + */ +@XmlRootElement(name = "fact") +public class CWEIdentifier extends Entity +{ + + // the name of the cwe + private Name name; + + /** + * required blank constructor + */ + public CWEIdentifier() + { + super(); + type = "toif:CWEIdentifier"; + } + + /** + * create a cweIdentifier entity. + * + * @param property + */ + public CWEIdentifier(String property) + { + super(); + type = "toif:CWEIdentifier"; + + this.name = new Name(property); + + } + + /** + * get the name of the cwe + * + * @return the name + */ + @XmlElementRef(name = "name") + public Name getName() + { + return name; + + } + + /** + * set teh name of the cwe + * + * @param name + * the name to set + */ + public void setName(String name) + { + this.name = new Name(name); + } + + /** + * Override the equals to find equivalent cweIdents + */ + @Override + public boolean equals(Object obj) + { + + if (obj instanceof CWEIdentifier) + { + CWEIdentifier cwe = (CWEIdentifier) obj; + + return name.getName().equals(cwe.getName().getName()); + } + return false; + + } + + /** + * override the hash. + */ + @Override + public int hashCode() + { + return name.getName().hashCode(); + } + +} diff --git a/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/entities/Checksum.java b/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/entities/Checksum.java new file mode 100644 index 00000000..d525f4e3 --- /dev/null +++ b/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/entities/Checksum.java @@ -0,0 +1,122 @@ +/******************************************************************************* + * ////////////////////////////////////////////////////////////////////////////////// + * // Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This program and the + * // accompanying materials are made available under the terms of the Open Source + * // Initiative OSI - Open Software License v3.0 which accompanies this + * // distribution, and is available at http://www.opensource.org/licenses/osl-3.0.php/ + * ////////////////////////////////////////////////////////////////////////////////// + ******************************************************************************/ +package com.kdmanalytics.toif.framework.xmlElements.entities; + +import java.io.FileInputStream; +import java.io.InputStream; +import java.security.MessageDigest; + +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlRootElement; + +/** + * Represents the checksum for the file entities. + * + * @author adam + * + */ +@XmlRootElement(name = "checksum") +public class Checksum +{ + + private String checksum; + + /** + * constructs a new checksum + * + * @param file + * The file entity this checksum is for. + */ + public Checksum(String file) + { + super(); + + this.checksum = checksum(file); + + if(checksum == null) { + checksum = "none"; + } + } + + /** + * constructs a new checksum + */ + public Checksum() + { + super(); + } + + /** + * get the checksum + * + * @return the checksum + */ + public String getChecksum() + { + return checksum; + } + + @XmlAttribute(name = "checksum") + public void setChecksum(String file) + { + } + + /** + * representation of MD5 digest + * + * @param file + * path for the file to do the sum on. + * @return The string representing the MD5 sum. + */ + public String checksum(String file) + { + try + { + // The input stream for the file. + InputStream inputStream = new FileInputStream(file); + + // get the MD5 implementation of the MessageDigest. + java.security.MessageDigest md5er = MessageDigest.getInstance("MD5"); + + byte[] buff = new byte[1024]; + int readBytes; + + // read into the buffer and update the digest. + do + { + readBytes = inputStream.read(buff); + if (readBytes > 0) + md5er.update(buff, 0, readBytes); + } + + while (readBytes != -1); + inputStream.close(); + + // complete the digest. + byte[] digest = md5er.digest(); + + if (digest == null) + return null; + + String strDigest = "0x"; + + // compile the md5 string. + for (int i = 0; i < digest.length; i++) + { + strDigest += Integer.toString((digest[i] & 0xff) + 0x100, 16).substring(1).toUpperCase(); + } + return strDigest; + } + + catch (Exception e) + { + return null; + } + } +} diff --git a/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/entities/ClusterIdentifier.java b/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/entities/ClusterIdentifier.java new file mode 100644 index 00000000..81069836 --- /dev/null +++ b/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/entities/ClusterIdentifier.java @@ -0,0 +1,99 @@ +/******************************************************************************* + * ////////////////////////////////////////////////////////////////////////////////// + * // Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This program and the + * // accompanying materials are made available under the terms of the Open Source + * // Initiative OSI - Open Software License v3.0 which accompanies this + * // distribution, and is available at http://www.opensource.org/licenses/osl-3.0.php/ + * ////////////////////////////////////////////////////////////////////////////////// + ******************************************************************************/ +package com.kdmanalytics.toif.framework.xmlElements.entities; + +import javax.xml.bind.annotation.XmlElementRef; +import javax.xml.bind.annotation.XmlRootElement; + +/** + * class which represents the cluster indentity entity + * + * @author Adam Nunn + * + */ +@XmlRootElement(name = "fact") +public class ClusterIdentifier extends Entity +{ + + // the name of the cluster + private Name name; + + /** + * required empty constructor + */ + public ClusterIdentifier() + { + super(); + type = "toif:ClusterIdentifier"; + } + + /** + * create a clusterIdentifier entity. + * + * @param property + */ + public ClusterIdentifier(String property) + { + super(); + type = "toif:ClusterIdentifier"; + + this.name = new Name(property); + + } + + /** + * get the name of the cluster + * + * @return the name + */ + @XmlElementRef(name = "name") + public Name getName() + { + return name; + + } + + /** + * set the name of the constructor. + * + * @param name + * the name to set + */ + public void setName(String name) + { + this.name = new Name(name); + } + + /** + * Override the equals to find equivalent clusterIdents + */ + @Override + public boolean equals(Object obj) + { + + if (obj instanceof ClusterIdentifier) + { + ClusterIdentifier cluster = (ClusterIdentifier) obj; + + return name.getName().equals(cluster.getName().getName()); + } + return false; + + } + + /** + * override the hash. + */ + @Override + public int hashCode() + { + return name.getName().hashCode(); + } + +} diff --git a/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/entities/CodeLocation.java b/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/entities/CodeLocation.java new file mode 100644 index 00000000..b0e5556f --- /dev/null +++ b/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/entities/CodeLocation.java @@ -0,0 +1,187 @@ +/******************************************************************************* + * ////////////////////////////////////////////////////////////////////////////////// + * // Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This program and the + * // accompanying materials are made available under the terms of the Open Source + * // Initiative OSI - Open Software License v3.0 which accompanies this + * // distribution, and is available at http://www.opensource.org/licenses/osl-3.0.php/ + * ////////////////////////////////////////////////////////////////////////////////// + ******************************************************************************/ +package com.kdmanalytics.toif.framework.xmlElements.entities; + +import javax.xml.bind.annotation.XmlElementRef; +import javax.xml.bind.annotation.XmlRootElement; + +/** + * Entity which represents the codeLocation. + * + * @author Adam Nunn + * + */ +@XmlRootElement(name = "fact") +public class CodeLocation extends Entity +{ + + // the linenumber + private LineNumber lineNumber = null; + + // the position + private Position position = null; + + // the offset. + private Offset offset = null; + + /** + * required blank constructor + */ + public CodeLocation() + { + super(); + + // set the xml type to "toif:CodeLocation" + type = "toif:CodeLocation"; + } + + /** + * make a codeLocation from the lineNumber, position, and offset. + * + * @param lineNumber + * the line number of the location + * @param position + * the position of the location + * @param offset + * the offset of the location + */ + public CodeLocation(Integer lineNumber, Integer position, Integer offset) + { + super(); + + // set the xml type to "toif:CodeLocation" + type = "toif:CodeLocation"; + + this.lineNumber = new LineNumber(lineNumber); + if (position != null) + this.position = new Position(position); + if (offset != null) + this.offset = new Offset(offset); + + } + + /** + * get the linenumber + * + * @return the lineNumber + */ + public LineNumber getLineNumber() + { + return lineNumber; + } + + /** + * set the linenumber + * + * @param lineNumber + * the lineNumber to set + */ + @XmlElementRef(name = "linenumber") + public void setLineNumber(LineNumber lineNumber) + { + this.lineNumber = lineNumber; + } + + /** + * get the position + * + * @return the position + */ + public Position getPosition() + { + return position; + } + + /** + * set teh position + * + * @param position + * the position to set + */ + @XmlElementRef(name = "position") + public void setPosition(Position position) + { + this.position = position; + } + + /** + * get the offset + * + * @return the offset + */ + public Offset getOffset() + { + return offset; + } + + /** + * set the offset + * + * @param offset + * the offset to set + */ + @XmlElementRef(name = "offset") + public void setOffset(Offset offset) + { + this.offset = offset; + } + + /** + * Over ride the equals method. To find equivalent codelocations. + */ + @Override + public boolean equals(Object obj) + { + boolean result = false; + + if (obj instanceof CodeLocation) + { + CodeLocation location = (CodeLocation) obj; + + if (getLineNumber() != null) + { + if (location.getLineNumber() == null) + return false; + result = getLineNumber().getLineNumber().equals(location.getLineNumber().getLineNumber()); + } + if (getOffset() != null) + { + if (location.getOffset() == null) + return false; + result = result && getOffset().getOffset().equals(location.getOffset().getOffset()); + } + if (getPosition() != null) + { + if (location.getPosition() == null) + return false; + result = result && getPosition().getPosition().equals(location.getPosition().getPosition()); + } + } + return result; + + } + + /** + * create a hash of the object. + */ + @Override + public int hashCode() + { + int result = 0; + if (lineNumber != null) + result ^= lineNumber.getLineNumber().hashCode(); + if (offset != null) + result ^= offset.hashCode(); + if (position != null) + result ^= position.hashCode(); + + return result; + } + +} diff --git a/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/entities/DataElement.java b/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/entities/DataElement.java new file mode 100644 index 00000000..9eb45f20 --- /dev/null +++ b/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/entities/DataElement.java @@ -0,0 +1,100 @@ +/******************************************************************************* + * ////////////////////////////////////////////////////////////////////////////////// + * // Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This program and the + * // accompanying materials are made available under the terms of the Open Source + * // Initiative OSI - Open Software License v3.0 which accompanies this + * // distribution, and is available at http://www.opensource.org/licenses/osl-3.0.php/ + * ////////////////////////////////////////////////////////////////////////////////// + ******************************************************************************/ +package com.kdmanalytics.toif.framework.xmlElements.entities; + +import javax.xml.bind.annotation.XmlElementRef; +import javax.xml.bind.annotation.XmlRootElement; + +/** + * class which represents the data Element entity. + * + * @author Adam Nunn + * + */ +@XmlRootElement(name = "fact") +public class DataElement extends Entity +{ + + // the name of the dataelement. + private Name name; + + /** + * construct a dataelement + * + * @param name + */ + public DataElement(String name) + { + super(); + + // set the xml type + type = "toif:DataElement"; + + this.name = new Name(name); + } + + /** + * required blank constructor + */ + public DataElement() + { + super(); + + // set the xml type + type = "toif:DataElement"; + } + + /** + * get the name of the data element. + * + * @return the name + */ + @XmlElementRef(name = "name") + public Name getName() + { + return name; + } + + /** + * set the name of the data element. + * + * @param name + * the name to set + */ + public void setName(String name) + { + this.name = new Name(name); + } + + /** + * Over ride the equals method + */ + @Override + public boolean equals(Object obj) + { + + if (obj instanceof DataElement) + { + DataElement dataElement = (DataElement) obj; + + return name.getName().equals(dataElement.getName().getName()); + } + return false; + + } + + /** + * override the hash. + */ + @Override + public int hashCode() + { + return name.getName().hashCode() ^ "dataElement".hashCode(); + } +} diff --git a/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/entities/Date.java b/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/entities/Date.java new file mode 100644 index 00000000..51bbcdaa --- /dev/null +++ b/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/entities/Date.java @@ -0,0 +1,70 @@ +/******************************************************************************* + * ////////////////////////////////////////////////////////////////////////////////// + * // Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This program and the + * // accompanying materials are made available under the terms of the Open Source + * // Initiative OSI - Open Software License v3.0 which accompanies this + * // distribution, and is available at http://www.opensource.org/licenses/osl-3.0.php/ + * ////////////////////////////////////////////////////////////////////////////////// + ******************************************************************************/ +package com.kdmanalytics.toif.framework.xmlElements.entities; + +import java.text.SimpleDateFormat; +import java.util.Calendar; + +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlRootElement; + +/** + * Class to represent the date entity + * + * @author Adam Nunn + * + */ +@XmlRootElement(name = "fact") +public class Date extends Entity +{ + + // how the date should be represented. + public static final String DATE_FORMAT_NOW = "yyyy-MM-dd HH:mm:ss"; + + // the date + private String date; + + /** + * create the date using the current time and date. + */ + public Date() + { + super(); + + // set the xml type to "toif:Date" + type = "toif:Date"; + + Calendar cal = Calendar.getInstance(); + SimpleDateFormat sdf = new SimpleDateFormat(DATE_FORMAT_NOW); + date = sdf.format(cal.getTime()); + } + + /** + * get the date + * + * @return the date + */ + public String getDate() + { + return date; + } + + /** + * set the date + * + * @param date + * the date to set + */ + @XmlAttribute(name = "date") + public void setDate(String date) + { + this.date = date; + } + +} diff --git a/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/entities/Description.java b/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/entities/Description.java new file mode 100644 index 00000000..b081ce3d --- /dev/null +++ b/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/entities/Description.java @@ -0,0 +1,68 @@ +/******************************************************************************* + * ////////////////////////////////////////////////////////////////////////////////// + * // Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This program and the + * // accompanying materials are made available under the terms of the Open Source + * // Initiative OSI - Open Software License v3.0 which accompanies this + * // distribution, and is available at http://www.opensource.org/licenses/osl-3.0.php/ + * ////////////////////////////////////////////////////////////////////////////////// + ******************************************************************************/ +package com.kdmanalytics.toif.framework.xmlElements.entities; + +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlRootElement; + +/** + * representation of the description entity. + * + * @author adam + * + */ +@XmlRootElement(name = "description") +public class Description +{ + + // the description + private String text; + + /** + * construct a description + * + * @param text + * the description. + */ + public Description(String text) + { + super(); + this.text = text; + } + + /** + * required empty constructor + */ + public Description() + { + super(); + } + + /** + * get the text + * + * @return + */ + public String getText() + { + return text; + } + + /** + * set the text for the description + * + * @param text + * the description + */ + @XmlAttribute(name = "text") + public void setText(String text) + { + this.text = text; + } +} diff --git a/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/entities/Directory.java b/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/entities/Directory.java new file mode 100644 index 00000000..042364d0 --- /dev/null +++ b/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/entities/Directory.java @@ -0,0 +1,178 @@ +/******************************************************************************* + * ////////////////////////////////////////////////////////////////////////////////// + * // Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This program and the + * // accompanying materials are made available under the terms of the Open Source + * // Initiative OSI - Open Software License v3.0 which accompanies this + * // distribution, and is available at http://www.opensource.org/licenses/osl-3.0.php/ + * ////////////////////////////////////////////////////////////////////////////////// + ******************************************************************************/ +package com.kdmanalytics.toif.framework.xmlElements.entities; + +import javax.xml.bind.annotation.XmlElementRef; +import javax.xml.bind.annotation.XmlRootElement; + +/** + * representation of the directory + * + * @author adam + * + */ +@XmlRootElement(name = "fact") +public class Directory extends Entity +{ + + // the name of the directory + private Name name; + + // the path to the directory + private String path; + + // the actual directory + private java.io.File directory; + + /** + * Create the directory based on the path to the directory. + * + * @param name + */ + public Directory(String name) + { + super(); + type = "toif:Directory"; + try + { + this.directory = new java.io.File(name); + } + catch (Exception e) + { + System.err.println(name + " " + path); + } + this.path = name; + + // if empty then it is probably the root. + if (directory.getName().isEmpty()) + { + this.name = new Name(directory.getPath()); + } + else + { + this.name = new Name(directory.getName()); + } + } + + /** + * required empty constructor + */ + public Directory() + { + super(); + type = "toif:Directory"; + } + + /** + * get the parent of the directory + * + * @return the parent of the directory + */ + public String getParent() + { + return directory.getParent(); + } + + /** + * get the name of the directory + * + * @return the name the name of the directory + */ + @XmlElementRef + public Name getName() + { + return name; + } + + /** + * set the name of the directory + * + * @param name + * the name to set + */ + public void setName(String name) + { + this.name = new Name(name); + } + + /** + * get the path to the directory + * + * @return the path as a string to the directory + */ + public String getPath() + { + return path; + } + + @Override + public int hashCode() + { + final int prime = 31; + int result = 1; + result = prime * result + ((name == null) ? 0 : name.hashCode()); + result = prime * result + ((path == null) ? 0 : path.hashCode()); + return result; + } + + @Override + public boolean equals(Object obj) + { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + Directory other = (Directory) obj; + if (name == null) + { + if (other.name != null) + return false; + } + else if (!name.equals(other.name)) + return false; + if (path == null) + { + if (other.path != null) + return false; + } + else if (!path.equals(other.path)) + return false; + return true; + } + +// /** +// * Over ride the equals method. This is so that we can make sure that only +// * one of these elements is in the end toif output. +// */ +// @Override +// public boolean equals(Object obj) +// { +// +// if (obj instanceof Directory) +// { +// Directory directory = (Directory) obj; +// +// return this.name.getName().equals(directory.getName().getName()) && this.path.equals(directory.getPath()); +// } +// return false; +// +// } +// +// /** +// * over ride the hash +// */ +// @Override +// public int hashCode() +// { +// return name.getName().hashCode() ^ path.hashCode() ^ "directory".hashCode(); +// } + +} diff --git a/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/entities/Element.java b/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/entities/Element.java new file mode 100644 index 00000000..21a87e62 --- /dev/null +++ b/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/entities/Element.java @@ -0,0 +1,81 @@ +/******************************************************************************* + * ////////////////////////////////////////////////////////////////////////////////// + * // Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This program and the + * // accompanying materials are made available under the terms of the Open Source + * // Initiative OSI - Open Software License v3.0 which accompanies this + * // distribution, and is available at http://www.opensource.org/licenses/osl-3.0.php/ + * ////////////////////////////////////////////////////////////////////////////////// + ******************************************************************************/ +package com.kdmanalytics.toif.framework.xmlElements.entities; + +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlRootElement; + +/** + * Type that all other entities and facts extend. + * + * @author adam + * + */ +@XmlRootElement +public class Element +{ + + // the type of the element. + protected String type = ""; + + // the id of the element. + private long id; + + /** + * empty constructor. + */ + public Element() + { + } + + /** + * get the id of the element. + * + * @return the id + */ + @XmlAttribute + public String getId() + { + return id + ""; + } + + /** + * set the id of the element + * + * @param id + * the id to set + */ + public void setId(int id) + { + this.id = id; + } + + /** + * get the type of the element. + * + * @return the type + */ + public String getType() + { + return type; + } + + /** + * set the type of the element. + * + * @param type + * the type to set + */ + @XmlAttribute(name = "xsi:type") + public void setType(String type) + { + this.type = type; + } + +} diff --git a/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/entities/EmailAddress.java b/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/entities/EmailAddress.java new file mode 100644 index 00000000..3bd7f83e --- /dev/null +++ b/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/entities/EmailAddress.java @@ -0,0 +1,67 @@ +/******************************************************************************* + * ////////////////////////////////////////////////////////////////////////////////// + * // Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This program and the + * // accompanying materials are made available under the terms of the Open Source + * // Initiative OSI - Open Software License v3.0 which accompanies this + * // distribution, and is available at http://www.opensource.org/licenses/osl-3.0.php/ + * ////////////////////////////////////////////////////////////////////////////////// + ******************************************************************************/ +package com.kdmanalytics.toif.framework.xmlElements.entities; + +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlRootElement; + +/** + * represents an email address element. + * + * @author adam + * + */ +@XmlRootElement(name = "email") +public class EmailAddress +{ + + // the email address + private String email; + + /** + * constructs a new email address + * + * @param email + */ + public EmailAddress(String email) + { + super(); + this.email = email; + } + + /** + * required empty constructor + */ + public EmailAddress() + { + super(); + } + + /** + * get the email address + * + * @return the email address + */ + public String getEmail() + { + return email; + } + + /** + * set the email address. + * + * @param email + */ + @XmlAttribute(name = "email") + public void setEmail(String email) + { + this.email = email; + } + +} diff --git a/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/entities/Entity.java b/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/entities/Entity.java new file mode 100644 index 00000000..27f19e49 --- /dev/null +++ b/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/entities/Entity.java @@ -0,0 +1,31 @@ +/******************************************************************************* + * ////////////////////////////////////////////////////////////////////////////////// + * // Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This program and the + * // accompanying materials are made available under the terms of the Open Source + * // Initiative OSI - Open Software License v3.0 which accompanies this + * // distribution, and is available at http://www.opensource.org/licenses/osl-3.0.php/ + * ////////////////////////////////////////////////////////////////////////////////// + ******************************************************************************/ +package com.kdmanalytics.toif.framework.xmlElements.entities; + +import javax.xml.bind.annotation.XmlRootElement; + +/** + * Entity is an extension of the element class. + * + * @author adam + * + */ +@XmlRootElement(name = "entity") +public class Entity extends Element +{ + + /** + * required empty constructor. + */ + public Entity() + { + super(); + } + +} diff --git a/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/entities/File.java b/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/entities/File.java new file mode 100644 index 00000000..7c2d0955 --- /dev/null +++ b/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/entities/File.java @@ -0,0 +1,212 @@ +/******************************************************************************* + * ////////////////////////////////////////////////////////////////////////////////// + * // Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This program and the + * // accompanying materials are made available under the terms of the Open Source + * // Initiative OSI - Open Software License v3.0 which accompanies this + * // distribution, and is available at http://www.opensource.org/licenses/osl-3.0.php/ + * ////////////////////////////////////////////////////////////////////////////////// + ******************************************************************************/ +package com.kdmanalytics.toif.framework.xmlElements.entities; + +import javax.xml.bind.annotation.XmlElementRef; +import javax.xml.bind.annotation.XmlRootElement; + +@XmlRootElement(name = "fact") +public class File extends Entity +{ + + // the name of the file. + private Name name; + + // the version of the file + private Version version; + + // the checksum of the file. + private Checksum checksum; + + // the path to the file. + private String path; + + /** + * required empty constructor + */ + public File() + { + super(); + type = "toif:File"; + } + + /** + * cronstruct a new file entity + * + * @param name + * the name of the file. + */ + public File(String name) + { + super(); + type = "toif:File"; + this.path = name; + + java.io.File file = new java.io.File(name); + + this.name = new Name(file.getName()); + + checksum = new Checksum(file.getPath()); + + if(checksum == null) { + checksum = new Checksum("none"); + } + + } + + /** + * get the name of the file. + * + * @return the name + */ + @XmlElementRef(name = "name") + public Name getName() + { + return name; + } + + /** + * set the name of the file + * + * @param name + * the name to set + */ + public void setName(String name) + { + this.name = new Name(name); + } + + /** + * get the version of the file. + * + * @return the version + */ + @XmlElementRef(name = "version") + public Version getVersion() + { + return version; + } + + /** + * set the version of the file. + * + * @param version + * the version to set + */ + public void setVersion(String version) + { + this.version = new Version(version); + } + + /** + * get the checksum. + * + * @return the checksum + */ + @XmlElementRef(name = "checksum") + public Checksum getChecksum() + { + return checksum; + } + + /** + * set the checksum + * + * @param checksum + * the checksum to set + */ + public void setChecksum(String checksum) + { + this.checksum = new Checksum(checksum); + } + + public String getPath() + { + return path; + } + + /** + * get the parent of the file. + * + * @return + */ + public String getParent() + { + java.io.File file = new java.io.File(path); + if (file.getParent() != null) + { + return file.getParent(); + } + return null; + } + + @Override + public int hashCode() + { + final int prime = 31; + int result = 1; + result = prime * result + ((name == null) ? 0 : name.hashCode()); + result = prime * result + ((path == null) ? 0 : path.hashCode()); + return result; + } + + @Override + public boolean equals(Object obj) + { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + File other = (File) obj; + if (name == null) + { + if (other.name != null) + return false; + } + else if (!name.equals(other.name)) + return false; + if (path == null) + { + if (other.path != null) + return false; + } + else if (!path.equals(other.path)) + return false; + return true; + } + +// /** +// * override the equals method so that only one of these files is present in +// * the elements. +// */ +// @Override +// public boolean equals(Object obj) +// { +// +// if (obj instanceof File) +// { +// File file = (File) obj; +// +// return getName().getName().equals(file.getName().getName()) && getPath().equals(file.getPath()); +// } +// return false; +// +// } +// +// /** +// * override the hashcode. +// */ +// @Override +// public int hashCode() +// { +// return getName().getName().hashCode() ^ getPath().hashCode() ^ "file".hashCode(); +// } +} diff --git a/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/entities/Finding.java b/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/entities/Finding.java new file mode 100644 index 00000000..96d0be61 --- /dev/null +++ b/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/entities/Finding.java @@ -0,0 +1,33 @@ +/******************************************************************************* + * ////////////////////////////////////////////////////////////////////////////////// + * // Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This program and the + * // accompanying materials are made available under the terms of the Open Source + * // Initiative OSI - Open Software License v3.0 which accompanies this + * // distribution, and is available at http://www.opensource.org/licenses/osl-3.0.php/ + * ////////////////////////////////////////////////////////////////////////////////// + ******************************************************************************/ +package com.kdmanalytics.toif.framework.xmlElements.entities; + +import javax.xml.bind.annotation.XmlRootElement; + +/** + * represents a finding entity + * + * @author Adam Nunn + * + */ +@XmlRootElement(name = "fact") +public class Finding extends Entity +{ + + /** + * construct a new finding element. also doubles as the required empty + * constructor + */ + public Finding() + { + super(); + type = "toif:Finding"; + } + +} diff --git a/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/entities/Generator.java b/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/entities/Generator.java new file mode 100644 index 00000000..69005c19 --- /dev/null +++ b/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/entities/Generator.java @@ -0,0 +1,160 @@ +/******************************************************************************* + * ////////////////////////////////////////////////////////////////////////////////// + * // Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This program and the + * // accompanying materials are made available under the terms of the Open Source + * // Initiative OSI - Open Software License v3.0 which accompanies this + * // distribution, and is available at http://www.opensource.org/licenses/osl-3.0.php/ + * ////////////////////////////////////////////////////////////////////////////////// + ******************************************************************************/ +package com.kdmanalytics.toif.framework.xmlElements.entities; + +import javax.xml.bind.annotation.XmlElementRef; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlType; + +/** + * represents a generator entity. + * + * @author adam + * + */ +@XmlType(propOrder = { "name", "description", "version" }) +@XmlRootElement(name = "fact") +public class Generator extends Entity +{ + + // the name of the generator + private Name name; + + // the description of the generator + private Description description; + + // the version of the generator + private Version version; + + /** + * construct a new generator entity. + * + * @param name + * the name of the generator + * @param description + * the generator's description + * @param version + * the generator's version. + */ + public Generator(String name, String description, String version) + { + super(); + type = "toif:Generator"; + if (name != null) + this.name = new Name(name); + if (description != null) + this.description = new Description(description); + if (version != null) + this.version = new Version(version); + } + + /** + * required empty constructor + */ + public Generator() + { + super(); + type = "toif:Generator"; + } + + /** + * get the name of the generator + * + * @return the name the generator's name + */ + @XmlElementRef(name = "name") + public Name getName() + { + return name; + } + + /** + * set the name of the generator. + * + * @param name + * the name to set + */ + public void setName(String name) + { + this.name = new Name(name); + } + + /** + * get the description of the generator + * + * @return the description the generators description. + */ + @XmlElementRef(name = "description") + public Description getDescription() + { + return description; + } + + /** + * set the description of the generatpor + * + * @param description + * the description to set + */ + public void setDescription(String description) + { + this.description = new Description(description); + } + + /** + * get the version of the generator. + * + * @return the version the version of the generator. + */ + @XmlElementRef(name = "version") + public Version getVersion() + { + return version; + } + + /** + * set the version of the generator. + * + * @param version + * the version to set + */ + public void setVersion(String version) + { + this.version = new Version(version); + } + + /** + * override the equals method. this is so that we can make sure that there + * is only one of these elements in toif output. + */ + @Override + public boolean equals(Object obj) + { + + if (obj instanceof Generator) + { + Generator gen = (Generator) obj; + + return name.getName().equals(gen.getName().getName()) && description.getText().equals(gen.getDescription().getText()) + && version.getVersion().equals(gen.getVersion().getVersion()); + } + return false; + + } + + /** + * override the hashcode + */ + @Override + public int hashCode() + { + return name.getName().hashCode() ^ description.getText().hashCode() ^ version.getVersion().hashCode(); + } + +} diff --git a/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/entities/LineNumber.java b/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/entities/LineNumber.java new file mode 100644 index 00000000..b8163260 --- /dev/null +++ b/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/entities/LineNumber.java @@ -0,0 +1,68 @@ +/******************************************************************************* + * ////////////////////////////////////////////////////////////////////////////////// + * // Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This program and the + * // accompanying materials are made available under the terms of the Open Source + * // Initiative OSI - Open Software License v3.0 which accompanies this + * // distribution, and is available at http://www.opensource.org/licenses/osl-3.0.php/ + * ////////////////////////////////////////////////////////////////////////////////// + ******************************************************************************/ +package com.kdmanalytics.toif.framework.xmlElements.entities; + +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlRootElement; + +/** + * represents the linenumber entity. + * + * @author adam + * + */ +@XmlRootElement(name = "lineNumber") +public class LineNumber +{ + + // the linenumber + private Integer lineNumber; + + /** + * costruct a new line number entity. + * + * @param lineNumber + */ + public LineNumber(Integer lineNumber) + { + super(); + this.lineNumber = lineNumber; + } + + /** + * required empty constructor + */ + public LineNumber() + { + super(); + } + + /** + * get the line number. + * + * @return the line number. + */ + public Integer getLineNumber() + { + return lineNumber; + } + + /** + * set the line number + * + * @param lineNumber + * the line number where the finding is found. + */ + @XmlAttribute(name = "lineNumber") + public void setLineNumber(Integer lineNumber) + { + this.lineNumber = lineNumber; + } + +} diff --git a/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/entities/Name.java b/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/entities/Name.java new file mode 100644 index 00000000..9138e78e --- /dev/null +++ b/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/entities/Name.java @@ -0,0 +1,98 @@ +/******************************************************************************* + * ////////////////////////////////////////////////////////////////////////////////// + * // Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This program and the + * // accompanying materials are made available under the terms of the Open Source + * // Initiative OSI - Open Software License v3.0 which accompanies this + * // distribution, and is available at http://www.opensource.org/licenses/osl-3.0.php/ + * ////////////////////////////////////////////////////////////////////////////////// + ******************************************************************************/ +package com.kdmanalytics.toif.framework.xmlElements.entities; + +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlRootElement; + +/** + * represents the name attribute + * + * @author adam + * + */ +@XmlRootElement(name = "name") +public class Name +{ + + // the name + private String name; + + /** + * construct a new name + * + * @param name + * the name + */ + public Name(String name) + { + super(); + this.name = name; + } + + /** + * required empty constructor. + */ + public Name() + { + super(); + } + + /** + * get the name + * + * @return the name + */ + public String getName() + { + return name; + } + + /** + * set the name + * + * @param name + * the name + */ + @XmlAttribute(name = "name") + public void setName(String name) + { + this.name = name; + } + + @Override + public int hashCode() + { + final int prime = 31; + int result = 1; + result = prime * result + ((name == null) ? 0 : name.hashCode()); + return result; + } + + @Override + public boolean equals(Object obj) + { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + Name other = (Name) obj; + if (name == null) + { + if (other.name != null) + return false; + } + else if (!name.equals(other.name)) + return false; + return true; + } + +} diff --git a/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/entities/Offset.java b/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/entities/Offset.java new file mode 100644 index 00000000..3f8c6afa --- /dev/null +++ b/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/entities/Offset.java @@ -0,0 +1,68 @@ +/******************************************************************************* + * ////////////////////////////////////////////////////////////////////////////////// + * // Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This program and the + * // accompanying materials are made available under the terms of the Open Source + * // Initiative OSI - Open Software License v3.0 which accompanies this + * // distribution, and is available at http://www.opensource.org/licenses/osl-3.0.php/ + * ////////////////////////////////////////////////////////////////////////////////// + ******************************************************************************/ +package com.kdmanalytics.toif.framework.xmlElements.entities; + +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlRootElement; + +/** + * represents the offset attribute + * + * @author adam + * + */ +@XmlRootElement(name = "offset") +public class Offset +{ + + // the offset + private Integer offset; + + /** + * construct a new offset entity + * + * @param offset + */ + public Offset(Integer offset) + { + super(); + this.offset = offset; + } + + /** + * required empty constructor + */ + public Offset() + { + super(); + } + + /** + * get the offset + * + * @return the offset + */ + public Integer getOffset() + { + return offset; + } + + /** + * set the offset + * + * @param offset + * the offset. + */ + @XmlAttribute(name = "offset") + public void setOffset(Integer offset) + { + this.offset = offset; + } + +} diff --git a/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/entities/Organization.java b/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/entities/Organization.java new file mode 100644 index 00000000..a30db68e --- /dev/null +++ b/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/entities/Organization.java @@ -0,0 +1,221 @@ +/******************************************************************************* + * ////////////////////////////////////////////////////////////////////////////////// + * // Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This program and the + * // accompanying materials are made available under the terms of the Open Source + * // Initiative OSI - Open Software License v3.0 which accompanies this + * // distribution, and is available at http://www.opensource.org/licenses/osl-3.0.php/ + * ////////////////////////////////////////////////////////////////////////////////// + ******************************************************************************/ +package com.kdmanalytics.toif.framework.xmlElements.entities; + +import javax.xml.bind.annotation.XmlElementRef; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlType; + +/** + * represents the organization entity. + * + * @author adam + * + */ +@XmlType(propOrder = { "name", "description", "address", "phone", "email" }) +@XmlRootElement(name = "fact") +public class Organization extends Entity +{ + + // the name of the organization + @XmlElementRef(name = "name") + private Name name = null; + + // the description of the organization + @XmlElementRef(name = "description") + private Description description = null; + + // the address of the organization + @XmlElementRef(name = "address") + private Address address = null; + + // the phone number of the organization + @XmlElementRef(name = "phone") + private Phone phone = null; + + // the email address of the organization. + @XmlElementRef(name = "email") + private EmailAddress email = null; + + /** + * construct an new organization entity. + * + * @param name + * the name of the organization + * @param description + * the description of the organization + * @param address + * the address of the organization + * @param phone + * the phone number of the of the organization + * @param email + * the email address of the organization + */ + public Organization(String name, String description, String address, String phone, String email) + { + super(); + type = "toif:Organization"; + + if (name != null) + this.name = new Name(name); + if (description != null) + this.description = new Description(description); + if (address != null) + this.address = new Address(address); + if (phone != null) + this.phone = new Phone(phone); + if (email != null) + this.email = new EmailAddress(email); + } + + /** + * required empty constructor + */ + public Organization() + { + super(); + type = "toif:Organization"; + } + + /** + * get the name of the organization + * + * @return the name of the organization + */ + public Name getName() + { + return name; + } + + /** + * set the name of the organization. + * + * @param name + * the name to set + */ + public void setName(String name) + { + this.name = new Name(name); + } + + /** + * the description of the organization + * + * @return the description + */ + public Description getDescription() + { + return description; + } + + /** + * set the description of the organization. + * + * @param description + * the description to set + */ + public void setDescription(String description) + { + this.description = new Description(description); + } + + /** + * get the address of the organization. + * + * @return the address + */ + public Address getAddress() + { + return address; + } + + /** + * set the address of the organization. + * + * @param address + * the address to set + */ + public void setAddress(String address) + { + this.address = new Address(address); + } + + /** + * get the organization's phone number + * + * @return the phone + */ + public Phone getPhone() + { + return phone; + } + + /** + * set the organization's phone number + * + * @param phone + * the phone to set + */ + public void setPhone(String phone) + { + this.phone = new Phone(phone); + } + + /** + * the organizations email address. + * + * @return the email + */ + public EmailAddress getEmail() + { + return email; + } + + /** + * set the organizations email address. + * + * @param email + * the email to set + */ + public void setEmail(String email) + { + this.email = new EmailAddress(email); + } + + /** + * override the equals method. this makes sure that there are not duplicate + * equivalent organizations in the toif output + */ + @Override + public boolean equals(Object obj) + { + + if (obj instanceof Organization) + { + Organization org = (Organization) obj; + + return name.getName().equals(org.getName().getName()) && description.getText().equals(org.getDescription().getText()) + && address.getAddress().equals(org.getAddress().getAddress()) && email.getEmail().equals(org.getEmail().getEmail()) + && phone.getPhone().equals(org.getPhone().getPhone()); + } + return false; + + } + + /** + * override the hash + */ + @Override + public int hashCode() + { + return name.getName().hashCode() ^ description.getText().hashCode() ^ address.getAddress().hashCode() ^ email.getEmail().hashCode() + ^ phone.getPhone().hashCode(); + } + +} diff --git a/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/entities/Person.java b/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/entities/Person.java new file mode 100644 index 00000000..bea9170b --- /dev/null +++ b/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/entities/Person.java @@ -0,0 +1,152 @@ +/******************************************************************************* + * ////////////////////////////////////////////////////////////////////////////////// + * // Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This program and the + * // accompanying materials are made available under the terms of the Open Source + * // Initiative OSI - Open Software License v3.0 which accompanies this + * // distribution, and is available at http://www.opensource.org/licenses/osl-3.0.php/ + * ////////////////////////////////////////////////////////////////////////////////// + ******************************************************************************/ +package com.kdmanalytics.toif.framework.xmlElements.entities; + +import javax.xml.bind.annotation.XmlElementRef; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlType; + +/** + * represents the person entity. + * + * @author adam + * + */ +@XmlType(propOrder = { "name", "phone", "email" }) +@XmlRootElement(name = "fact") +public class Person extends Entity +{ + + // the person's name + private Name name; + + // the person's phone number + private Phone phone; + + // the person's email address. + private EmailAddress email; + + /** + * the required empty constructor. + */ + public Person() + { + super(); + type = "toif:Person"; + } + + /** + * construct a new person entity. + * + * @param name + * the person's name + * @param email + * the person's email address. + * @param phone + * the person's phone number + */ + public Person(String name, String email, String phone) + { + super(); + type = "toif:Person"; + + this.name = new Name(name); + this.email = new EmailAddress(email); + this.phone = new Phone(phone); + + } + + /** + * get the person's name + * + * @return the name + */ + @XmlElementRef(name = "name") + public Name getName() + { + return name; + } + + /** + * set the person's name + * + * @param name + * the name to set + */ + public void setName(String name) + { + this.name = new Name(name); + } + + /** + * get the persons phone number + * + * @return the phone + */ + @XmlElementRef(name = "phone") + public Phone getPhone() + { + return phone; + } + + /** + * @param phone + * the phone to set + */ + public void setPhone(String phone) + { + this.phone = new Phone(phone); + } + + /** + * @return the email + */ + @XmlElementRef(name = "email") + public EmailAddress getEmail() + { + return email; + } + + /** + * @param email + * the email to set + */ + public void setEmail(String email) + { + this.email = new EmailAddress(email); + } + + /** + * override the equals method so that we can ensure the toif output only has + * one equivalent person. + */ + @Override + public boolean equals(Object obj) + { + + if (obj instanceof Person) + { + Person person = (Person) obj; + + return name.getName().equals(person.getName().getName()) && phone.getPhone().equals(person.getPhone().getPhone()) + && email.getEmail().equals(person.getEmail().getEmail()); + } + return false; + + } + + /** + * override the hashcode + */ + @Override + public int hashCode() + { + return name.getName().hashCode() ^ phone.getPhone().hashCode() ^ email.getEmail().hashCode(); + } +} diff --git a/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/entities/Phone.java b/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/entities/Phone.java new file mode 100644 index 00000000..5b2c4a12 --- /dev/null +++ b/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/entities/Phone.java @@ -0,0 +1,68 @@ +/******************************************************************************* + * ////////////////////////////////////////////////////////////////////////////////// + * // Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This program and the + * // accompanying materials are made available under the terms of the Open Source + * // Initiative OSI - Open Software License v3.0 which accompanies this + * // distribution, and is available at http://www.opensource.org/licenses/osl-3.0.php/ + * ////////////////////////////////////////////////////////////////////////////////// + ******************************************************************************/ +package com.kdmanalytics.toif.framework.xmlElements.entities; + +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlRootElement; + +/** + * representation of the phone number attribute + * + * @author adam + * + */ +@XmlRootElement(name = "phone") +public class Phone +{ + + // the phone number + private String phone; + + /** + * constuct a new phone number attribute + * + * @param phone + * the phone number + */ + public Phone(String phone) + { + super(); + this.phone = phone; + } + + /** + * required empty constructor + */ + public Phone() + { + super(); + } + + /** + * get the phone number + * + * @return the phone number + */ + public String getPhone() + { + return phone; + } + + /** + * set the phone number + * + * @param phone + * the phone number + */ + @XmlAttribute(name = "phone") + public void setPhone(String phone) + { + this.phone = phone; + } +} diff --git a/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/entities/Position.java b/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/entities/Position.java new file mode 100644 index 00000000..3703c216 --- /dev/null +++ b/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/entities/Position.java @@ -0,0 +1,69 @@ +/******************************************************************************* + * ////////////////////////////////////////////////////////////////////////////////// + * // Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This program and the + * // accompanying materials are made available under the terms of the Open Source + * // Initiative OSI - Open Software License v3.0 which accompanies this + * // distribution, and is available at http://www.opensource.org/licenses/osl-3.0.php/ + * ////////////////////////////////////////////////////////////////////////////////// + ******************************************************************************/ +package com.kdmanalytics.toif.framework.xmlElements.entities; + +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlRootElement; + +/** + * represents the position attribute. + * + * @author adam + * + */ +@XmlRootElement(name = "position") +public class Position +{ + + // the position + private Integer position; + + /** + * construct a new position attribute. + * + * @param position + * the position of the finding + */ + public Position(Integer position) + { + super(); + this.position = position; + } + + /** + * required empty constructor. + */ + public Position() + { + super(); + } + + /** + * get the postion. + * + * @return the position + */ + public Integer getPosition() + { + return position; + } + + /** + * set the postion + * + * @param position + * the position. + */ + @XmlAttribute(name = "position") + public void setPosition(Integer position) + { + this.position = position; + } + +} diff --git a/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/entities/Project.java b/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/entities/Project.java new file mode 100644 index 00000000..82403bde --- /dev/null +++ b/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/entities/Project.java @@ -0,0 +1,126 @@ +/******************************************************************************* + * ////////////////////////////////////////////////////////////////////////////////// + * // Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This program and the + * // accompanying materials are made available under the terms of the Open Source + * // Initiative OSI - Open Software License v3.0 which accompanies this + * // distribution, and is available at http://www.opensource.org/licenses/osl-3.0.php/ + * ////////////////////////////////////////////////////////////////////////////////// + ******************************************************************************/ +package com.kdmanalytics.toif.framework.xmlElements.entities; + +import javax.xml.bind.annotation.XmlElementRef; +import javax.xml.bind.annotation.XmlRootElement; + +/** + * represents the project entity + * + * @author adam + * + */ +@XmlRootElement(name = "fact") +public class Project extends Entity +{ + + // the name of the project + private Name name; + + // the description of the project + private Description description; + + /** + * create a new project entity + * + * @param name + * the name of the project + * @param description + * the description of the project + */ + public Project(String name, String description) + { + super(); + type = "toif:Project"; + this.name = new Name(name); + this.description = new Description(description); + } + + /** + * required empty constructor + */ + public Project() + { + super(); + type = "toif:Project"; + } + + /** + * get the name of the project + * + * @return the name + */ + @XmlElementRef(name = "name") + public Name getName() + { + return name; + } + + /** + * set the name of the project + * + * @param name + * the name to set + */ + public void setName(String name) + { + this.name = new Name(name); + } + + /** + * get the description of the project + * + * @return the description + */ + @XmlElementRef(name = "description") + public Description getDescription() + { + return description; + } + + /** + * get the description of the project + * + * @param description + * the description to set + */ + public void setDescription(String description) + { + this.description = new Description(description); + } + + /** + * override the equals method so that we can make sure that there is only + * one of these elements in the toif output. + */ + @Override + public boolean equals(Object obj) + { + + if (obj instanceof Project) + { + Project proj = (Project) obj; + + return name.getName().equals(proj.getName().getName()) && description.getText().equals(proj.getDescription().getText()); + } + return false; + + } + + /** + * override the hascode. + */ + @Override + public int hashCode() + { + return name.getName().hashCode() ^ description.getText().hashCode(); + } + +} diff --git a/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/entities/Role.java b/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/entities/Role.java new file mode 100644 index 00000000..42054abc --- /dev/null +++ b/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/entities/Role.java @@ -0,0 +1,128 @@ +/******************************************************************************* + * ////////////////////////////////////////////////////////////////////////////////// + * // Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This program and the + * // accompanying materials are made available under the terms of the Open Source + * // Initiative OSI - Open Software License v3.0 which accompanies this + * // distribution, and is available at http://www.opensource.org/licenses/osl-3.0.php/ + * ////////////////////////////////////////////////////////////////////////////////// + ******************************************************************************/ +package com.kdmanalytics.toif.framework.xmlElements.entities; + +import javax.xml.bind.annotation.XmlElementRef; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlType; + +/** + * represents the role entity. + * + * @author adam + * + */ +@XmlType(propOrder = { "name", "description" }) +@XmlRootElement(name = "fact") +public class Role extends Entity +{ + + // the name of the role + private Name name; + + // the description of the role + private Description description; + + /** + * construct a new role + * + * @param name + * the name of the role + * @param description + * the description of the role + */ + public Role(String name, String description) + { + super(); + type = "toif:Role"; + this.name = new Name(name); + this.description = new Description(description); + } + + /** + * required empty constructor + */ + public Role() + { + super(); + type = "toif:Role"; + } + + /** + * get the name of the role + * + * @return the name + */ + @XmlElementRef(name = "name") + public Name getName() + { + return name; + } + + /** + * set the name for the role + * + * @param name + * the name to set + */ + public void setName(String name) + { + this.name = new Name(name); + } + + /** + * get the description for the role + * + * @return the description + */ + @XmlElementRef(name = "description") + public Description getDescription() + { + return description; + } + + /** + * set the description for the role + * + * @param description + * the description to set + */ + public void setDescription(String description) + { + this.description = new Description(description); + } + + /** + * override the equals method. This is to be sure that there is only one of + * these roles in the toif output. + */ + @Override + public boolean equals(Object obj) + { + + if (obj instanceof Role) + { + Role role = (Role) obj; + + return name.getName().equals(role.getName().getName()) && description.getText().equals(role.getDescription().getText()); + } + return false; + + } + + /** + * override the hashcode. + */ + @Override + public int hashCode() + { + return name.getName().hashCode() ^ description.getText().hashCode(); + } + +} diff --git a/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/entities/SFPIdentifier.java b/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/entities/SFPIdentifier.java new file mode 100644 index 00000000..c30cef02 --- /dev/null +++ b/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/entities/SFPIdentifier.java @@ -0,0 +1,97 @@ +/******************************************************************************* + * ////////////////////////////////////////////////////////////////////////////////// + * // Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This program and the + * // accompanying materials are made available under the terms of the Open Source + * // Initiative OSI - Open Software License v3.0 which accompanies this + * // distribution, and is available at http://www.opensource.org/licenses/osl-3.0.php/ + * ////////////////////////////////////////////////////////////////////////////////// + ******************************************************************************/ +package com.kdmanalytics.toif.framework.xmlElements.entities; + +import javax.xml.bind.annotation.XmlElementRef; +import javax.xml.bind.annotation.XmlRootElement; + + +/** + * class which represents the sfp-indentity entity + * + * @author Adam Nunn + * + */ +@XmlRootElement(name = "fact") +public class SFPIdentifier extends Entity +{ + + // the name of the cwe + private Name name; + + /** + * required blank constructor + */ + public SFPIdentifier() + { + super(); + type = "toif:SFPIdentifier"; + } + + /** + * create a cweIdentifier entity. + * + * @param property + */ + public SFPIdentifier(String property) + { + super(); + type = "toif:SFPIdentifier"; + + this.name = new Name(property); + + } + + /** + * + * @return the name + */ + @XmlElementRef(name = "name") + public Name getName() + { + return name; + + } + + /** + * @param name + * the name to set + */ + public void setName(String name) + { + this.name = new Name(name); + } + + /** + * Override the equals to find equivalent cweIdents + */ + @Override + public boolean equals(Object obj) + { + + if (obj instanceof SFPIdentifier) + { + SFPIdentifier sfp = (SFPIdentifier) obj; + + return name.getName().equals(sfp.getName().getName()); + } + return false; + + } + + /** + * override the hash. + */ + @Override + public int hashCode() + { + return name.getName().hashCode(); + } + +} diff --git a/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/entities/Segment.java b/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/entities/Segment.java new file mode 100644 index 00000000..b269881a --- /dev/null +++ b/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/entities/Segment.java @@ -0,0 +1,148 @@ +/******************************************************************************* + * ////////////////////////////////////////////////////////////////////////////////// + * // Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This program and the + * // accompanying materials are made available under the terms of the Open Source + * // Initiative OSI - Open Software License v3.0 which accompanies this + * // distribution, and is available at http://www.opensource.org/licenses/osl-3.0.php/ + * ////////////////////////////////////////////////////////////////////////////////// + ******************************************************************************/ +package com.kdmanalytics.toif.framework.xmlElements.entities; + +import java.util.ArrayList; + +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElementRef; +import javax.xml.bind.annotation.XmlRootElement; + +/** + * represents the segment entity in the toif output. + * + * @author adam + * + */ +@XmlRootElement(name = "toif:TOIFSegment") +public class Segment extends Element +{ + + // the name of the segment + @XmlElementRef + private Name name; + + // the description of the segment + private Description description; + + /* + * doctype stuff. + */ + @XmlAttribute(name = "xmlns:toif") + private String toif = "http://kdmanalytics.com/toif.xsd"; + + @XmlAttribute(name = "xmlns:xsi") + private String xsi = "http://www.w3.org/2001/XMLSchema-instance"; + + @XmlAttribute(name = "xmlns:xmi") + private String xmi = "http://www.omg.org/XMI"; + + @XmlAttribute(name = "xsi:schemaLocation") + private String schemaLocation = "http://kdmanalytics.com/TOIFSchema.xsd TOIFSchema.xsd"; + + // the list of element in the segment. + private ArrayList elements = new ArrayList(); + + /** + * construct a new segment. + */ + public Segment() + { + super(); + type = "toif:TOIFSegment"; + } + + /** + * get the name of the segment. + * + * @return the name of the segment. + */ + public Name getName() + { + return name; + } + + /** + * set the name of the segment. + * + * @param name + * the name to set + */ + public void setName(String name) + { + this.name = new Name(name); + } + + /** + * get the description of the segment. + * + * @return the description + */ + @XmlElementRef(name = "description") + public Description getDescription() + { + return description; + } + + /** + * set the description of the segment + * + * @param description + * the description to set + */ + @XmlAttribute(name = "description") + public void setDescription(String description) + { + this.description = new Description(description); + } + + /** + * @return the elements + */ + @XmlElementRef() + public ArrayList getElements() + { + return elements; + } + + public void clearSegment() + { + elements.clear(); + } + + /** + * @param elements + * the elements to set + */ + public void setElements(ArrayList elements) + { + this.elements = elements; + } + + /** + * + * @param finding + */ + public void addElement(Element element) + { + elements.add(element); + + } + + public void setId(int id) + { + this.name = new Name(id + ""); + } + + public String getId() + { + return null; + } + +} diff --git a/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/entities/Statement.java b/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/entities/Statement.java new file mode 100644 index 00000000..a08ecd92 --- /dev/null +++ b/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/entities/Statement.java @@ -0,0 +1,22 @@ +/******************************************************************************* + * ////////////////////////////////////////////////////////////////////////////////// + * // Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This program and the + * // accompanying materials are made available under the terms of the Open Source + * // Initiative OSI - Open Software License v3.0 which accompanies this + * // distribution, and is available at http://www.opensource.org/licenses/osl-3.0.php/ + * ////////////////////////////////////////////////////////////////////////////////// + ******************************************************************************/ +package com.kdmanalytics.toif.framework.xmlElements.entities; + +import javax.xml.bind.annotation.XmlRootElement; + +@XmlRootElement(name="fact") +public class Statement extends Entity +{ + + public Statement() + { + super(); + type = "toif:Statement"; + } +} diff --git a/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/entities/Text.java b/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/entities/Text.java new file mode 100644 index 00000000..e7eed117 --- /dev/null +++ b/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/entities/Text.java @@ -0,0 +1,43 @@ +/******************************************************************************* + * ////////////////////////////////////////////////////////////////////////////////// + * // Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This program and the + * // accompanying materials are made available under the terms of the Open Source + * // Initiative OSI - Open Software License v3.0 which accompanies this + * // distribution, and is available at http://www.opensource.org/licenses/osl-3.0.php/ + * ////////////////////////////////////////////////////////////////////////////////// + ******************************************************************************/ +package com.kdmanalytics.toif.framework.xmlElements.entities; + +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlRootElement; + +@XmlRootElement(name="description") +public class Text +{ + private String text; + + /** + * + * @param text + */ + public Text(String text) + { + super(); + this.setText(text); + } + + public Text() { + super(); + } + + @XmlAttribute(name = "text") + public void setText(String text) + { + this.text = text; + } + + public String getText() + { + return text; + } +} diff --git a/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/entities/Vendor.java b/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/entities/Vendor.java new file mode 100644 index 00000000..d2366e5f --- /dev/null +++ b/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/entities/Vendor.java @@ -0,0 +1,28 @@ +/******************************************************************************* + * ////////////////////////////////////////////////////////////////////////////////// + * // Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This program and the + * // accompanying materials are made available under the terms of the Open Source + * // Initiative OSI - Open Software License v3.0 which accompanies this + * // distribution, and is available at http://www.opensource.org/licenses/osl-3.0.php/ + * ////////////////////////////////////////////////////////////////////////////////// + ******************************************************************************/ +package com.kdmanalytics.toif.framework.xmlElements.entities; + +import javax.xml.bind.annotation.XmlRootElement; + +@XmlRootElement(name = "fact") +public class Vendor extends Organization +{ + + public Vendor() + { + super(); + type = "toif:Vendor"; + } + + public Vendor(String name, String description, String address, String phone, String email) + { + super(name, description, address, phone, email); + type = "toif:Vendor"; + } +} diff --git a/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/entities/Version.java b/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/entities/Version.java new file mode 100644 index 00000000..caf12376 --- /dev/null +++ b/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/entities/Version.java @@ -0,0 +1,40 @@ +/******************************************************************************* + * ////////////////////////////////////////////////////////////////////////////////// + * // Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This program and the + * // accompanying materials are made available under the terms of the Open Source + * // Initiative OSI - Open Software License v3.0 which accompanies this + * // distribution, and is available at http://www.opensource.org/licenses/osl-3.0.php/ + * ////////////////////////////////////////////////////////////////////////////////// + ******************************************************************************/ +package com.kdmanalytics.toif.framework.xmlElements.entities; + +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlRootElement; + +@XmlRootElement(name="version") +public class Version +{ + private String version; + + public Version(String version) + { + super(); + this.version = version; + } + + public Version() { + super(); + } + + + public String getVersion() + { + return version; + } + + @XmlAttribute(name="version") + public void setVersion(String version) + { + this.version = version; + } +} diff --git a/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/entities/WeaknessDescription.java b/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/entities/WeaknessDescription.java new file mode 100644 index 00000000..5503cff2 --- /dev/null +++ b/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/entities/WeaknessDescription.java @@ -0,0 +1,75 @@ +/******************************************************************************* + * ////////////////////////////////////////////////////////////////////////////////// + * // Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This program and the + * // accompanying materials are made available under the terms of the Open Source + * // Initiative OSI - Open Software License v3.0 which accompanies this + * // distribution, and is available at http://www.opensource.org/licenses/osl-3.0.php/ + * ////////////////////////////////////////////////////////////////////////////////// + ******************************************************************************/ +package com.kdmanalytics.toif.framework.xmlElements.entities; + +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlRootElement; + +@XmlRootElement(name = "fact") +public class WeaknessDescription extends Entity +{ + private String weaknessDescription; + + public WeaknessDescription() + { + super(); + type = "toif:WeaknessDescription"; + } + + public WeaknessDescription(String weaknessDescription) + { + super(); + type = "toif:WeaknessDescription"; + this.weaknessDescription = weaknessDescription; + } + + /** + * @return the weaknessDescription + */ + public String getWeaknessDescription() + { + return weaknessDescription; + } + + /** + * @param weaknessDescription + * the weaknessDescription to set + */ + @XmlAttribute(name="text") + public void setWeaknessDescription(String weaknessDescription) + { + this.weaknessDescription = weaknessDescription; + } + + /** + * + */ + @Override + public boolean equals(Object obj) + { + + if (obj instanceof WeaknessDescription) + { + WeaknessDescription description = (WeaknessDescription) obj; + + return weaknessDescription.equals(description.getWeaknessDescription()); + } + return false; + + } + + /** + * + */ + @Override + public int hashCode() { + return weaknessDescription.hashCode(); + } + +} diff --git a/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/facts/AdaptorIsSuppliedByVendor.java b/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/facts/AdaptorIsSuppliedByVendor.java new file mode 100644 index 00000000..bb106413 --- /dev/null +++ b/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/facts/AdaptorIsSuppliedByVendor.java @@ -0,0 +1,83 @@ +/******************************************************************************* + * ////////////////////////////////////////////////////////////////////////////////// + * // Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This program and the + * // accompanying materials are made available under the terms of the Open Source + * // Initiative OSI - Open Software License v3.0 which accompanies this + * // distribution, and is available at http://www.opensource.org/licenses/osl-3.0.php/ + * ////////////////////////////////////////////////////////////////////////////////// + ******************************************************************************/ +package com.kdmanalytics.toif.framework.xmlElements.facts; + +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlType; + +import com.kdmanalytics.toif.framework.xmlElements.entities.Adaptor; +import com.kdmanalytics.toif.framework.xmlElements.entities.Vendor; + +@XmlType(propOrder = { "vendor", "adaptor" }) +@XmlRootElement(name="fact") +public class AdaptorIsSuppliedByVendor extends Fact +{ + + private Adaptor adaptor; + + private Vendor vendor; + + public AdaptorIsSuppliedByVendor(Adaptor adaptor, Vendor vendor) + { + super(); + type = "toif:AdaptorIsSuppliedByVendor"; + this.adaptor = adaptor; + this.vendor = vendor; + } + + + public AdaptorIsSuppliedByVendor() + { + super(); + type = "toif:AdaptorIsSuppliedByVendor"; + } + + + + /** + * @return the adaptor + */ + @XmlAttribute + public String getAdaptor() + { + return adaptor.getId(); + } + + + + /** + * @param adaptor the adaptor to set + */ + public void setAdaptor(Adaptor adaptor) + { + this.adaptor = adaptor; + } + + + + /** + * @return the vendor + */ + @XmlAttribute + public String getVendor() + { + return vendor.getId(); + } + + + + /** + * @param vendor the vendor to set + */ + public void setVendor(Vendor vendor) + { + this.vendor = vendor; + } +} diff --git a/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/facts/AdaptorSupportsGenerator.java b/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/facts/AdaptorSupportsGenerator.java new file mode 100644 index 00000000..3d26d736 --- /dev/null +++ b/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/facts/AdaptorSupportsGenerator.java @@ -0,0 +1,81 @@ +/******************************************************************************* + * ////////////////////////////////////////////////////////////////////////////////// + * // Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This program and the + * // accompanying materials are made available under the terms of the Open Source + * // Initiative OSI - Open Software License v3.0 which accompanies this + * // distribution, and is available at http://www.opensource.org/licenses/osl-3.0.php/ + * ////////////////////////////////////////////////////////////////////////////////// + ******************************************************************************/ +package com.kdmanalytics.toif.framework.xmlElements.facts; + +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlType; + +import com.kdmanalytics.toif.framework.xmlElements.entities.Adaptor; +import com.kdmanalytics.toif.framework.xmlElements.entities.Generator; + +@XmlType(propOrder = { "generator", "adaptor" }) +@XmlRootElement(name = "fact") +public class AdaptorSupportsGenerator extends Fact +{ + + private Adaptor adaptor; + + private Generator generator; + + public AdaptorSupportsGenerator() + { + super(); + type = "toif:AdaptorSupportsGenerator"; + } + + /** + * + * @param adaptor + * @param generator + */ + public AdaptorSupportsGenerator(Adaptor adaptor, Generator generator) + { + super(); + type = "toif:AdaptorSupportsGenerator"; + this.adaptor = adaptor; + this.generator = generator; + } + + /** + * @return the adaptor + */ + @XmlAttribute + public String getAdaptor() + { + return adaptor.getId(); + } + + /** + * @param adaptor + * the adaptor to set + */ + public void setAdaptor(Adaptor adaptor) + { + this.adaptor = adaptor; + } + + /** + * @return the generator + */ + @XmlAttribute + public String getGenerator() + { + return generator.getId(); + } + + /** + * @param generator + * the generator to set + */ + public void setGenerator(Generator generator) + { + this.generator = generator; + } +} diff --git a/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/facts/CodeLocationReferencesFile.java b/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/facts/CodeLocationReferencesFile.java new file mode 100644 index 00000000..1c07ee02 --- /dev/null +++ b/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/facts/CodeLocationReferencesFile.java @@ -0,0 +1,76 @@ +/******************************************************************************* + * ////////////////////////////////////////////////////////////////////////////////// + * // Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This program and the + * // accompanying materials are made available under the terms of the Open Source + * // Initiative OSI - Open Software License v3.0 which accompanies this + * // distribution, and is available at http://www.opensource.org/licenses/osl-3.0.php/ + * ////////////////////////////////////////////////////////////////////////////////// + ******************************************************************************/ +package com.kdmanalytics.toif.framework.xmlElements.facts; + +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlRootElement; + +import com.kdmanalytics.toif.framework.xmlElements.entities.CodeLocation; +import com.kdmanalytics.toif.framework.xmlElements.entities.File; + +@XmlRootElement(name = "fact") +public class CodeLocationReferencesFile extends Fact +{ + + private CodeLocation location; + + private File file; + + public CodeLocationReferencesFile() + { + super(); + type = "toif:CodeLocationReferencesFile"; + } + + public CodeLocationReferencesFile(CodeLocation newLocation, File newFile) + { + super(); + type = "toif:CodeLocationReferencesFile"; + + this.location = newLocation; + this.file = newFile; + } + + /** + * @return the location + */ + @XmlAttribute(name = "codeLocation") + public String getLocation() + { + return location.getId(); + } + + /** + * @param location + * the location to set + */ + public void setLocation(CodeLocation location) + { + this.location = location; + } + + /** + * @return the file + */ + @XmlAttribute(name = "file") + public String getFile() + { + return file.getId(); + } + + /** + * @param file + * the file to set + */ + public void setFile(File file) + { + this.file = file; + } + +} diff --git a/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/facts/DataElementIsInvolvedInFinding.java b/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/facts/DataElementIsInvolvedInFinding.java new file mode 100644 index 00000000..2a2b2718 --- /dev/null +++ b/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/facts/DataElementIsInvolvedInFinding.java @@ -0,0 +1,77 @@ +/******************************************************************************* + * ////////////////////////////////////////////////////////////////////////////////// + * // Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This program and the + * // accompanying materials are made available under the terms of the Open Source + * // Initiative OSI - Open Software License v3.0 which accompanies this + * // distribution, and is available at http://www.opensource.org/licenses/osl-3.0.php/ + * ////////////////////////////////////////////////////////////////////////////////// + ******************************************************************************/ +package com.kdmanalytics.toif.framework.xmlElements.facts; + +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlType; + +import com.kdmanalytics.toif.framework.xmlElements.entities.DataElement; +import com.kdmanalytics.toif.framework.xmlElements.entities.Finding; + +@XmlType(propOrder = { "finding", "dataElement" }) +@XmlRootElement(name = "fact") +public class DataElementIsInvolvedInFinding extends Fact +{ + + private DataElement dataElement; + + private Finding finding; + + public DataElementIsInvolvedInFinding(DataElement dataElement, Finding finding) + { + super(); + type = "toif:DataElementIsInvolvedInFinding"; + this.dataElement = dataElement; + this.finding = finding; + } + + public DataElementIsInvolvedInFinding() + { + super(); + type = "toif:DataElementIsInvolvedInFinding"; + } + + /** + * @return the dataElement + */ + @XmlAttribute(name = "data") + public String getDataElement() + { + return dataElement.getId(); + } + + /** + * @param dataElement + * the dataElement to set + */ + public void setDataElement(DataElement dataElement) + { + this.dataElement = dataElement; + } + + /** + * @return the finding + */ + @XmlAttribute(name = "finding") + public String getFinding() + { + return finding.getId(); + } + + /** + * @param finding + * the finding to set + */ + public void setFinding(Finding finding) + { + this.finding = finding; + } + +} diff --git a/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/facts/DataElementIsInvolvedInStatement.java b/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/facts/DataElementIsInvolvedInStatement.java new file mode 100644 index 00000000..b54af0a3 --- /dev/null +++ b/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/facts/DataElementIsInvolvedInStatement.java @@ -0,0 +1,79 @@ +/******************************************************************************* + * ////////////////////////////////////////////////////////////////////////////////// + * // Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This program and the + * // accompanying materials are made available under the terms of the Open Source + * // Initiative OSI - Open Software License v3.0 which accompanies this + * // distribution, and is available at http://www.opensource.org/licenses/osl-3.0.php/ + * ////////////////////////////////////////////////////////////////////////////////// + ******************************************************************************/ +package com.kdmanalytics.toif.framework.xmlElements.facts; + +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlType; + +import com.kdmanalytics.toif.framework.xmlElements.entities.DataElement; +import com.kdmanalytics.toif.framework.xmlElements.entities.Statement; + +@XmlType(propOrder = { "statement", "dataElement" }) +@XmlRootElement(name="fact") +public class DataElementIsInvolvedInStatement extends Fact +{ + + private DataElement dataElement; + + private Statement statement; + + public DataElementIsInvolvedInStatement(DataElement dataElement, Statement statement) + { + super(); + type = "toif:DataElementIsInvolvedInStatement"; + this.dataElement = dataElement; + this.statement = statement; + } + + public DataElementIsInvolvedInStatement() + { + super(); + type = "toif:DataElementIsInvolvedInStatement"; + } + + + /** + * @return the dataElement + */ + @XmlAttribute(name="data") + public String getDataElement() + { + return dataElement.getId(); + } + + + /** + * @param dataElement the dataElement to set + */ + public void setDataElement(DataElement dataElement) + { + this.dataElement = dataElement; + } + + + /** + * @return the statement + */ + @XmlAttribute(name="statement") + public String getStatement() + { + return statement.getId(); + } + + + /** + * @param statement the statement to set + */ + public void setStatement(Statement statement) + { + this.statement = statement; + } + +} diff --git a/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/facts/DirectoryIsContainedInDirectory.java b/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/facts/DirectoryIsContainedInDirectory.java new file mode 100644 index 00000000..b91ba851 --- /dev/null +++ b/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/facts/DirectoryIsContainedInDirectory.java @@ -0,0 +1,118 @@ +/******************************************************************************* + * ////////////////////////////////////////////////////////////////////////////////// + * // Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This program and the + * // accompanying materials are made available under the terms of the Open Source + * // Initiative OSI - Open Software License v3.0 which accompanies this + * // distribution, and is available at http://www.opensource.org/licenses/osl-3.0.php/ + * ////////////////////////////////////////////////////////////////////////////////// + ******************************************************************************/ +package com.kdmanalytics.toif.framework.xmlElements.facts; + +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlType; + +import com.kdmanalytics.toif.framework.xmlElements.entities.Directory; + +@XmlType(propOrder = { "directory2", "directory1" }) +@XmlRootElement(name = "fact") +public class DirectoryIsContainedInDirectory extends Fact +{ + + private Directory directory1; + + private Directory directory2; + + public DirectoryIsContainedInDirectory() + { + super(); + type = "toif:DirectoryIsContainedInDirectory"; + } + + public DirectoryIsContainedInDirectory(Directory directory1, Directory directory2) + { + super(); + type = "toif:DirectoryIsContainedInDirectory"; + this.directory1 = directory1; + this.directory2 = directory2; + } + + /** + * @return the directory1 + */ + @XmlAttribute(name = "directory1") + public String getDirectory1() + { + return directory1.getId(); + } + + /** + * @param directory1 + * the directory1 to set + */ + public void setDirectory1(Directory directory1) + { + this.directory1 = directory1; + } + + /** + * @return the directory1 + */ + public String getDirectory1Path() + { + return directory1.getPath(); + } + + /** + * @return the directory1 + */ + public String getDirectory2Path() + { + return directory2.getPath(); + } + + /** + * @return the directory2 + */ + @XmlAttribute(name = "directory2") + public String getDirectory2() + { + return directory2.getId(); + } + + /** + * @param directory2 + * the directory2 to set + */ + public void setDirectory2(Directory directory2) + { + this.directory2 = directory2; + } + + /** + * + */ + @Override + public boolean equals(Object obj) + { + + if (obj instanceof DirectoryIsContainedInDirectory) + { + DirectoryIsContainedInDirectory fact = (DirectoryIsContainedInDirectory) obj; + + return getDirectory1Path().equals(fact.getDirectory1Path()) && getDirectory2Path().equals(fact.getDirectory2Path()); + } + return false; + + } + + /** + * + */ + @Override + public int hashCode() { + return getDirectory1Path().hashCode() ^ getDirectory2Path().hashCode(); + } + + +} diff --git a/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/facts/Fact.java b/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/facts/Fact.java new file mode 100644 index 00000000..25025407 --- /dev/null +++ b/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/facts/Fact.java @@ -0,0 +1,24 @@ +/******************************************************************************* + * ////////////////////////////////////////////////////////////////////////////////// + * // Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This program and the + * // accompanying materials are made available under the terms of the Open Source + * // Initiative OSI - Open Software License v3.0 which accompanies this + * // distribution, and is available at http://www.opensource.org/licenses/osl-3.0.php/ + * ////////////////////////////////////////////////////////////////////////////////// + ******************************************************************************/ +package com.kdmanalytics.toif.framework.xmlElements.facts; + +import javax.xml.bind.annotation.XmlRootElement; + +import com.kdmanalytics.toif.framework.xmlElements.entities.Element; + +@XmlRootElement +public class Fact extends Element +{ + + public Fact() + { + super(); + } + +} diff --git a/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/facts/FileIsContainedInDirectory.java b/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/facts/FileIsContainedInDirectory.java new file mode 100644 index 00000000..f78b3edf --- /dev/null +++ b/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/facts/FileIsContainedInDirectory.java @@ -0,0 +1,112 @@ +/******************************************************************************* + * ////////////////////////////////////////////////////////////////////////////////// + * // Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This program and the + * // accompanying materials are made available under the terms of the Open Source + * // Initiative OSI - Open Software License v3.0 which accompanies this + * // distribution, and is available at http://www.opensource.org/licenses/osl-3.0.php/ + * ////////////////////////////////////////////////////////////////////////////////// + ******************************************************************************/ +package com.kdmanalytics.toif.framework.xmlElements.facts; + +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlRootElement; + +import com.kdmanalytics.toif.framework.xmlElements.entities.Directory; +import com.kdmanalytics.toif.framework.xmlElements.entities.File; + +@XmlRootElement(name = "fact") +public class FileIsContainedInDirectory extends Fact +{ + + private File file; + + private Directory directory; + + public FileIsContainedInDirectory() + { + super(); + type = "toif:FileIsContainedInDirectory"; + } + + public FileIsContainedInDirectory(File file, Directory directory) + { + super(); + type = "toif:FileIsContainedInDirectory"; + this.file = file; + this.directory = directory; + } + + /** + * @return the file + */ + @XmlAttribute(name = "file") + public String getFile() + { + return file.getId(); + } + + /** + * @param file + * the file to set + */ + public void setFile(File file) + { + this.file = file; + } + + /** + * @return the directory + */ + @XmlAttribute(name = "directory") + public String getDirectory() + { + return directory.getId(); + } + + /** + * @param directory + * the directory to set + */ + public void setDirectory(Directory directory) + { + this.directory = directory; + } + + @Override + public int hashCode() + { + final int prime = 31; + int result = 1; + result = prime * result + ((directory == null) ? 0 : directory.hashCode()); + result = prime * result + ((file == null) ? 0 : file.hashCode()); + return result; + } + + @Override + public boolean equals(Object obj) + { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + FileIsContainedInDirectory other = (FileIsContainedInDirectory) obj; + if (directory == null) + { + if (other.directory != null) + return false; + } + else if (!directory.equals(other.directory)) + return false; + if (file == null) + { + if (other.file != null) + return false; + } + else if (!file.equals(other.file)) + return false; + return true; + } + +} diff --git a/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/facts/FindingHasCWEIdentifier.java b/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/facts/FindingHasCWEIdentifier.java new file mode 100644 index 00000000..3ab71752 --- /dev/null +++ b/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/facts/FindingHasCWEIdentifier.java @@ -0,0 +1,76 @@ +/******************************************************************************* + * ////////////////////////////////////////////////////////////////////////////////// + * // Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This program and the + * // accompanying materials are made available under the terms of the Open Source + * // Initiative OSI - Open Software License v3.0 which accompanies this + * // distribution, and is available at http://www.opensource.org/licenses/osl-3.0.php/ + * ////////////////////////////////////////////////////////////////////////////////// + ******************************************************************************/ +package com.kdmanalytics.toif.framework.xmlElements.facts; + +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlRootElement; + +import com.kdmanalytics.toif.framework.xmlElements.entities.CWEIdentifier; +import com.kdmanalytics.toif.framework.xmlElements.entities.Finding; + +@XmlRootElement(name = "fact") +public class FindingHasCWEIdentifier extends Fact +{ + + private Finding finding; + + private CWEIdentifier cweId; + + public FindingHasCWEIdentifier() + { + super(); + type = "toif:FindingHasCWEIdentifier"; + } + + public FindingHasCWEIdentifier(Finding finding, CWEIdentifier cweId) + { + super(); + type = "toif:FindingHasCWEIdentifier"; + + this.finding = finding; + this.cweId = cweId; + } + + /** + * @return the finding + */ + @XmlAttribute + public String getFinding() + { + return finding.getId(); + } + + /** + * @param finding + * the finding to set + */ + public void setFinding(Finding finding) + { + this.finding = finding; + } + + /** + * @return the cweId + */ + @XmlAttribute(name = "cwe") + public String getCweId() + { + return cweId.getId(); + } + + /** + * @param cweId + * the cweId to set + */ + public void setCweId(CWEIdentifier cweId) + { + this.cweId = cweId; + } + +} diff --git a/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/facts/FindingHasClusterIdentifier.java b/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/facts/FindingHasClusterIdentifier.java new file mode 100644 index 00000000..83408d63 --- /dev/null +++ b/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/facts/FindingHasClusterIdentifier.java @@ -0,0 +1,76 @@ +/******************************************************************************* + * ////////////////////////////////////////////////////////////////////////////////// + * // Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This program and the + * // accompanying materials are made available under the terms of the Open Source + * // Initiative OSI - Open Software License v3.0 which accompanies this + * // distribution, and is available at http://www.opensource.org/licenses/osl-3.0.php/ + * ////////////////////////////////////////////////////////////////////////////////// + ******************************************************************************/ +package com.kdmanalytics.toif.framework.xmlElements.facts; + +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlRootElement; + +import com.kdmanalytics.toif.framework.xmlElements.entities.ClusterIdentifier; +import com.kdmanalytics.toif.framework.xmlElements.entities.Finding; + +@XmlRootElement(name = "fact") +public class FindingHasClusterIdentifier extends Fact +{ + + private Finding finding; + + private ClusterIdentifier clusterId; + + public FindingHasClusterIdentifier() + { + super(); + type = "toif:FindingHasClusterIdentifier"; + } + + public FindingHasClusterIdentifier(Finding finding, ClusterIdentifier clusterId) + { + super(); + type = "toif:FindingHasClusterIdentifier"; + + this.finding = finding; + this.clusterId = clusterId; + } + + /** + * @return the finding + */ + @XmlAttribute(name="finding") + public String getFindingId() + { + return finding.getId(); + } + + /** + * @param finding + * the finding to set + */ + public void setFindingId(Finding finding) + { + this.finding = finding; + } + + /** + * @return the cweId + */ + @XmlAttribute(name = "cluster") + public String getClusterId() + { + return clusterId.getId(); + } + + /** + * @param cweId + * the cweId to set + */ + public void setClusterId(ClusterIdentifier clusterId) + { + this.clusterId = clusterId; + } + +} diff --git a/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/facts/FindingHasCodeLocation.java b/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/facts/FindingHasCodeLocation.java new file mode 100644 index 00000000..5e76a182 --- /dev/null +++ b/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/facts/FindingHasCodeLocation.java @@ -0,0 +1,79 @@ +/******************************************************************************* + * ////////////////////////////////////////////////////////////////////////////////// + * // Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This program and the + * // accompanying materials are made available under the terms of the Open Source + * // Initiative OSI - Open Software License v3.0 which accompanies this + * // distribution, and is available at http://www.opensource.org/licenses/osl-3.0.php/ + * ////////////////////////////////////////////////////////////////////////////////// + ******************************************************************************/ +package com.kdmanalytics.toif.framework.xmlElements.facts; + +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlType; + +import com.kdmanalytics.toif.framework.xmlElements.entities.CodeLocation; +import com.kdmanalytics.toif.framework.xmlElements.entities.Finding; + +@XmlType(propOrder = { "location", "finding" }) +@XmlRootElement(name="fact") +public class FindingHasCodeLocation extends Fact +{ + + private Finding finding; + + private CodeLocation location; + + public FindingHasCodeLocation(Finding finding, CodeLocation location) + { + super(); + type="toif:FindingHasCodeLocation"; + this.finding = finding; + this.location = location; + } + + public FindingHasCodeLocation() { + super(); + type="toif:FindingHasCodeLocation"; + } + + + /** + * @return the finding + */ + @XmlAttribute + public String getFinding() + { + return finding.getId(); + } + + + /** + * @param finding the finding to set + */ + public void setFinding(Finding finding) + { + this.finding = finding; + } + + + /** + * @return the location + */ + @XmlAttribute + public String getLocation() + { + return location.getId(); + } + + + /** + * @param location the location to set + */ + public void setLocation(CodeLocation location) + { + this.location = location; + } + + +} diff --git a/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/facts/FindingHasSFPIdentifier.java b/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/facts/FindingHasSFPIdentifier.java new file mode 100644 index 00000000..b410c5a4 --- /dev/null +++ b/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/facts/FindingHasSFPIdentifier.java @@ -0,0 +1,79 @@ +/******************************************************************************* + * ////////////////////////////////////////////////////////////////////////////////// + * // Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This program and the + * // accompanying materials are made available under the terms of the Open Source + * // Initiative OSI - Open Software License v3.0 which accompanies this + * // distribution, and is available at http://www.opensource.org/licenses/osl-3.0.php/ + * ////////////////////////////////////////////////////////////////////////////////// + ******************************************************************************/ +package com.kdmanalytics.toif.framework.xmlElements.facts; + + +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlType; + +import com.kdmanalytics.toif.framework.xmlElements.entities.Finding; +import com.kdmanalytics.toif.framework.xmlElements.entities.SFPIdentifier; + +@XmlType(propOrder = { "sfpId", "finding" }) +@XmlRootElement(name = "fact") +public class FindingHasSFPIdentifier extends Fact +{ + + private Finding finding; + + private SFPIdentifier sfpId; + + public FindingHasSFPIdentifier() + { + super(); + type = "toif:FindingHasSFPIdentifier"; + } + + public FindingHasSFPIdentifier(Finding finding, SFPIdentifier sfpId) + { + super(); + type = "toif:FindingHasSFPIdentifier"; + + this.finding = finding; + this.sfpId = sfpId; + } + + /** + * @return the finding + */ + @XmlAttribute + public String getFinding() + { + return finding.getId(); + } + + /** + * @param finding + * the finding to set + */ + public void setFinding(Finding finding) + { + this.finding = finding; + } + + /** + * @return the cweId + */ + @XmlAttribute(name = "sfp") + public String getSfpId() + { + return sfpId.getId(); + } + + /** + * @param cweId + * the cweId to set + */ + public void setSfpId(SFPIdentifier sfpId) + { + this.sfpId = sfpId; + } + +} diff --git a/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/facts/FindingIsDescribedByWeaknessDescription.java b/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/facts/FindingIsDescribedByWeaknessDescription.java new file mode 100644 index 00000000..63450db1 --- /dev/null +++ b/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/facts/FindingIsDescribedByWeaknessDescription.java @@ -0,0 +1,78 @@ +/******************************************************************************* + * ////////////////////////////////////////////////////////////////////////////////// + * // Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This program and the + * // accompanying materials are made available under the terms of the Open Source + * // Initiative OSI - Open Software License v3.0 which accompanies this + * // distribution, and is available at http://www.opensource.org/licenses/osl-3.0.php/ + * ////////////////////////////////////////////////////////////////////////////////// + ******************************************************************************/ +package com.kdmanalytics.toif.framework.xmlElements.facts; + +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlType; + +import com.kdmanalytics.toif.framework.xmlElements.entities.Finding; +import com.kdmanalytics.toif.framework.xmlElements.entities.WeaknessDescription; + +@XmlType(propOrder = { "weaknessDescription", "finding" }) +@XmlRootElement(name = "fact") +public class FindingIsDescribedByWeaknessDescription extends Fact +{ + + private Finding finding; + + private WeaknessDescription weaknessDescription; + + public FindingIsDescribedByWeaknessDescription() + { + super(); + type = "toif:FindingIsDescribedByWeaknessDescription"; + } + + public FindingIsDescribedByWeaknessDescription(Finding finding, WeaknessDescription weaknessDescription) + { + super(); + type = "toif:FindingIsDescribedByWeaknessDescription"; + + this.finding = finding; + this.weaknessDescription = weaknessDescription; + } + + /** + * @return the finding + */ + @XmlAttribute(name = "finding") + public String getFinding() + { + return finding.getId(); + } + + /** + * @param finding + * the finding to set + */ + public void setFinding(Finding finding) + { + this.finding = finding; + } + + /** + * @return the weaknessDescription + */ + @XmlAttribute(name = "description") + public String getWeaknessDescription() + { + return weaknessDescription.getId(); + } + + /** + * @param weaknessDescription + * the weaknessDescription to set + */ + public void setWeaknessDescription(WeaknessDescription weaknessDescription) + { + this.weaknessDescription = weaknessDescription; + } + +} diff --git a/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/facts/GeneratorIsSuppliedByVendor.java b/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/facts/GeneratorIsSuppliedByVendor.java new file mode 100644 index 00000000..bf97929b --- /dev/null +++ b/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/facts/GeneratorIsSuppliedByVendor.java @@ -0,0 +1,77 @@ +/******************************************************************************* + * ////////////////////////////////////////////////////////////////////////////////// + * // Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This program and the + * // accompanying materials are made available under the terms of the Open Source + * // Initiative OSI - Open Software License v3.0 which accompanies this + * // distribution, and is available at http://www.opensource.org/licenses/osl-3.0.php/ + * ////////////////////////////////////////////////////////////////////////////////// + ******************************************************************************/ +package com.kdmanalytics.toif.framework.xmlElements.facts; + +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlType; + +import com.kdmanalytics.toif.framework.xmlElements.entities.Generator; +import com.kdmanalytics.toif.framework.xmlElements.entities.Vendor; + +@XmlType(propOrder = { "vendor", "generator" }) +@XmlRootElement(name="fact") +public class GeneratorIsSuppliedByVendor extends Fact +{ + + private Generator generator; + + private Vendor vendor; + + public GeneratorIsSuppliedByVendor(Generator generator, Vendor vendor) + { + super(); + type="toif:GeneratorIsSuppliedByVendor"; + this.generator = generator; + this.vendor = vendor; + } + + public GeneratorIsSuppliedByVendor() { + super(); + type="toif:GeneratorIsSuppliedByVendor"; + } + + + /** + * @return the generator + */ + @XmlAttribute + public String getGenerator() + { + return generator.getId(); + } + + + /** + * @param generator the generator to set + */ + public void setGenerator(Generator generator) + { + this.generator = generator; + } + + + /** + * @return the vendor + */ + @XmlAttribute + public String getVendor() + { + return vendor.getId(); + } + + + /** + * @param vendor the vendor to set + */ + public void setVendor(Vendor vendor) + { + this.vendor = vendor; + } +} diff --git a/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/facts/OrganizationIsInvolvedInProjectAsRole.java b/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/facts/OrganizationIsInvolvedInProjectAsRole.java new file mode 100644 index 00000000..14d476d3 --- /dev/null +++ b/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/facts/OrganizationIsInvolvedInProjectAsRole.java @@ -0,0 +1,99 @@ +/******************************************************************************* + * ////////////////////////////////////////////////////////////////////////////////// + * // Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This program and the + * // accompanying materials are made available under the terms of the Open Source + * // Initiative OSI - Open Software License v3.0 which accompanies this + * // distribution, and is available at http://www.opensource.org/licenses/osl-3.0.php/ + * ////////////////////////////////////////////////////////////////////////////////// + ******************************************************************************/ +package com.kdmanalytics.toif.framework.xmlElements.facts; + +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlType; + +import com.kdmanalytics.toif.framework.xmlElements.entities.Organization; +import com.kdmanalytics.toif.framework.xmlElements.entities.Project; +import com.kdmanalytics.toif.framework.xmlElements.entities.Role; + +@XmlType(propOrder = { "role", "project","organization" }) +@XmlRootElement(name="fact") +public class OrganizationIsInvolvedInProjectAsRole extends Fact +{ + private Organization organization; + private Project project; + private Role role; + + public OrganizationIsInvolvedInProjectAsRole(Organization organization, Project project, Role role) + { + super(); + type="toif:OrganizationIsInvolvedInProjectAsRole"; + this.organization = organization; + this.project = project; + this.role = role; + } + + public OrganizationIsInvolvedInProjectAsRole() { + super(); + type="toif:OrganizationIsInvolvedInProjectAsRole"; + } + + + /** + * @return the organization + */ + @XmlAttribute + public String getOrganization() + { + return organization.getId(); + } + + + /** + * @param organization the organization to set + */ + public void setOrganization(Organization organization) + { + this.organization = organization; + } + + + /** + * @return the project + */ + @XmlAttribute + public String getProject() + { + return project.getId(); + } + + + /** + * @param project the project to set + */ + public void setProject(Project project) + { + this.project = project; + } + + + /** + * @return the role + */ + @XmlAttribute + public String getRole() + { + return role.getId(); + } + + + /** + * @param role the role to set + */ + public void setRole(Role role) + { + this.role = role; + } + + +} diff --git a/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/facts/OrganizationIsPartOfOrganizationAsRole.java b/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/facts/OrganizationIsPartOfOrganizationAsRole.java new file mode 100644 index 00000000..88fd4da5 --- /dev/null +++ b/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/facts/OrganizationIsPartOfOrganizationAsRole.java @@ -0,0 +1,97 @@ +/******************************************************************************* + * ////////////////////////////////////////////////////////////////////////////////// + * // Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This program and the + * // accompanying materials are made available under the terms of the Open Source + * // Initiative OSI - Open Software License v3.0 which accompanies this + * // distribution, and is available at http://www.opensource.org/licenses/osl-3.0.php/ + * ////////////////////////////////////////////////////////////////////////////////// + ******************************************************************************/ +package com.kdmanalytics.toif.framework.xmlElements.facts; + +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlType; + +import com.kdmanalytics.toif.framework.xmlElements.entities.Organization; +import com.kdmanalytics.toif.framework.xmlElements.entities.Role; + +@XmlType(propOrder = { "role", "organization2","organization1" }) +@XmlRootElement(name="fact") +public class OrganizationIsPartOfOrganizationAsRole extends Fact +{ + + private Organization organization1; + + private Organization organization2; + + private Role role; + + public OrganizationIsPartOfOrganizationAsRole(Organization organization1, Organization organization2, Role role) + { + super(); + type = "toif:OrganizationIsPartOfOrganizationAsRole"; + this.organization1 = organization1; + this.organization2 = organization2; + this.role = role; + } + + public OrganizationIsPartOfOrganizationAsRole() + { + super(); + type = "toif:OrganizationIsPartOfOrganizationAsRole"; + } + + /** + * @return the organization1 + */ + @XmlAttribute + public String getOrganization1() + { + return organization1.getId(); + } + + /** + * @param organization1 + * the organization1 to set + */ + public void setOrganization1(Organization organization1) + { + this.organization1 = organization1; + } + + /** + * @return the organization2 + */ + @XmlAttribute + public String getOrganization2() + { + return organization2.getId(); + } + + /** + * @param organization2 + * the organization2 to set + */ + public void setOrganization2(Organization organization2) + { + this.organization2 = organization2; + } + + /** + * @return the role + */ + @XmlAttribute + public String getRole() + { + return role.getId(); + } + + /** + * @param role + * the role to set + */ + public void setRole(Role role) + { + this.role = role; + } +} diff --git a/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/facts/PersonIsEmployedByOrganizationAsRole.java b/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/facts/PersonIsEmployedByOrganizationAsRole.java new file mode 100644 index 00000000..6719e574 --- /dev/null +++ b/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/facts/PersonIsEmployedByOrganizationAsRole.java @@ -0,0 +1,98 @@ +/******************************************************************************* + * ////////////////////////////////////////////////////////////////////////////////// + * // Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This program and the + * // accompanying materials are made available under the terms of the Open Source + * // Initiative OSI - Open Software License v3.0 which accompanies this + * // distribution, and is available at http://www.opensource.org/licenses/osl-3.0.php/ + * ////////////////////////////////////////////////////////////////////////////////// + ******************************************************************************/ +package com.kdmanalytics.toif.framework.xmlElements.facts; + +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlType; + +import com.kdmanalytics.toif.framework.xmlElements.entities.Organization; +import com.kdmanalytics.toif.framework.xmlElements.entities.Person; +import com.kdmanalytics.toif.framework.xmlElements.entities.Role; + +@XmlType(propOrder = { "role", "organization","person" }) +@XmlRootElement(name = "fact") +public class PersonIsEmployedByOrganizationAsRole extends Fact +{ + + private Person person; + + private Organization organization; + + private Role role; + + public PersonIsEmployedByOrganizationAsRole(Person person, Organization organization, Role role) + { + super(); + type = "toif:PersonIsEmployedByOrganizationAsRole"; + this.person = person; + this.organization = organization; + this.role = role; + } + + public PersonIsEmployedByOrganizationAsRole() + { + super(); + type = "toif:PersonIsEmployedByOrganizationAsRole"; + } + + /** + * @return the person + */ + @XmlAttribute + public String getPerson() + { + return person.getId(); + } + + /** + * @param person + * the person to set + */ + public void setPerson(Person person) + { + this.person = person; + } + + /** + * @return the organization + */ + @XmlAttribute + public String getOrganization() + { + return organization.getId(); + } + + /** + * @param organization + * the organization to set + */ + public void setOrganization(Organization organization) + { + this.organization = organization; + } + + /** + * @return the role + */ + @XmlAttribute + public String getRole() + { + return role.getId(); + } + + /** + * @param role + * the role to set + */ + public void setRole(Role role) + { + this.role = role; + } +} diff --git a/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/facts/PersonIsInvolvedInProjectAsRole.java b/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/facts/PersonIsInvolvedInProjectAsRole.java new file mode 100644 index 00000000..3e028651 --- /dev/null +++ b/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/facts/PersonIsInvolvedInProjectAsRole.java @@ -0,0 +1,96 @@ +/******************************************************************************* + * ////////////////////////////////////////////////////////////////////////////////// + * // Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This program and the + * // accompanying materials are made available under the terms of the Open Source + * // Initiative OSI - Open Software License v3.0 which accompanies this + * // distribution, and is available at http://www.opensource.org/licenses/osl-3.0.php/ + * ////////////////////////////////////////////////////////////////////////////////// + ******************************************************************************/ +package com.kdmanalytics.toif.framework.xmlElements.facts; + +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlRootElement; + +import com.kdmanalytics.toif.framework.xmlElements.entities.Person; +import com.kdmanalytics.toif.framework.xmlElements.entities.Project; +import com.kdmanalytics.toif.framework.xmlElements.entities.Role; + +@XmlRootElement(name="fact") +public class PersonIsInvolvedInProjectAsRole extends Fact +{ + + private Person person; + private Project project; + private Role role; + + public PersonIsInvolvedInProjectAsRole(Person person, Project project, Role role) + { + super(); + type="toif:PersonIsInvolvedInProjectAsRole"; + this.person = person; + this.project = project; + this.role = role; + } + + public PersonIsInvolvedInProjectAsRole() { + super(); + type="toif:PersonIsInvolvedInProjectAsRole"; + } + + + /** + * @return the person + */ + @XmlAttribute + public String getPerson() + { + return person.getId(); + } + + + /** + * @param person the person to set + */ + public void setPerson(Person person) + { + this.person = person; + } + + + /** + * @return the project + */ + @XmlAttribute + public String getProject() + { + return project.getId(); + } + + + /** + * @param project the project to set + */ + public void setProject(Project project) + { + this.project = project; + } + + + /** + * @return the role + */ + @XmlAttribute + public String getRole() + { + return role.getId(); + } + + + /** + * @param role the role to set + */ + public void setRole(Role role) + { + this.role = role; + } +} diff --git a/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/facts/StatementHasCodeLocation.java b/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/facts/StatementHasCodeLocation.java new file mode 100644 index 00000000..62cb6ba8 --- /dev/null +++ b/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/facts/StatementHasCodeLocation.java @@ -0,0 +1,79 @@ +/******************************************************************************* + * ////////////////////////////////////////////////////////////////////////////////// + * // Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This program and the + * // accompanying materials are made available under the terms of the Open Source + * // Initiative OSI - Open Software License v3.0 which accompanies this + * // distribution, and is available at http://www.opensource.org/licenses/osl-3.0.php/ + * ////////////////////////////////////////////////////////////////////////////////// + ******************************************************************************/ +package com.kdmanalytics.toif.framework.xmlElements.facts; + +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlType; + +import com.kdmanalytics.toif.framework.xmlElements.entities.CodeLocation; +import com.kdmanalytics.toif.framework.xmlElements.entities.Statement; + +@XmlType(propOrder = { "location", "statement" }) +@XmlRootElement(name="fact") +public class StatementHasCodeLocation extends Fact +{ + + private Statement statement; + + private CodeLocation location; + + public StatementHasCodeLocation(Statement statement, CodeLocation codeLocation) + { + super(); + type="toif:StatementHasCodeLocation"; + this.statement = statement; + this.location = codeLocation; + } + + public StatementHasCodeLocation() { + super(); + type="toif:StatementHasCodeLocation"; + } + + + /** + * @return the statement + */ + @XmlAttribute + public String getStatement() + { + return statement.getId(); + } + + + /** + * @param statement the statement to set + */ + public void setStatement(Statement statement) + { + this.statement = statement; + } + + + /** + * @return the codeLocation + */ + @XmlAttribute + public String getlocation() + { + return location.getId(); + } + + + /** + * @param codeLocation the codeLocation to set + */ + public void setlocation(CodeLocation codeLocation) + { + this.location = codeLocation; + } + + +} diff --git a/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/facts/StatementIsInvolvedInFinding.java b/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/facts/StatementIsInvolvedInFinding.java new file mode 100644 index 00000000..ef274fe2 --- /dev/null +++ b/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/facts/StatementIsInvolvedInFinding.java @@ -0,0 +1,73 @@ +/******************************************************************************* + * ////////////////////////////////////////////////////////////////////////////////// + * // Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This program and the + * // accompanying materials are made available under the terms of the Open Source + * // Initiative OSI - Open Software License v3.0 which accompanies this + * // distribution, and is available at http://www.opensource.org/licenses/osl-3.0.php/ + * ////////////////////////////////////////////////////////////////////////////////// + ******************************************************************************/ +package com.kdmanalytics.toif.framework.xmlElements.facts; + +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlRootElement; + +import com.kdmanalytics.toif.framework.xmlElements.entities.Finding; +import com.kdmanalytics.toif.framework.xmlElements.entities.Statement; + +@XmlRootElement(name="fact") +public class StatementIsInvolvedInFinding extends Fact +{ + private Statement statement; + private Finding finding; + + public StatementIsInvolvedInFinding() { + super(); + type="toif:StatementIsInvolvedInFinding"; + } + + public StatementIsInvolvedInFinding(Statement statement, Finding finding) + { + super(); + type="toif:StatementIsInvolvedInFinding"; + this.statement = statement; + this.finding = finding; + } + + + /** + * @return the statement + */ + @XmlAttribute + public String getStatement() + { + return statement.getId(); + } + + + /** + * @param statement the statement to set + */ + public void setStatement(Statement statement) + { + this.statement = statement; + } + + + /** + * @return the finding + */ + @XmlAttribute + public String getFinding() + { + return finding.getId(); + } + + + /** + * @param finding the finding to set + */ + public void setFinding(Finding finding) + { + this.finding = finding; + } +} diff --git a/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/facts/StatementIsProceededByStatement.java b/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/facts/StatementIsProceededByStatement.java new file mode 100644 index 00000000..84ed0047 --- /dev/null +++ b/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/facts/StatementIsProceededByStatement.java @@ -0,0 +1,72 @@ +/******************************************************************************* + * ////////////////////////////////////////////////////////////////////////////////// + * // Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This program and the + * // accompanying materials are made available under the terms of the Open Source + * // Initiative OSI - Open Software License v3.0 which accompanies this + * // distribution, and is available at http://www.opensource.org/licenses/osl-3.0.php/ + * ////////////////////////////////////////////////////////////////////////////////// + ******************************************************************************/ +package com.kdmanalytics.toif.framework.xmlElements.facts; + +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlRootElement; + +import com.kdmanalytics.toif.framework.xmlElements.entities.Statement; + +@XmlRootElement(name="fact") +public class StatementIsProceededByStatement extends Fact +{ + private Statement statement1; + private Statement statement2; + + public StatementIsProceededByStatement() { + super(); + type="toif:StatementIsProceededByStatement"; + } + + public StatementIsProceededByStatement(Statement statement1, Statement statement2) + { + super(); + type="toif:StatementIsProceededByStatement"; + this.statement1 = statement1; + this.statement2 = statement2; + } + + + /** + * @return the statement + */ + @XmlAttribute + public String getStatement1() + { + return statement1.getId(); + } + + + /** + * @param statement the statement to set + */ + public void setStatement1(Statement statement) + { + this.statement1 = statement; + } + + + /** + * @return the finding + */ + @XmlAttribute + public String getStatement2() + { + return statement2.getId(); + } + + + /** + * @param finding the finding to set + */ + public void setStatement2(Statement statement) + { + this.statement2 = statement; + } +} diff --git a/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/facts/StatementIsSinkInFinding.java b/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/facts/StatementIsSinkInFinding.java new file mode 100644 index 00000000..97ce0d94 --- /dev/null +++ b/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/facts/StatementIsSinkInFinding.java @@ -0,0 +1,77 @@ +/******************************************************************************* + * ////////////////////////////////////////////////////////////////////////////////// + * // Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This program and the + * // accompanying materials are made available under the terms of the Open Source + * // Initiative OSI - Open Software License v3.0 which accompanies this + * // distribution, and is available at http://www.opensource.org/licenses/osl-3.0.php/ + * ////////////////////////////////////////////////////////////////////////////////// + ******************************************************************************/ +package com.kdmanalytics.toif.framework.xmlElements.facts; + +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlRootElement; + +import com.kdmanalytics.toif.framework.xmlElements.entities.Finding; +import com.kdmanalytics.toif.framework.xmlElements.entities.Statement; + +@XmlRootElement(name = "fact") +public class StatementIsSinkInFinding extends Fact +{ + + private Statement statement; + + private Finding finding; + + public StatementIsSinkInFinding() { + super(); + type="toif:StatementIsSinkInFinding"; + } + + public StatementIsSinkInFinding(Statement statement, Finding finding) + { + super(); + type="toif:StatementIsSinkInFinding"; + this.statement = statement; + this.finding = finding; + } + + + /** + * @return the statement + */ + @XmlAttribute + public String getStatement() + { + return statement.getId(); + } + + + /** + * @param statement the statement to set + */ + public void setStatement(Statement statement) + { + this.statement = statement; + } + + + /** + * @return the finding + */ + @XmlAttribute + public String getFinding() + { + return finding.getId(); + } + + + /** + * @param finding the finding to set + */ + public void setFinding(Finding finding) + { + this.finding = finding; + } + + +} diff --git a/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/facts/TOIFSegmentIsCreatedAtDate.java b/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/facts/TOIFSegmentIsCreatedAtDate.java new file mode 100644 index 00000000..ebfa00cc --- /dev/null +++ b/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/facts/TOIFSegmentIsCreatedAtDate.java @@ -0,0 +1,75 @@ +/******************************************************************************* + * ////////////////////////////////////////////////////////////////////////////////// + * // Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This program and the + * // accompanying materials are made available under the terms of the Open Source + * // Initiative OSI - Open Software License v3.0 which accompanies this + * // distribution, and is available at http://www.opensource.org/licenses/osl-3.0.php/ + * ////////////////////////////////////////////////////////////////////////////////// + ******************************************************************************/ +package com.kdmanalytics.toif.framework.xmlElements.facts; + +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlRootElement; + +import com.kdmanalytics.toif.framework.xmlElements.entities.Date; +import com.kdmanalytics.toif.framework.xmlElements.entities.Segment; + +@XmlRootElement(name = "fact") +public class TOIFSegmentIsCreatedAtDate extends Fact +{ + private Segment segment; + private Date date; + + public TOIFSegmentIsCreatedAtDate() { + super(); + type = "toif:TOIFSegmentIsCreatedAtDate"; + } + + public TOIFSegmentIsCreatedAtDate(Segment segment, Date date) + { + super(); + type = "toif:TOIFSegmentIsCreatedAtDate"; + this.segment = segment; + this.date = date; + } + + + /** + * @return the segment + */ + @XmlAttribute + public String getSegment() + { + return segment.getName().getName(); + } + + + /** + * @param segment the segment to set + */ + public void setSegment(Segment segment) + { + this.segment = segment; + } + + + /** + * @return the date + */ + @XmlAttribute + public String getDate() + { + return date.getId(); + } + + + /** + * @param date the date to set + */ + public void setDate(Date date) + { + this.date = date; + } + + +} diff --git a/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/facts/TOIFSegmentIsGeneratedByGenerator.java b/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/facts/TOIFSegmentIsGeneratedByGenerator.java new file mode 100644 index 00000000..63d6c440 --- /dev/null +++ b/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/facts/TOIFSegmentIsGeneratedByGenerator.java @@ -0,0 +1,78 @@ +/******************************************************************************* + * ////////////////////////////////////////////////////////////////////////////////// + * // Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This program and the + * // accompanying materials are made available under the terms of the Open Source + * // Initiative OSI - Open Software License v3.0 which accompanies this + * // distribution, and is available at http://www.opensource.org/licenses/osl-3.0.php/ + * ////////////////////////////////////////////////////////////////////////////////// + ******************************************************************************/ +package com.kdmanalytics.toif.framework.xmlElements.facts; + +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlRootElement; + +import com.kdmanalytics.toif.framework.xmlElements.entities.Generator; +import com.kdmanalytics.toif.framework.xmlElements.entities.Segment; + +@XmlRootElement(name = "fact") +public class TOIFSegmentIsGeneratedByGenerator extends Fact +{ + private Segment segment; + private Generator generator; + + public TOIFSegmentIsGeneratedByGenerator() { + super(); + type = "toif:TOIFSegmentIsGeneratedByGenerator"; + } + + public TOIFSegmentIsGeneratedByGenerator(Segment segment, Generator generator) + { + super(); + type = "toif:TOIFSegmentIsGeneratedByGenerator"; + this.segment = segment; + this.generator = generator; + } + + + /** + * @return the generator + */ + @XmlAttribute + public String getGenerator() + { + return generator.getId(); + } + + + /** + * @param generator the generator to set + */ + public void setGenerator(Generator generator) + { + this.generator = generator; + } + + + + /** + * @return the segment + */ + @XmlAttribute + public String getSegment() + { + return segment.getName().getName(); + } + + + + /** + * @param segment the segment to set + */ + public void setSegment(Segment segment) + { + this.segment = segment; + } + + + +} diff --git a/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/facts/TOIFSegmentIsGeneratedByPerson.java b/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/facts/TOIFSegmentIsGeneratedByPerson.java new file mode 100644 index 00000000..9b8646b2 --- /dev/null +++ b/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/facts/TOIFSegmentIsGeneratedByPerson.java @@ -0,0 +1,73 @@ +/******************************************************************************* + * ////////////////////////////////////////////////////////////////////////////////// + * // Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This program and the + * // accompanying materials are made available under the terms of the Open Source + * // Initiative OSI - Open Software License v3.0 which accompanies this + * // distribution, and is available at http://www.opensource.org/licenses/osl-3.0.php/ + * ////////////////////////////////////////////////////////////////////////////////// + ******************************************************************************/ +package com.kdmanalytics.toif.framework.xmlElements.facts; + +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlRootElement; + +import com.kdmanalytics.toif.framework.xmlElements.entities.Person; +import com.kdmanalytics.toif.framework.xmlElements.entities.Segment; + +@XmlRootElement(name="fact") +public class TOIFSegmentIsGeneratedByPerson extends Fact +{ + private Segment segment; + private Person person; + + public TOIFSegmentIsGeneratedByPerson() { + super(); + type = "toif:TOIFSegmentIsGeneratedByPerson"; + } + + public TOIFSegmentIsGeneratedByPerson(Segment segment, Person person) + { + super(); + type = "toif:TOIFSegmentIsGeneratedByPerson"; + this.segment = segment; + this.person = person; + } + + + /** + * @return the segment + */ + @XmlAttribute + public String getSegment() + { + return segment.getName().getName(); + } + + + /** + * @param segment the segment to set + */ + public void setSegment(Segment segment) + { + this.segment = segment; + } + + + /** + * @return the person + */ + @XmlAttribute + public String getPerson() + { + return person.getId(); + } + + + /** + * @param person the person to set + */ + public void setPerson(Person person) + { + this.person = person; + } +} diff --git a/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/facts/TOIFSegmentIsOwnedByOrganization.java b/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/facts/TOIFSegmentIsOwnedByOrganization.java new file mode 100644 index 00000000..6d36ea3d --- /dev/null +++ b/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/facts/TOIFSegmentIsOwnedByOrganization.java @@ -0,0 +1,73 @@ +/******************************************************************************* + * ////////////////////////////////////////////////////////////////////////////////// + * // Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This program and the + * // accompanying materials are made available under the terms of the Open Source + * // Initiative OSI - Open Software License v3.0 which accompanies this + * // distribution, and is available at http://www.opensource.org/licenses/osl-3.0.php/ + * ////////////////////////////////////////////////////////////////////////////////// + ******************************************************************************/ +package com.kdmanalytics.toif.framework.xmlElements.facts; + +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlRootElement; + +import com.kdmanalytics.toif.framework.xmlElements.entities.Organization; +import com.kdmanalytics.toif.framework.xmlElements.entities.Segment; + +@XmlRootElement(name="fact") +public class TOIFSegmentIsOwnedByOrganization extends Fact +{ + private Segment segment; + private Organization organization; + + public TOIFSegmentIsOwnedByOrganization() { + super(); + type = "toif:TOIFSegmentIsOwnedByOrganization"; + } + + public TOIFSegmentIsOwnedByOrganization(Segment segment, Organization organization) + { + super(); + type = "toif:TOIFSegmentIsOwnedByOrganization"; + this.segment = segment; + this.organization = organization; + } + + + /** + * @return the segment + */ + @XmlAttribute + public String getSegment() + { + return segment.getName().getName(); + } + + + /** + * @param segment the segment to set + */ + public void setSegment(Segment segment) + { + this.segment = segment; + } + + + /** + * @return the organization + */ + @XmlAttribute + public String getOrganization() + { + return organization.getId(); + } + + + /** + * @param organization the organization to set + */ + public void setOrganization(Organization organization) + { + this.organization = organization; + } +} diff --git a/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/facts/TOIFSegmentIsProcessedByAdaptor.java b/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/facts/TOIFSegmentIsProcessedByAdaptor.java new file mode 100644 index 00000000..df9c9d51 --- /dev/null +++ b/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/facts/TOIFSegmentIsProcessedByAdaptor.java @@ -0,0 +1,78 @@ +/******************************************************************************* + * ////////////////////////////////////////////////////////////////////////////////// + * // Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This program and the + * // accompanying materials are made available under the terms of the Open Source + * // Initiative OSI - Open Software License v3.0 which accompanies this + * // distribution, and is available at http://www.opensource.org/licenses/osl-3.0.php/ + * ////////////////////////////////////////////////////////////////////////////////// + ******************************************************************************/ +package com.kdmanalytics.toif.framework.xmlElements.facts; + +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlRootElement; + +import com.kdmanalytics.toif.framework.xmlElements.entities.Adaptor; +import com.kdmanalytics.toif.framework.xmlElements.entities.Segment; + +@XmlRootElement(name="fact") +public class TOIFSegmentIsProcessedByAdaptor extends Fact +{ + private Segment segment; + private Adaptor adaptor; + + public TOIFSegmentIsProcessedByAdaptor() { + super(); + type = "toif:TOIFSegmentIsProcessedByAdaptor"; + } + + public TOIFSegmentIsProcessedByAdaptor(Segment segment, Adaptor adaptor) + { + super(); + type = "toif:TOIFSegmentIsProcessedByAdaptor"; + this.segment = segment; + this.adaptor = adaptor; + } + + + /** + * @return the generator + */ + @XmlAttribute + public String getAdaptor() + { + return adaptor.getId(); + } + + + /** + * @param generator the generator to set + */ + public void setAdaptor(Adaptor adaptor) + { + this.adaptor = adaptor; + } + + + + /** + * @return the segment + */ + @XmlAttribute + public String getSegment() + { + return segment.getName().getName(); + } + + + + /** + * @param segment the segment to set + */ + public void setSegment(Segment segment) + { + this.segment = segment; + } + + + +} diff --git a/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/facts/TOIFSegmentIsProducedByOrganization.java b/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/facts/TOIFSegmentIsProducedByOrganization.java new file mode 100644 index 00000000..ee33b31b --- /dev/null +++ b/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/facts/TOIFSegmentIsProducedByOrganization.java @@ -0,0 +1,73 @@ +/******************************************************************************* + * ////////////////////////////////////////////////////////////////////////////////// + * // Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This program and the + * // accompanying materials are made available under the terms of the Open Source + * // Initiative OSI - Open Software License v3.0 which accompanies this + * // distribution, and is available at http://www.opensource.org/licenses/osl-3.0.php/ + * ////////////////////////////////////////////////////////////////////////////////// + ******************************************************************************/ +package com.kdmanalytics.toif.framework.xmlElements.facts; + +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlRootElement; + +import com.kdmanalytics.toif.framework.xmlElements.entities.Organization; +import com.kdmanalytics.toif.framework.xmlElements.entities.Segment; + +@XmlRootElement(name = "fact") +public class TOIFSegmentIsProducedByOrganization extends Fact +{ + private Segment segment; + private Organization organization; + + public TOIFSegmentIsProducedByOrganization() { + super(); + type = "toif:TOIFSegmentIsProducedByOrganization"; + } + + public TOIFSegmentIsProducedByOrganization(Segment segment, Organization organization) + { + super(); + type = "toif:TOIFSegmentIsProducedByOrganization"; + this.segment = segment; + this.organization = organization; + } + + + /** + * @return the segment + */ + @XmlAttribute + public String getSegment() + { + return segment.getName().getName(); + } + + + /** + * @param segment the segment to set + */ + public void setSegment(Segment segment) + { + this.segment = segment; + } + + + /** + * @return the organization + */ + @XmlAttribute + public String getOrganization() + { + return organization.getId(); + } + + + /** + * @param organization the organization to set + */ + public void setOrganization(Organization organization) + { + this.organization = organization; + } +} diff --git a/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/facts/TOIFSegmentIsRelatedToProject.java b/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/facts/TOIFSegmentIsRelatedToProject.java new file mode 100644 index 00000000..47610caf --- /dev/null +++ b/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/facts/TOIFSegmentIsRelatedToProject.java @@ -0,0 +1,69 @@ +/******************************************************************************* + * ////////////////////////////////////////////////////////////////////////////////// + * // Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This program and the + * // accompanying materials are made available under the terms of the Open Source + * // Initiative OSI - Open Software License v3.0 which accompanies this + * // distribution, and is available at http://www.opensource.org/licenses/osl-3.0.php/ + * ////////////////////////////////////////////////////////////////////////////////// + ******************************************************************************/ +package com.kdmanalytics.toif.framework.xmlElements.facts; + +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlRootElement; + +import com.kdmanalytics.toif.framework.xmlElements.entities.Project; +import com.kdmanalytics.toif.framework.xmlElements.entities.Segment; + +@XmlRootElement(name = "fact") +public class TOIFSegmentIsRelatedToProject extends Fact +{ + private Segment segment; + private Project project; + + public TOIFSegmentIsRelatedToProject() { + super(); + type = "toif:TOIFSegmentIsRelatedToProject"; + } + + public TOIFSegmentIsRelatedToProject(Segment segment, Project project) + { + super(); + type = "toif:TOIFSegmentIsRelatedToProject"; + this.segment = segment; + this.project = project; + } + + /** + * @return the segment + */ + @XmlAttribute + public String getSegment() + { + return segment.getName().getName(); + } + + /** + * @param segment the segment to set + */ + public void setSegment(Segment segment) + { + this.segment = segment; + } + + /** + * @return the project + */ + @XmlAttribute + public String getProject() + { + return project.getId(); + } + + /** + * @param project the project to set + */ + public void setProject(Project project) + { + this.project = project; + } +} diff --git a/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/facts/TOIFSegmentIsSupervisedByPerson.java b/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/facts/TOIFSegmentIsSupervisedByPerson.java new file mode 100644 index 00000000..9eb4fac8 --- /dev/null +++ b/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/facts/TOIFSegmentIsSupervisedByPerson.java @@ -0,0 +1,73 @@ +/******************************************************************************* + * ////////////////////////////////////////////////////////////////////////////////// + * // Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This program and the + * // accompanying materials are made available under the terms of the Open Source + * // Initiative OSI - Open Software License v3.0 which accompanies this + * // distribution, and is available at http://www.opensource.org/licenses/osl-3.0.php/ + * ////////////////////////////////////////////////////////////////////////////////// + ******************************************************************************/ +package com.kdmanalytics.toif.framework.xmlElements.facts; + +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlRootElement; + +import com.kdmanalytics.toif.framework.xmlElements.entities.Person; +import com.kdmanalytics.toif.framework.xmlElements.entities.Segment; + +@XmlRootElement(name="fact") +public class TOIFSegmentIsSupervisedByPerson extends Fact +{ + private Segment segment; + private Person person; + + public TOIFSegmentIsSupervisedByPerson() { + super(); + type = "toif:TOIFSegmentIsSupervisedByPerson"; + } + + public TOIFSegmentIsSupervisedByPerson(Segment segment, Person person) + { + super(); + type = "toif:TOIFSegmentIsSupervisedByPerson"; + this.segment = segment; + this.person = person; + } + + + /** + * @return the segment + */ + @XmlAttribute + public String getSegment() + { + return segment.getName().getName(); + } + + + /** + * @param segment the segment to set + */ + public void setSegment(Segment segment) + { + this.segment = segment; + } + + + /** + * @return the person + */ + @XmlAttribute + public String getPerson() + { + return person.getId(); + } + + + /** + * @param person the person to set + */ + public void setPerson(Person person) + { + this.person = person; + } +} diff --git a/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/facts/TOIFSegmentReferencesFile.java b/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/facts/TOIFSegmentReferencesFile.java new file mode 100644 index 00000000..38d0877c --- /dev/null +++ b/com.kdmanalytics.toif.framework/src/com/kdmanalytics/toif/framework/xmlElements/facts/TOIFSegmentReferencesFile.java @@ -0,0 +1,84 @@ +/******************************************************************************* + * ////////////////////////////////////////////////////////////////////////////////// + * // Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This program and the + * // accompanying materials are made available under the terms of the Open Source + * // Initiative OSI - Open Software License v3.0 which accompanies this + * // distribution, and is available at http://www.opensource.org/licenses/osl-3.0.php/ + * ////////////////////////////////////////////////////////////////////////////////// + ******************************************************************************/ +package com.kdmanalytics.toif.framework.xmlElements.facts; + +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlRootElement; + +import com.kdmanalytics.toif.framework.xmlElements.entities.File; +import com.kdmanalytics.toif.framework.xmlElements.entities.Segment; + +@XmlRootElement(name = "fact") +public class TOIFSegmentReferencesFile extends Fact +{ + + private File file = null; + + private Segment segment = null; + + /** + * + * @param segment + * @param file + */ + public TOIFSegmentReferencesFile(Segment segment, File file) + { + super(); + type = "toif:TOIFSegmentReferencesFile"; + this.segment = segment; + this.file = file; + } + + /** + * + */ + public TOIFSegmentReferencesFile() { + super(); + type = "toif:TOIFSegmentReferencesFile"; + } + + + /** + * @return the file + */ + @XmlAttribute(name = "file") + public String getFile() + { + return file.getId(); + } + + + /** + * @param file the file to set + */ + public void setFile(File file) + { + this.file = file; + } + + + /** + * @return the segment + */ + @XmlAttribute + public String getSegment() + { + return segment.getName().getName(); + } + + + /** + * @param segment the segment to set + */ + public void setSegment(Segment segment) + { + this.segment = segment; + } + +} diff --git a/com.kdmanalytics.toif.framework/src/example/housekeeping b/com.kdmanalytics.toif.framework/src/example/housekeeping new file mode 100644 index 00000000..d9a3f122 --- /dev/null +++ b/com.kdmanalytics.toif.framework/src/example/housekeeping @@ -0,0 +1,38 @@ +########################### +# Facts +########################### + +TOIFSegmentIsRelatedToProject=project1 +TOIFSegmentIsProducedByOrganization=org1 +TOIFSegmentIsOwnedByOrganization=org1 + +TOIFSegmentIsGeneratedByPerson=person1 +TOIFSegmentIsSupervisedByPerson=person1 + +PersonIsInvolvedInProjectAsRole=person1;project1;role1 +OrganizationIsInvolvedInProjectAsRole=org1;project1;role2 +#OrganizationIsPartOfOrganizationAsRole=org1;org2;role2 +PersonIsEmployedByOrganizationAsRole=person1;org1;role1 + +########################### +# Entities +########################### + +SegmentDescription=Segment relating to the findings by the analyzer. + +#projectId=name;description +project1=The Project;The description of the project. + +#personId=name;email;phone +person1=Ken Duck;ken@kdmanalytics.com;613-627-1011 +#person2=Joe Bloggs;blogs@kdmanalytics.com;555-1234 + +#organizationId=name;description;address;phone;email +org1=KDM Analytics;KDM Analytics is a security assurance company providing products and services for threat risk assessment and management, due diligence assessments, and information and data assurance. Leveraging our decades of experience in static analysis, reverse engineering and formal methods, we have created breakthrough products for the automated and systematic investigation of code, data and networks;3730 Richmond Rd, Suite 204, Ottawa, ON K2H 5B9;613-627-1011;info@kdmanalytics.com + +#organizationId=name;description;address;phone;email +#org2=Acme Corporation;Acme Corporation;blah;555-5555;thingamy@thingamy.com + +#roleId=name;description +role1=Analyst;Analyst for KDM Analytics +role2=Analysis;Security Assurance diff --git a/com.kdmanalytics.toif.framework/src/resources/SFP_CWE_Mapping.txt b/com.kdmanalytics.toif.framework/src/resources/SFP_CWE_Mapping.txt new file mode 100644 index 00000000..92dd4dfa --- /dev/null +++ b/com.kdmanalytics.toif.framework/src/resources/SFP_CWE_Mapping.txt @@ -0,0 +1,316 @@ +CWE-1=SFP-1 +CWE398=SFP-1 +CWE128=SFP1 +CWE190=SFP1 +CWE191=SFP1 +CWE194=SFP1 +CWE195=SFP1 +CWE196=SFP1 +CWE197=SFP1 +CWE681=SFP1 +CWE704=SFP1 +CWE468=SFP1 +CWE456=SFP1 +CWE457=SFP1 +CWE369=SFP1 +CWE579=SFP1 +CWE594=SFP1 +CWE475=SFP1 +CWE685=SFP1 +CWE686=SFP1 +CWE466=SFP1 +CWE562=SFP1 +CWE587=SFP1 +CWE481=SFP1 +CWE486=SFP1 +CWE570=SFP1 +CWE571=SFP1 +CWE597=SFP1 +CWE768=SFP1 +CWE482=SFP2 +CWE561=SFP2 +CWE563=SFP2 +CWE111=SFP3 +CWE242=SFP3 +CWE245=SFP3 +CWE246=SFP3 +CWE382=SFP3 +CWE383=SFP3 +CWE474=SFP3 +CWE477=SFP3 +CWE479=SFP3 +CWE558=SFP3 +CWE574=SFP3 +CWE575=SFP3 +CWE576=SFP3 +CWE577=SFP3 +CWE578=SFP3 +CWE589=SFP3 +CWE676=SFP3 +CWE617=SFP3 +CWE572=SFP3 +CWE586=SFP3 +CWE248=SFP4 +CWE252=SFP4 +CWE253=SFP4 +CWE273=SFP4 +CWE280=SFP4 +CWE390=SFP4 +CWE391=SFP4 +CWE394=SFP4 +CWE431=SFP4 +CWE600=SFP4 +CWE478=SFP4 +CWE484=SFP4 +CWE665=SFP4 +CWE396=SFP5 +CWE397=SFP5 +CWE392=SFP6 +CWE393=SFP6 +CWE584=SFP6 +CWE416=SFP7 +CWE476=SFP7 +CWE469=SFP1 +CWE588=SFP7 +CWE118=SFP8 +CWE119=SFP8 +CWE121=SFP8 +CWE122=SFP8 +CWE123=SFP8 +CWE124=SFP8 +CWE125=SFP8 +CWE126=SFP8 +CWE127=SFP8 +CWE129=SFP8 +CWE120=SFP8 +CWE785=SFP9 +CWE249=SFP9 +CWE135=SFP10 +CWE467=SFP10 +CWE251=SFP10 +CWE170=SFP11 +CWE415=SFP12 +CWE590=SFP12 +CWE761=SFP12 +CWE762=SFP12 +CWE763=SFP12 +CWE763=SFP12 +CWE763=SFP12 +CWE763=SFP12 +CWE400=SFP13 +CWE674=SFP13 +CWE774=SFP13 +CWE401=SFP14 +CWE404=SFP14 +CWE459=SFP14 +CWE771=SFP14 +CWE772=SFP14 +CWE773=SFP14 +CWE775=SFP14 +CWE672=SFP15 +CWE022=SFP16 +CWE023=SFP16 +CWE024=SFP16 +CWE025=SFP16 +CWE026=SFP16 +CWE027=SFP16 +CWE028=SFP16 +CWE029=SFP16 +CWE030=SFP16 +CWE031=SFP16 +CWE032=SFP16 +CWE033=SFP16 +CWE034=SFP16 +CWE035=SFP16 +CWE036=SFP16 +CWE037=SFP16 +CWE038=SFP16 +CWE039=SFP16 +CWE040=SFP16 +CWE042=SFP16 +CWE043=SFP16 +CWE044=SFP16 +CWE045=SFP16 +CWE046=SFP16 +CWE047=SFP16 +CWE048=SFP16 +CWE049=SFP16 +CWE050=SFP16 +CWE051=SFP16 +CWE052=SFP16 +CWE053=SFP16 +CWE054=SFP16 +CWE055=SFP16 +CWE056=SFP16 +CWE057=SFP16 +CWE058=SFP16 +CWE067=SFP16 +CWE073=SFP16 +CWE243=SFP17 +CWE059=SFP18 +CWE062=SFP18 +CWE064=SFP18 +CWE065=SFP18 +CWE364=SFP19 +CWE365=SFP19 +CWE366=SFP19 +CWE413=SFP19 +CWE414=SFP19 +CWE543=SFP19 +CWE567=SFP19 +CWE609=SFP19 +CWE662=SFP19 +CWE667=SFP19 +CWE363=SFP20 +CWE367=SFP20 +CWE370=SFP20 +CWE638=SFP20 +CWE765=SFP21 +CWE764=SFP21 +CWE585=SFP21 +CWE412=SFP22 +CWE311=SFP23 +CWE319=SFP23 +CWE523=SFP23 +CWE256=SFP23 +CWE257=SFP23 +CWE312=SFP23 +CWE313=SFP23 +CWE314=SFP23 +CWE315=SFP23 +CWE317=SFP23 +CWE642=SFP23 +CWE117=SFP23 +CWE532=SFP23 +CWE215=SFP23 +CWE497=SFP23 +CWE209=SFP23 +CWE210=SFP23 +CWE008=SFP23 +CWE214=SFP23 +CWE316=SFP23 +CWE403=SFP23 +CWE495=SFP23 +CWE498=SFP23 +CWE499=SFP23 +CWE501=SFP23 +CWE526=SFP23 +CWE591=SFP23 +CWE598=SFP23 +CWE607=SFP23 +CWE533=SFP23 +CWE534=SFP23 +CWE542=SFP23 +CWE374=SFP23 +CWE375=SFP23 +CWE014=SFP23 +CWE226=SFP23 +CWE244=SFP23 +CWE767=SFP23 +CWE093=SFP24 +CWE138=SFP24 +CWE140=SFP24 +CWE141=SFP24 +CWE142=SFP24 +CWE143=SFP24 +CWE144=SFP24 +CWE145=SFP24 +CWE146=SFP24 +CWE147=SFP24 +CWE148=SFP24 +CWE149=SFP24 +CWE150=SFP24 +CWE151=SFP24 +CWE152=SFP24 +CWE153=SFP24 +CWE154=SFP24 +CWE155=SFP24 +CWE156=SFP24 +CWE157=SFP24 +CWE158=SFP24 +CWE159=SFP24 +CWE160=SFP24 +CWE161=SFP24 +CWE162=SFP24 +CWE163=SFP24 +CWE164=SFP24 +CWE165=SFP24 +CWE641=SFP24 +CWE102=SFP24 +CWE103=SFP24 +CWE104=SFP24 +CWE105=SFP24 +CWE108=SFP24 +CWE109=SFP24 +CWE110=SFP24 +CWE554=SFP24 +CWE077=SFP24 +CWE078=SFP24 +CWE079=SFP24 +CWE080=SFP24 +CWE084=SFP24 +CWE086=SFP24 +CWE112=SFP24 +CWE113=SFP24 +CWE601=SFP24 +CWE644=SFP24 +CWE074=SFP24 +CWE081=SFP24 +CWE082=SFP24 +CWE083=SFP24 +CWE085=SFP24 +CWE087=SFP24 +CWE089=SFP24 +CWE090=SFP24 +CWE091=SFP24 +CWE095=SFP24 +CWE096=SFP24 +CWE099=SFP24 +CWE134=SFP24 +CWE564=SFP24 +CWE611=SFP24 +CWE619=SFP24 +CWE621=SFP24 +CWE624=SFP24 +CWE641=SFP24 +CWE643=SFP24 +CWE652=SFP24 +CWE015=SFP25 +CWE020=SFP25 +CWE454=SFP25 +CWE606=SFP25 +CWE496=SFP25 +CWE502=SFP25 +CWE616=SFP25 +CWE566=SFP25 +CWE494=SFP27 +CWE545=SFP27 +CWE622=SFP27 +CWE489=SFP28 +CWE531=SFP28 +CWE608=SFP28 +CWE491=SFP28 +CWE493=SFP28 +CWE500=SFP28 +CWE568=SFP28 +CWE580=SFP28 +CWE582=SFP28 +CWE583=SFP28 +CWE766=SFP28 +CWE247=SFP29 +CWE292=SFP29 +CWE293=SFP29 +CWE350=SFP29 +CWE360=SFP29 +CWE565=SFP29 +CWE422=SFP30 +CWE425=SFP30 +CWE306=SFP31 +CWE620=SFP31 +CWE605=SFP32 +CWE259=SFP33 +CWE321=SFP33 +CWE307=SFP34 +CWE285=SFP35 +CWE424=SFP35 +CWE272=SFP36 \ No newline at end of file diff --git a/com.kdmanalytics.toif.framework/src/resources/default b/com.kdmanalytics.toif.framework/src/resources/default new file mode 100644 index 00000000..3d690a17 --- /dev/null +++ b/com.kdmanalytics.toif.framework/src/resources/default @@ -0,0 +1,36 @@ +########################### +# Facts +########################### + +TOIFSegmentIsRelatedToProject=project1 +TOIFSegmentIsProducedByOrganization=org1 +TOIFSegmentIsOwnedByOrganization=org1 +TOIFSegmentIsGeneratedByPerson=person1 +TOIFSegmentIsSupervisedByPerson=person1 + +PersonIsInvolvedInProjectAsRole=person1;project1;role1 +OrganizationIsInvolvedInProjectAsRole=org1;project1;role2 +OrganizationIsPartOfOrganizationAsRole=org1;org2;role2 +PersonIsEmployedByOrganizationAsRole=person1;org1;role1 + +########################### +# Entities +########################### + +SegmentDescription=Segment relating to the findings. + +#projectId=name;description +project1=project;project description. + +#personId=name;email;phone +person1=NoName;noName@domain.com;555-1234 + +#organizationId=name;description;address;phone;email +org1=Org;Org Inc;Road;555-5555;noName@domain.com + +#organizationId=name;description;address;phone;email +org2=Acme Corporation;Acme Corporation;blah;555-5555;thingamy@thingamy.com + +#roleId=name;description +role1=Software Developer;Developer +role2=company;employer diff --git a/com.kdmanalytics.toif.framework/target/MANIFEST.MF b/com.kdmanalytics.toif.framework/target/MANIFEST.MF new file mode 100644 index 00000000..e950caed --- /dev/null +++ b/com.kdmanalytics.toif.framework/target/MANIFEST.MF @@ -0,0 +1,20 @@ +Manifest-Version: 1.0 +Export-Package: com.kdmanalytics.toif.framework.parser,com.kdmanalytic + s.toif.framework.toolAdaptor,com.kdmanalytics.toif.framework.utils,co + m.kdmanalytics.toif.framework.xmlElements.entities,com.kdmanalytics.t + oif.framework.xmlElements.facts +Bundle-ActivationPolicy: lazy +Bundle-Name: TOIF Adaptor +Bundle-RequiredExecutionEnvironment: JavaSE-1.7 +Require-Bundle: org.eclipse.core.runtime,com.lexicalscope.jewelcli;bun + dle-version="[0.8.5,1.0.0)",org.apache.commons.lang3;bundle-version=" + [3.1.0,4.0.0)",com.kdmanalytics.toif.common;bundle-version="1.14.0",o + rg.apache.log4j;bundle-version="[1.2.15,1.3.0)" +Bundle-Vendor: KDM Analytics Inc. +Bundle-Version: 1.15.5 +Bundle-ManifestVersion: 2 +Bundle-Activator: com.kdmanalytics.toif.framework.Activator +Bundle-SymbolicName: com.kdmanalytics.toif.framework;singleton:=true +Import-Package: org.apache.xerces.parsers +Eclipse-RegisterBuddy: com.lexicalscope.jewelcli + diff --git a/com.kdmanalytics.toif.framework/target/classes/HouseKeepingXMLSchema.xsd b/com.kdmanalytics.toif.framework/target/classes/HouseKeepingXMLSchema.xsd new file mode 100644 index 00000000..5a31523b --- /dev/null +++ b/com.kdmanalytics.toif.framework/target/classes/HouseKeepingXMLSchema.xsd @@ -0,0 +1,630 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/com.kdmanalytics.toif.framework/target/classes/TOIFSchema.xsd b/com.kdmanalytics.toif.framework/target/classes/TOIFSchema.xsd new file mode 100644 index 00000000..a8824954 --- /dev/null +++ b/com.kdmanalytics.toif.framework/target/classes/TOIFSchema.xsd @@ -0,0 +1,716 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/Activator.class b/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/Activator.class new file mode 100644 index 00000000..7dad50a9 Binary files /dev/null and b/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/Activator.class differ diff --git a/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/config/houseKeeping b/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/config/houseKeeping new file mode 100644 index 00000000..59ece675 --- /dev/null +++ b/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/config/houseKeeping @@ -0,0 +1,44 @@ +########################### +# Facts +########################### + +TOIFSegmentIsRelatedToProject=project1 +TOIFSegmentIsProducedByOrganization=org1 +TOIFSegmentIsOwnedByOrganization=org2 +TOIFSegmentIsGeneratedByGenerator=generator1 +TOIFSegmentIsGeneratedByPerson=person1 +TOIFSegmentIsSupervisedByPerson=person2 + +PersonIsInvolvedInProjectAsRole=person1;project1;role1 +OrganizationIsInvolvedInProjectAsRole=org1;project1;role2 +AdaptorSupportsGenerator=generator1 +AdaptorIsSuppliedByVendor=vendor1 +GeneratorIsSuppliedByVendor=generator1;vendor1 +OrganizationIsPartOfOrganizationAsRole=org1;org2;role2 +PersonIsEmployedByOrganizationAsRole=person1;org1;role1 + +########################### +# Entities +########################### + +#projectId=name;description +project1=Test Project;The test project during development + +#generatorId=name;description;version +generator1=jlint;java checking;2.3 + +#personId=name;email;phone +person1=Adam Nunn;adam@kdmanalytics.com;555-1234 +person2=Joe Bloggs;blogs@kdmanalytics.com;555-1234 + +#organizationId=name;description;address;email;phone +org1=KDM;Kdm Analytics;Richmond;kdm@kdmanalytics.com;555-5555 + +#organizationId=name;description;address;email;phone +org2=Acme;Acme Analytics;blah;thingamy@thingamy.com;555-5555 + +#roleId=name;description +role1=developer;programmer +role2=company;employer + +vendor1=Me;Kdm Analytics;Richmond;kdm@kdmanalytics.com;555-5555 \ No newline at end of file diff --git a/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/parser/StreamGobbler.class b/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/parser/StreamGobbler.class new file mode 100644 index 00000000..ed9d9306 Binary files /dev/null and b/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/parser/StreamGobbler.class differ diff --git a/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/toolAdaptor/AbstractAdaptor.class b/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/toolAdaptor/AbstractAdaptor.class new file mode 100644 index 00000000..0f7d9d7b Binary files /dev/null and b/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/toolAdaptor/AbstractAdaptor.class differ diff --git a/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/toolAdaptor/AdaptorOptions.class b/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/toolAdaptor/AdaptorOptions.class new file mode 100644 index 00000000..f78c8112 Binary files /dev/null and b/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/toolAdaptor/AdaptorOptions.class differ diff --git a/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/toolAdaptor/Language.class b/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/toolAdaptor/Language.class new file mode 100644 index 00000000..46dedd4d Binary files /dev/null and b/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/toolAdaptor/Language.class differ diff --git a/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/toolAdaptor/ToolAdaptor.class b/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/toolAdaptor/ToolAdaptor.class new file mode 100644 index 00000000..0409eef0 Binary files /dev/null and b/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/toolAdaptor/ToolAdaptor.class differ diff --git a/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/toolAdaptor/ToolAdaptorUtil.class b/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/toolAdaptor/ToolAdaptorUtil.class new file mode 100644 index 00000000..b83fc5a7 Binary files /dev/null and b/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/toolAdaptor/ToolAdaptorUtil.class differ diff --git a/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/utils/ClusterMapping.class b/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/utils/ClusterMapping.class new file mode 100644 index 00000000..d97c3f17 Binary files /dev/null and b/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/utils/ClusterMapping.class differ diff --git a/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/utils/DirectToifInput.class b/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/utils/DirectToifInput.class new file mode 100644 index 00000000..1247b37a Binary files /dev/null and b/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/utils/DirectToifInput.class differ diff --git a/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/utils/ElementComparator.class b/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/utils/ElementComparator.class new file mode 100644 index 00000000..c3ba7e69 Binary files /dev/null and b/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/utils/ElementComparator.class differ diff --git a/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/utils/FindingCreator.class b/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/utils/FindingCreator.class new file mode 100644 index 00000000..8e256a27 Binary files /dev/null and b/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/utils/FindingCreator.class differ diff --git a/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/entities/Adaptor.class b/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/entities/Adaptor.class new file mode 100644 index 00000000..2ff33b50 Binary files /dev/null and b/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/entities/Adaptor.class differ diff --git a/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/entities/Address.class b/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/entities/Address.class new file mode 100644 index 00000000..d9fd8e75 Binary files /dev/null and b/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/entities/Address.class differ diff --git a/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/entities/CWEIdentifier.class b/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/entities/CWEIdentifier.class new file mode 100644 index 00000000..6422c5ba Binary files /dev/null and b/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/entities/CWEIdentifier.class differ diff --git a/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/entities/Checksum.class b/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/entities/Checksum.class new file mode 100644 index 00000000..4a9a1362 Binary files /dev/null and b/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/entities/Checksum.class differ diff --git a/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/entities/ClusterIdentifier.class b/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/entities/ClusterIdentifier.class new file mode 100644 index 00000000..9205169a Binary files /dev/null and b/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/entities/ClusterIdentifier.class differ diff --git a/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/entities/CodeLocation.class b/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/entities/CodeLocation.class new file mode 100644 index 00000000..9ea70ca0 Binary files /dev/null and b/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/entities/CodeLocation.class differ diff --git a/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/entities/DataElement.class b/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/entities/DataElement.class new file mode 100644 index 00000000..3182d816 Binary files /dev/null and b/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/entities/DataElement.class differ diff --git a/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/entities/Date.class b/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/entities/Date.class new file mode 100644 index 00000000..d8795ae8 Binary files /dev/null and b/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/entities/Date.class differ diff --git a/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/entities/Description.class b/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/entities/Description.class new file mode 100644 index 00000000..668a4e4f Binary files /dev/null and b/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/entities/Description.class differ diff --git a/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/entities/Directory.class b/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/entities/Directory.class new file mode 100644 index 00000000..b34ee591 Binary files /dev/null and b/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/entities/Directory.class differ diff --git a/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/entities/Element.class b/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/entities/Element.class new file mode 100644 index 00000000..7e9ae31f Binary files /dev/null and b/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/entities/Element.class differ diff --git a/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/entities/EmailAddress.class b/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/entities/EmailAddress.class new file mode 100644 index 00000000..70e64b2f Binary files /dev/null and b/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/entities/EmailAddress.class differ diff --git a/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/entities/Entity.class b/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/entities/Entity.class new file mode 100644 index 00000000..c584623b Binary files /dev/null and b/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/entities/Entity.class differ diff --git a/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/entities/File.class b/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/entities/File.class new file mode 100644 index 00000000..f7497c7a Binary files /dev/null and b/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/entities/File.class differ diff --git a/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/entities/Finding.class b/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/entities/Finding.class new file mode 100644 index 00000000..519f04b4 Binary files /dev/null and b/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/entities/Finding.class differ diff --git a/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/entities/Generator.class b/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/entities/Generator.class new file mode 100644 index 00000000..f7f3775a Binary files /dev/null and b/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/entities/Generator.class differ diff --git a/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/entities/LineNumber.class b/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/entities/LineNumber.class new file mode 100644 index 00000000..dc445b41 Binary files /dev/null and b/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/entities/LineNumber.class differ diff --git a/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/entities/Name.class b/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/entities/Name.class new file mode 100644 index 00000000..32aea8dc Binary files /dev/null and b/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/entities/Name.class differ diff --git a/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/entities/Offset.class b/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/entities/Offset.class new file mode 100644 index 00000000..1b5998cc Binary files /dev/null and b/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/entities/Offset.class differ diff --git a/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/entities/Organization.class b/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/entities/Organization.class new file mode 100644 index 00000000..7f409e44 Binary files /dev/null and b/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/entities/Organization.class differ diff --git a/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/entities/Person.class b/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/entities/Person.class new file mode 100644 index 00000000..86eb843b Binary files /dev/null and b/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/entities/Person.class differ diff --git a/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/entities/Phone.class b/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/entities/Phone.class new file mode 100644 index 00000000..cd2b4537 Binary files /dev/null and b/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/entities/Phone.class differ diff --git a/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/entities/Position.class b/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/entities/Position.class new file mode 100644 index 00000000..3a41eb5a Binary files /dev/null and b/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/entities/Position.class differ diff --git a/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/entities/Project.class b/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/entities/Project.class new file mode 100644 index 00000000..5329b094 Binary files /dev/null and b/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/entities/Project.class differ diff --git a/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/entities/Role.class b/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/entities/Role.class new file mode 100644 index 00000000..8a5ac58b Binary files /dev/null and b/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/entities/Role.class differ diff --git a/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/entities/SFPIdentifier.class b/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/entities/SFPIdentifier.class new file mode 100644 index 00000000..490c661b Binary files /dev/null and b/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/entities/SFPIdentifier.class differ diff --git a/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/entities/Segment.class b/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/entities/Segment.class new file mode 100644 index 00000000..a49df269 Binary files /dev/null and b/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/entities/Segment.class differ diff --git a/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/entities/Statement.class b/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/entities/Statement.class new file mode 100644 index 00000000..682dc5fa Binary files /dev/null and b/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/entities/Statement.class differ diff --git a/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/entities/Text.class b/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/entities/Text.class new file mode 100644 index 00000000..1f13ea7b Binary files /dev/null and b/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/entities/Text.class differ diff --git a/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/entities/Vendor.class b/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/entities/Vendor.class new file mode 100644 index 00000000..b84dfbd2 Binary files /dev/null and b/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/entities/Vendor.class differ diff --git a/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/entities/Version.class b/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/entities/Version.class new file mode 100644 index 00000000..774adeaa Binary files /dev/null and b/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/entities/Version.class differ diff --git a/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/entities/WeaknessDescription.class b/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/entities/WeaknessDescription.class new file mode 100644 index 00000000..7cbe7235 Binary files /dev/null and b/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/entities/WeaknessDescription.class differ diff --git a/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/facts/AdaptorIsSuppliedByVendor.class b/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/facts/AdaptorIsSuppliedByVendor.class new file mode 100644 index 00000000..a5490955 Binary files /dev/null and b/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/facts/AdaptorIsSuppliedByVendor.class differ diff --git a/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/facts/AdaptorSupportsGenerator.class b/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/facts/AdaptorSupportsGenerator.class new file mode 100644 index 00000000..f60fdb97 Binary files /dev/null and b/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/facts/AdaptorSupportsGenerator.class differ diff --git a/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/facts/CodeLocationReferencesFile.class b/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/facts/CodeLocationReferencesFile.class new file mode 100644 index 00000000..2f0cb4dd Binary files /dev/null and b/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/facts/CodeLocationReferencesFile.class differ diff --git a/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/facts/DataElementIsInvolvedInFinding.class b/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/facts/DataElementIsInvolvedInFinding.class new file mode 100644 index 00000000..14071f8b Binary files /dev/null and b/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/facts/DataElementIsInvolvedInFinding.class differ diff --git a/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/facts/DataElementIsInvolvedInStatement.class b/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/facts/DataElementIsInvolvedInStatement.class new file mode 100644 index 00000000..82b783ac Binary files /dev/null and b/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/facts/DataElementIsInvolvedInStatement.class differ diff --git a/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/facts/DirectoryIsContainedInDirectory.class b/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/facts/DirectoryIsContainedInDirectory.class new file mode 100644 index 00000000..8d2e4833 Binary files /dev/null and b/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/facts/DirectoryIsContainedInDirectory.class differ diff --git a/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/facts/Fact.class b/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/facts/Fact.class new file mode 100644 index 00000000..ace5fd90 Binary files /dev/null and b/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/facts/Fact.class differ diff --git a/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/facts/FileIsContainedInDirectory.class b/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/facts/FileIsContainedInDirectory.class new file mode 100644 index 00000000..cb061890 Binary files /dev/null and b/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/facts/FileIsContainedInDirectory.class differ diff --git a/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/facts/FindingHasCWEIdentifier.class b/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/facts/FindingHasCWEIdentifier.class new file mode 100644 index 00000000..ee2c0ac5 Binary files /dev/null and b/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/facts/FindingHasCWEIdentifier.class differ diff --git a/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/facts/FindingHasClusterIdentifier.class b/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/facts/FindingHasClusterIdentifier.class new file mode 100644 index 00000000..059e6028 Binary files /dev/null and b/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/facts/FindingHasClusterIdentifier.class differ diff --git a/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/facts/FindingHasCodeLocation.class b/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/facts/FindingHasCodeLocation.class new file mode 100644 index 00000000..81b238cb Binary files /dev/null and b/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/facts/FindingHasCodeLocation.class differ diff --git a/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/facts/FindingHasSFPIdentifier.class b/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/facts/FindingHasSFPIdentifier.class new file mode 100644 index 00000000..e3fd341a Binary files /dev/null and b/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/facts/FindingHasSFPIdentifier.class differ diff --git a/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/facts/FindingIsDescribedByWeaknessDescription.class b/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/facts/FindingIsDescribedByWeaknessDescription.class new file mode 100644 index 00000000..169ae818 Binary files /dev/null and b/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/facts/FindingIsDescribedByWeaknessDescription.class differ diff --git a/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/facts/GeneratorIsSuppliedByVendor.class b/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/facts/GeneratorIsSuppliedByVendor.class new file mode 100644 index 00000000..2f535ec4 Binary files /dev/null and b/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/facts/GeneratorIsSuppliedByVendor.class differ diff --git a/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/facts/OrganizationIsInvolvedInProjectAsRole.class b/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/facts/OrganizationIsInvolvedInProjectAsRole.class new file mode 100644 index 00000000..8f0f8d8b Binary files /dev/null and b/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/facts/OrganizationIsInvolvedInProjectAsRole.class differ diff --git a/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/facts/OrganizationIsPartOfOrganizationAsRole.class b/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/facts/OrganizationIsPartOfOrganizationAsRole.class new file mode 100644 index 00000000..d997a238 Binary files /dev/null and b/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/facts/OrganizationIsPartOfOrganizationAsRole.class differ diff --git a/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/facts/PersonIsEmployedByOrganizationAsRole.class b/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/facts/PersonIsEmployedByOrganizationAsRole.class new file mode 100644 index 00000000..2aa4b9c8 Binary files /dev/null and b/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/facts/PersonIsEmployedByOrganizationAsRole.class differ diff --git a/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/facts/PersonIsInvolvedInProjectAsRole.class b/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/facts/PersonIsInvolvedInProjectAsRole.class new file mode 100644 index 00000000..ca615288 Binary files /dev/null and b/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/facts/PersonIsInvolvedInProjectAsRole.class differ diff --git a/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/facts/StatementHasCodeLocation.class b/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/facts/StatementHasCodeLocation.class new file mode 100644 index 00000000..db101fd3 Binary files /dev/null and b/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/facts/StatementHasCodeLocation.class differ diff --git a/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/facts/StatementIsInvolvedInFinding.class b/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/facts/StatementIsInvolvedInFinding.class new file mode 100644 index 00000000..77e85cc1 Binary files /dev/null and b/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/facts/StatementIsInvolvedInFinding.class differ diff --git a/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/facts/StatementIsProceededByStatement.class b/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/facts/StatementIsProceededByStatement.class new file mode 100644 index 00000000..2eaf70c8 Binary files /dev/null and b/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/facts/StatementIsProceededByStatement.class differ diff --git a/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/facts/StatementIsSinkInFinding.class b/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/facts/StatementIsSinkInFinding.class new file mode 100644 index 00000000..84f03365 Binary files /dev/null and b/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/facts/StatementIsSinkInFinding.class differ diff --git a/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/facts/TOIFSegmentIsCreatedAtDate.class b/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/facts/TOIFSegmentIsCreatedAtDate.class new file mode 100644 index 00000000..ee9555f8 Binary files /dev/null and b/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/facts/TOIFSegmentIsCreatedAtDate.class differ diff --git a/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/facts/TOIFSegmentIsGeneratedByGenerator.class b/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/facts/TOIFSegmentIsGeneratedByGenerator.class new file mode 100644 index 00000000..3310979e Binary files /dev/null and b/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/facts/TOIFSegmentIsGeneratedByGenerator.class differ diff --git a/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/facts/TOIFSegmentIsGeneratedByPerson.class b/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/facts/TOIFSegmentIsGeneratedByPerson.class new file mode 100644 index 00000000..bfa44a6d Binary files /dev/null and b/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/facts/TOIFSegmentIsGeneratedByPerson.class differ diff --git a/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/facts/TOIFSegmentIsOwnedByOrganization.class b/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/facts/TOIFSegmentIsOwnedByOrganization.class new file mode 100644 index 00000000..c058da84 Binary files /dev/null and b/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/facts/TOIFSegmentIsOwnedByOrganization.class differ diff --git a/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/facts/TOIFSegmentIsProcessedByAdaptor.class b/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/facts/TOIFSegmentIsProcessedByAdaptor.class new file mode 100644 index 00000000..1967c7ad Binary files /dev/null and b/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/facts/TOIFSegmentIsProcessedByAdaptor.class differ diff --git a/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/facts/TOIFSegmentIsProducedByOrganization.class b/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/facts/TOIFSegmentIsProducedByOrganization.class new file mode 100644 index 00000000..e0af726f Binary files /dev/null and b/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/facts/TOIFSegmentIsProducedByOrganization.class differ diff --git a/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/facts/TOIFSegmentIsRelatedToProject.class b/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/facts/TOIFSegmentIsRelatedToProject.class new file mode 100644 index 00000000..d95cf831 Binary files /dev/null and b/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/facts/TOIFSegmentIsRelatedToProject.class differ diff --git a/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/facts/TOIFSegmentIsSupervisedByPerson.class b/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/facts/TOIFSegmentIsSupervisedByPerson.class new file mode 100644 index 00000000..5561c20c Binary files /dev/null and b/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/facts/TOIFSegmentIsSupervisedByPerson.class differ diff --git a/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/facts/TOIFSegmentReferencesFile.class b/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/facts/TOIFSegmentReferencesFile.class new file mode 100644 index 00000000..ec0fd40c Binary files /dev/null and b/com.kdmanalytics.toif.framework/target/classes/com/kdmanalytics/toif/framework/xmlElements/facts/TOIFSegmentReferencesFile.class differ diff --git a/com.kdmanalytics.toif.framework/target/classes/example/housekeeping b/com.kdmanalytics.toif.framework/target/classes/example/housekeeping new file mode 100644 index 00000000..d9a3f122 --- /dev/null +++ b/com.kdmanalytics.toif.framework/target/classes/example/housekeeping @@ -0,0 +1,38 @@ +########################### +# Facts +########################### + +TOIFSegmentIsRelatedToProject=project1 +TOIFSegmentIsProducedByOrganization=org1 +TOIFSegmentIsOwnedByOrganization=org1 + +TOIFSegmentIsGeneratedByPerson=person1 +TOIFSegmentIsSupervisedByPerson=person1 + +PersonIsInvolvedInProjectAsRole=person1;project1;role1 +OrganizationIsInvolvedInProjectAsRole=org1;project1;role2 +#OrganizationIsPartOfOrganizationAsRole=org1;org2;role2 +PersonIsEmployedByOrganizationAsRole=person1;org1;role1 + +########################### +# Entities +########################### + +SegmentDescription=Segment relating to the findings by the analyzer. + +#projectId=name;description +project1=The Project;The description of the project. + +#personId=name;email;phone +person1=Ken Duck;ken@kdmanalytics.com;613-627-1011 +#person2=Joe Bloggs;blogs@kdmanalytics.com;555-1234 + +#organizationId=name;description;address;phone;email +org1=KDM Analytics;KDM Analytics is a security assurance company providing products and services for threat risk assessment and management, due diligence assessments, and information and data assurance. Leveraging our decades of experience in static analysis, reverse engineering and formal methods, we have created breakthrough products for the automated and systematic investigation of code, data and networks;3730 Richmond Rd, Suite 204, Ottawa, ON K2H 5B9;613-627-1011;info@kdmanalytics.com + +#organizationId=name;description;address;phone;email +#org2=Acme Corporation;Acme Corporation;blah;555-5555;thingamy@thingamy.com + +#roleId=name;description +role1=Analyst;Analyst for KDM Analytics +role2=Analysis;Security Assurance diff --git a/com.kdmanalytics.toif.framework/target/classes/packet-dcerpc.c.toif.xml b/com.kdmanalytics.toif.framework/target/classes/packet-dcerpc.c.toif.xml new file mode 100644 index 00000000..1ebef1bc --- /dev/null +++ b/com.kdmanalytics.toif.framework/target/classes/packet-dcerpc.c.toif.xml @@ -0,0 +1,1241 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/com.kdmanalytics.toif.framework/target/classes/resources/SFP_CWE_Mapping.txt b/com.kdmanalytics.toif.framework/target/classes/resources/SFP_CWE_Mapping.txt new file mode 100644 index 00000000..92dd4dfa --- /dev/null +++ b/com.kdmanalytics.toif.framework/target/classes/resources/SFP_CWE_Mapping.txt @@ -0,0 +1,316 @@ +CWE-1=SFP-1 +CWE398=SFP-1 +CWE128=SFP1 +CWE190=SFP1 +CWE191=SFP1 +CWE194=SFP1 +CWE195=SFP1 +CWE196=SFP1 +CWE197=SFP1 +CWE681=SFP1 +CWE704=SFP1 +CWE468=SFP1 +CWE456=SFP1 +CWE457=SFP1 +CWE369=SFP1 +CWE579=SFP1 +CWE594=SFP1 +CWE475=SFP1 +CWE685=SFP1 +CWE686=SFP1 +CWE466=SFP1 +CWE562=SFP1 +CWE587=SFP1 +CWE481=SFP1 +CWE486=SFP1 +CWE570=SFP1 +CWE571=SFP1 +CWE597=SFP1 +CWE768=SFP1 +CWE482=SFP2 +CWE561=SFP2 +CWE563=SFP2 +CWE111=SFP3 +CWE242=SFP3 +CWE245=SFP3 +CWE246=SFP3 +CWE382=SFP3 +CWE383=SFP3 +CWE474=SFP3 +CWE477=SFP3 +CWE479=SFP3 +CWE558=SFP3 +CWE574=SFP3 +CWE575=SFP3 +CWE576=SFP3 +CWE577=SFP3 +CWE578=SFP3 +CWE589=SFP3 +CWE676=SFP3 +CWE617=SFP3 +CWE572=SFP3 +CWE586=SFP3 +CWE248=SFP4 +CWE252=SFP4 +CWE253=SFP4 +CWE273=SFP4 +CWE280=SFP4 +CWE390=SFP4 +CWE391=SFP4 +CWE394=SFP4 +CWE431=SFP4 +CWE600=SFP4 +CWE478=SFP4 +CWE484=SFP4 +CWE665=SFP4 +CWE396=SFP5 +CWE397=SFP5 +CWE392=SFP6 +CWE393=SFP6 +CWE584=SFP6 +CWE416=SFP7 +CWE476=SFP7 +CWE469=SFP1 +CWE588=SFP7 +CWE118=SFP8 +CWE119=SFP8 +CWE121=SFP8 +CWE122=SFP8 +CWE123=SFP8 +CWE124=SFP8 +CWE125=SFP8 +CWE126=SFP8 +CWE127=SFP8 +CWE129=SFP8 +CWE120=SFP8 +CWE785=SFP9 +CWE249=SFP9 +CWE135=SFP10 +CWE467=SFP10 +CWE251=SFP10 +CWE170=SFP11 +CWE415=SFP12 +CWE590=SFP12 +CWE761=SFP12 +CWE762=SFP12 +CWE763=SFP12 +CWE763=SFP12 +CWE763=SFP12 +CWE763=SFP12 +CWE400=SFP13 +CWE674=SFP13 +CWE774=SFP13 +CWE401=SFP14 +CWE404=SFP14 +CWE459=SFP14 +CWE771=SFP14 +CWE772=SFP14 +CWE773=SFP14 +CWE775=SFP14 +CWE672=SFP15 +CWE022=SFP16 +CWE023=SFP16 +CWE024=SFP16 +CWE025=SFP16 +CWE026=SFP16 +CWE027=SFP16 +CWE028=SFP16 +CWE029=SFP16 +CWE030=SFP16 +CWE031=SFP16 +CWE032=SFP16 +CWE033=SFP16 +CWE034=SFP16 +CWE035=SFP16 +CWE036=SFP16 +CWE037=SFP16 +CWE038=SFP16 +CWE039=SFP16 +CWE040=SFP16 +CWE042=SFP16 +CWE043=SFP16 +CWE044=SFP16 +CWE045=SFP16 +CWE046=SFP16 +CWE047=SFP16 +CWE048=SFP16 +CWE049=SFP16 +CWE050=SFP16 +CWE051=SFP16 +CWE052=SFP16 +CWE053=SFP16 +CWE054=SFP16 +CWE055=SFP16 +CWE056=SFP16 +CWE057=SFP16 +CWE058=SFP16 +CWE067=SFP16 +CWE073=SFP16 +CWE243=SFP17 +CWE059=SFP18 +CWE062=SFP18 +CWE064=SFP18 +CWE065=SFP18 +CWE364=SFP19 +CWE365=SFP19 +CWE366=SFP19 +CWE413=SFP19 +CWE414=SFP19 +CWE543=SFP19 +CWE567=SFP19 +CWE609=SFP19 +CWE662=SFP19 +CWE667=SFP19 +CWE363=SFP20 +CWE367=SFP20 +CWE370=SFP20 +CWE638=SFP20 +CWE765=SFP21 +CWE764=SFP21 +CWE585=SFP21 +CWE412=SFP22 +CWE311=SFP23 +CWE319=SFP23 +CWE523=SFP23 +CWE256=SFP23 +CWE257=SFP23 +CWE312=SFP23 +CWE313=SFP23 +CWE314=SFP23 +CWE315=SFP23 +CWE317=SFP23 +CWE642=SFP23 +CWE117=SFP23 +CWE532=SFP23 +CWE215=SFP23 +CWE497=SFP23 +CWE209=SFP23 +CWE210=SFP23 +CWE008=SFP23 +CWE214=SFP23 +CWE316=SFP23 +CWE403=SFP23 +CWE495=SFP23 +CWE498=SFP23 +CWE499=SFP23 +CWE501=SFP23 +CWE526=SFP23 +CWE591=SFP23 +CWE598=SFP23 +CWE607=SFP23 +CWE533=SFP23 +CWE534=SFP23 +CWE542=SFP23 +CWE374=SFP23 +CWE375=SFP23 +CWE014=SFP23 +CWE226=SFP23 +CWE244=SFP23 +CWE767=SFP23 +CWE093=SFP24 +CWE138=SFP24 +CWE140=SFP24 +CWE141=SFP24 +CWE142=SFP24 +CWE143=SFP24 +CWE144=SFP24 +CWE145=SFP24 +CWE146=SFP24 +CWE147=SFP24 +CWE148=SFP24 +CWE149=SFP24 +CWE150=SFP24 +CWE151=SFP24 +CWE152=SFP24 +CWE153=SFP24 +CWE154=SFP24 +CWE155=SFP24 +CWE156=SFP24 +CWE157=SFP24 +CWE158=SFP24 +CWE159=SFP24 +CWE160=SFP24 +CWE161=SFP24 +CWE162=SFP24 +CWE163=SFP24 +CWE164=SFP24 +CWE165=SFP24 +CWE641=SFP24 +CWE102=SFP24 +CWE103=SFP24 +CWE104=SFP24 +CWE105=SFP24 +CWE108=SFP24 +CWE109=SFP24 +CWE110=SFP24 +CWE554=SFP24 +CWE077=SFP24 +CWE078=SFP24 +CWE079=SFP24 +CWE080=SFP24 +CWE084=SFP24 +CWE086=SFP24 +CWE112=SFP24 +CWE113=SFP24 +CWE601=SFP24 +CWE644=SFP24 +CWE074=SFP24 +CWE081=SFP24 +CWE082=SFP24 +CWE083=SFP24 +CWE085=SFP24 +CWE087=SFP24 +CWE089=SFP24 +CWE090=SFP24 +CWE091=SFP24 +CWE095=SFP24 +CWE096=SFP24 +CWE099=SFP24 +CWE134=SFP24 +CWE564=SFP24 +CWE611=SFP24 +CWE619=SFP24 +CWE621=SFP24 +CWE624=SFP24 +CWE641=SFP24 +CWE643=SFP24 +CWE652=SFP24 +CWE015=SFP25 +CWE020=SFP25 +CWE454=SFP25 +CWE606=SFP25 +CWE496=SFP25 +CWE502=SFP25 +CWE616=SFP25 +CWE566=SFP25 +CWE494=SFP27 +CWE545=SFP27 +CWE622=SFP27 +CWE489=SFP28 +CWE531=SFP28 +CWE608=SFP28 +CWE491=SFP28 +CWE493=SFP28 +CWE500=SFP28 +CWE568=SFP28 +CWE580=SFP28 +CWE582=SFP28 +CWE583=SFP28 +CWE766=SFP28 +CWE247=SFP29 +CWE292=SFP29 +CWE293=SFP29 +CWE350=SFP29 +CWE360=SFP29 +CWE565=SFP29 +CWE422=SFP30 +CWE425=SFP30 +CWE306=SFP31 +CWE620=SFP31 +CWE605=SFP32 +CWE259=SFP33 +CWE321=SFP33 +CWE307=SFP34 +CWE285=SFP35 +CWE424=SFP35 +CWE272=SFP36 \ No newline at end of file diff --git a/com.kdmanalytics.toif.framework/target/classes/resources/default b/com.kdmanalytics.toif.framework/target/classes/resources/default new file mode 100644 index 00000000..3d690a17 --- /dev/null +++ b/com.kdmanalytics.toif.framework/target/classes/resources/default @@ -0,0 +1,36 @@ +########################### +# Facts +########################### + +TOIFSegmentIsRelatedToProject=project1 +TOIFSegmentIsProducedByOrganization=org1 +TOIFSegmentIsOwnedByOrganization=org1 +TOIFSegmentIsGeneratedByPerson=person1 +TOIFSegmentIsSupervisedByPerson=person1 + +PersonIsInvolvedInProjectAsRole=person1;project1;role1 +OrganizationIsInvolvedInProjectAsRole=org1;project1;role2 +OrganizationIsPartOfOrganizationAsRole=org1;org2;role2 +PersonIsEmployedByOrganizationAsRole=person1;org1;role1 + +########################### +# Entities +########################### + +SegmentDescription=Segment relating to the findings. + +#projectId=name;description +project1=project;project description. + +#personId=name;email;phone +person1=NoName;noName@domain.com;555-1234 + +#organizationId=name;description;address;phone;email +org1=Org;Org Inc;Road;555-5555;noName@domain.com + +#organizationId=name;description;address;phone;email +org2=Acme Corporation;Acme Corporation;blah;555-5555;thingamy@thingamy.com + +#roleId=name;description +role1=Software Developer;Developer +role2=company;employer diff --git a/com.kdmanalytics.toif.framework/target/com.kdmanalytics.toif.framework-1.15.5.jar b/com.kdmanalytics.toif.framework/target/com.kdmanalytics.toif.framework-1.15.5.jar new file mode 100644 index 00000000..90b8b13a Binary files /dev/null and b/com.kdmanalytics.toif.framework/target/com.kdmanalytics.toif.framework-1.15.5.jar differ diff --git a/com.kdmanalytics.toif.framework/target/local-artifacts.properties b/com.kdmanalytics.toif.framework/target/local-artifacts.properties new file mode 100644 index 00000000..dc27bd86 --- /dev/null +++ b/com.kdmanalytics.toif.framework/target/local-artifacts.properties @@ -0,0 +1,4 @@ +#Thu May 29 09:55:59 EDT 2014 +artifact.attached.p2metadata=/home/adam/git/toif/plugins/com.kdmanalytics.toif.framework/target/p2content.xml +artifact.main=/home/adam/git/toif/plugins/com.kdmanalytics.toif.framework/target/com.kdmanalytics.toif.framework-1.15.5.jar +artifact.attached.p2artifacts=/home/adam/git/toif/plugins/com.kdmanalytics.toif.framework/target/p2artifacts.xml diff --git a/com.kdmanalytics.toif.framework/target/maven-archiver/pom.properties b/com.kdmanalytics.toif.framework/target/maven-archiver/pom.properties new file mode 100644 index 00000000..ed219636 --- /dev/null +++ b/com.kdmanalytics.toif.framework/target/maven-archiver/pom.properties @@ -0,0 +1,5 @@ +#Generated by Maven +#Thu May 29 09:55:59 EDT 2014 +version=1.15.5 +groupId=com.kdmanalytics.toif.compile +artifactId=com.kdmanalytics.toif.framework diff --git a/com.kdmanalytics.toif.framework/target/p2artifacts.xml b/com.kdmanalytics.toif.framework/target/p2artifacts.xml new file mode 100644 index 00000000..795ddc0f --- /dev/null +++ b/com.kdmanalytics.toif.framework/target/p2artifacts.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/com.kdmanalytics.toif.framework/target/p2content.xml b/com.kdmanalytics.toif.framework/target/p2content.xml new file mode 100644 index 00000000..2c449458 --- /dev/null +++ b/com.kdmanalytics.toif.framework/target/p2content.xml @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Bundle-SymbolicName: com.kdmanalytics.toif.framework;singleton:=true Bundle-Version: 1.15.5 + + + + + diff --git a/com.kdmanalytics.toif.framework/xml/HouseKeepingXMLSchema.xsd b/com.kdmanalytics.toif.framework/xml/HouseKeepingXMLSchema.xsd new file mode 100644 index 00000000..5a31523b --- /dev/null +++ b/com.kdmanalytics.toif.framework/xml/HouseKeepingXMLSchema.xsd @@ -0,0 +1,630 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/com.kdmanalytics.toif.framework/xml/TOIFSchema.xsd b/com.kdmanalytics.toif.framework/xml/TOIFSchema.xsd new file mode 100644 index 00000000..a8824954 --- /dev/null +++ b/com.kdmanalytics.toif.framework/xml/TOIFSchema.xsd @@ -0,0 +1,716 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/com.kdmanalytics.toif.framework/xml/packet-dcerpc.c.toif.xml b/com.kdmanalytics.toif.framework/xml/packet-dcerpc.c.toif.xml new file mode 100644 index 00000000..1ebef1bc --- /dev/null +++ b/com.kdmanalytics.toif.framework/xml/packet-dcerpc.c.toif.xml @@ -0,0 +1,1241 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/com.kdmanalytics.toif.jlint/.classpath b/com.kdmanalytics.toif.jlint/.classpath new file mode 100644 index 00000000..098194ca --- /dev/null +++ b/com.kdmanalytics.toif.jlint/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/com.kdmanalytics.toif.jlint/.project b/com.kdmanalytics.toif.jlint/.project new file mode 100644 index 00000000..9ff805b0 --- /dev/null +++ b/com.kdmanalytics.toif.jlint/.project @@ -0,0 +1,28 @@ + + + com.kdmanalytics.toif.jlint + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + + org.eclipse.pde.PluginNature + org.eclipse.jdt.core.javanature + + diff --git a/com.kdmanalytics.toif.jlint/.settings/org.eclipse.jdt.core.prefs b/com.kdmanalytics.toif.jlint/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 00000000..f42de363 --- /dev/null +++ b/com.kdmanalytics.toif.jlint/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,7 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 +org.eclipse.jdt.core.compiler.compliance=1.7 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.7 diff --git a/com.kdmanalytics.toif.jlint/META-INF/MANIFEST.MF b/com.kdmanalytics.toif.jlint/META-INF/MANIFEST.MF new file mode 100644 index 00000000..70ba74d3 --- /dev/null +++ b/com.kdmanalytics.toif.jlint/META-INF/MANIFEST.MF @@ -0,0 +1,13 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: TOIF Jlint +Bundle-SymbolicName: com.kdmanalytics.toif.jlint;singleton:=true +Bundle-Version: 1.16.0.qualifier +Bundle-Activator: com.kdmanalytics.toif.jlint.Activator +Bundle-Vendor: KDM Analytics Inc. +Require-Bundle: com.kdmanalytics.toif.framework;bundle-version="[1.15.0,2.0.0)", + org.eclipse.core.runtime, + org.apache.log4j;bundle-version="[1.2.15,1.3.0)", + com.kdmanalytics.toif.common;bundle-version="[1.15.0,2.0.0)" +Bundle-RequiredExecutionEnvironment: JavaSE-1.7 +Export-Package: com.kdmanalytics.toif.adaptor diff --git a/com.kdmanalytics.toif.jlint/bin/com/kdmanalytics/toif/adaptor/JlintAdaptor.class b/com.kdmanalytics.toif.jlint/bin/com/kdmanalytics/toif/adaptor/JlintAdaptor.class new file mode 100644 index 00000000..ab33deb5 Binary files /dev/null and b/com.kdmanalytics.toif.jlint/bin/com/kdmanalytics/toif/adaptor/JlintAdaptor.class differ diff --git a/com.kdmanalytics.toif.jlint/bin/com/kdmanalytics/toif/jlint/Activator.class b/com.kdmanalytics.toif.jlint/bin/com/kdmanalytics/toif/jlint/Activator.class new file mode 100644 index 00000000..b1bb2442 Binary files /dev/null and b/com.kdmanalytics.toif.jlint/bin/com/kdmanalytics/toif/jlint/Activator.class differ diff --git a/com.kdmanalytics.toif.jlint/bin/config/JlintAdaptorConfiguration b/com.kdmanalytics.toif.jlint/bin/config/JlintAdaptorConfiguration new file mode 100644 index 00000000..afdd820a --- /dev/null +++ b/com.kdmanalytics.toif.jlint/bin/config/JlintAdaptorConfiguration @@ -0,0 +1,144 @@ +# - No SFP or CWE found +# - No CWE Found +# - SFP and CWE Found + +#################################################### +# http://www.garret.ru/jlint/ReadMe.htm +#################################################### + +################################# +# Synchronization +################################# + +#Loop id:invocation of synchronized method name can cause deadlock +sync_loopElement=invocation of synchronized method # can cause deadlock +sync_loop=;SFP--1;CWE-833 + +#Loop LoopId/PathId: invocation of method name forms the loop in class dependency graph +loopElement=invocation of method # forms the loop in class dependency graph +loop=;SFP--1;CWE-833 + +#Lock a is requested while holding lock b, with other thread holding a and requesting lock b +lockElement=Lock # is requested while holding lock +lock=;SFP--1;CWE-833 + +#Method wait() can be invoked with monitor of other object locked +waitElement=Method # can be invoked with monitor of other object locked +wait=;SFP--1;CWE-833 + +#Call sequence to method name can cause deadlock in wait() +wait_pathElement=Call sequence to method # can cause deadlock +wait_path=;SFP--1;CWE-833 + +#Synchronized method name is overridden by non-synchronized method of derived class name +nosyncElement=Synchronized method # is overridden by non-synchronized method of derived class +nosync=;SFP-19;CWE-662 + +#Method name can be called from different threads and is not synchronized +concurrent_callElement=Method # can be called from different threads and is not synchronized +concurrent_call=;SFP-19;CWE-662 + +#Field name of class name can be accessed from different threads and is not volatile +concurrent_accessElement=Field # of class +concurrent_access=;SFP-19;CWE-662 + +#Method name implementing 'Runnable' interface is not synchronized +run_nosyncElement=Method # implementing 'Runnable' interface is not synchronized +run_nosync=;SFP-19;CWE-662 + +#Value of lock .* is changed outside synchronization or constructor.; +loop_assignElement=Value of lock # is changed +loop_assign=;SFP-19;CWE-662 + +#Method name.wait() is called without synchronizing on name.; +wait_nosyncElement=Method # is called +wait_nosync=;SFP-19;CWE-662 + +################################# +# Inheritance +################################# + +#Method name is not overridden by method with the same name of derived class name +not_overriddenElement=Method # is not overridden by method +not_overridden=;SFP--1;CWE-710 + +#equals() was overriden but not hashcode() +overridden=;SFP--1;CWE-581 + +#Component name in class name shadows one in base class name +field_redefinedElement=Component '#' in class +field_redefined=;SFP--1;CWE-710 + +#Local variable name shadows component of class name +shadow_localElement=Local variable '#' shadows component of class +shadow_local=;SFP--1;CWE-710 + +#Method finalize() doesn't call super.finalize() +super_finalize=;SFP-28;CWE-568 + +################################# +# Data flow +################################# + +#Method name can be invoked with NULL as number parameter and this parameter is used without check for null +null_paramElement=Method # can be invoked with NULL +null_param=;SFP-7;CWE-476 + +#Value of referenced variable name may be NULL. +null_varElement=Value of referenced variable # may be NULL +null_var=;SFP-7;CWE-476 + +#NULL reference can be used +null_ptr=;SFP-7;CWE-476 + +#Zero operand for operation +zero_operand=;SFP--1;CWE-398 + +#Result of operation is always 0 +zero_result=;SFP--1;CWE-398 + +#Shift with count relation than integer +#Shift count range [min,max] is out of domain +shift_count=;SFP--1;CWE-682 + +#Range of expression value has no intersection with target type domain +conversion=;SFP-1;CWE-681 + +#Data can be lost as a result of truncation to type +truncation=;SFP-1;CWE-197 + +#May be type cast is not correctly applied +overflow=;SFP-1;CWE-704 + +#Comparison always produces the same result +same_result=;SFP--1;CWE-682 + +#Compared operands can be equal only when both of them are 0 +disjoint_mask=;SFP--1;CWE-398 + +#Reminder always equal to the first operand +redundant=;SFP--1;CWE-398 + +#Comparison of short with char +short_char_cmp=;SFP-1;CWE-197 + +#Compare strings as object references +string_cmp=;SFP-1;CWE-597 + +#Inequality comparison can be replaced with equality comparison +weak_cmp=;SFP--1;CWE-710 + +#Switch case constant integer can't be produced by switch expression +incomp_case=;SFP-2;CWE-561 + +#Array length [integer,integer] is less than zero +neg_len=;SFP--1;CWE-131 + +#Array length [integer,integer] is less than zero +array_less_zero=;SFP-4;CWE-665 + +#Index [integer,integer] may be out of array bounds +maybe_bad_index=;SFP-8;CWE-118 + +#Index [integer,integer] is out of array bounds +out_of_bounds=;SFP-8;CWE-118 \ No newline at end of file diff --git a/com.kdmanalytics.toif.jlint/bin/config/idConfig b/com.kdmanalytics.toif.jlint/bin/config/idConfig new file mode 100644 index 00000000..376e8b79 --- /dev/null +++ b/com.kdmanalytics.toif.jlint/bin/config/idConfig @@ -0,0 +1,39 @@ +Loop .*: invocation of synchronized method .* can cause deadlock.;sync_loop +Loop .*: invocation of method .* forms the loop in class dependency graph.;loop +Lock .* is requested while holding lock .*, with other thread holding .* and requesting lock .*;lock +Method wait() can be invoked with monitor of other object locked.;wait +Call sequence to method .* can cause deadlock in wait().;wait_path +Synchronized method .* is overridden by non-synchronized method of derived class .*;nosync +Method .* can be called from different threads and is not synchronized.;concurrent_call +Field .* of class.;concurrent_access +Method .* implementing 'Runnable' interface is not synchronized.;run_nosync +Value of lock .* is changed outside synchronization or constructor.;loop_assign +Value of lock .* is changed while (potentially) owning it.;loop_assign +Method .* is called without synchronizing on .*.;wait_nosync +Method .* is not overridden by method with the same name of derived class .*;not_overridden +Component .* shadows one in base class .*;field_redefined +Local variable .* shadows component of class.;shadow_local +Method .* doesn't call .*;super_finalize +Method .* can be invoked with .*;null_param +Value of referenced variable .* may be NULL.;null_var +NULL reference can be used.;null_ptr +Zero operand for .* operation.;zero_operand +Result of operation is always 0.;zero_result +Shift with count relation than integer.;shift_count +Shift .* count range .* is out of domain.;shift_count +Range of expression value has no intersection with .* type domain.;conversion +Data can be lost as a result of truncation to .*;truncation +truncation;truncation +Maybe type cast is not correctly applied.;overflow +Comparison always produces the same result.;same_result +Compared expressions can be equal only when both of them are 0.;disjoint_mask +Reminder always equal to the first operand.;redundant +Comparison of short with char.;short_char_cmp +Compare strings as object references.;string_cmp +Inequality comparison can be replaced with equality comparison.;weak_cmp +Switch case constant .* can't be produced by switch expression.;incomp_case +Array length .* is less than zero.;array_less_zero +Array length .* may be less than zero.;array_less_zero +Index .* is out of array bounds.;out_of_bounds +Index .* may be out of array bounds.;out_of_bounds +.* was overridden but not .*;overridden diff --git a/com.kdmanalytics.toif.jlint/build.properties b/com.kdmanalytics.toif.jlint/build.properties new file mode 100644 index 00000000..e9863e28 --- /dev/null +++ b/com.kdmanalytics.toif.jlint/build.properties @@ -0,0 +1,5 @@ +source.. = src/ +output.. = bin/ +bin.includes = META-INF/,\ + .,\ + plugin.xml diff --git a/com.kdmanalytics.toif.jlint/plugin.xml b/com.kdmanalytics.toif.jlint/plugin.xml new file mode 100644 index 00000000..fb0a4d81 --- /dev/null +++ b/com.kdmanalytics.toif.jlint/plugin.xml @@ -0,0 +1,11 @@ + + + + + + + + + diff --git a/com.kdmanalytics.toif.jlint/pom.xml b/com.kdmanalytics.toif.jlint/pom.xml new file mode 100644 index 00000000..2941fdeb --- /dev/null +++ b/com.kdmanalytics.toif.jlint/pom.xml @@ -0,0 +1,21 @@ + + + + 4.0.0 + + + com.kdmanalytics.toif + plugins + 1.16.0-SNAPSHOT + + + com.kdmanalytics.toif.compile + com.kdmanalytics.toif.jlint + + + eclipse-plugin + + Jlint Adaptor + \ No newline at end of file diff --git a/com.kdmanalytics.toif.jlint/src/com/kdmanalytics/toif/adaptor/JlintAdaptor.java b/com.kdmanalytics.toif.jlint/src/com/kdmanalytics/toif/adaptor/JlintAdaptor.java new file mode 100644 index 00000000..5bde6a71 --- /dev/null +++ b/com.kdmanalytics.toif.jlint/src/com/kdmanalytics/toif/adaptor/JlintAdaptor.java @@ -0,0 +1,462 @@ + +package com.kdmanalytics.toif.adaptor; + +/******************************************************************************* + * Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This program and + * the accompanying materials are made available under the terms of the Open + * Source Initiative OSI - Open Software License v3.0 which accompanies this + * distribution, and is available at + * http://www.opensource.org/licenses/osl-3.0.php/ + ******************************************************************************/ +import java.io.BufferedReader; +import java.io.FileInputStream; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.util.ArrayList; +import java.util.Properties; +import java.util.Scanner; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import org.apache.log4j.Logger; + +import com.kdmanalytics.toif.common.exception.ToifException; +import com.kdmanalytics.toif.framework.toolAdaptor.AbstractAdaptor; +import com.kdmanalytics.toif.framework.toolAdaptor.AdaptorOptions; +import com.kdmanalytics.toif.framework.toolAdaptor.Language; +import com.kdmanalytics.toif.framework.utils.FindingCreator; +import com.kdmanalytics.toif.framework.xmlElements.entities.Element; +import com.kdmanalytics.toif.framework.xmlElements.entities.File; + +/** + * class for the jlint adaptor. + * + * @author "Adam Nunn " + * + */ +public class JlintAdaptor extends AbstractAdaptor +{ + +/** + * the logger. + */ +private static Logger LOG = Logger.getLogger(JlintAdaptor.class); + + /* + * (non-Javadoc) + * + * @see + * com.kdmanalytics.toif.framework.toolAdaptor.AbstractAdaptor#getAdaptorName + * () + */ + @Override + public String getAdaptorName() + { + return "JLint"; + } + + /* + * (non-Javadoc) + * + * @see com.kdmanalytics.toif.framework.toolAdaptor.AbstractAdaptor# + * getAdaptorDescription() + */ + @Override + public String getAdaptorDescription() + { + return "Jlint will check your Java code and find bugs, inconsistencies and synchronization problems by doing data flow analysis and building the lock graph."; + } + + /** + * create the List using the FindingCreator of elements. + * @throws ToifException + */ + @Override + public ArrayList parse(java.io.File process, AdaptorOptions options, File file, boolean[] validLines, boolean unknownCWE) throws ToifException + { + InputStream inStream = null; + BufferedReader br = null; + String line = null; + try + + { + // new finding creator + FindingCreator creator = new FindingCreator(getProperties(), getAdaptorName(), unknownCWE); + + // get the stream from the process. + inStream = new FileInputStream(process); + + // new buffered reader from the stream. + br = new BufferedReader(new InputStreamReader(inStream)); + + + + // read each line one at a time + while ((line = br.readLine()) != null) + { + + // the different elements are divided by a colon + String[] elements = line.split(":"); + + // anything of length 3, is a finding + if (elements.length == 3) + { + + // create the parts of a finding. + String msg = elements[2].trim(); + String id = deriveId(elements[2]); + int lineNumber = Integer.parseInt(elements[1]); + // String file = elements[0]; + + String dataElement = getDataElement(id, msg); + // create the finding using the finding creator. + creator.create(msg, id, lineNumber, null, null, file, dataElement, null); + } + + } + // close resources + br.close(); + br = null; + inStream.close(); + inStream = null; + return creator.getElements(); + + } + catch (Exception e) + { + final String msg = getAdaptorName() + ": Error while reading input stream from tool: file=" + process.getAbsolutePath() + " line=" +line; + LOG.error( msg, e); + throw new ToifException( msg, e ); + } + finally + { + try + { + if (br != null) + br.close(); + + if (inStream != null) + inStream.close(); + + } + catch (Exception e) + { + LOG.error(getAdaptorName() + ": Unable to close stream", e); + } + } + + } + + /** + * Since there are no weakness ID's for jlint, we need to create our own. + * The ID's need to be unique for all weaknesses but the same for all + * variants of the same weakness. + * + * @param string + * @return + * @throws ToifException + */ + private String deriveId(String description) throws ToifException + { + + Scanner scan = null; + try + + { + scan = new Scanner(getClass().getResourceAsStream("/config/idConfig")); + + String line = null; + while (scan.hasNextLine()) + { + line = scan.nextLine(); + String[] lineParts = line.split(";"); + String pattern = lineParts[0]; + String id = lineParts[1]; + + Pattern r = Pattern.compile(pattern); + + Matcher m = r.matcher(description); + + if (m.find()) + { + scan.close(); + scan = null; + return id; + } + } + + // free resources + scan.close(); + scan = null; + } + catch (Exception e) + { + final String msg = getAdaptorName() + ": Could not access the idConfig file."; + LOG.error( msg , e); + throw new ToifException( msg, e); + } + finally + { + try + { + if (scan != null) + scan.close(); + } + catch (Exception e) + { + System.err.println(getAdaptorName() + ": Unable to close scanner."); + } + } + return description; + } + + /** + * Commands to run the tool. In the form of a String array. + */ + @Override + public String[] runToolCommands(AdaptorOptions options, String[] otherOpts) + { + final String[] commands = { "jlint", options.getInputFile().toString() }; + return commands; + } + + /** + * Get the dataElement's name from the configuration file. + * + * @param id + * the error's id. + * @param msg + * the error's message. + * @return The name as a string for the dataElement. + */ + public String getDataElement(String id, String msg) + { + Properties props = getProperties(); + + if (props.getProperty(id + "Element") == null) + { + return null; + } + + // look for the property which defines where the element is. + final String prop = props.getProperty(id + "Element"); + + String reg = ""; + + // choose which regex to use. + if (prop.startsWith("#")) + { + final String text = msg.substring(msg.length() - prop.length() + 1); + reg = ".*(?=" + text + ")"; + } + else if (prop.endsWith("#")) + { + final String text = prop.split("#")[0]; + reg = "(?<=" + text + ").*"; + } + else + { + final String[] text = prop.split("#"); + reg = "(?<=" + text[0] + ").*(?=" + text[1] + ")"; + } + + // match the pattern to the message + final Pattern pat = Pattern.compile(reg, Pattern.DOTALL); + final Matcher matcher = pat.matcher(msg); + + String name = ""; + + // if the matcher makes a find, use this as the name + if (matcher.find()) + { + name = matcher.group(); + } + else + { + return null; + } + + return name; + } + + /* + * (non-Javadoc) + * + * @see com.kdmanalytics.toif.framework.toolAdaptor.AbstractAdaptor# + * getAdaptorVendorAddress() + */ + @Override + public String getAdaptorVendorAddress() + { + return "3730 Richmond Rd, Suite 204, Ottawa, ON, K2H 5B9"; + } + + /* + * (non-Javadoc) + * + * @see com.kdmanalytics.toif.framework.toolAdaptor.AbstractAdaptor# + * getAdaptorVendorDescription() + */ + @Override + public String getAdaptorVendorDescription() + { + return "KDM Analytics is a security assurance company providing products and services for threat risk assessment and management, due diligence assessments, and information and data assurance. Leveraging our decades of experience in static analysis, reverse engineering and formal methods, we have created breakthrough products for the automated and systematic investigation of code, data and networks."; + } + + /* + * (non-Javadoc) + * + * @see com.kdmanalytics.toif.framework.toolAdaptor.AbstractAdaptor# + * getAdaptorVendorEmail() + */ + @Override + public String getAdaptorVendorEmail() + { + return "adam@kdmanalytics.com"; + } + + /* + * (non-Javadoc) + * + * @see com.kdmanalytics.toif.framework.toolAdaptor.AbstractAdaptor# + * getAdaptorVendorName() + */ + @Override + public String getAdaptorVendorName() + { + return "KDM Analytics"; + } + + /* + * (non-Javadoc) + * + * @see com.kdmanalytics.toif.framework.toolAdaptor.AbstractAdaptor# + * getAdaptorVendorPhone() + */ + @Override + public String getAdaptorVendorPhone() + { + return "613-627-1011"; + } + + /* + * (non-Javadoc) + * + * @see com.kdmanalytics.toif.framework.toolAdaptor.AbstractAdaptor# + * getGeneratorDescription() + */ + @Override + public String getGeneratorDescription() + { + return "Jlint will check your Java code and find bugs, inconsistencies and synchronization problems by doing data flow analysis and building the lock graph."; + } + + /* + * (non-Javadoc) + * + * @see + * com.kdmanalytics.toif.framework.toolAdaptor.AbstractAdaptor#getGeneratorName + * () + */ + @Override + public String getGeneratorName() + { + return "jlint"; + } + + /* + * (non-Javadoc) + * + * @see com.kdmanalytics.toif.framework.toolAdaptor.AbstractAdaptor# + * getGeneratorVendorAddress() + */ + @Override + public String getGeneratorVendorAddress() + { + return "http://artho.com/index.shtml"; + } + + /* + * (non-Javadoc) + * + * @see com.kdmanalytics.toif.framework.toolAdaptor.AbstractAdaptor# + * getGeneratorVendorDescription() + */ + @Override + public String getGeneratorVendorDescription() + { + return "We develop tools for web pages with dynamic content of medium size"; + } + + /* + * (non-Javadoc) + * + * @see com.kdmanalytics.toif.framework.toolAdaptor.AbstractAdaptor# + * getGeneratorVendorEmail() + */ + @Override + public String getGeneratorVendorEmail() + { + return "cyrille@artho.com"; + } + + /* + * (non-Javadoc) + * + * @see com.kdmanalytics.toif.framework.toolAdaptor.AbstractAdaptor# + * getGeneratorVendorName() + */ + @Override + public String getGeneratorVendorName() + { + return "artho"; + } + + /* + * (non-Javadoc) + * + * @see com.kdmanalytics.toif.framework.toolAdaptor.AbstractAdaptor# + * getGeneratorVendorPhone() + */ + @Override + public String getGeneratorVendorPhone() + { + return "+81.8051731892"; + } + + /* + * (non-Javadoc) + * + * @see com.kdmanalytics.toif.framework.toolAdaptor.AbstractAdaptor# + * getGeneratorVersion() + */ + @Override + public String getGeneratorVersion() + { + return "Assumed 3.0"; + } + + @Override + public String getRuntoolName() + { + return "jlint"; + } + + @Override + public Language getLanguage() + { + return Language.JAVA; + } + + @Override + public boolean acceptsDOptions() + { + return false; + } + + @Override + public boolean acceptsIOptions() + { + return false; + } +} diff --git a/com.kdmanalytics.toif.jlint/src/com/kdmanalytics/toif/jlint/Activator.java b/com.kdmanalytics.toif.jlint/src/com/kdmanalytics/toif/jlint/Activator.java new file mode 100644 index 00000000..21466805 --- /dev/null +++ b/com.kdmanalytics.toif.jlint/src/com/kdmanalytics/toif/jlint/Activator.java @@ -0,0 +1,36 @@ +/******************************************************************************* + * Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This program and the + * accompanying materials are made available under the terms of the Open Source + * Initiative OSI - Open Software License v3.0 which accompanies this + * distribution, and is available at http://www.opensource.org/licenses/osl-3.0.php/ + ******************************************************************************/ +package com.kdmanalytics.toif.jlint; + +import org.osgi.framework.BundleActivator; +import org.osgi.framework.BundleContext; + +public class Activator implements BundleActivator { + + private static BundleContext context; + + static BundleContext getContext() { + return context; + } + + /* + * (non-Javadoc) + * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext) + */ + public void start(BundleContext bundleContext) throws Exception { + Activator.context = bundleContext; + } + + /* + * (non-Javadoc) + * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext) + */ + public void stop(BundleContext bundleContext) throws Exception { + Activator.context = null; + } + +} diff --git a/com.kdmanalytics.toif.jlint/src/config/JlintAdaptorConfiguration b/com.kdmanalytics.toif.jlint/src/config/JlintAdaptorConfiguration new file mode 100644 index 00000000..afdd820a --- /dev/null +++ b/com.kdmanalytics.toif.jlint/src/config/JlintAdaptorConfiguration @@ -0,0 +1,144 @@ +# - No SFP or CWE found +# - No CWE Found +# - SFP and CWE Found + +#################################################### +# http://www.garret.ru/jlint/ReadMe.htm +#################################################### + +################################# +# Synchronization +################################# + +#Loop id:invocation of synchronized method name can cause deadlock +sync_loopElement=invocation of synchronized method # can cause deadlock +sync_loop=;SFP--1;CWE-833 + +#Loop LoopId/PathId: invocation of method name forms the loop in class dependency graph +loopElement=invocation of method # forms the loop in class dependency graph +loop=;SFP--1;CWE-833 + +#Lock a is requested while holding lock b, with other thread holding a and requesting lock b +lockElement=Lock # is requested while holding lock +lock=;SFP--1;CWE-833 + +#Method wait() can be invoked with monitor of other object locked +waitElement=Method # can be invoked with monitor of other object locked +wait=;SFP--1;CWE-833 + +#Call sequence to method name can cause deadlock in wait() +wait_pathElement=Call sequence to method # can cause deadlock +wait_path=;SFP--1;CWE-833 + +#Synchronized method name is overridden by non-synchronized method of derived class name +nosyncElement=Synchronized method # is overridden by non-synchronized method of derived class +nosync=;SFP-19;CWE-662 + +#Method name can be called from different threads and is not synchronized +concurrent_callElement=Method # can be called from different threads and is not synchronized +concurrent_call=;SFP-19;CWE-662 + +#Field name of class name can be accessed from different threads and is not volatile +concurrent_accessElement=Field # of class +concurrent_access=;SFP-19;CWE-662 + +#Method name implementing 'Runnable' interface is not synchronized +run_nosyncElement=Method # implementing 'Runnable' interface is not synchronized +run_nosync=;SFP-19;CWE-662 + +#Value of lock .* is changed outside synchronization or constructor.; +loop_assignElement=Value of lock # is changed +loop_assign=;SFP-19;CWE-662 + +#Method name.wait() is called without synchronizing on name.; +wait_nosyncElement=Method # is called +wait_nosync=;SFP-19;CWE-662 + +################################# +# Inheritance +################################# + +#Method name is not overridden by method with the same name of derived class name +not_overriddenElement=Method # is not overridden by method +not_overridden=;SFP--1;CWE-710 + +#equals() was overriden but not hashcode() +overridden=;SFP--1;CWE-581 + +#Component name in class name shadows one in base class name +field_redefinedElement=Component '#' in class +field_redefined=;SFP--1;CWE-710 + +#Local variable name shadows component of class name +shadow_localElement=Local variable '#' shadows component of class +shadow_local=;SFP--1;CWE-710 + +#Method finalize() doesn't call super.finalize() +super_finalize=;SFP-28;CWE-568 + +################################# +# Data flow +################################# + +#Method name can be invoked with NULL as number parameter and this parameter is used without check for null +null_paramElement=Method # can be invoked with NULL +null_param=;SFP-7;CWE-476 + +#Value of referenced variable name may be NULL. +null_varElement=Value of referenced variable # may be NULL +null_var=;SFP-7;CWE-476 + +#NULL reference can be used +null_ptr=;SFP-7;CWE-476 + +#Zero operand for operation +zero_operand=;SFP--1;CWE-398 + +#Result of operation is always 0 +zero_result=;SFP--1;CWE-398 + +#Shift with count relation than integer +#Shift count range [min,max] is out of domain +shift_count=;SFP--1;CWE-682 + +#Range of expression value has no intersection with target type domain +conversion=;SFP-1;CWE-681 + +#Data can be lost as a result of truncation to type +truncation=;SFP-1;CWE-197 + +#May be type cast is not correctly applied +overflow=;SFP-1;CWE-704 + +#Comparison always produces the same result +same_result=;SFP--1;CWE-682 + +#Compared operands can be equal only when both of them are 0 +disjoint_mask=;SFP--1;CWE-398 + +#Reminder always equal to the first operand +redundant=;SFP--1;CWE-398 + +#Comparison of short with char +short_char_cmp=;SFP-1;CWE-197 + +#Compare strings as object references +string_cmp=;SFP-1;CWE-597 + +#Inequality comparison can be replaced with equality comparison +weak_cmp=;SFP--1;CWE-710 + +#Switch case constant integer can't be produced by switch expression +incomp_case=;SFP-2;CWE-561 + +#Array length [integer,integer] is less than zero +neg_len=;SFP--1;CWE-131 + +#Array length [integer,integer] is less than zero +array_less_zero=;SFP-4;CWE-665 + +#Index [integer,integer] may be out of array bounds +maybe_bad_index=;SFP-8;CWE-118 + +#Index [integer,integer] is out of array bounds +out_of_bounds=;SFP-8;CWE-118 \ No newline at end of file diff --git a/com.kdmanalytics.toif.jlint/src/config/idConfig b/com.kdmanalytics.toif.jlint/src/config/idConfig new file mode 100644 index 00000000..376e8b79 --- /dev/null +++ b/com.kdmanalytics.toif.jlint/src/config/idConfig @@ -0,0 +1,39 @@ +Loop .*: invocation of synchronized method .* can cause deadlock.;sync_loop +Loop .*: invocation of method .* forms the loop in class dependency graph.;loop +Lock .* is requested while holding lock .*, with other thread holding .* and requesting lock .*;lock +Method wait() can be invoked with monitor of other object locked.;wait +Call sequence to method .* can cause deadlock in wait().;wait_path +Synchronized method .* is overridden by non-synchronized method of derived class .*;nosync +Method .* can be called from different threads and is not synchronized.;concurrent_call +Field .* of class.;concurrent_access +Method .* implementing 'Runnable' interface is not synchronized.;run_nosync +Value of lock .* is changed outside synchronization or constructor.;loop_assign +Value of lock .* is changed while (potentially) owning it.;loop_assign +Method .* is called without synchronizing on .*.;wait_nosync +Method .* is not overridden by method with the same name of derived class .*;not_overridden +Component .* shadows one in base class .*;field_redefined +Local variable .* shadows component of class.;shadow_local +Method .* doesn't call .*;super_finalize +Method .* can be invoked with .*;null_param +Value of referenced variable .* may be NULL.;null_var +NULL reference can be used.;null_ptr +Zero operand for .* operation.;zero_operand +Result of operation is always 0.;zero_result +Shift with count relation than integer.;shift_count +Shift .* count range .* is out of domain.;shift_count +Range of expression value has no intersection with .* type domain.;conversion +Data can be lost as a result of truncation to .*;truncation +truncation;truncation +Maybe type cast is not correctly applied.;overflow +Comparison always produces the same result.;same_result +Compared expressions can be equal only when both of them are 0.;disjoint_mask +Reminder always equal to the first operand.;redundant +Comparison of short with char.;short_char_cmp +Compare strings as object references.;string_cmp +Inequality comparison can be replaced with equality comparison.;weak_cmp +Switch case constant .* can't be produced by switch expression.;incomp_case +Array length .* is less than zero.;array_less_zero +Array length .* may be less than zero.;array_less_zero +Index .* is out of array bounds.;out_of_bounds +Index .* may be out of array bounds.;out_of_bounds +.* was overridden but not .*;overridden diff --git a/com.kdmanalytics.toif.jlint/target/MANIFEST.MF b/com.kdmanalytics.toif.jlint/target/MANIFEST.MF new file mode 100644 index 00000000..ecb995f4 --- /dev/null +++ b/com.kdmanalytics.toif.jlint/target/MANIFEST.MF @@ -0,0 +1,14 @@ +Manifest-Version: 1.0 +Export-Package: com.kdmanalytics.toif.adaptor +Require-Bundle: com.kdmanalytics.toif.framework;bundle-version="[1.15. + 0,2.0.0)",org.eclipse.core.runtime,org.apache.log4j;bundle-version="[ + 1.2.15,1.3.0)",com.kdmanalytics.toif.common;bundle-version="[1.15.0,2 + .0.0)" +Bundle-Vendor: KDM Analytics Inc. +Bundle-Version: 1.15.5 +Bundle-Name: TOIF Jlint +Bundle-Activator: com.kdmanalytics.toif.jlint.Activator +Bundle-ManifestVersion: 2 +Bundle-SymbolicName: com.kdmanalytics.toif.jlint;singleton:=true +Bundle-RequiredExecutionEnvironment: JavaSE-1.7 + diff --git a/com.kdmanalytics.toif.jlint/target/classes/com/kdmanalytics/toif/adaptor/JlintAdaptor.class b/com.kdmanalytics.toif.jlint/target/classes/com/kdmanalytics/toif/adaptor/JlintAdaptor.class new file mode 100644 index 00000000..c031dc09 Binary files /dev/null and b/com.kdmanalytics.toif.jlint/target/classes/com/kdmanalytics/toif/adaptor/JlintAdaptor.class differ diff --git a/com.kdmanalytics.toif.jlint/target/classes/com/kdmanalytics/toif/jlint/Activator.class b/com.kdmanalytics.toif.jlint/target/classes/com/kdmanalytics/toif/jlint/Activator.class new file mode 100644 index 00000000..b1bb2442 Binary files /dev/null and b/com.kdmanalytics.toif.jlint/target/classes/com/kdmanalytics/toif/jlint/Activator.class differ diff --git a/com.kdmanalytics.toif.jlint/target/classes/config/JlintAdaptorConfiguration b/com.kdmanalytics.toif.jlint/target/classes/config/JlintAdaptorConfiguration new file mode 100644 index 00000000..afdd820a --- /dev/null +++ b/com.kdmanalytics.toif.jlint/target/classes/config/JlintAdaptorConfiguration @@ -0,0 +1,144 @@ +# - No SFP or CWE found +# - No CWE Found +# - SFP and CWE Found + +#################################################### +# http://www.garret.ru/jlint/ReadMe.htm +#################################################### + +################################# +# Synchronization +################################# + +#Loop id:invocation of synchronized method name can cause deadlock +sync_loopElement=invocation of synchronized method # can cause deadlock +sync_loop=;SFP--1;CWE-833 + +#Loop LoopId/PathId: invocation of method name forms the loop in class dependency graph +loopElement=invocation of method # forms the loop in class dependency graph +loop=;SFP--1;CWE-833 + +#Lock a is requested while holding lock b, with other thread holding a and requesting lock b +lockElement=Lock # is requested while holding lock +lock=;SFP--1;CWE-833 + +#Method wait() can be invoked with monitor of other object locked +waitElement=Method # can be invoked with monitor of other object locked +wait=;SFP--1;CWE-833 + +#Call sequence to method name can cause deadlock in wait() +wait_pathElement=Call sequence to method # can cause deadlock +wait_path=;SFP--1;CWE-833 + +#Synchronized method name is overridden by non-synchronized method of derived class name +nosyncElement=Synchronized method # is overridden by non-synchronized method of derived class +nosync=;SFP-19;CWE-662 + +#Method name can be called from different threads and is not synchronized +concurrent_callElement=Method # can be called from different threads and is not synchronized +concurrent_call=;SFP-19;CWE-662 + +#Field name of class name can be accessed from different threads and is not volatile +concurrent_accessElement=Field # of class +concurrent_access=;SFP-19;CWE-662 + +#Method name implementing 'Runnable' interface is not synchronized +run_nosyncElement=Method # implementing 'Runnable' interface is not synchronized +run_nosync=;SFP-19;CWE-662 + +#Value of lock .* is changed outside synchronization or constructor.; +loop_assignElement=Value of lock # is changed +loop_assign=;SFP-19;CWE-662 + +#Method name.wait() is called without synchronizing on name.; +wait_nosyncElement=Method # is called +wait_nosync=;SFP-19;CWE-662 + +################################# +# Inheritance +################################# + +#Method name is not overridden by method with the same name of derived class name +not_overriddenElement=Method # is not overridden by method +not_overridden=;SFP--1;CWE-710 + +#equals() was overriden but not hashcode() +overridden=;SFP--1;CWE-581 + +#Component name in class name shadows one in base class name +field_redefinedElement=Component '#' in class +field_redefined=;SFP--1;CWE-710 + +#Local variable name shadows component of class name +shadow_localElement=Local variable '#' shadows component of class +shadow_local=;SFP--1;CWE-710 + +#Method finalize() doesn't call super.finalize() +super_finalize=;SFP-28;CWE-568 + +################################# +# Data flow +################################# + +#Method name can be invoked with NULL as number parameter and this parameter is used without check for null +null_paramElement=Method # can be invoked with NULL +null_param=;SFP-7;CWE-476 + +#Value of referenced variable name may be NULL. +null_varElement=Value of referenced variable # may be NULL +null_var=;SFP-7;CWE-476 + +#NULL reference can be used +null_ptr=;SFP-7;CWE-476 + +#Zero operand for operation +zero_operand=;SFP--1;CWE-398 + +#Result of operation is always 0 +zero_result=;SFP--1;CWE-398 + +#Shift with count relation than integer +#Shift count range [min,max] is out of domain +shift_count=;SFP--1;CWE-682 + +#Range of expression value has no intersection with target type domain +conversion=;SFP-1;CWE-681 + +#Data can be lost as a result of truncation to type +truncation=;SFP-1;CWE-197 + +#May be type cast is not correctly applied +overflow=;SFP-1;CWE-704 + +#Comparison always produces the same result +same_result=;SFP--1;CWE-682 + +#Compared operands can be equal only when both of them are 0 +disjoint_mask=;SFP--1;CWE-398 + +#Reminder always equal to the first operand +redundant=;SFP--1;CWE-398 + +#Comparison of short with char +short_char_cmp=;SFP-1;CWE-197 + +#Compare strings as object references +string_cmp=;SFP-1;CWE-597 + +#Inequality comparison can be replaced with equality comparison +weak_cmp=;SFP--1;CWE-710 + +#Switch case constant integer can't be produced by switch expression +incomp_case=;SFP-2;CWE-561 + +#Array length [integer,integer] is less than zero +neg_len=;SFP--1;CWE-131 + +#Array length [integer,integer] is less than zero +array_less_zero=;SFP-4;CWE-665 + +#Index [integer,integer] may be out of array bounds +maybe_bad_index=;SFP-8;CWE-118 + +#Index [integer,integer] is out of array bounds +out_of_bounds=;SFP-8;CWE-118 \ No newline at end of file diff --git a/com.kdmanalytics.toif.jlint/target/classes/config/idConfig b/com.kdmanalytics.toif.jlint/target/classes/config/idConfig new file mode 100644 index 00000000..376e8b79 --- /dev/null +++ b/com.kdmanalytics.toif.jlint/target/classes/config/idConfig @@ -0,0 +1,39 @@ +Loop .*: invocation of synchronized method .* can cause deadlock.;sync_loop +Loop .*: invocation of method .* forms the loop in class dependency graph.;loop +Lock .* is requested while holding lock .*, with other thread holding .* and requesting lock .*;lock +Method wait() can be invoked with monitor of other object locked.;wait +Call sequence to method .* can cause deadlock in wait().;wait_path +Synchronized method .* is overridden by non-synchronized method of derived class .*;nosync +Method .* can be called from different threads and is not synchronized.;concurrent_call +Field .* of class.;concurrent_access +Method .* implementing 'Runnable' interface is not synchronized.;run_nosync +Value of lock .* is changed outside synchronization or constructor.;loop_assign +Value of lock .* is changed while (potentially) owning it.;loop_assign +Method .* is called without synchronizing on .*.;wait_nosync +Method .* is not overridden by method with the same name of derived class .*;not_overridden +Component .* shadows one in base class .*;field_redefined +Local variable .* shadows component of class.;shadow_local +Method .* doesn't call .*;super_finalize +Method .* can be invoked with .*;null_param +Value of referenced variable .* may be NULL.;null_var +NULL reference can be used.;null_ptr +Zero operand for .* operation.;zero_operand +Result of operation is always 0.;zero_result +Shift with count relation than integer.;shift_count +Shift .* count range .* is out of domain.;shift_count +Range of expression value has no intersection with .* type domain.;conversion +Data can be lost as a result of truncation to .*;truncation +truncation;truncation +Maybe type cast is not correctly applied.;overflow +Comparison always produces the same result.;same_result +Compared expressions can be equal only when both of them are 0.;disjoint_mask +Reminder always equal to the first operand.;redundant +Comparison of short with char.;short_char_cmp +Compare strings as object references.;string_cmp +Inequality comparison can be replaced with equality comparison.;weak_cmp +Switch case constant .* can't be produced by switch expression.;incomp_case +Array length .* is less than zero.;array_less_zero +Array length .* may be less than zero.;array_less_zero +Index .* is out of array bounds.;out_of_bounds +Index .* may be out of array bounds.;out_of_bounds +.* was overridden but not .*;overridden diff --git a/com.kdmanalytics.toif.jlint/target/com.kdmanalytics.toif.jlint-1.15.5.jar b/com.kdmanalytics.toif.jlint/target/com.kdmanalytics.toif.jlint-1.15.5.jar new file mode 100644 index 00000000..6f633422 Binary files /dev/null and b/com.kdmanalytics.toif.jlint/target/com.kdmanalytics.toif.jlint-1.15.5.jar differ diff --git a/com.kdmanalytics.toif.jlint/target/local-artifacts.properties b/com.kdmanalytics.toif.jlint/target/local-artifacts.properties new file mode 100644 index 00000000..337c70c8 --- /dev/null +++ b/com.kdmanalytics.toif.jlint/target/local-artifacts.properties @@ -0,0 +1,4 @@ +#Thu May 29 09:56:34 EDT 2014 +artifact.attached.p2metadata=/home/adam/git/toif/plugins/com.kdmanalytics.toif.jlint/target/p2content.xml +artifact.main=/home/adam/git/toif/plugins/com.kdmanalytics.toif.jlint/target/com.kdmanalytics.toif.jlint-1.15.5.jar +artifact.attached.p2artifacts=/home/adam/git/toif/plugins/com.kdmanalytics.toif.jlint/target/p2artifacts.xml diff --git a/com.kdmanalytics.toif.jlint/target/maven-archiver/pom.properties b/com.kdmanalytics.toif.jlint/target/maven-archiver/pom.properties new file mode 100644 index 00000000..6da82cdc --- /dev/null +++ b/com.kdmanalytics.toif.jlint/target/maven-archiver/pom.properties @@ -0,0 +1,5 @@ +#Generated by Maven +#Thu May 29 09:56:34 EDT 2014 +version=1.15.5 +groupId=com.kdmanalytics.toif.compile +artifactId=com.kdmanalytics.toif.jlint diff --git a/com.kdmanalytics.toif.jlint/target/p2artifacts.xml b/com.kdmanalytics.toif.jlint/target/p2artifacts.xml new file mode 100644 index 00000000..a7a4d15c --- /dev/null +++ b/com.kdmanalytics.toif.jlint/target/p2artifacts.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/com.kdmanalytics.toif.jlint/target/p2content.xml b/com.kdmanalytics.toif.jlint/target/p2content.xml new file mode 100644 index 00000000..12fa6e9e --- /dev/null +++ b/com.kdmanalytics.toif.jlint/target/p2content.xml @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Bundle-SymbolicName: com.kdmanalytics.toif.jlint;singleton:=true Bundle-Version: 1.15.5 + + + + + diff --git a/com.kdmanalytics.toif.rats/.classpath b/com.kdmanalytics.toif.rats/.classpath new file mode 100644 index 00000000..098194ca --- /dev/null +++ b/com.kdmanalytics.toif.rats/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/com.kdmanalytics.toif.rats/.project b/com.kdmanalytics.toif.rats/.project new file mode 100644 index 00000000..36073db2 --- /dev/null +++ b/com.kdmanalytics.toif.rats/.project @@ -0,0 +1,28 @@ + + + com.kdmanalytics.toif.rats + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + + org.eclipse.pde.PluginNature + org.eclipse.jdt.core.javanature + + diff --git a/com.kdmanalytics.toif.rats/.settings/org.eclipse.jdt.core.prefs b/com.kdmanalytics.toif.rats/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 00000000..f42de363 --- /dev/null +++ b/com.kdmanalytics.toif.rats/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,7 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 +org.eclipse.jdt.core.compiler.compliance=1.7 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.7 diff --git a/com.kdmanalytics.toif.rats/META-INF/MANIFEST.MF b/com.kdmanalytics.toif.rats/META-INF/MANIFEST.MF new file mode 100644 index 00000000..87a72aec --- /dev/null +++ b/com.kdmanalytics.toif.rats/META-INF/MANIFEST.MF @@ -0,0 +1,14 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: TOIF Rats +Bundle-SymbolicName: com.kdmanalytics.toif.rats;singleton:=true +Bundle-Version: 1.16.0.qualifier +Bundle-Activator: com.kdmanalytics.toif.rats.Activator +Bundle-Vendor: KDM Analytics Inc. +Require-Bundle: org.eclipse.core.runtime, + com.kdmanalytics.toif.framework;bundle-version="[1.6.0,2.0.0)", + org.apache.xerces;bundle-version="[2.11.0,3.0.0)", + org.apache.log4j;bundle-version="[1.2.15,1.3.0)", + com.kdmanalytics.toif.common;bundle-version="[1.15.0,2.0.0)" +Bundle-RequiredExecutionEnvironment: JavaSE-1.7 +Export-Package: com.kdmanalytics.toif.adaptor diff --git a/com.kdmanalytics.toif.rats/bin/com/kdmanalytics/toif/adaptor/RatsAdaptor.class b/com.kdmanalytics.toif.rats/bin/com/kdmanalytics/toif/adaptor/RatsAdaptor.class new file mode 100644 index 00000000..4c704b6a Binary files /dev/null and b/com.kdmanalytics.toif.rats/bin/com/kdmanalytics/toif/adaptor/RatsAdaptor.class differ diff --git a/com.kdmanalytics.toif.rats/bin/com/kdmanalytics/toif/rats/Activator.class b/com.kdmanalytics.toif.rats/bin/com/kdmanalytics/toif/rats/Activator.class new file mode 100644 index 00000000..59d3f349 Binary files /dev/null and b/com.kdmanalytics.toif.rats/bin/com/kdmanalytics/toif/rats/Activator.class differ diff --git a/com.kdmanalytics.toif.rats/bin/com/kdmanalytics/toif/rats/RatsParser.class b/com.kdmanalytics.toif.rats/bin/com/kdmanalytics/toif/rats/RatsParser.class new file mode 100644 index 00000000..9dc250b3 Binary files /dev/null and b/com.kdmanalytics.toif.rats/bin/com/kdmanalytics/toif/rats/RatsParser.class differ diff --git a/com.kdmanalytics.toif.rats/bin/config/RatsAdaptorConfiguration b/com.kdmanalytics.toif.rats/bin/config/RatsAdaptorConfiguration new file mode 100644 index 00000000..24468ed9 --- /dev/null +++ b/com.kdmanalytics.toif.rats/bin/config/RatsAdaptorConfiguration @@ -0,0 +1,240 @@ +#RATS C: + +#Standard random number generators should not be used to generate randomness used for security reasons. For security sensitive randomness a crytographic randomness generator that provides sufficient entropy should be used. +randdesc=Predictability;SFP--1;CWE-340 + +#Double check that your buffer is as big as you specify. When using functions that accept a number n of bytes to copy, such as strncpy, be aware that if the dest buffer size = n it may not NULL-terminate the string. +bufbig=;SFP-8;CWE-120 + +#Check buffer boundaries if calling this function in a loop and make sure you are not in danger of writing past the allocated space. +bufloop=;SFP-8;CWE-119 + +#Truncate all input strings to a reasonable length before passing them to this function +bufreasonable=;SFP-8;CWE-119 + +#Many calls for generating temporary file names are insecure (susceptible to race conditions). Use a securely generated file name, for example, by pulling 64 bits of randomness from /dev/random, base 64 encoding it and using that as a file suffix. +tmpfile=;SFP-20;CWE-367 + +#DNS results can easily be forged by an attacker (or arbitrarily set to large values, etc), and should not be trusted +dns=;SFP-29;CWE-247 + +#Buffer size must be _MAX_PATH+1 or larger for this function to be safe +pathbuf=;SFP-9;CWE-785 + +#LoadLibrary will search several places for a library if no path is specified, allowing trojan DLL's to be inserted elsewhere even if the intended DLL is correctly protected from overwriting. Make sure to specify the full path +dllload=Tainted Input;SPF--1;CWE-114 + +#GetExtensionVersion() is called by IIS in the system's security context. Be very careful what you do here, as you are basically suid root for the machine. If you are calling the function rather than implementing it, howabout *not* calling it in the system's security context if possible? +iis_extension=;SFP--1;CWE-250 + +#GetTempPath() may return the current directory or the windows directory. Be careful what you place in these locations. Important files may be overwritten, and trojan DLL's may be dropped in these locations. Never use a user-input filename when writing to a location given by GetTempPath(). +w32tmppath=;SFP-16;CWE-73 + +#Many program execution commands under Windows will search the path for a program if you do not explicitly specify a full path to the file. This can allow trojans to be executed instead. Also, be sure to specify a file extension, since otherwise multiple extensions will be tried by the operating system, providing another opportunity for trojans +w32exec=;SFP-16;CWE-73 + +#While this _exec variant does not search the path for a program (good!), it will run .com files before .exe files and the like. Make sure to specify a file extension +w32execnop=;SFP-16;CWE-73 + +#This function does not properly handle non-NULL terminated strings. This does not result in exploitable code, but can lead to access violations. +accessv=;SFP-11;CWE-170 + +#Impersonation functions return error codes when they fail. These error codes must be checked otherwise code could be run with extra privileges when an impersonation has failed +w32impers=;SFP-4;CWE-252 + +#This function can throw exceptions in low memory conditions. Use InitialCriticalSectionAndSpinCount instead +w32crit=;SFP-4;CWE-248 + + +#Check to be sure that the format string passed as argument %d to this function call does not come from an untrusted source that could have added formatting characters that the code is not prepared to handle. +formatArg=;SFP-24;CWE-134 + +#Check to be sure that argument %d passed to this function call will not copy more data than can be handled, resulting in a buffer overflow +srcBufArg=;SFP-8;CWE-120 + +#Check to be sure that the non-constant format string passed as argument %d to this function call does not come from an untrusted source that could have added formatting characters that the code is not prepared to handle +fsproblem=;SFP-24;CWE-134 + +#Argument %d to this function call should be checked to ensure that it does not come from an untrusted source without first verifying that it contains nothing dangerous. +inputproblem=;SFP-25;CWE-20 + +#A potential TOCTOU (Time Of Check, Time Of Use) vulnerability exists. This is the first line where a check has occured. +raceConditionUse=;SFP-20;CWE-367 + +#A potential race condition vulnerability exists here. Normally a call to this function is vulnerable only when a match check precedes it. No check was detected, however one could still exist that could not be detected +staticlocalbuffer=;SFP-8;CWE-121 + +#Extra care should be taken to ensure that character arrays that are allocated on the stack are used safely. They are prime targets for buffer overflow attacks. +staticglobalbuffer=;SFP-8;CWE-120 + +#A function call is not being made here, but a reference is being made to a name that is normally a vulnerable function. It could be being assigned as a pointer to function. +reference=;SFP-3;CWE-676 + +#Do not use a variable that has been derived from untrusted sources within a backtick. Doing so could allow an attacker to execute arbitrary python code. +pythonBacktick=;SFP-25;CWE-454 + +#The backtick will act just like an call to exec(), so care should be exercised that the string being backtick evaluated does not come from an untrusted source. +otherBacktick=;SFP-24;CWE-95 + +#Unknown!?!? +none=;SFP--1;CWE--1 + +#Reminder: Do not forget to chdir() to an appropriate directory before calling chroot()! +chroot=;SFP-17;CWE-243 + +#Gets is unsafe!! No bounds checking is performed, buffer is easily overflowable by user. Use fgets(buf, size, stdin) instead. +gets=;SFP-3;CWE-676 + +#Environment variables are highly untrustable input. They may be of any length, and contain any data. Do not make any assumptions regarding content or length. If at all possible avoid using them, and if it is necessary, sanitize them and truncate them to a reasonable length. +getEnv=;SFP-25;CWE-15 + +#The last argument is the number of wide chars, not the number of bytes. Getting this wrong can cause a buffer overflow since you will indicate that the buffer is twice the size it actually is. Don't forget about NULL termination. +multiByteToWideChar=;SFP-10;CWE-135 + +#Be sure the destination buffer is at least MAXPATHLEN big. This function may still internally overflow a static buffer, try to avoid using it. If you must, check the size the path your pass in is no longer than MAXPATHLEN +realPath=;SFP-9;CWE-785 + +#cin is unsafe. No bounds checking is performed. Buffer is easily overflowable by user. +cin=;SFP-3;CWE-676 + +#The results of this call are easy to forge. +getLogin=;SFP-3;CWE-676 + +#This may be forgable. Whether it is or not, even the man page recommends against using this. +cuserid=;SFP-3;CWE-676 + +#The results are easy for an attacker to forge, and not reliable. +ttyname=;SFP-3;CWE-676 + +#When setting signal handlers, do not use the same function to handle multiple signals. There exists the possibility a race condition will result if 2 or more different signals are sent to the process at nearly the same time. Also, when writing signal handlers, it is best to do as little as possible in them. The best strategy is to use the signal handler to set a flag, that another part of the program tests and performs the appropriate action(s) when it is set. +signals=;SFP-19;CWE-364 + +#Don't use on memory intended to be secure, because the old structure will not be zeroed out. +realloc=;SFP-14;CWE-244 + +#Remember that sensitive data get copied on fork. For example, a random number generator's internal state will get duplicated, and the child may start outputting identical number streams. +fork=;SFP-23;CWE-214 + +#Some implementations may be broken. Additionally, Remember that sensitive data get copied on fork. For example, a random number generator's internal state will get duplicated, and the child may start outputting identical number streams. Use fork() instead. +vfork=;SFP-23;CWE-214 + +#If the third argument, pDacl, is NULL there is no protection from attack. As an example, an attacker could set a Deny All to Everyone ACE on such an object. +setSecurityDescriptorDacl=Access Control;SFP--1;CWE-279 + +#Consider using strlcat() instead +strncat=;SFP-3;CWE-676 + +#umask() can easily be used to create files with unsafe priviledges. It should be set to restrictive values. +umask=AccessControl;SFP--1;CWE-279 + +#This function does not set the inheritance bits in the Access Controle Entry, making it vulnerable. +addAccessAllowedAce=;SFP-3;CWE-676 + +#When using this function, it is important to be sure that the string being passed in does not contain relative path elements (../ for example), or a null, which may cause underlying C calls to behave in ways you do not expect. This is especially important if the string is in any way constructed from a user supplied value." +taintedfileop=;SFP-16;CWE-23 + +#The filehandle argument should not be derived from user input. Doing so could allow arbitrary filehandles to have operations carried out on them +fcntl=;SFP-24;CWE-99 + +#The second argument specifiying the packed address to bind to, should not be derived from user input. If the address is derived from user input, it is possible for a malicious user to cause the socket to be bound to an address of their choice. +bind=;SFP-24;CWE-99 + + + +#RATS PHP + +#Arguments 1, 2, 4 and 5 of this function may be passed to an external program. (Usually sendmail). Under Windows, they will be passed to a remote email server. If these values are derived from user input, make sure they are properly formatted and contain no unexpected characters or extra data. +mail=;SFP-24;CWE-77 + +#This function literally leaks memory. Are you sure you meant to use this +leak=;SFP-14;CWE-401 + +#Reminder: Do not forget to chdir() to an appropriate directory before calling chroot() +phpChroot=;SFP-17;CWE-243 + +#The results of this call are easy to forge. +posix_getlogin=;SFP-3;CWE-676 + +#The results are easy for an attacker to forge, and not reliable. +posix_ttyname=;SFP-3;CWE-676 + + + +#RATS OPENSSL + +#Allow the function to dynamically allocate the buffer. If you insist on a fixed buffer, then double check that your buffer is as big as you specify. +avoidbuf=;SFP-8;CWE-119 + +#Does the memory need to be cleaned if moved? Use re[m]alloc_clean instead +cleanrealloc=;SFP-23;CWE-244 + +#Does the memory need to be cleaned before freeing? +cleanfree=;SFP-23;CWE-244 + +#Use ERR_error_string_n() instead +stringn=;SFP-3;CWE-676 + +#make sure the buffer is EVP_MAX_MD_SIZE +mdlen=;SFP-8;CWE-120 + +#make sure the output buffer is either at least one block less one byte bigger than the input, or that you are sure inputs are always multiples of the block size, and the output buffer is as big as the input. +enclen=;SFP-8;CWE-120 + +#make sure the output buffer is four thirds the size of the input buffer (precisely out=((in+2)/3)*4 where the division is truncated. +encodelen=;SFP-8;CWE-120 + +#Use strlcpy/strlcat instead of strncpy/strncat +usel=;SFP-8;CWE-120 + + + +#RATS RUBY + +#Ruby safe level 2 disables this function as it could be potentially dangerous. Verify this function is being used in a safe manner. +rubysafelevel=;SFP-3;CWE-676 + +#Verify variable is properly validated from tainted input. +untaint=;SFP-25;CWE-20 + +#Unchecked user input could allow director traversal attacks. +send_files=;SFP-16;CWE-22 + +#Unknown +rubySystem=;SFP--1;CWE--1 + +#Make sure user data is not passed to exec. +exec=;SFP-24;CWE-77 + +#This method allows I/O access outside of the application. All I/O should be validated. +open=;SFP-24;CWE-20 + +#Use of params, verify all user values are checked before using. Never pass params directly to a new object i.e. Object.new(params[:user]) +params=;SFP-24;CWE-99 + + +#Unknown +chmod_R=;SFP-3;CWE-676 + +#Unknown +chown_R=;SFP-3;CWE-676 + +#Unknown +ln_s=;SFP-3;CWE-676 + +#Unknown +mkdir_p=;SFP-3;CWE-676 + +#Unknown +mkpath=;SFP-3;CWE-676 + +#Unknown +touch=;SFP-3;CWE-676 + +#Unchecked user input could all exectuion of system commands. +popen=;SFP-25;CWE-20 + +#Unchecked user input could all loading of rouge scripts. +load=;SFP-27;CWE-545 + +#Make sure this function is not being used for any security related tasks. +rand=Predictability;SFP--1;CWE-340 diff --git a/com.kdmanalytics.toif.rats/bin/config/RatsAdaptorIdConfig b/com.kdmanalytics.toif.rats/bin/config/RatsAdaptorIdConfig new file mode 100644 index 00000000..7d149c25 --- /dev/null +++ b/com.kdmanalytics.toif.rats/bin/config/RatsAdaptorIdConfig @@ -0,0 +1,106 @@ +#RATS-C + +Standard random number generators should not be used to.*;randdesc +Double check that your buffer is as big as you specify.*;bufbig +Check buffer boundaries if calling this function in a loop.*;bufloop +Truncate all input strings to a.*;bufreasonable +Many calls for generating temporary file names are.*;tmpfile +DNS results can easily be forged by an attacker.*;dns +Buffer size must be .*;pathbuf +LoadLibrary will search several places for a library if no path is specified, allowing trojan DLL's to be inserted elsewhere even if the intended DLL is correctly protected from overwriting.*;dllload +GetExtensionVersion.* is called by IIS in the.*;iis_extension +GetTempPath.* may return the current directory or the.*;w32tmppath +Many program execution commands under Windows will search.*;w32exec +While this _exec variant does not search the path for.*;w32execnop +This function does not properly handle non-NULL terminated.*;accessv +Impersonation functions return error codes when they.*;w32impers +This function can throw exceptions in low memory.*;w32crit +Check to be sure that the format string passed as argument.*;formatArg +Check to be sure that argument .* passed to this function call will not.*;srcBufArg +Check to be sure that the non-constant format string passed as argument.*;fsproblem +Argument .* to this function call should be checked to ensure that it does.*;inputproblem +A potential race condition vulnerability exists here.*;raceconditionuse +Extra care should be taken to ensure that character arrays that are allocated on the stack.*;staticlocalbuffer +Extra care should be taken to ensure that character arrays that are allocated with a static.*;staticglobalbuffer +A function call is not being made here, but a reference is being made to a name that is normally a vulnerable function.*;reference +Do not use a variable that has been derived from untrusted sources within a backtick.*;pythonBacktick +The backtick will act just like an call to exec.* so care should be exercised that the string being backtick evaluated does not come from an.*;otherBacktick +A potential TOCTOU .* vulnerability.*;raceConditionUse +Reminder.* Do not forget to chdir.* to an appropriate directory before calling chroot.*;chroot +Gets is unsafe.* No bounds checking is performed.* buffer is easily overflowable by user.*;gets +Environment variables are highly untrustable input.*;getEnv +The last argument is the number of wide chars.* not the number of bytes.*;multiByteToWideChar +Be sure the destination buffer is at least MAXPATHLEN big.*;realPath +cin is unsafe.*;cin +The results of this call are easy to forge.*;getLogin +This may be forgable.*;cuserid +The results are easy for an attacker to forge.* and not reliable.*;ttyname +When setting signal handlers.* do not use the same function to handle multiple signals.*;signals +Don't use on memory intended to be secure.* because the old structure will not be zeroed out.*;realloc +Remember that sensitive data get copied on fork.*;fork +Some implementations may be broken.*;vfork +If the third argument.* pDacl.* is NULL there is no protection from attack.*;setSecurityDescriptorDacl +Consider using strlcat.*;strncat +umask.* can easily be used to create files with unsafe priviledges.*;umask +This function does not set the inheritance bits in the Access Controle Entry.*;addAccessAllowedAce + + +Unknown.*;none + + + +#RATS PEARL + +When using.* it is important to be sure that the string being passed in does not contain relative path elements.*;taintedfileop +The filehandle argument should not be derived from user input.*;fcntl +The second argument specifiying the packed address to bind to.* should not be derived from user input.* If the address is derived from user input.* it is possible for a malicious user to cause the socket to be bound to an address of their choice.;bind +When using setpgrp.* neither argument should be derived from user input.* doing so may allow the attacker to modify both the PID and the PGRP argument.* possibly allowing arbitrary processes to have their process group changed.*;setgrp +When using setpriority.* do not pass arguments to it that are derived from user input.* Doing so could allow an attacker to set the priority of an arbitrary process on the system.*;setPriority +Care should be exercised when using the syscall function.* Arguments derived from user input are to be avoided.* and are especially dangerous due to the fact they are passed directly to the underlying OS call.* There is also a potential for buffer-overflow like problems with strings that may be written to.* Extend all perl strings to sane lengths before passing them into this function.*;syscall +The second argument specifiying the packed address to bind to.* should not be derived from user input.* If the address is derived from user input.* it is possible for a malicious user to cause the socket to connect to an arbitrary remote address.* enabling hijacking of potentially sensitive network data.*;connect +When using system.* it is important to be sure that the string being used does not contain relative path elements .* or a null.* which may cause underlying C calls to behave strangely.* It is also imperative to insure the string has no characters that may be interpreted by the shell.* possibly allowing arbitrary commands to be run.*;system +The filename argument of open should be carefully checked if it is being created with any user-supplied string as a compontent of it.* Strings should be checked for occurences of path backtracking.* which may cause the underlying C call to interpret the filename to open differently than expected.* It is also important to make sure that the final filename does not end in a .* as this will cause the path to be executed.*;open +Using a user supplied expression as an argument to this function should be avoided.* Explicitly set the umask to a value you know is safe.*;pearlUmask +Avoid constructing the list of process ids to kill with any strings that contain user inputted data.* Users may be able to manipulate the pid values in such a way as to cause arbitrary signals to be sent to processes.* possibly leading to exploits or DoS attacks.*;kill +Using user supplied strings as the arguments to ioctl may allow the user to manipulate the device in arbitrary ways.*;ioctl +Using user supplied strings anywhere inside of an eval is extremely dangerous.* Unvalidated user input fed into an eval call may allow the user to execute arbitrary perl code.* Avoid ever passing user supplied strings into eval.*;eval +Glob invokes a shell .* to obtain the list of filenames that match the glob pattern.* Unvalidated user input used in a glob pattern could allow arbitrary shell code to be run.* possibly executing programs as a result.* Avoid using user input in glob patterns.*;glob + + + +#RATS PHP + +Arguments .* they will be passed to a remote email server.* make sure they are properly formatted and contain no unexpected characters or extra data.*;mail +This function literally leaks memory.*;leak +Reminder.* Do not forget to chdir.* to an appropriate directory before calling chroot.*;phpChroot + The results of this call are easy to forge.*;posix_getlogin +The results are easy for an attacker to forge.*;posix_ttyname + + +RATS OPENSSL + +Allow the function to dynamically allocate the buffer.* If you insist on a fixed buffer.* then double check that your buffer is as big as you specify.*;avoidbuf +Does the memory need to be cleaned if moved.*;cleanrealloc +Does the memory need to be cleaned before freeing.*;cleanfree +Use ERR_error_string_n.* instead.*;stringn +make sure the buffer is EVP_MAX_MD_SIZE.*;mdlen +make sure the output buffer is either at least one block less one byte biggerthan the input.*;enclen +make sure the output buffer is four thirds the size of the input buffer.*;encodelen +Use strlcpy.*strlcat instead of strncpy.*strncat.*;usel + + +RATS RUBY + +Ruby safe level 2 disables this function as it could be potentially dangerous.*;rubysafelevel +Verify variable is properly validated from tainted input.*;untaint +Unchecked user input could allow director traversal attacks.*;send_files +#;rubySystem +Make sure user data is not passed to exec.*;exec +This method allows .* access outside of the application.*;open +Use of params.* verify all user values are checked before using.*;params +Unchecked user input could all exectuion of system commands.*;popen +Unchecked user input could all loading of rouge scripts.*;load +Make sure this function is not being used for any security related tasks.*;rand + + + diff --git a/com.kdmanalytics.toif.rats/build.properties b/com.kdmanalytics.toif.rats/build.properties new file mode 100644 index 00000000..e9863e28 --- /dev/null +++ b/com.kdmanalytics.toif.rats/build.properties @@ -0,0 +1,5 @@ +source.. = src/ +output.. = bin/ +bin.includes = META-INF/,\ + .,\ + plugin.xml diff --git a/com.kdmanalytics.toif.rats/plugin.xml b/com.kdmanalytics.toif.rats/plugin.xml new file mode 100644 index 00000000..6ef19435 --- /dev/null +++ b/com.kdmanalytics.toif.rats/plugin.xml @@ -0,0 +1,11 @@ + + + + + + + + + diff --git a/com.kdmanalytics.toif.rats/pom.xml b/com.kdmanalytics.toif.rats/pom.xml new file mode 100644 index 00000000..09f5a1a0 --- /dev/null +++ b/com.kdmanalytics.toif.rats/pom.xml @@ -0,0 +1,21 @@ + + + + 4.0.0 + + + com.kdmanalytics.toif + plugins + 1.16.0-SNAPSHOT + + + com.kdmanalytics.toif.compile + com.kdmanalytics.toif.rats + + + eclipse-plugin + + Rats Adaptor + \ No newline at end of file diff --git a/com.kdmanalytics.toif.rats/src/com/kdmanalytics/toif/adaptor/RatsAdaptor.java b/com.kdmanalytics.toif.rats/src/com/kdmanalytics/toif/adaptor/RatsAdaptor.java new file mode 100644 index 00000000..8e296b5c --- /dev/null +++ b/com.kdmanalytics.toif.rats/src/com/kdmanalytics/toif/adaptor/RatsAdaptor.java @@ -0,0 +1,242 @@ + +package com.kdmanalytics.toif.adaptor; + +/******************************************************************************* + * Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This program and + * the accompanying materials are made available under the terms of the Open + * Source Initiative OSI - Open Software License v3.0 which accompanies this + * distribution, and is available at + * http://www.opensource.org/licenses/osl-3.0.php/ + ******************************************************************************/ +import java.io.BufferedReader; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.FileInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.util.ArrayList; + +import org.xml.sax.InputSource; +import org.xml.sax.SAXException; +import org.xml.sax.XMLReader; +import org.xml.sax.helpers.XMLReaderFactory; + +import com.kdmanalytics.toif.framework.parser.StreamGobbler; +import com.kdmanalytics.toif.framework.toolAdaptor.AbstractAdaptor; +import com.kdmanalytics.toif.framework.toolAdaptor.AdaptorOptions; +import com.kdmanalytics.toif.framework.toolAdaptor.Language; +import com.kdmanalytics.toif.framework.xmlElements.entities.Element; +import com.kdmanalytics.toif.framework.xmlElements.entities.File; +import com.kdmanalytics.toif.rats.RatsParser; + +/** + * the Rough audit tool for security adaptor. + * + * @author "Adam Nunn " + * + */ +public class RatsAdaptor extends AbstractAdaptor +{ + + @Override + public String getAdaptorName() + { + return "Rough Audit Tool for Security"; + } + + @Override + public String getAdaptorDescription() + { + return "The Rough Audit Tool Adaptor"; + } + + @Override + public String[] runToolCommands(AdaptorOptions options, String[] otherOpts) + { + final String[] commands = { "rats", "--xml", "--quiet", options.getInputFile().toString() }; + return commands; + } + + /** + * parse the output of the rats tool + */ + @Override + public ArrayList parse(java.io.File process, AdaptorOptions options, File file, boolean[] validLines, boolean unknownCWE) + { + try + { + final InputStream inputStream = new FileInputStream(process); + Thread stderr; + final RatsParser parser = new RatsParser(getProperties(), file, getAdaptorName(), validLines, unknownCWE); + + final ByteArrayOutputStream errStream = new ByteArrayOutputStream(); + + stderr = new Thread(new StreamGobbler(inputStream, errStream)); + + stderr.start(); + stderr.join(); + + // process.waitFor(); + + final byte[] data = errStream.toByteArray(); + final ByteArrayInputStream in = new ByteArrayInputStream(data); + + final XMLReader rdr = XMLReaderFactory.createXMLReader("org.apache.xerces.parsers.SAXParser"); + rdr.setContentHandler(parser); + rdr.parse(new InputSource(in)); + + return parser.getElements(); + + } + catch (final SAXException e) + { + e.printStackTrace(); + } + catch (final IOException e) + { + e.printStackTrace(); + } + catch (final InterruptedException e) + { + e.printStackTrace(); + } + + return null; + } + + @Override + public String getAdaptorVendorAddress() + { + return "3730 Richmond Rd, Suite 204, Ottawa, ON, K2H 5B9"; + } + + @Override + public String getAdaptorVendorDescription() + { + return "KDM Analytics is a security assurance company providing products and services for threat risk assessment and management, due diligence assessments, and information and data assurance. Leveraging our decades of experience in static analysis, reverse engineering and formal methods, we have created breakthrough products for the automated and systematic investigation of code, data and networks."; + } + + @Override + public String getAdaptorVendorEmail() + { + return "adam@kdmanalytics.com"; + } + + @Override + public String getAdaptorVendorName() + { + return "KDM Analytics"; + } + + @Override + public String getAdaptorVendorPhone() + { + return "613-627-1011"; + } + + @Override + public String getGeneratorDescription() + { + return "RATS is a tool for scanning C, C++, Perl, PHP and Python source code and flagging common security related programming errors such as buffer overflows and TOCTOU (Time Of Check, Time Of Use) race conditions."; + } + + @Override + public String getGeneratorName() + { + return "RATS - Rough Auditing Tool for Security"; + } + + @Override + public String getGeneratorVendorAddress() + { + return "2215 Bridgepointe Pkwy, Suite 400, San Mateo, CA, 94404"; + } + + @Override + public String getGeneratorVendorDescription() + { + return "Fortify's Software Security Assurance products and services protect companies from the threats posed by security flaws in business-critical software applications."; + } + + @Override + public String getGeneratorVendorEmail() + { + return "contact@fortify.com"; + } + + @Override + public String getGeneratorVendorName() + { + return "Fortify"; + } + + @Override + public String getGeneratorVendorPhone() + { + return "650-358-5600"; + } + + @Override + public String getGeneratorVersion() + { + final String[] commands = { "rats", "-help" }; + ProcessBuilder rats = new ProcessBuilder(commands); + try + { + Process ratsInstance = rats.start(); + InputStream in = ratsInstance.getInputStream(); + + BufferedReader br = new BufferedReader(new InputStreamReader(in)); + + String strLine; + + while ((strLine = br.readLine()) != null) + { + String[] stringArray = strLine.split(" "); + if (stringArray[1].trim().equals("v2.3")) + { + return stringArray[1].trim(); + } + else + { + System.err.println(getAdaptorName() + ": Generator " + stringArray[1] + " found, only version v2.3 has been tested"); + return stringArray[1].trim(); + } + } + + } + catch (IOException e) + { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + return ""; + } + + @Override + public String getRuntoolName() + { + return "rats"; + } + + @Override + public Language getLanguage() + { + return Language.C; + } + + @Override + public boolean acceptsDOptions() + { + return false; + } + + @Override + public boolean acceptsIOptions() + { + return false; + } + +} diff --git a/com.kdmanalytics.toif.rats/src/com/kdmanalytics/toif/rats/Activator.java b/com.kdmanalytics.toif.rats/src/com/kdmanalytics/toif/rats/Activator.java new file mode 100644 index 00000000..0a33b6ad --- /dev/null +++ b/com.kdmanalytics.toif.rats/src/com/kdmanalytics/toif/rats/Activator.java @@ -0,0 +1,39 @@ +/******************************************************************************* + * Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This program and the + * accompanying materials are made available under the terms of the Open Source + * Initiative OSI - Open Software License v3.0 which accompanies this + * distribution, and is available at http://www.opensource.org/licenses/osl-3.0.php/ + ******************************************************************************/ +package com.kdmanalytics.toif.rats; + +import org.osgi.framework.BundleActivator; +import org.osgi.framework.BundleContext; +/** + * The activator class controls the plug-in life cycle + */ + +public class Activator implements BundleActivator { + + private static BundleContext context; + + static BundleContext getContext() { + return context; + } + + /* + * (non-Javadoc) + * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext) + */ + public void start(BundleContext bundleContext) throws Exception { + Activator.context = bundleContext; + } + + /* + * (non-Javadoc) + * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext) + */ + public void stop(BundleContext bundleContext) throws Exception { + Activator.context = null; + } + +} diff --git a/com.kdmanalytics.toif.rats/src/com/kdmanalytics/toif/rats/RatsParser.java b/com.kdmanalytics.toif.rats/src/com/kdmanalytics/toif/rats/RatsParser.java new file mode 100644 index 00000000..97326fe7 --- /dev/null +++ b/com.kdmanalytics.toif.rats/src/com/kdmanalytics/toif/rats/RatsParser.java @@ -0,0 +1,238 @@ + +package com.kdmanalytics.toif.rats; + +/******************************************************************************* + * Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This program and + * the accompanying materials are made available under the terms of the Open + * Source Initiative OSI - Open Software License v3.0 which accompanies this + * distribution, and is available at + * http://www.opensource.org/licenses/osl-3.0.php/ + ******************************************************************************/ +import java.io.IOException; +import java.util.ArrayList; +import java.util.Properties; +import java.util.Scanner; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import org.apache.log4j.Logger; +import org.xml.sax.Attributes; +import org.xml.sax.helpers.DefaultHandler; + +import com.kdmanalytics.toif.framework.utils.FindingCreator; +import com.kdmanalytics.toif.framework.xmlElements.entities.Element; +import com.kdmanalytics.toif.framework.xmlElements.entities.File; + +/** + * Parser for the rats tool output. + * + * @author "Adam Nunn " + * + */ +public class RatsParser extends DefaultHandler +{ + +/** + * the logger. + */ +private static Logger LOG = Logger.getLogger(RatsParser.class); + + private FindingCreator findingCreator; + + private String id; + + private String type; + + private String message; + + private File file; + + private Integer line; + + private StringBuffer tmpValue = new StringBuffer(); + + private boolean[] validLines; + + /** + * create the new parser + */ + public RatsParser(Properties props, File file, String name, boolean[] validLines, boolean unknownCWE) + { + findingCreator = new FindingCreator(props, name, unknownCWE); + this.file = file; + this.validLines = validLines; + } + + /** + * called for the starting element. + */ + public void startElement(String uri, String localName, String qName, Attributes attrs) + { + tmpValue.setLength(0); + } + + /** + * + */ + public void characters(char[] ch, int start, int length) + { + tmpValue.append(ch, start, length); + } + + /** + * Tries to match the weakness to an id in the idConfig file. if there is + * not weakness description, then we fall back on the type. + */ + public void endElement(String uri, String localName, String qName) + { + if ("type".equals(qName)) + { + type = tmpValue.toString().trim(); + type = type.replace(" ", ""); + } + + if ("message".equals(qName)) + { + message = tmpValue.toString().trim(); + message = message.replace("\n", " "); + message = message.replaceAll("\\s{2,}", " "); + id = deriveId(message); + } + + if ("name".equals(qName)) + { + // file = tmpValue.toString().trim(); + } + + if ("line".equals(qName)) + { + line = Integer.parseInt(tmpValue.toString().trim()); + + if (id == null || id.isEmpty()) + { + id = type; + } + + // if there are valid lines + if (validLines != null) + { + // return if the line number is greater than the array size. + if (line >= validLines.length) + { + try + { + FindingCreator.writeToFile("Rats: Not a valid line (uncompiled) "+file.getPath()+":"+line+"\n"); + } + catch (IOException e) + { + // TODO Auto-generated catch block + e.printStackTrace(); + } + return; + } + // return if the validity is false. + else if (!validLines[line]) + { + try + { + FindingCreator.writeToFile("Rats: Not a valid line (uncompiled) "+file.getPath()+":"+line+"\n"); + } + catch (IOException e) + { + // TODO Auto-generated catch block + e.printStackTrace(); + } + return; + } + } + + // pass the required information to the finding creator. + findingCreator.create(message, id, line, null, null, file, null, null); + // // if there are valid lines + // if (validLines != null) + // { + // // return if the line number is greater than the array size. + // if (line >= validLines.length) + // { + // return; + // } + // // return if the validity is false. + // else if (!validLines[line]) + // { + // return; + // } + // } + // else + // { + // findingCreator.create(message, id, line, null, null, file, null, + // null); + // } + } + } + + public ArrayList getElements() + { + return findingCreator.getElements(); + } + + /** + * derive the id from the description and the id config file. + * + * @param description + * @return + */ + private String deriveId(String description) + { + Scanner scan = null; + try + { + scan = new Scanner(getClass().getResourceAsStream("/config/RatsAdaptorIdConfig")); + + String line = null; + while (scan.hasNextLine()) + { + + line = scan.nextLine(); + String[] lineParts = line.split(";"); + if (line.startsWith("#")) + { + continue; + } + if (lineParts.length != 2) + { + continue; + } + if (line.isEmpty()) + { + continue; + } + + String pattern = lineParts[0]; + String id = lineParts[1]; + + Pattern r = Pattern.compile(pattern); + Matcher m = r.matcher(description); + + if (m.find()) + { + scan.close(); scan = null; + return id; + + } + } + } + catch (Exception e) + { + final String msg = "Could not access the idConfig file." ; + LOG.fatal( msg, e); + + } + finally + { + if (scan != null) + scan.close(); + } + return null; + } + +} diff --git a/com.kdmanalytics.toif.rats/src/config/RatsAdaptorConfiguration b/com.kdmanalytics.toif.rats/src/config/RatsAdaptorConfiguration new file mode 100644 index 00000000..24468ed9 --- /dev/null +++ b/com.kdmanalytics.toif.rats/src/config/RatsAdaptorConfiguration @@ -0,0 +1,240 @@ +#RATS C: + +#Standard random number generators should not be used to generate randomness used for security reasons. For security sensitive randomness a crytographic randomness generator that provides sufficient entropy should be used. +randdesc=Predictability;SFP--1;CWE-340 + +#Double check that your buffer is as big as you specify. When using functions that accept a number n of bytes to copy, such as strncpy, be aware that if the dest buffer size = n it may not NULL-terminate the string. +bufbig=;SFP-8;CWE-120 + +#Check buffer boundaries if calling this function in a loop and make sure you are not in danger of writing past the allocated space. +bufloop=;SFP-8;CWE-119 + +#Truncate all input strings to a reasonable length before passing them to this function +bufreasonable=;SFP-8;CWE-119 + +#Many calls for generating temporary file names are insecure (susceptible to race conditions). Use a securely generated file name, for example, by pulling 64 bits of randomness from /dev/random, base 64 encoding it and using that as a file suffix. +tmpfile=;SFP-20;CWE-367 + +#DNS results can easily be forged by an attacker (or arbitrarily set to large values, etc), and should not be trusted +dns=;SFP-29;CWE-247 + +#Buffer size must be _MAX_PATH+1 or larger for this function to be safe +pathbuf=;SFP-9;CWE-785 + +#LoadLibrary will search several places for a library if no path is specified, allowing trojan DLL's to be inserted elsewhere even if the intended DLL is correctly protected from overwriting. Make sure to specify the full path +dllload=Tainted Input;SPF--1;CWE-114 + +#GetExtensionVersion() is called by IIS in the system's security context. Be very careful what you do here, as you are basically suid root for the machine. If you are calling the function rather than implementing it, howabout *not* calling it in the system's security context if possible? +iis_extension=;SFP--1;CWE-250 + +#GetTempPath() may return the current directory or the windows directory. Be careful what you place in these locations. Important files may be overwritten, and trojan DLL's may be dropped in these locations. Never use a user-input filename when writing to a location given by GetTempPath(). +w32tmppath=;SFP-16;CWE-73 + +#Many program execution commands under Windows will search the path for a program if you do not explicitly specify a full path to the file. This can allow trojans to be executed instead. Also, be sure to specify a file extension, since otherwise multiple extensions will be tried by the operating system, providing another opportunity for trojans +w32exec=;SFP-16;CWE-73 + +#While this _exec variant does not search the path for a program (good!), it will run .com files before .exe files and the like. Make sure to specify a file extension +w32execnop=;SFP-16;CWE-73 + +#This function does not properly handle non-NULL terminated strings. This does not result in exploitable code, but can lead to access violations. +accessv=;SFP-11;CWE-170 + +#Impersonation functions return error codes when they fail. These error codes must be checked otherwise code could be run with extra privileges when an impersonation has failed +w32impers=;SFP-4;CWE-252 + +#This function can throw exceptions in low memory conditions. Use InitialCriticalSectionAndSpinCount instead +w32crit=;SFP-4;CWE-248 + + +#Check to be sure that the format string passed as argument %d to this function call does not come from an untrusted source that could have added formatting characters that the code is not prepared to handle. +formatArg=;SFP-24;CWE-134 + +#Check to be sure that argument %d passed to this function call will not copy more data than can be handled, resulting in a buffer overflow +srcBufArg=;SFP-8;CWE-120 + +#Check to be sure that the non-constant format string passed as argument %d to this function call does not come from an untrusted source that could have added formatting characters that the code is not prepared to handle +fsproblem=;SFP-24;CWE-134 + +#Argument %d to this function call should be checked to ensure that it does not come from an untrusted source without first verifying that it contains nothing dangerous. +inputproblem=;SFP-25;CWE-20 + +#A potential TOCTOU (Time Of Check, Time Of Use) vulnerability exists. This is the first line where a check has occured. +raceConditionUse=;SFP-20;CWE-367 + +#A potential race condition vulnerability exists here. Normally a call to this function is vulnerable only when a match check precedes it. No check was detected, however one could still exist that could not be detected +staticlocalbuffer=;SFP-8;CWE-121 + +#Extra care should be taken to ensure that character arrays that are allocated on the stack are used safely. They are prime targets for buffer overflow attacks. +staticglobalbuffer=;SFP-8;CWE-120 + +#A function call is not being made here, but a reference is being made to a name that is normally a vulnerable function. It could be being assigned as a pointer to function. +reference=;SFP-3;CWE-676 + +#Do not use a variable that has been derived from untrusted sources within a backtick. Doing so could allow an attacker to execute arbitrary python code. +pythonBacktick=;SFP-25;CWE-454 + +#The backtick will act just like an call to exec(), so care should be exercised that the string being backtick evaluated does not come from an untrusted source. +otherBacktick=;SFP-24;CWE-95 + +#Unknown!?!? +none=;SFP--1;CWE--1 + +#Reminder: Do not forget to chdir() to an appropriate directory before calling chroot()! +chroot=;SFP-17;CWE-243 + +#Gets is unsafe!! No bounds checking is performed, buffer is easily overflowable by user. Use fgets(buf, size, stdin) instead. +gets=;SFP-3;CWE-676 + +#Environment variables are highly untrustable input. They may be of any length, and contain any data. Do not make any assumptions regarding content or length. If at all possible avoid using them, and if it is necessary, sanitize them and truncate them to a reasonable length. +getEnv=;SFP-25;CWE-15 + +#The last argument is the number of wide chars, not the number of bytes. Getting this wrong can cause a buffer overflow since you will indicate that the buffer is twice the size it actually is. Don't forget about NULL termination. +multiByteToWideChar=;SFP-10;CWE-135 + +#Be sure the destination buffer is at least MAXPATHLEN big. This function may still internally overflow a static buffer, try to avoid using it. If you must, check the size the path your pass in is no longer than MAXPATHLEN +realPath=;SFP-9;CWE-785 + +#cin is unsafe. No bounds checking is performed. Buffer is easily overflowable by user. +cin=;SFP-3;CWE-676 + +#The results of this call are easy to forge. +getLogin=;SFP-3;CWE-676 + +#This may be forgable. Whether it is or not, even the man page recommends against using this. +cuserid=;SFP-3;CWE-676 + +#The results are easy for an attacker to forge, and not reliable. +ttyname=;SFP-3;CWE-676 + +#When setting signal handlers, do not use the same function to handle multiple signals. There exists the possibility a race condition will result if 2 or more different signals are sent to the process at nearly the same time. Also, when writing signal handlers, it is best to do as little as possible in them. The best strategy is to use the signal handler to set a flag, that another part of the program tests and performs the appropriate action(s) when it is set. +signals=;SFP-19;CWE-364 + +#Don't use on memory intended to be secure, because the old structure will not be zeroed out. +realloc=;SFP-14;CWE-244 + +#Remember that sensitive data get copied on fork. For example, a random number generator's internal state will get duplicated, and the child may start outputting identical number streams. +fork=;SFP-23;CWE-214 + +#Some implementations may be broken. Additionally, Remember that sensitive data get copied on fork. For example, a random number generator's internal state will get duplicated, and the child may start outputting identical number streams. Use fork() instead. +vfork=;SFP-23;CWE-214 + +#If the third argument, pDacl, is NULL there is no protection from attack. As an example, an attacker could set a Deny All to Everyone ACE on such an object. +setSecurityDescriptorDacl=Access Control;SFP--1;CWE-279 + +#Consider using strlcat() instead +strncat=;SFP-3;CWE-676 + +#umask() can easily be used to create files with unsafe priviledges. It should be set to restrictive values. +umask=AccessControl;SFP--1;CWE-279 + +#This function does not set the inheritance bits in the Access Controle Entry, making it vulnerable. +addAccessAllowedAce=;SFP-3;CWE-676 + +#When using this function, it is important to be sure that the string being passed in does not contain relative path elements (../ for example), or a null, which may cause underlying C calls to behave in ways you do not expect. This is especially important if the string is in any way constructed from a user supplied value." +taintedfileop=;SFP-16;CWE-23 + +#The filehandle argument should not be derived from user input. Doing so could allow arbitrary filehandles to have operations carried out on them +fcntl=;SFP-24;CWE-99 + +#The second argument specifiying the packed address to bind to, should not be derived from user input. If the address is derived from user input, it is possible for a malicious user to cause the socket to be bound to an address of their choice. +bind=;SFP-24;CWE-99 + + + +#RATS PHP + +#Arguments 1, 2, 4 and 5 of this function may be passed to an external program. (Usually sendmail). Under Windows, they will be passed to a remote email server. If these values are derived from user input, make sure they are properly formatted and contain no unexpected characters or extra data. +mail=;SFP-24;CWE-77 + +#This function literally leaks memory. Are you sure you meant to use this +leak=;SFP-14;CWE-401 + +#Reminder: Do not forget to chdir() to an appropriate directory before calling chroot() +phpChroot=;SFP-17;CWE-243 + +#The results of this call are easy to forge. +posix_getlogin=;SFP-3;CWE-676 + +#The results are easy for an attacker to forge, and not reliable. +posix_ttyname=;SFP-3;CWE-676 + + + +#RATS OPENSSL + +#Allow the function to dynamically allocate the buffer. If you insist on a fixed buffer, then double check that your buffer is as big as you specify. +avoidbuf=;SFP-8;CWE-119 + +#Does the memory need to be cleaned if moved? Use re[m]alloc_clean instead +cleanrealloc=;SFP-23;CWE-244 + +#Does the memory need to be cleaned before freeing? +cleanfree=;SFP-23;CWE-244 + +#Use ERR_error_string_n() instead +stringn=;SFP-3;CWE-676 + +#make sure the buffer is EVP_MAX_MD_SIZE +mdlen=;SFP-8;CWE-120 + +#make sure the output buffer is either at least one block less one byte bigger than the input, or that you are sure inputs are always multiples of the block size, and the output buffer is as big as the input. +enclen=;SFP-8;CWE-120 + +#make sure the output buffer is four thirds the size of the input buffer (precisely out=((in+2)/3)*4 where the division is truncated. +encodelen=;SFP-8;CWE-120 + +#Use strlcpy/strlcat instead of strncpy/strncat +usel=;SFP-8;CWE-120 + + + +#RATS RUBY + +#Ruby safe level 2 disables this function as it could be potentially dangerous. Verify this function is being used in a safe manner. +rubysafelevel=;SFP-3;CWE-676 + +#Verify variable is properly validated from tainted input. +untaint=;SFP-25;CWE-20 + +#Unchecked user input could allow director traversal attacks. +send_files=;SFP-16;CWE-22 + +#Unknown +rubySystem=;SFP--1;CWE--1 + +#Make sure user data is not passed to exec. +exec=;SFP-24;CWE-77 + +#This method allows I/O access outside of the application. All I/O should be validated. +open=;SFP-24;CWE-20 + +#Use of params, verify all user values are checked before using. Never pass params directly to a new object i.e. Object.new(params[:user]) +params=;SFP-24;CWE-99 + + +#Unknown +chmod_R=;SFP-3;CWE-676 + +#Unknown +chown_R=;SFP-3;CWE-676 + +#Unknown +ln_s=;SFP-3;CWE-676 + +#Unknown +mkdir_p=;SFP-3;CWE-676 + +#Unknown +mkpath=;SFP-3;CWE-676 + +#Unknown +touch=;SFP-3;CWE-676 + +#Unchecked user input could all exectuion of system commands. +popen=;SFP-25;CWE-20 + +#Unchecked user input could all loading of rouge scripts. +load=;SFP-27;CWE-545 + +#Make sure this function is not being used for any security related tasks. +rand=Predictability;SFP--1;CWE-340 diff --git a/com.kdmanalytics.toif.rats/src/config/RatsAdaptorIdConfig b/com.kdmanalytics.toif.rats/src/config/RatsAdaptorIdConfig new file mode 100644 index 00000000..7d149c25 --- /dev/null +++ b/com.kdmanalytics.toif.rats/src/config/RatsAdaptorIdConfig @@ -0,0 +1,106 @@ +#RATS-C + +Standard random number generators should not be used to.*;randdesc +Double check that your buffer is as big as you specify.*;bufbig +Check buffer boundaries if calling this function in a loop.*;bufloop +Truncate all input strings to a.*;bufreasonable +Many calls for generating temporary file names are.*;tmpfile +DNS results can easily be forged by an attacker.*;dns +Buffer size must be .*;pathbuf +LoadLibrary will search several places for a library if no path is specified, allowing trojan DLL's to be inserted elsewhere even if the intended DLL is correctly protected from overwriting.*;dllload +GetExtensionVersion.* is called by IIS in the.*;iis_extension +GetTempPath.* may return the current directory or the.*;w32tmppath +Many program execution commands under Windows will search.*;w32exec +While this _exec variant does not search the path for.*;w32execnop +This function does not properly handle non-NULL terminated.*;accessv +Impersonation functions return error codes when they.*;w32impers +This function can throw exceptions in low memory.*;w32crit +Check to be sure that the format string passed as argument.*;formatArg +Check to be sure that argument .* passed to this function call will not.*;srcBufArg +Check to be sure that the non-constant format string passed as argument.*;fsproblem +Argument .* to this function call should be checked to ensure that it does.*;inputproblem +A potential race condition vulnerability exists here.*;raceconditionuse +Extra care should be taken to ensure that character arrays that are allocated on the stack.*;staticlocalbuffer +Extra care should be taken to ensure that character arrays that are allocated with a static.*;staticglobalbuffer +A function call is not being made here, but a reference is being made to a name that is normally a vulnerable function.*;reference +Do not use a variable that has been derived from untrusted sources within a backtick.*;pythonBacktick +The backtick will act just like an call to exec.* so care should be exercised that the string being backtick evaluated does not come from an.*;otherBacktick +A potential TOCTOU .* vulnerability.*;raceConditionUse +Reminder.* Do not forget to chdir.* to an appropriate directory before calling chroot.*;chroot +Gets is unsafe.* No bounds checking is performed.* buffer is easily overflowable by user.*;gets +Environment variables are highly untrustable input.*;getEnv +The last argument is the number of wide chars.* not the number of bytes.*;multiByteToWideChar +Be sure the destination buffer is at least MAXPATHLEN big.*;realPath +cin is unsafe.*;cin +The results of this call are easy to forge.*;getLogin +This may be forgable.*;cuserid +The results are easy for an attacker to forge.* and not reliable.*;ttyname +When setting signal handlers.* do not use the same function to handle multiple signals.*;signals +Don't use on memory intended to be secure.* because the old structure will not be zeroed out.*;realloc +Remember that sensitive data get copied on fork.*;fork +Some implementations may be broken.*;vfork +If the third argument.* pDacl.* is NULL there is no protection from attack.*;setSecurityDescriptorDacl +Consider using strlcat.*;strncat +umask.* can easily be used to create files with unsafe priviledges.*;umask +This function does not set the inheritance bits in the Access Controle Entry.*;addAccessAllowedAce + + +Unknown.*;none + + + +#RATS PEARL + +When using.* it is important to be sure that the string being passed in does not contain relative path elements.*;taintedfileop +The filehandle argument should not be derived from user input.*;fcntl +The second argument specifiying the packed address to bind to.* should not be derived from user input.* If the address is derived from user input.* it is possible for a malicious user to cause the socket to be bound to an address of their choice.;bind +When using setpgrp.* neither argument should be derived from user input.* doing so may allow the attacker to modify both the PID and the PGRP argument.* possibly allowing arbitrary processes to have their process group changed.*;setgrp +When using setpriority.* do not pass arguments to it that are derived from user input.* Doing so could allow an attacker to set the priority of an arbitrary process on the system.*;setPriority +Care should be exercised when using the syscall function.* Arguments derived from user input are to be avoided.* and are especially dangerous due to the fact they are passed directly to the underlying OS call.* There is also a potential for buffer-overflow like problems with strings that may be written to.* Extend all perl strings to sane lengths before passing them into this function.*;syscall +The second argument specifiying the packed address to bind to.* should not be derived from user input.* If the address is derived from user input.* it is possible for a malicious user to cause the socket to connect to an arbitrary remote address.* enabling hijacking of potentially sensitive network data.*;connect +When using system.* it is important to be sure that the string being used does not contain relative path elements .* or a null.* which may cause underlying C calls to behave strangely.* It is also imperative to insure the string has no characters that may be interpreted by the shell.* possibly allowing arbitrary commands to be run.*;system +The filename argument of open should be carefully checked if it is being created with any user-supplied string as a compontent of it.* Strings should be checked for occurences of path backtracking.* which may cause the underlying C call to interpret the filename to open differently than expected.* It is also important to make sure that the final filename does not end in a .* as this will cause the path to be executed.*;open +Using a user supplied expression as an argument to this function should be avoided.* Explicitly set the umask to a value you know is safe.*;pearlUmask +Avoid constructing the list of process ids to kill with any strings that contain user inputted data.* Users may be able to manipulate the pid values in such a way as to cause arbitrary signals to be sent to processes.* possibly leading to exploits or DoS attacks.*;kill +Using user supplied strings as the arguments to ioctl may allow the user to manipulate the device in arbitrary ways.*;ioctl +Using user supplied strings anywhere inside of an eval is extremely dangerous.* Unvalidated user input fed into an eval call may allow the user to execute arbitrary perl code.* Avoid ever passing user supplied strings into eval.*;eval +Glob invokes a shell .* to obtain the list of filenames that match the glob pattern.* Unvalidated user input used in a glob pattern could allow arbitrary shell code to be run.* possibly executing programs as a result.* Avoid using user input in glob patterns.*;glob + + + +#RATS PHP + +Arguments .* they will be passed to a remote email server.* make sure they are properly formatted and contain no unexpected characters or extra data.*;mail +This function literally leaks memory.*;leak +Reminder.* Do not forget to chdir.* to an appropriate directory before calling chroot.*;phpChroot + The results of this call are easy to forge.*;posix_getlogin +The results are easy for an attacker to forge.*;posix_ttyname + + +RATS OPENSSL + +Allow the function to dynamically allocate the buffer.* If you insist on a fixed buffer.* then double check that your buffer is as big as you specify.*;avoidbuf +Does the memory need to be cleaned if moved.*;cleanrealloc +Does the memory need to be cleaned before freeing.*;cleanfree +Use ERR_error_string_n.* instead.*;stringn +make sure the buffer is EVP_MAX_MD_SIZE.*;mdlen +make sure the output buffer is either at least one block less one byte biggerthan the input.*;enclen +make sure the output buffer is four thirds the size of the input buffer.*;encodelen +Use strlcpy.*strlcat instead of strncpy.*strncat.*;usel + + +RATS RUBY + +Ruby safe level 2 disables this function as it could be potentially dangerous.*;rubysafelevel +Verify variable is properly validated from tainted input.*;untaint +Unchecked user input could allow director traversal attacks.*;send_files +#;rubySystem +Make sure user data is not passed to exec.*;exec +This method allows .* access outside of the application.*;open +Use of params.* verify all user values are checked before using.*;params +Unchecked user input could all exectuion of system commands.*;popen +Unchecked user input could all loading of rouge scripts.*;load +Make sure this function is not being used for any security related tasks.*;rand + + + diff --git a/com.kdmanalytics.toif.rats/target/MANIFEST.MF b/com.kdmanalytics.toif.rats/target/MANIFEST.MF new file mode 100644 index 00000000..1901b21a --- /dev/null +++ b/com.kdmanalytics.toif.rats/target/MANIFEST.MF @@ -0,0 +1,14 @@ +Manifest-Version: 1.0 +Export-Package: com.kdmanalytics.toif.adaptor +Require-Bundle: org.eclipse.core.runtime,com.kdmanalytics.toif.framewo + rk;bundle-version="[1.6.0,2.0.0)",org.apache.xerces;bundle-version="[ + 2.11.0,3.0.0)",org.apache.log4j;bundle-version="[1.2.15,1.3.0)",com.k + dmanalytics.toif.common;bundle-version="[1.15.0,2.0.0)" +Bundle-Vendor: KDM Analytics Inc. +Bundle-Version: 1.15.5 +Bundle-Name: TOIF Rats +Bundle-Activator: com.kdmanalytics.toif.rats.Activator +Bundle-ManifestVersion: 2 +Bundle-SymbolicName: com.kdmanalytics.toif.rats;singleton:=true +Bundle-RequiredExecutionEnvironment: JavaSE-1.7 + diff --git a/com.kdmanalytics.toif.rats/target/classes/com/kdmanalytics/toif/adaptor/RatsAdaptor.class b/com.kdmanalytics.toif.rats/target/classes/com/kdmanalytics/toif/adaptor/RatsAdaptor.class new file mode 100644 index 00000000..4c704b6a Binary files /dev/null and b/com.kdmanalytics.toif.rats/target/classes/com/kdmanalytics/toif/adaptor/RatsAdaptor.class differ diff --git a/com.kdmanalytics.toif.rats/target/classes/com/kdmanalytics/toif/rats/Activator.class b/com.kdmanalytics.toif.rats/target/classes/com/kdmanalytics/toif/rats/Activator.class new file mode 100644 index 00000000..59d3f349 Binary files /dev/null and b/com.kdmanalytics.toif.rats/target/classes/com/kdmanalytics/toif/rats/Activator.class differ diff --git a/com.kdmanalytics.toif.rats/target/classes/com/kdmanalytics/toif/rats/RatsParser.class b/com.kdmanalytics.toif.rats/target/classes/com/kdmanalytics/toif/rats/RatsParser.class new file mode 100644 index 00000000..742575e8 Binary files /dev/null and b/com.kdmanalytics.toif.rats/target/classes/com/kdmanalytics/toif/rats/RatsParser.class differ diff --git a/com.kdmanalytics.toif.rats/target/classes/config/RatsAdaptorConfiguration b/com.kdmanalytics.toif.rats/target/classes/config/RatsAdaptorConfiguration new file mode 100644 index 00000000..24468ed9 --- /dev/null +++ b/com.kdmanalytics.toif.rats/target/classes/config/RatsAdaptorConfiguration @@ -0,0 +1,240 @@ +#RATS C: + +#Standard random number generators should not be used to generate randomness used for security reasons. For security sensitive randomness a crytographic randomness generator that provides sufficient entropy should be used. +randdesc=Predictability;SFP--1;CWE-340 + +#Double check that your buffer is as big as you specify. When using functions that accept a number n of bytes to copy, such as strncpy, be aware that if the dest buffer size = n it may not NULL-terminate the string. +bufbig=;SFP-8;CWE-120 + +#Check buffer boundaries if calling this function in a loop and make sure you are not in danger of writing past the allocated space. +bufloop=;SFP-8;CWE-119 + +#Truncate all input strings to a reasonable length before passing them to this function +bufreasonable=;SFP-8;CWE-119 + +#Many calls for generating temporary file names are insecure (susceptible to race conditions). Use a securely generated file name, for example, by pulling 64 bits of randomness from /dev/random, base 64 encoding it and using that as a file suffix. +tmpfile=;SFP-20;CWE-367 + +#DNS results can easily be forged by an attacker (or arbitrarily set to large values, etc), and should not be trusted +dns=;SFP-29;CWE-247 + +#Buffer size must be _MAX_PATH+1 or larger for this function to be safe +pathbuf=;SFP-9;CWE-785 + +#LoadLibrary will search several places for a library if no path is specified, allowing trojan DLL's to be inserted elsewhere even if the intended DLL is correctly protected from overwriting. Make sure to specify the full path +dllload=Tainted Input;SPF--1;CWE-114 + +#GetExtensionVersion() is called by IIS in the system's security context. Be very careful what you do here, as you are basically suid root for the machine. If you are calling the function rather than implementing it, howabout *not* calling it in the system's security context if possible? +iis_extension=;SFP--1;CWE-250 + +#GetTempPath() may return the current directory or the windows directory. Be careful what you place in these locations. Important files may be overwritten, and trojan DLL's may be dropped in these locations. Never use a user-input filename when writing to a location given by GetTempPath(). +w32tmppath=;SFP-16;CWE-73 + +#Many program execution commands under Windows will search the path for a program if you do not explicitly specify a full path to the file. This can allow trojans to be executed instead. Also, be sure to specify a file extension, since otherwise multiple extensions will be tried by the operating system, providing another opportunity for trojans +w32exec=;SFP-16;CWE-73 + +#While this _exec variant does not search the path for a program (good!), it will run .com files before .exe files and the like. Make sure to specify a file extension +w32execnop=;SFP-16;CWE-73 + +#This function does not properly handle non-NULL terminated strings. This does not result in exploitable code, but can lead to access violations. +accessv=;SFP-11;CWE-170 + +#Impersonation functions return error codes when they fail. These error codes must be checked otherwise code could be run with extra privileges when an impersonation has failed +w32impers=;SFP-4;CWE-252 + +#This function can throw exceptions in low memory conditions. Use InitialCriticalSectionAndSpinCount instead +w32crit=;SFP-4;CWE-248 + + +#Check to be sure that the format string passed as argument %d to this function call does not come from an untrusted source that could have added formatting characters that the code is not prepared to handle. +formatArg=;SFP-24;CWE-134 + +#Check to be sure that argument %d passed to this function call will not copy more data than can be handled, resulting in a buffer overflow +srcBufArg=;SFP-8;CWE-120 + +#Check to be sure that the non-constant format string passed as argument %d to this function call does not come from an untrusted source that could have added formatting characters that the code is not prepared to handle +fsproblem=;SFP-24;CWE-134 + +#Argument %d to this function call should be checked to ensure that it does not come from an untrusted source without first verifying that it contains nothing dangerous. +inputproblem=;SFP-25;CWE-20 + +#A potential TOCTOU (Time Of Check, Time Of Use) vulnerability exists. This is the first line where a check has occured. +raceConditionUse=;SFP-20;CWE-367 + +#A potential race condition vulnerability exists here. Normally a call to this function is vulnerable only when a match check precedes it. No check was detected, however one could still exist that could not be detected +staticlocalbuffer=;SFP-8;CWE-121 + +#Extra care should be taken to ensure that character arrays that are allocated on the stack are used safely. They are prime targets for buffer overflow attacks. +staticglobalbuffer=;SFP-8;CWE-120 + +#A function call is not being made here, but a reference is being made to a name that is normally a vulnerable function. It could be being assigned as a pointer to function. +reference=;SFP-3;CWE-676 + +#Do not use a variable that has been derived from untrusted sources within a backtick. Doing so could allow an attacker to execute arbitrary python code. +pythonBacktick=;SFP-25;CWE-454 + +#The backtick will act just like an call to exec(), so care should be exercised that the string being backtick evaluated does not come from an untrusted source. +otherBacktick=;SFP-24;CWE-95 + +#Unknown!?!? +none=;SFP--1;CWE--1 + +#Reminder: Do not forget to chdir() to an appropriate directory before calling chroot()! +chroot=;SFP-17;CWE-243 + +#Gets is unsafe!! No bounds checking is performed, buffer is easily overflowable by user. Use fgets(buf, size, stdin) instead. +gets=;SFP-3;CWE-676 + +#Environment variables are highly untrustable input. They may be of any length, and contain any data. Do not make any assumptions regarding content or length. If at all possible avoid using them, and if it is necessary, sanitize them and truncate them to a reasonable length. +getEnv=;SFP-25;CWE-15 + +#The last argument is the number of wide chars, not the number of bytes. Getting this wrong can cause a buffer overflow since you will indicate that the buffer is twice the size it actually is. Don't forget about NULL termination. +multiByteToWideChar=;SFP-10;CWE-135 + +#Be sure the destination buffer is at least MAXPATHLEN big. This function may still internally overflow a static buffer, try to avoid using it. If you must, check the size the path your pass in is no longer than MAXPATHLEN +realPath=;SFP-9;CWE-785 + +#cin is unsafe. No bounds checking is performed. Buffer is easily overflowable by user. +cin=;SFP-3;CWE-676 + +#The results of this call are easy to forge. +getLogin=;SFP-3;CWE-676 + +#This may be forgable. Whether it is or not, even the man page recommends against using this. +cuserid=;SFP-3;CWE-676 + +#The results are easy for an attacker to forge, and not reliable. +ttyname=;SFP-3;CWE-676 + +#When setting signal handlers, do not use the same function to handle multiple signals. There exists the possibility a race condition will result if 2 or more different signals are sent to the process at nearly the same time. Also, when writing signal handlers, it is best to do as little as possible in them. The best strategy is to use the signal handler to set a flag, that another part of the program tests and performs the appropriate action(s) when it is set. +signals=;SFP-19;CWE-364 + +#Don't use on memory intended to be secure, because the old structure will not be zeroed out. +realloc=;SFP-14;CWE-244 + +#Remember that sensitive data get copied on fork. For example, a random number generator's internal state will get duplicated, and the child may start outputting identical number streams. +fork=;SFP-23;CWE-214 + +#Some implementations may be broken. Additionally, Remember that sensitive data get copied on fork. For example, a random number generator's internal state will get duplicated, and the child may start outputting identical number streams. Use fork() instead. +vfork=;SFP-23;CWE-214 + +#If the third argument, pDacl, is NULL there is no protection from attack. As an example, an attacker could set a Deny All to Everyone ACE on such an object. +setSecurityDescriptorDacl=Access Control;SFP--1;CWE-279 + +#Consider using strlcat() instead +strncat=;SFP-3;CWE-676 + +#umask() can easily be used to create files with unsafe priviledges. It should be set to restrictive values. +umask=AccessControl;SFP--1;CWE-279 + +#This function does not set the inheritance bits in the Access Controle Entry, making it vulnerable. +addAccessAllowedAce=;SFP-3;CWE-676 + +#When using this function, it is important to be sure that the string being passed in does not contain relative path elements (../ for example), or a null, which may cause underlying C calls to behave in ways you do not expect. This is especially important if the string is in any way constructed from a user supplied value." +taintedfileop=;SFP-16;CWE-23 + +#The filehandle argument should not be derived from user input. Doing so could allow arbitrary filehandles to have operations carried out on them +fcntl=;SFP-24;CWE-99 + +#The second argument specifiying the packed address to bind to, should not be derived from user input. If the address is derived from user input, it is possible for a malicious user to cause the socket to be bound to an address of their choice. +bind=;SFP-24;CWE-99 + + + +#RATS PHP + +#Arguments 1, 2, 4 and 5 of this function may be passed to an external program. (Usually sendmail). Under Windows, they will be passed to a remote email server. If these values are derived from user input, make sure they are properly formatted and contain no unexpected characters or extra data. +mail=;SFP-24;CWE-77 + +#This function literally leaks memory. Are you sure you meant to use this +leak=;SFP-14;CWE-401 + +#Reminder: Do not forget to chdir() to an appropriate directory before calling chroot() +phpChroot=;SFP-17;CWE-243 + +#The results of this call are easy to forge. +posix_getlogin=;SFP-3;CWE-676 + +#The results are easy for an attacker to forge, and not reliable. +posix_ttyname=;SFP-3;CWE-676 + + + +#RATS OPENSSL + +#Allow the function to dynamically allocate the buffer. If you insist on a fixed buffer, then double check that your buffer is as big as you specify. +avoidbuf=;SFP-8;CWE-119 + +#Does the memory need to be cleaned if moved? Use re[m]alloc_clean instead +cleanrealloc=;SFP-23;CWE-244 + +#Does the memory need to be cleaned before freeing? +cleanfree=;SFP-23;CWE-244 + +#Use ERR_error_string_n() instead +stringn=;SFP-3;CWE-676 + +#make sure the buffer is EVP_MAX_MD_SIZE +mdlen=;SFP-8;CWE-120 + +#make sure the output buffer is either at least one block less one byte bigger than the input, or that you are sure inputs are always multiples of the block size, and the output buffer is as big as the input. +enclen=;SFP-8;CWE-120 + +#make sure the output buffer is four thirds the size of the input buffer (precisely out=((in+2)/3)*4 where the division is truncated. +encodelen=;SFP-8;CWE-120 + +#Use strlcpy/strlcat instead of strncpy/strncat +usel=;SFP-8;CWE-120 + + + +#RATS RUBY + +#Ruby safe level 2 disables this function as it could be potentially dangerous. Verify this function is being used in a safe manner. +rubysafelevel=;SFP-3;CWE-676 + +#Verify variable is properly validated from tainted input. +untaint=;SFP-25;CWE-20 + +#Unchecked user input could allow director traversal attacks. +send_files=;SFP-16;CWE-22 + +#Unknown +rubySystem=;SFP--1;CWE--1 + +#Make sure user data is not passed to exec. +exec=;SFP-24;CWE-77 + +#This method allows I/O access outside of the application. All I/O should be validated. +open=;SFP-24;CWE-20 + +#Use of params, verify all user values are checked before using. Never pass params directly to a new object i.e. Object.new(params[:user]) +params=;SFP-24;CWE-99 + + +#Unknown +chmod_R=;SFP-3;CWE-676 + +#Unknown +chown_R=;SFP-3;CWE-676 + +#Unknown +ln_s=;SFP-3;CWE-676 + +#Unknown +mkdir_p=;SFP-3;CWE-676 + +#Unknown +mkpath=;SFP-3;CWE-676 + +#Unknown +touch=;SFP-3;CWE-676 + +#Unchecked user input could all exectuion of system commands. +popen=;SFP-25;CWE-20 + +#Unchecked user input could all loading of rouge scripts. +load=;SFP-27;CWE-545 + +#Make sure this function is not being used for any security related tasks. +rand=Predictability;SFP--1;CWE-340 diff --git a/com.kdmanalytics.toif.rats/target/classes/config/RatsAdaptorIdConfig b/com.kdmanalytics.toif.rats/target/classes/config/RatsAdaptorIdConfig new file mode 100644 index 00000000..7d149c25 --- /dev/null +++ b/com.kdmanalytics.toif.rats/target/classes/config/RatsAdaptorIdConfig @@ -0,0 +1,106 @@ +#RATS-C + +Standard random number generators should not be used to.*;randdesc +Double check that your buffer is as big as you specify.*;bufbig +Check buffer boundaries if calling this function in a loop.*;bufloop +Truncate all input strings to a.*;bufreasonable +Many calls for generating temporary file names are.*;tmpfile +DNS results can easily be forged by an attacker.*;dns +Buffer size must be .*;pathbuf +LoadLibrary will search several places for a library if no path is specified, allowing trojan DLL's to be inserted elsewhere even if the intended DLL is correctly protected from overwriting.*;dllload +GetExtensionVersion.* is called by IIS in the.*;iis_extension +GetTempPath.* may return the current directory or the.*;w32tmppath +Many program execution commands under Windows will search.*;w32exec +While this _exec variant does not search the path for.*;w32execnop +This function does not properly handle non-NULL terminated.*;accessv +Impersonation functions return error codes when they.*;w32impers +This function can throw exceptions in low memory.*;w32crit +Check to be sure that the format string passed as argument.*;formatArg +Check to be sure that argument .* passed to this function call will not.*;srcBufArg +Check to be sure that the non-constant format string passed as argument.*;fsproblem +Argument .* to this function call should be checked to ensure that it does.*;inputproblem +A potential race condition vulnerability exists here.*;raceconditionuse +Extra care should be taken to ensure that character arrays that are allocated on the stack.*;staticlocalbuffer +Extra care should be taken to ensure that character arrays that are allocated with a static.*;staticglobalbuffer +A function call is not being made here, but a reference is being made to a name that is normally a vulnerable function.*;reference +Do not use a variable that has been derived from untrusted sources within a backtick.*;pythonBacktick +The backtick will act just like an call to exec.* so care should be exercised that the string being backtick evaluated does not come from an.*;otherBacktick +A potential TOCTOU .* vulnerability.*;raceConditionUse +Reminder.* Do not forget to chdir.* to an appropriate directory before calling chroot.*;chroot +Gets is unsafe.* No bounds checking is performed.* buffer is easily overflowable by user.*;gets +Environment variables are highly untrustable input.*;getEnv +The last argument is the number of wide chars.* not the number of bytes.*;multiByteToWideChar +Be sure the destination buffer is at least MAXPATHLEN big.*;realPath +cin is unsafe.*;cin +The results of this call are easy to forge.*;getLogin +This may be forgable.*;cuserid +The results are easy for an attacker to forge.* and not reliable.*;ttyname +When setting signal handlers.* do not use the same function to handle multiple signals.*;signals +Don't use on memory intended to be secure.* because the old structure will not be zeroed out.*;realloc +Remember that sensitive data get copied on fork.*;fork +Some implementations may be broken.*;vfork +If the third argument.* pDacl.* is NULL there is no protection from attack.*;setSecurityDescriptorDacl +Consider using strlcat.*;strncat +umask.* can easily be used to create files with unsafe priviledges.*;umask +This function does not set the inheritance bits in the Access Controle Entry.*;addAccessAllowedAce + + +Unknown.*;none + + + +#RATS PEARL + +When using.* it is important to be sure that the string being passed in does not contain relative path elements.*;taintedfileop +The filehandle argument should not be derived from user input.*;fcntl +The second argument specifiying the packed address to bind to.* should not be derived from user input.* If the address is derived from user input.* it is possible for a malicious user to cause the socket to be bound to an address of their choice.;bind +When using setpgrp.* neither argument should be derived from user input.* doing so may allow the attacker to modify both the PID and the PGRP argument.* possibly allowing arbitrary processes to have their process group changed.*;setgrp +When using setpriority.* do not pass arguments to it that are derived from user input.* Doing so could allow an attacker to set the priority of an arbitrary process on the system.*;setPriority +Care should be exercised when using the syscall function.* Arguments derived from user input are to be avoided.* and are especially dangerous due to the fact they are passed directly to the underlying OS call.* There is also a potential for buffer-overflow like problems with strings that may be written to.* Extend all perl strings to sane lengths before passing them into this function.*;syscall +The second argument specifiying the packed address to bind to.* should not be derived from user input.* If the address is derived from user input.* it is possible for a malicious user to cause the socket to connect to an arbitrary remote address.* enabling hijacking of potentially sensitive network data.*;connect +When using system.* it is important to be sure that the string being used does not contain relative path elements .* or a null.* which may cause underlying C calls to behave strangely.* It is also imperative to insure the string has no characters that may be interpreted by the shell.* possibly allowing arbitrary commands to be run.*;system +The filename argument of open should be carefully checked if it is being created with any user-supplied string as a compontent of it.* Strings should be checked for occurences of path backtracking.* which may cause the underlying C call to interpret the filename to open differently than expected.* It is also important to make sure that the final filename does not end in a .* as this will cause the path to be executed.*;open +Using a user supplied expression as an argument to this function should be avoided.* Explicitly set the umask to a value you know is safe.*;pearlUmask +Avoid constructing the list of process ids to kill with any strings that contain user inputted data.* Users may be able to manipulate the pid values in such a way as to cause arbitrary signals to be sent to processes.* possibly leading to exploits or DoS attacks.*;kill +Using user supplied strings as the arguments to ioctl may allow the user to manipulate the device in arbitrary ways.*;ioctl +Using user supplied strings anywhere inside of an eval is extremely dangerous.* Unvalidated user input fed into an eval call may allow the user to execute arbitrary perl code.* Avoid ever passing user supplied strings into eval.*;eval +Glob invokes a shell .* to obtain the list of filenames that match the glob pattern.* Unvalidated user input used in a glob pattern could allow arbitrary shell code to be run.* possibly executing programs as a result.* Avoid using user input in glob patterns.*;glob + + + +#RATS PHP + +Arguments .* they will be passed to a remote email server.* make sure they are properly formatted and contain no unexpected characters or extra data.*;mail +This function literally leaks memory.*;leak +Reminder.* Do not forget to chdir.* to an appropriate directory before calling chroot.*;phpChroot + The results of this call are easy to forge.*;posix_getlogin +The results are easy for an attacker to forge.*;posix_ttyname + + +RATS OPENSSL + +Allow the function to dynamically allocate the buffer.* If you insist on a fixed buffer.* then double check that your buffer is as big as you specify.*;avoidbuf +Does the memory need to be cleaned if moved.*;cleanrealloc +Does the memory need to be cleaned before freeing.*;cleanfree +Use ERR_error_string_n.* instead.*;stringn +make sure the buffer is EVP_MAX_MD_SIZE.*;mdlen +make sure the output buffer is either at least one block less one byte biggerthan the input.*;enclen +make sure the output buffer is four thirds the size of the input buffer.*;encodelen +Use strlcpy.*strlcat instead of strncpy.*strncat.*;usel + + +RATS RUBY + +Ruby safe level 2 disables this function as it could be potentially dangerous.*;rubysafelevel +Verify variable is properly validated from tainted input.*;untaint +Unchecked user input could allow director traversal attacks.*;send_files +#;rubySystem +Make sure user data is not passed to exec.*;exec +This method allows .* access outside of the application.*;open +Use of params.* verify all user values are checked before using.*;params +Unchecked user input could all exectuion of system commands.*;popen +Unchecked user input could all loading of rouge scripts.*;load +Make sure this function is not being used for any security related tasks.*;rand + + + diff --git a/com.kdmanalytics.toif.rats/target/com.kdmanalytics.toif.rats-1.15.5.jar b/com.kdmanalytics.toif.rats/target/com.kdmanalytics.toif.rats-1.15.5.jar new file mode 100644 index 00000000..114d59ee Binary files /dev/null and b/com.kdmanalytics.toif.rats/target/com.kdmanalytics.toif.rats-1.15.5.jar differ diff --git a/com.kdmanalytics.toif.rats/target/local-artifacts.properties b/com.kdmanalytics.toif.rats/target/local-artifacts.properties new file mode 100644 index 00000000..e772e87f --- /dev/null +++ b/com.kdmanalytics.toif.rats/target/local-artifacts.properties @@ -0,0 +1,4 @@ +#Thu May 29 09:56:29 EDT 2014 +artifact.attached.p2metadata=/home/adam/git/toif/plugins/com.kdmanalytics.toif.rats/target/p2content.xml +artifact.main=/home/adam/git/toif/plugins/com.kdmanalytics.toif.rats/target/com.kdmanalytics.toif.rats-1.15.5.jar +artifact.attached.p2artifacts=/home/adam/git/toif/plugins/com.kdmanalytics.toif.rats/target/p2artifacts.xml diff --git a/com.kdmanalytics.toif.rats/target/maven-archiver/pom.properties b/com.kdmanalytics.toif.rats/target/maven-archiver/pom.properties new file mode 100644 index 00000000..a14f48ef --- /dev/null +++ b/com.kdmanalytics.toif.rats/target/maven-archiver/pom.properties @@ -0,0 +1,5 @@ +#Generated by Maven +#Thu May 29 09:56:29 EDT 2014 +version=1.15.5 +groupId=com.kdmanalytics.toif.compile +artifactId=com.kdmanalytics.toif.rats diff --git a/com.kdmanalytics.toif.rats/target/p2artifacts.xml b/com.kdmanalytics.toif.rats/target/p2artifacts.xml new file mode 100644 index 00000000..fb6de605 --- /dev/null +++ b/com.kdmanalytics.toif.rats/target/p2artifacts.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/com.kdmanalytics.toif.rats/target/p2content.xml b/com.kdmanalytics.toif.rats/target/p2content.xml new file mode 100644 index 00000000..ce12d35b --- /dev/null +++ b/com.kdmanalytics.toif.rats/target/p2content.xml @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Bundle-SymbolicName: com.kdmanalytics.toif.rats;singleton:=true Bundle-Version: 1.15.5 + + + + + diff --git a/com.kdmanalytics.toif.rcp/.classpath b/com.kdmanalytics.toif.rcp/.classpath new file mode 100644 index 00000000..b1dabee3 --- /dev/null +++ b/com.kdmanalytics.toif.rcp/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/com.kdmanalytics.toif.rcp/.project b/com.kdmanalytics.toif.rcp/.project new file mode 100644 index 00000000..0e80ac64 --- /dev/null +++ b/com.kdmanalytics.toif.rcp/.project @@ -0,0 +1,28 @@ + + + com.kdmanalytics.toif.rcp + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + + org.eclipse.pde.PluginNature + org.eclipse.jdt.core.javanature + + diff --git a/com.kdmanalytics.toif.rcp/.settings/org.eclipse.jdt.core.prefs b/com.kdmanalytics.toif.rcp/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 00000000..11f6e462 --- /dev/null +++ b/com.kdmanalytics.toif.rcp/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,7 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 +org.eclipse.jdt.core.compiler.compliance=1.7 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.7 diff --git a/com.kdmanalytics.toif.rcp/META-INF/MANIFEST.MF b/com.kdmanalytics.toif.rcp/META-INF/MANIFEST.MF new file mode 100644 index 00000000..6323e2e6 --- /dev/null +++ b/com.kdmanalytics.toif.rcp/META-INF/MANIFEST.MF @@ -0,0 +1,21 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: TOIF RCP Application +Bundle-SymbolicName: com.kdmanalytics.toif.rcp; singleton:=true +Bundle-Version: 1.16.0.qualifier +Bundle-Activator: com.kdmanalytics.toif.rcp.ToifActivator +Bundle-Vendor: KDM Analytics Inc. +Eclipse-RegisterBuddy: com.lexicalscope.jewelcli +Require-Bundle: org.eclipse.core.runtime, + com.lexicalscope.jewelcli, + org.eclipse.rcp;bundle-version="3.7.2", + org.apache.xerces;bundle-version="2.11.0", + com.kdmanalytics.toif.framework;bundle-version="1.8.6", + com.google.guava;bundle-version="14.0.1", + org.apache.commons.io;bundle-version="[2.4.0,2.5.0)", + org.apache.log4j;bundle-version="1.2.15", + com.kdmanalytics.toif.facade;bundle-version="1.8.6", + net.sf.trove4j;bundle-version="3.0.3" +Bundle-RequiredExecutionEnvironment: JavaSE-1.7 +Bundle-ActivationPolicy: lazy +Bundle-Localization: plugin diff --git a/com.kdmanalytics.toif.rcp/bin/com/kdmanalytics/toif/rcp/ToifActivator.class b/com.kdmanalytics.toif.rcp/bin/com/kdmanalytics/toif/rcp/ToifActivator.class new file mode 100644 index 00000000..9c38da45 Binary files /dev/null and b/com.kdmanalytics.toif.rcp/bin/com/kdmanalytics/toif/rcp/ToifActivator.class differ diff --git a/com.kdmanalytics.toif.rcp/bin/com/kdmanalytics/toif/rcp/ToifApplication.class b/com.kdmanalytics.toif.rcp/bin/com/kdmanalytics/toif/rcp/ToifApplication.class new file mode 100644 index 00000000..71e7b1c6 Binary files /dev/null and b/com.kdmanalytics.toif.rcp/bin/com/kdmanalytics/toif/rcp/ToifApplication.class differ diff --git a/com.kdmanalytics.toif.rcp/bin/com/kdmanalytics/toif/rcp/internal/IToifCmd.class b/com.kdmanalytics.toif.rcp/bin/com/kdmanalytics/toif/rcp/internal/IToifCmd.class new file mode 100644 index 00000000..24b411f5 Binary files /dev/null and b/com.kdmanalytics.toif.rcp/bin/com/kdmanalytics/toif/rcp/internal/IToifCmd.class differ diff --git a/com.kdmanalytics.toif.rcp/bin/com/kdmanalytics/toif/rcp/internal/ToifCli.class b/com.kdmanalytics.toif.rcp/bin/com/kdmanalytics/toif/rcp/internal/ToifCli.class new file mode 100644 index 00000000..fbb444e7 Binary files /dev/null and b/com.kdmanalytics.toif.rcp/bin/com/kdmanalytics/toif/rcp/internal/ToifCli.class differ diff --git a/com.kdmanalytics.toif.rcp/bin/com/kdmanalytics/toif/rcp/internal/UserConsole.class b/com.kdmanalytics.toif.rcp/bin/com/kdmanalytics/toif/rcp/internal/UserConsole.class new file mode 100644 index 00000000..95927ec6 Binary files /dev/null and b/com.kdmanalytics.toif.rcp/bin/com/kdmanalytics/toif/rcp/internal/UserConsole.class differ diff --git a/com.kdmanalytics.toif.rcp/bin/com/kdmanalytics/toif/rcp/internal/cmd/AdaptorCmd.class b/com.kdmanalytics.toif.rcp/bin/com/kdmanalytics/toif/rcp/internal/cmd/AdaptorCmd.class new file mode 100644 index 00000000..5f11a0f7 Binary files /dev/null and b/com.kdmanalytics.toif.rcp/bin/com/kdmanalytics/toif/rcp/internal/cmd/AdaptorCmd.class differ diff --git a/com.kdmanalytics.toif.rcp/bin/com/kdmanalytics/toif/rcp/internal/cmd/MergeCmd.class b/com.kdmanalytics.toif.rcp/bin/com/kdmanalytics/toif/rcp/internal/cmd/MergeCmd.class new file mode 100644 index 00000000..c64b459d Binary files /dev/null and b/com.kdmanalytics.toif.rcp/bin/com/kdmanalytics/toif/rcp/internal/cmd/MergeCmd.class differ diff --git a/com.kdmanalytics.toif.rcp/bin/com/kdmanalytics/toif/rcp/internal/cmd/VersionCmd.class b/com.kdmanalytics.toif.rcp/bin/com/kdmanalytics/toif/rcp/internal/cmd/VersionCmd.class new file mode 100644 index 00000000..8817faaf Binary files /dev/null and b/com.kdmanalytics.toif.rcp/bin/com/kdmanalytics/toif/rcp/internal/cmd/VersionCmd.class differ diff --git a/com.kdmanalytics.toif.rcp/bin/com/kdmanalytics/toif/rcp/internal/util/BuildInformation.class b/com.kdmanalytics.toif.rcp/bin/com/kdmanalytics/toif/rcp/internal/util/BuildInformation.class new file mode 100644 index 00000000..d8523214 Binary files /dev/null and b/com.kdmanalytics.toif.rcp/bin/com/kdmanalytics/toif/rcp/internal/util/BuildInformation.class differ diff --git a/com.kdmanalytics.toif.rcp/bin/com/kdmanalytics/toif/rcp/internal/util/CommonUtil.class b/com.kdmanalytics.toif.rcp/bin/com/kdmanalytics/toif/rcp/internal/util/CommonUtil.class new file mode 100644 index 00000000..3f382871 Binary files /dev/null and b/com.kdmanalytics.toif.rcp/bin/com/kdmanalytics/toif/rcp/internal/util/CommonUtil.class differ diff --git a/com.kdmanalytics.toif.rcp/build.properties b/com.kdmanalytics.toif.rcp/build.properties new file mode 100644 index 00000000..34591b20 --- /dev/null +++ b/com.kdmanalytics.toif.rcp/build.properties @@ -0,0 +1,6 @@ +source.. = src/ +output.. = bin/ +bin.includes = plugin.xml,\ + META-INF/,\ + . +src.includes = bin/ diff --git a/com.kdmanalytics.toif.rcp/plugin.properties b/com.kdmanalytics.toif.rcp/plugin.properties new file mode 100644 index 00000000..e69de29b diff --git a/com.kdmanalytics.toif.rcp/plugin.xml b/com.kdmanalytics.toif.rcp/plugin.xml new file mode 100644 index 00000000..5f7e805c --- /dev/null +++ b/com.kdmanalytics.toif.rcp/plugin.xml @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + diff --git a/com.kdmanalytics.toif.rcp/pom.xml b/com.kdmanalytics.toif.rcp/pom.xml new file mode 100644 index 00000000..0f9bf222 --- /dev/null +++ b/com.kdmanalytics.toif.rcp/pom.xml @@ -0,0 +1,71 @@ + + + + 4.0.0 + + + com.kdmanalytics.toif + plugins + 1.16.0-SNAPSHOT + + + com.kdmanalytics.toif.compile + com.kdmanalytics.toif.rcp + + + eclipse-plugin + + TOIF RCP + + + + jenkins + + + env.BUILD_NUMBER + + + + + + maven-antrun-plugin + + + prepare-package + process-resources + + + + + + + + run + + + + package + package + + + + + + + + run + + + + + + + + + diff --git a/com.kdmanalytics.toif.rcp/src/com/kdmanalytics/toif/rcp/ToifActivator.java b/com.kdmanalytics.toif.rcp/src/com/kdmanalytics/toif/rcp/ToifActivator.java new file mode 100644 index 00000000..e24a25af --- /dev/null +++ b/com.kdmanalytics.toif.rcp/src/com/kdmanalytics/toif/rcp/ToifActivator.java @@ -0,0 +1,37 @@ +package com.kdmanalytics.toif.rcp; + +/******************************************************************************* + * Copyright (c) 2013 KDM Analytics, Inc. All rights reserved. This program and + * the accompanying materials are made available under the terms of the Open + * Source Initiative OSI - Open Software License v3.0 which accompanies this + * distribution, and is available at + * http://www.opensource.org/licenses/osl-3.0.php/ + ******************************************************************************/ +import org.osgi.framework.BundleActivator; +import org.osgi.framework.BundleContext; + +public class ToifActivator implements BundleActivator { + + private static BundleContext context; + + static BundleContext getContext() { + return context; + } + + /* + * (non-Javadoc) + * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext) + */ + public void start(BundleContext bundleContext) throws Exception { + ToifActivator.context = bundleContext; + } + + /* + * (non-Javadoc) + * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext) + */ + public void stop(BundleContext bundleContext) throws Exception { + ToifActivator.context = null; + } + +} diff --git a/com.kdmanalytics.toif.rcp/src/com/kdmanalytics/toif/rcp/ToifApplication.java b/com.kdmanalytics.toif.rcp/src/com/kdmanalytics/toif/rcp/ToifApplication.java new file mode 100644 index 00000000..998b0145 --- /dev/null +++ b/com.kdmanalytics.toif.rcp/src/com/kdmanalytics/toif/rcp/ToifApplication.java @@ -0,0 +1,78 @@ +package com.kdmanalytics.toif.rcp; + +/******************************************************************************* + * Copyright (c) 2013 KDM Analytics, Inc. All rights reserved. This program and + * the accompanying materials are made available under the terms of the Open + * Source Initiative OSI - Open Software License v3.0 which accompanies this + * distribution, and is available at + * http://www.opensource.org/licenses/osl-3.0.php/ + ******************************************************************************/ +import java.util.List; + +import org.eclipse.core.runtime.Platform; +import org.eclipse.equinox.app.IApplication; +import org.eclipse.equinox.app.IApplicationContext; + +import com.google.common.collect.Lists; +import com.kdmanalytics.toif.rcp.internal.UserConsole; + +/** + * This class controls all aspects of the application's execution + */ +public class ToifApplication implements IApplication + { + + /* + * (non-Javadoc) + * + * @see org.eclipse.equinox.app.IApplication#start(org.eclipse.equinox.app. + * IApplicationContext) + */ + public Object start(IApplicationContext context) throws Exception + { + boolean markerFound = false; + List toifArgList = Lists.newArrayList(); + List adaptorArgList = Lists.newArrayList(); + + // Strip some arguments passed by eclipse that we are + // not interested it and build argument list + String[] appArgs = Platform.getApplicationArgs(); + + for (String s : appArgs) + { + if (s.equals("-product")) + continue; + + if (markerFound) + adaptorArgList.add( s ); + else + { + if ( s.equals("--")) + { + markerFound = true; + continue; + } + else + toifArgList.add( s ); + } + } + + String[] toifArgs = toifArgList.toArray( new String[toifArgList.size()]); + String[] adaptorArgs = adaptorArgList.toArray( new String[adaptorArgList.size()]); + + UserConsole uc = new UserConsole(toifArgs, adaptorArgs); + uc.execute(); + + return IApplication.EXIT_OK; + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.equinox.app.IApplication#stop() + */ + public void stop() + { + // nothing to do + } + } diff --git a/com.kdmanalytics.toif.rcp/src/com/kdmanalytics/toif/rcp/internal/IToifCmd.java b/com.kdmanalytics.toif.rcp/src/com/kdmanalytics/toif/rcp/internal/IToifCmd.java new file mode 100644 index 00000000..ed6b0882 --- /dev/null +++ b/com.kdmanalytics.toif.rcp/src/com/kdmanalytics/toif/rcp/internal/IToifCmd.java @@ -0,0 +1,13 @@ +package com.kdmanalytics.toif.rcp.internal; + +/******************************************************************************* + * Copyright (c) 2013 KDM Analytics, Inc. All rights reserved. This program and + * the accompanying materials are made available under the terms of the Open + * Source Initiative OSI - Open Software License v3.0 which accompanies this + * distribution, and is available at + * http://www.opensource.org/licenses/osl-3.0.php/ + ******************************************************************************/ +public interface IToifCmd + { + void execute( ToifCli toifCli, String userArgs[]); + } diff --git a/com.kdmanalytics.toif.rcp/src/com/kdmanalytics/toif/rcp/internal/ToifCli.java b/com.kdmanalytics.toif.rcp/src/com/kdmanalytics/toif/rcp/internal/ToifCli.java new file mode 100644 index 00000000..d5af8d06 --- /dev/null +++ b/com.kdmanalytics.toif.rcp/src/com/kdmanalytics/toif/rcp/internal/ToifCli.java @@ -0,0 +1,61 @@ +package com.kdmanalytics.toif.rcp.internal; + + +/******************************************************************************* + * Copyright (c) 2013 KDM Analytics, Inc. All rights reserved. This program and + * the accompanying materials are made available under the terms of the Open + * Source Initiative OSI - Open Software License v3.0 which accompanies this + * distribution, and is available at + * http://www.opensource.org/licenses/osl-3.0.php/ + ******************************************************************************/ + +import java.io.File; +import java.util.Set; + +import com.lexicalscope.jewel.cli.Option; + +public interface ToifCli + { + @Option + boolean isVersion(); + + @Option + boolean isMerge(); + + @Option + Set getAdaptor(); + boolean isAdaptor(); + + @Option (shortName="v") + boolean isVerbose(); + + //-------------------------------------------- + // Adaptor specific options + //-------------------------------------------- + @Option (shortName="i") + Set getInputfile(); + boolean isInputfile(); + + @Option (shortName="o") + File getOutputdirectory(); + boolean isOutputdirectory(); + + @Option (shortName="h") + File getHousekeeping(); + boolean isHousekeeping(); + + //-------------------------------------------- + // Merge specific options + //-------------------------------------------- + @Option( shortName="r") + File getRepository(); + boolean isRepository(); + + @Option (shortName="k") + File getKdmfile(); + boolean isKdmfile(); + + @Option + String getRootname(); + boolean isRootname(); + } diff --git a/com.kdmanalytics.toif.rcp/src/com/kdmanalytics/toif/rcp/internal/UserConsole.java b/com.kdmanalytics.toif.rcp/src/com/kdmanalytics/toif/rcp/internal/UserConsole.java new file mode 100644 index 00000000..744ac93d --- /dev/null +++ b/com.kdmanalytics.toif.rcp/src/com/kdmanalytics/toif/rcp/internal/UserConsole.java @@ -0,0 +1,139 @@ +package com.kdmanalytics.toif.rcp.internal; + +/******************************************************************************* + * Copyright (c) 2013 KDM Analytics, Inc. All rights reserved. This program and + * the accompanying materials are made available under the terms of the Open + * Source Initiative OSI - Open Software License v3.0 which accompanies this + * distribution, and is available at + * http://www.opensource.org/licenses/osl-3.0.php/ + ******************************************************************************/ +import java.io.File; + +import com.kdmanalytics.toif.rcp.internal.cmd.AdaptorCmd; +import com.kdmanalytics.toif.rcp.internal.cmd.MergeCmd; +import com.kdmanalytics.toif.rcp.internal.cmd.VersionCmd; +import com.lexicalscope.jewel.cli.CliFactory; + +public class UserConsole + { + String toifArgs[] = null; + String AdaptorArgs[] = null; + + public UserConsole() + { + } + + public UserConsole(String toifArgs[], String adaptorArgs[]) + { + this.toifArgs = toifArgs; + this.AdaptorArgs = adaptorArgs; + } + + public void execute() + { + // Check out CLI options + ToifCli toifCli = null; + try + { + toifCli = CliFactory.parseArguments(ToifCli.class, toifArgs); + } + catch( Exception ex) + { + System.err.println( "Invalid Arguments: " + ex.getMessage()); + return; + } + + + // Check if supplied options are valid + if ( argsValid( toifCli) == false) + { + System.err.println( "Invalid arguments"); + return; + } + + // Are we doing Version? + if (toifCli.isVersion()) doVersion( toifCli ); + if (toifCli.isAdaptor()) doAdaptor( toifCli ); + if (toifCli.isMerge()) doMerge( toifCli); + + + } + + private void doVersion( ToifCli toifCli) + { + VersionCmd cmd = new VersionCmd(); + cmd.execute( toifCli, this.AdaptorArgs); + } + + private void doAdaptor( ToifCli toifCli) + { + // Ensure that output directory is specifed + if (!toifCli.isOutputdirectory()) + { + System.err.println( "Output directory needs to be specified"); + return; + } + + // Ensure that specified directory exists + if (!toifCli.getOutputdirectory().exists()) + toifCli.getOutputdirectory().mkdirs(); + + AdaptorCmd cmd = new AdaptorCmd(); + cmd.execute(toifCli, this.AdaptorArgs); + + } + + private void doMerge( ToifCli toifCli) + { + MergeCmd cmd = new MergeCmd(); + cmd.execute( toifCli, this.AdaptorArgs); + } + + /*************************************************** + * Just perform some sanity checking on the arguments + * + **************************************************/ + private boolean argsValid( ToifCli cli) + { + // Check that we are only doing a single command + if (cli.isMerge() && cli.isAdaptor()) + { + System.err.println( "Can only do adaptor or merge"); + return false; + } + + // Check inputfile + if (cli.isInputfile()) + { + for (File file: cli.getInputfile()) + { + if (!file.exists()) + { + System.err.println( "Specified inputfile does not exist: " + file.getAbsolutePath()); + return false; + } + + if (!file.isFile() && !file.isDirectory()) + { + System.err.println( "Specified inputfile not valid: " + file.getAbsolutePath()); + return false; + } + + + } + + } + + // Check house keeping + if (cli.isHousekeeping()) + { + if (!cli.getHousekeeping().isFile()) + { + System.err.println( "Specified housekeeping file not valid: " + cli.getHousekeeping()); + return false; + } + } + + return true; + } + } diff --git a/com.kdmanalytics.toif.rcp/src/com/kdmanalytics/toif/rcp/internal/cmd/AdaptorCmd.java b/com.kdmanalytics.toif.rcp/src/com/kdmanalytics/toif/rcp/internal/cmd/AdaptorCmd.java new file mode 100644 index 00000000..9c8af3e1 --- /dev/null +++ b/com.kdmanalytics.toif.rcp/src/com/kdmanalytics/toif/rcp/internal/cmd/AdaptorCmd.java @@ -0,0 +1,59 @@ +package com.kdmanalytics.toif.rcp.internal.cmd; + +/******************************************************************************* + * Copyright (c) 2013 KDM Analytics, Inc. All rights reserved. This program and + * the accompanying materials are made available under the terms of the Open + * Source Initiative OSI - Open Software License v3.0 which accompanies this + * distribution, and is available at + * http://www.opensource.org/licenses/osl-3.0.php/ + ******************************************************************************/ +import java.io.File; + + + + +import com.kdmanalytics.toif.common.exception.ToifException; +import com.kdmanalytics.toif.facade.ToifFacade; +import com.kdmanalytics.toif.framework.toolAdaptor.AbstractAdaptor; +import com.kdmanalytics.toif.framework.toolAdaptor.ToolAdaptorUtil; +import com.kdmanalytics.toif.rcp.internal.IToifCmd; +import com.kdmanalytics.toif.rcp.internal.ToifCli; + +public class AdaptorCmd implements IToifCmd + { + + @Override + public void execute(ToifCli toifCli, String userArgs[]) + { + // Expand each adaptor as required + for (String toolName : toifCli.getAdaptor()) + { + System.out.println( "tool name=" + toolName); + + for (AbstractAdaptor adaptor : ToolAdaptorUtil.getAdaptors()) + { + //System.out.println( adaptor.getAdaptorName()); + if (toolName.equalsIgnoreCase( adaptor.getRuntoolName())) + { + ToifFacade toif = new ToifFacade(); + if (!toif.isAdapterReportingToolRunnable(adaptor)) + System.err.println( "Adaptor " + adaptor.getAdaptorName() + "is not runnable"); + else + try + { + for (File inputFile : toifCli.getInputfile()) + { + toif.execute(adaptor, inputFile, toifCli.getHousekeeping(), + toifCli.getOutputdirectory(), new File("."), userArgs, null); + } + } + catch (IllegalArgumentException | ToifException e) + { + System.err.println( "Illegal Argument:" + e.getMessage() ); + return; } + } + } + } + } + + } diff --git a/com.kdmanalytics.toif.rcp/src/com/kdmanalytics/toif/rcp/internal/cmd/MergeCmd.java b/com.kdmanalytics.toif.rcp/src/com/kdmanalytics/toif/rcp/internal/cmd/MergeCmd.java new file mode 100644 index 00000000..1aee4194 --- /dev/null +++ b/com.kdmanalytics.toif.rcp/src/com/kdmanalytics/toif/rcp/internal/cmd/MergeCmd.java @@ -0,0 +1,36 @@ +package com.kdmanalytics.toif.rcp.internal.cmd; + +/******************************************************************************* + * Copyright (c) 2013 KDM Analytics, Inc. All rights reserved. This program and + * the accompanying materials are made available under the terms of the Open + * Source Initiative OSI - Open Software License v3.0 which accompanies this + * distribution, and is available at + * http://www.opensource.org/licenses/osl-3.0.php/ + ******************************************************************************/ + +import com.kdmanalytics.toif.common.exception.ToifException; +import com.kdmanalytics.toif.facade.ToifFacade; +import com.kdmanalytics.toif.rcp.internal.IToifCmd; +import com.kdmanalytics.toif.rcp.internal.ToifCli; + +public class MergeCmd implements IToifCmd + { + + @Override + public void execute(ToifCli toifCli, String userArgs[]) + { + + ToifFacade toif = new ToifFacade(); + try + { + toif.merge( toifCli.getKdmfile(), toifCli.getInputfile(), true); + } + catch (ToifException e) + { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + } + + } diff --git a/com.kdmanalytics.toif.rcp/src/com/kdmanalytics/toif/rcp/internal/cmd/VersionCmd.java b/com.kdmanalytics.toif.rcp/src/com/kdmanalytics/toif/rcp/internal/cmd/VersionCmd.java new file mode 100644 index 00000000..e63ab86c --- /dev/null +++ b/com.kdmanalytics.toif.rcp/src/com/kdmanalytics/toif/rcp/internal/cmd/VersionCmd.java @@ -0,0 +1,53 @@ +package com.kdmanalytics.toif.rcp.internal.cmd; + +/******************************************************************************* + * Copyright (c) 2013 KDM Analytics, Inc. All rights reserved. This program and + * the accompanying materials are made available under the terms of the Open + * Source Initiative OSI - Open Software License v3.0 which accompanies this + * distribution, and is available at + * http://www.opensource.org/licenses/osl-3.0.php/ + ******************************************************************************/ +import com.kdmanalytics.toif.framework.toolAdaptor.AbstractAdaptor; +import com.kdmanalytics.toif.framework.toolAdaptor.ToolAdaptorUtil; +import com.kdmanalytics.toif.rcp.internal.IToifCmd; +import com.kdmanalytics.toif.rcp.internal.ToifCli; +import com.kdmanalytics.toif.rcp.internal.util.BuildInformation; +import com.kdmanalytics.toif.rcp.internal.util.CommonUtil; + +public class VersionCmd implements IToifCmd + { + + @Override + public void execute(ToifCli toifCli, String userArgs[]) + { + BuildInformation bi = new BuildInformation( this ); + System.out.println( "Version="+ bi.getVersion()); + System.out.println( ""); + + if (toifCli.isVerbose()) + { + // List detected plugins + for (AbstractAdaptor adaptor :ToolAdaptorUtil.getAdaptors()) + { + StringBuilder sb = new StringBuilder(); + sb.append( "Adaptor Name="); + String name = CommonUtil.padRight( adaptor.getAdaptorName(), 15); + sb.append( name); + + sb.append( " tool="); + String tool = CommonUtil.padRight( adaptor.getRuntoolName(), 15); + sb.append( tool ); + + sb.append( " version="); + bi = new BuildInformation( this ); + sb.append( bi.getVersion()); + + System.out.println( sb ); + } + } + + } + + + + } diff --git a/com.kdmanalytics.toif.rcp/src/com/kdmanalytics/toif/rcp/internal/util/BuildInformation.java b/com.kdmanalytics.toif.rcp/src/com/kdmanalytics/toif/rcp/internal/util/BuildInformation.java new file mode 100644 index 00000000..ea4e0bf0 --- /dev/null +++ b/com.kdmanalytics.toif.rcp/src/com/kdmanalytics/toif/rcp/internal/util/BuildInformation.java @@ -0,0 +1,224 @@ +package com.kdmanalytics.toif.rcp.internal.util; + + +/******************************************************************************* + * Copyright (c) 2013 KDM Analytics, Inc. All rights reserved. This program and + * the accompanying materials are made available under the terms of the Open + * Source Initiative OSI - Open Software License v3.0 which accompanies this + * distribution, and is available at + * http://www.opensource.org/licenses/osl-3.0.php/ + ******************************************************************************/ +import java.io.File; +import java.io.IOException; +import java.net.MalformedURLException; +import java.net.URL; +import java.util.jar.Attributes; +import java.util.jar.JarFile; +import java.util.jar.Manifest; + +final public class BuildInformation + { + private Manifest manifest = null; + private Attributes attributes = null; + private File jarFile = null; + + public BuildInformation() + { + } + + public BuildInformation( Object object) + { + manifest = getManifest( object ); + + attributes = manifest.getMainAttributes(); + } + + + public BuildInformation( File jarFile) + { + JarFile jar; + try + { + jar = new JarFile( jarFile ); + manifest = jar.getManifest(); + + if (manifest != null) + attributes = manifest.getMainAttributes(); + + this.jarFile = jarFile; + } + catch (MalformedURLException e) + { + // Just skip + } + catch (IOException e) + { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + + public boolean isValid() + { + if (manifest == null) + return false; + else + return true; + } + + + //------------------------------------------------------------- + // Return Manifest Associated with this object + //------------------------------------------------------------- + private Manifest getManifest( Object object) + { + try + { + URL manifestUrl = object.getClass().getProtectionDomain().getCodeSource().getLocation(); + + JarFile jar = new JarFile(manifestUrl.getFile()); + Manifest manifest = jar.getManifest(); + jar.close(); + + return manifest; + } + catch (MalformedURLException e) + { + // Just skip + } + catch (IOException e) + { + // Just skip + } + + return null; + } + + final public String getVersion() + { + if (manifest == null) + return null; + else + { + String versionString = KDMVersionFormat( attributes.getValue("Implementation-Version") ); + if (versionString == null) + { + // Implementation value not set .. try to use bundle tags + versionString = bundleVersionFormat( attributes.getValue("Bundle-Version") ); + } + + return versionString; + } + } + + + private String KDMVersionFormat( String versionString) + { + if (versionString == null) + return null; + + // Check if KDM format + if (!versionString.trim().matches("[0-9].[0-9].[0-9].*.\\([0-9]*-.*.\\)")) + return versionString; + else + { + String token[] = versionString.split(" "); + if (token.length == 2) + { + // extract version # + String version = token[0]; + if (version.contains("-")) + version = version.substring(0, version.indexOf('-')); + + // extract build # + String buildNumber = token[1]; + if (buildNumber.contains("-") && buildNumber.length() > 2) + buildNumber = token[1].substring(1, token[1].indexOf("-")); + + // Generate KDM version string + if (versionString.contains("SNAPSHOT")) + return ( version + '-' + buildNumber + " (development)"); + else + return ( version + '-' + buildNumber + " (production)"); + } + + return versionString; + } + } + + + private String bundleVersionFormat( String versionString) + { + if (versionString == null) + return null; + + int index = versionString.lastIndexOf( '.'); + if (index != -1) + { + String tt = versionString.substring(index+1); + + // make sure that is is valid time code + if (tt.matches("[0-9]*") && tt.length() >= 8) + { + String version = versionString.substring(0, index); + if (isKdmEntity()) + return version + "-" + tt + " (patch)"; + else + return version + "-" + tt; + } + } + + return versionString; + } + + + public boolean isKdmEntity() + { + Attributes attributes = manifest.getMainAttributes(); + + String vendor = attributes.getValue("Impelmentation-Vendor"); + if (vendor != null) + if (vendor.contains("KDM Analytics")) + return true; + + vendor = attributes.getValue("Bundle-Vendor"); + if (vendor != null) + if (vendor.contains("KDM Analytics") || vendor.contains("KDMANALYTICS")) + return true; + + return false; + } + + + //-------------------------------------------------------------- + // Get title + //-------------------------------------------------------------- + final public String getTitle() + { + String title = attributes.getValue("Bundle-Name"); + if (title == null || title.contains("%")) + title = attributes.getValue("Implementation-Title"); + + return title; + } + + + //-------------------------------------------------------------- + // Get Vendor + //-------------------------------------------------------------- + final public String getVendor() + { + String vendor = attributes.getValue("Bundle-Vendor"); + if (vendor == null || vendor.contains("%")) + vendor = attributes.getValue("Implementation-Vendor"); + + return vendor; + } + + + + final public File getJarFile() + { + return jarFile; + } + } diff --git a/com.kdmanalytics.toif.rcp/src/com/kdmanalytics/toif/rcp/internal/util/CommonUtil.java b/com.kdmanalytics.toif.rcp/src/com/kdmanalytics/toif/rcp/internal/util/CommonUtil.java new file mode 100644 index 00000000..18e21ecc --- /dev/null +++ b/com.kdmanalytics.toif.rcp/src/com/kdmanalytics/toif/rcp/internal/util/CommonUtil.java @@ -0,0 +1,62 @@ +package com.kdmanalytics.toif.rcp.internal.util; + + +/******************************************************************************* + * Copyright (c) 2013 KDM Analytics, Inc. All rights reserved. This program and + * the accompanying materials are made available under the terms of the Open + * Source Initiative OSI - Open Software License v3.0 which accompanies this + * distribution, and is available at + * http://www.opensource.org/licenses/osl-3.0.php/ + ******************************************************************************/ + +import java.io.IOException; +import java.net.MalformedURLException; +import java.net.URL; +import java.util.jar.JarFile; +import java.util.jar.Manifest; + + +public final class CommonUtil + { + //----------------------------------------------------------------------------------- + // Extract version information of jar Manifest + //----------------------------------------------------------------------------------- + public static final String getVersion( Object object) + { + try + { + URL manifestUrl = object.getClass().getProtectionDomain().getCodeSource().getLocation(); + + JarFile jar = new JarFile(manifestUrl.getFile()); + Manifest mf = jar.getManifest(); + String version = mf.getMainAttributes().getValue("Bundle-Version"); + jar.close(); + + return version; + } + catch (MalformedURLException e) + { + // Just skip + } + catch (IOException e) + { + // Just skip + } + + return null; + } + + + public static String padRight(String s, int n) { + return String.format("%1$-" + n + "s", s); + } + +public static String padLeft(String s, int n) { + return String.format("%1$" + n + "s", s); +} + + + } + + + diff --git a/com.kdmanalytics.toif.rcp/target/MANIFEST.MF b/com.kdmanalytics.toif.rcp/target/MANIFEST.MF new file mode 100644 index 00000000..8e66b0eb --- /dev/null +++ b/com.kdmanalytics.toif.rcp/target/MANIFEST.MF @@ -0,0 +1,19 @@ +Manifest-Version: 1.0 +Require-Bundle: org.eclipse.core.runtime,com.lexicalscope.jewelcli,org + .eclipse.rcp;bundle-version="3.7.2",org.apache.xerces;bundle-version= + "2.11.0",com.kdmanalytics.toif.framework;bundle-version="1.8.6",com.g + oogle.guava;bundle-version="14.0.1",org.apache.commons.io;bundle-vers + ion="[2.4.0,2.5.0)",org.apache.log4j;bundle-version="1.2.15",com.kdma + nalytics.toif.facade;bundle-version="1.8.6",net.sf.trove4j;bundle-ver + sion="3.0.3" +Bundle-Vendor: KDM Analytics Inc. +Bundle-ActivationPolicy: lazy +Bundle-Version: 1.15.5 +Bundle-Localization: plugin +Bundle-Name: TOIF RCP Application +Bundle-Activator: com.kdmanalytics.toif.rcp.ToifActivator +Bundle-ManifestVersion: 2 +Bundle-SymbolicName: com.kdmanalytics.toif.rcp; singleton:=true +Eclipse-RegisterBuddy: com.lexicalscope.jewelcli +Bundle-RequiredExecutionEnvironment: JavaSE-1.7 + diff --git a/com.kdmanalytics.toif.rcp/target/classes/com/kdmanalytics/toif/rcp/ToifActivator.class b/com.kdmanalytics.toif.rcp/target/classes/com/kdmanalytics/toif/rcp/ToifActivator.class new file mode 100644 index 00000000..9c38da45 Binary files /dev/null and b/com.kdmanalytics.toif.rcp/target/classes/com/kdmanalytics/toif/rcp/ToifActivator.class differ diff --git a/com.kdmanalytics.toif.rcp/target/classes/com/kdmanalytics/toif/rcp/ToifApplication.class b/com.kdmanalytics.toif.rcp/target/classes/com/kdmanalytics/toif/rcp/ToifApplication.class new file mode 100644 index 00000000..71e7b1c6 Binary files /dev/null and b/com.kdmanalytics.toif.rcp/target/classes/com/kdmanalytics/toif/rcp/ToifApplication.class differ diff --git a/com.kdmanalytics.toif.rcp/target/classes/com/kdmanalytics/toif/rcp/internal/IToifCmd.class b/com.kdmanalytics.toif.rcp/target/classes/com/kdmanalytics/toif/rcp/internal/IToifCmd.class new file mode 100644 index 00000000..24b411f5 Binary files /dev/null and b/com.kdmanalytics.toif.rcp/target/classes/com/kdmanalytics/toif/rcp/internal/IToifCmd.class differ diff --git a/com.kdmanalytics.toif.rcp/target/classes/com/kdmanalytics/toif/rcp/internal/ToifCli.class b/com.kdmanalytics.toif.rcp/target/classes/com/kdmanalytics/toif/rcp/internal/ToifCli.class new file mode 100644 index 00000000..fbb444e7 Binary files /dev/null and b/com.kdmanalytics.toif.rcp/target/classes/com/kdmanalytics/toif/rcp/internal/ToifCli.class differ diff --git a/com.kdmanalytics.toif.rcp/target/classes/com/kdmanalytics/toif/rcp/internal/UserConsole.class b/com.kdmanalytics.toif.rcp/target/classes/com/kdmanalytics/toif/rcp/internal/UserConsole.class new file mode 100644 index 00000000..95927ec6 Binary files /dev/null and b/com.kdmanalytics.toif.rcp/target/classes/com/kdmanalytics/toif/rcp/internal/UserConsole.class differ diff --git a/com.kdmanalytics.toif.rcp/target/classes/com/kdmanalytics/toif/rcp/internal/cmd/AdaptorCmd.class b/com.kdmanalytics.toif.rcp/target/classes/com/kdmanalytics/toif/rcp/internal/cmd/AdaptorCmd.class new file mode 100644 index 00000000..5f11a0f7 Binary files /dev/null and b/com.kdmanalytics.toif.rcp/target/classes/com/kdmanalytics/toif/rcp/internal/cmd/AdaptorCmd.class differ diff --git a/com.kdmanalytics.toif.rcp/target/classes/com/kdmanalytics/toif/rcp/internal/cmd/MergeCmd.class b/com.kdmanalytics.toif.rcp/target/classes/com/kdmanalytics/toif/rcp/internal/cmd/MergeCmd.class new file mode 100644 index 00000000..c64b459d Binary files /dev/null and b/com.kdmanalytics.toif.rcp/target/classes/com/kdmanalytics/toif/rcp/internal/cmd/MergeCmd.class differ diff --git a/com.kdmanalytics.toif.rcp/target/classes/com/kdmanalytics/toif/rcp/internal/cmd/VersionCmd.class b/com.kdmanalytics.toif.rcp/target/classes/com/kdmanalytics/toif/rcp/internal/cmd/VersionCmd.class new file mode 100644 index 00000000..8817faaf Binary files /dev/null and b/com.kdmanalytics.toif.rcp/target/classes/com/kdmanalytics/toif/rcp/internal/cmd/VersionCmd.class differ diff --git a/com.kdmanalytics.toif.rcp/target/classes/com/kdmanalytics/toif/rcp/internal/util/BuildInformation.class b/com.kdmanalytics.toif.rcp/target/classes/com/kdmanalytics/toif/rcp/internal/util/BuildInformation.class new file mode 100644 index 00000000..628a5576 Binary files /dev/null and b/com.kdmanalytics.toif.rcp/target/classes/com/kdmanalytics/toif/rcp/internal/util/BuildInformation.class differ diff --git a/com.kdmanalytics.toif.rcp/target/classes/com/kdmanalytics/toif/rcp/internal/util/CommonUtil.class b/com.kdmanalytics.toif.rcp/target/classes/com/kdmanalytics/toif/rcp/internal/util/CommonUtil.class new file mode 100644 index 00000000..e305f9db Binary files /dev/null and b/com.kdmanalytics.toif.rcp/target/classes/com/kdmanalytics/toif/rcp/internal/util/CommonUtil.class differ diff --git a/com.kdmanalytics.toif.rcp/target/com.kdmanalytics.toif.rcp-1.15.5.jar b/com.kdmanalytics.toif.rcp/target/com.kdmanalytics.toif.rcp-1.15.5.jar new file mode 100644 index 00000000..3c314e1d Binary files /dev/null and b/com.kdmanalytics.toif.rcp/target/com.kdmanalytics.toif.rcp-1.15.5.jar differ diff --git a/com.kdmanalytics.toif.rcp/target/local-artifacts.properties b/com.kdmanalytics.toif.rcp/target/local-artifacts.properties new file mode 100644 index 00000000..f527e301 --- /dev/null +++ b/com.kdmanalytics.toif.rcp/target/local-artifacts.properties @@ -0,0 +1,4 @@ +#Thu May 29 09:56:44 EDT 2014 +artifact.attached.p2metadata=/home/adam/git/toif/plugins/com.kdmanalytics.toif.rcp/target/p2content.xml +artifact.main=/home/adam/git/toif/plugins/com.kdmanalytics.toif.rcp/target/com.kdmanalytics.toif.rcp-1.15.5.jar +artifact.attached.p2artifacts=/home/adam/git/toif/plugins/com.kdmanalytics.toif.rcp/target/p2artifacts.xml diff --git a/com.kdmanalytics.toif.rcp/target/maven-archiver/pom.properties b/com.kdmanalytics.toif.rcp/target/maven-archiver/pom.properties new file mode 100644 index 00000000..3f1d183c --- /dev/null +++ b/com.kdmanalytics.toif.rcp/target/maven-archiver/pom.properties @@ -0,0 +1,5 @@ +#Generated by Maven +#Thu May 29 09:56:44 EDT 2014 +version=1.15.5 +groupId=com.kdmanalytics.toif.compile +artifactId=com.kdmanalytics.toif.rcp diff --git a/com.kdmanalytics.toif.rcp/target/p2artifacts.xml b/com.kdmanalytics.toif.rcp/target/p2artifacts.xml new file mode 100644 index 00000000..36af7161 --- /dev/null +++ b/com.kdmanalytics.toif.rcp/target/p2artifacts.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/com.kdmanalytics.toif.rcp/target/p2content.xml b/com.kdmanalytics.toif.rcp/target/p2content.xml new file mode 100644 index 00000000..388c66a0 --- /dev/null +++ b/com.kdmanalytics.toif.rcp/target/p2content.xml @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Bundle-SymbolicName: com.kdmanalytics.toif.rcp; singleton:=true Bundle-Version: 1.15.5 + + + + + diff --git a/com.kdmanalytics.toif.rcp/toif-rcp-linux.product b/com.kdmanalytics.toif.rcp/toif-rcp-linux.product new file mode 100644 index 00000000..17c5c328 --- /dev/null +++ b/com.kdmanalytics.toif.rcp/toif-rcp-linux.product @@ -0,0 +1,78 @@ + + + + + + + + + + -consoleLog + -Dosgi.requiredJavaVersion=1.5 -Dhelp.lucene.tokenizer=standard -XX:MaxPermSize=256m -Xms40m -Xmx512m + -XstartOnFirstThread -Dorg.eclipse.swt.internal.carbon.smallFonts + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/com.kdmanalytics.toif.rcp/toif-rcp-win.product b/com.kdmanalytics.toif.rcp/toif-rcp-win.product new file mode 100644 index 00000000..d1a163b7 --- /dev/null +++ b/com.kdmanalytics.toif.rcp/toif-rcp-win.product @@ -0,0 +1,133 @@ + + + + + + + + + + -consoleLog + -Dosgi.requiredJavaVersion=1.5 -Dhelp.lucene.tokenizer=standard -Xms80m -Xmx1024m + -XstartOnFirstThread -Dorg.eclipse.swt.internal.carbon.smallFonts + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/com.kdmanalytics.toif.report/.classpath b/com.kdmanalytics.toif.report/.classpath new file mode 100644 index 00000000..ad32c83a --- /dev/null +++ b/com.kdmanalytics.toif.report/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/com.kdmanalytics.toif.report/.project b/com.kdmanalytics.toif.report/.project new file mode 100644 index 00000000..50d0d8ce --- /dev/null +++ b/com.kdmanalytics.toif.report/.project @@ -0,0 +1,28 @@ + + + com.kdmanalytics.toif.report + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + + org.eclipse.pde.PluginNature + org.eclipse.jdt.core.javanature + + diff --git a/com.kdmanalytics.toif.report/.settings/org.eclipse.jdt.core.prefs b/com.kdmanalytics.toif.report/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 00000000..d1a970b8 --- /dev/null +++ b/com.kdmanalytics.toif.report/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,8 @@ +#Tue Nov 01 15:31:00 EDT 2011 +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 +org.eclipse.jdt.core.compiler.compliance=1.6 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.6 diff --git a/com.kdmanalytics.toif.report/.settings/org.eclipse.pde.core.prefs b/com.kdmanalytics.toif.report/.settings/org.eclipse.pde.core.prefs new file mode 100644 index 00000000..5f96f3f7 --- /dev/null +++ b/com.kdmanalytics.toif.report/.settings/org.eclipse.pde.core.prefs @@ -0,0 +1,3 @@ +#Wed Dec 28 15:58:35 EST 2011 +eclipse.preferences.version=1 +resolve.requirebundle=false diff --git a/com.kdmanalytics.toif.report/META-INF/MANIFEST.MF b/com.kdmanalytics.toif.report/META-INF/MANIFEST.MF new file mode 100644 index 00000000..3a968f33 --- /dev/null +++ b/com.kdmanalytics.toif.report/META-INF/MANIFEST.MF @@ -0,0 +1,27 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: TOIF Report View +Bundle-SymbolicName: com.kdmanalytics.toif.report;singleton:=true +Bundle-Version: 1.16.0.qualifier +Bundle-Activator: com.kdmanalytics.toif.report.internal.Activator +Bundle-Vendor: KDM Analytics Inc. +Require-Bundle: com.google.guava;bundle-version="[14.0.1,15.0.0)", + org.apache.log4j;bundle-version="[1.2.15,2.0.0)", + org.openrdf.sesame;bundle-version="[2.4.0,2.5.0)", + org.eclipse.ui;bundle-version="[3.7.0,4.2.0)", + org.eclipse.core.runtime;bundle-version="[3.7.0,4.2.0)", + org.eclipse.ui.ide;bundle-version="[3.7.0,4.2.0)", + org.eclipse.core.filesystem;bundle-version="[1.3.100,2.0.0)", + org.eclipse.core.expressions;bundle-version="[3.4.300,3.5.0)", + org.eclipse.core.resources;bundle-version="[3.7.0,4.2.0)", + org.apache.commons.lang3;bundle-version="[3.1.0,4.0.0)", + org.apache.commons.io;bundle-version="[2.4.0,3.0.0)", + org.eclipse.jdt.core;bundle-version="[3.7.0,4.2.0)", + com.kdmanalytics.toif.ccr;bundle-version="[1.6.0,2.0.0)" +Bundle-RequiredExecutionEnvironment: JavaSE-1.6 +Eclipse-ExtensibleAPI: true +Bundle-ActivationPolicy: lazy +Bundle-ClassPath: . +Export-Package: com.kdmanalytics.toif.report.items,com.kdmanalytics.to + if.report.util;uses:="org.eclipse.core.resources,org.openrdf.reposito + ry" diff --git a/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/Activator.class b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/Activator.class new file mode 100644 index 00000000..5fd1f284 Binary files /dev/null and b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/Activator.class differ diff --git a/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/contributionItems/TraceContributionItem.class b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/contributionItems/TraceContributionItem.class new file mode 100644 index 00000000..1917814e Binary files /dev/null and b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/contributionItems/TraceContributionItem.class differ diff --git a/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/contributionItems/package-info.class b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/contributionItems/package-info.class new file mode 100644 index 00000000..d2e1cfd2 Binary files /dev/null and b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/contributionItems/package-info.class differ diff --git a/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/filters/AbstractValidFilter.class b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/filters/AbstractValidFilter.class new file mode 100644 index 00000000..bc12a62d Binary files /dev/null and b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/filters/AbstractValidFilter.class differ diff --git a/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/filters/CWETwoToolsFilter.class b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/filters/CWETwoToolsFilter.class new file mode 100644 index 00000000..bf60ad12 Binary files /dev/null and b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/filters/CWETwoToolsFilter.class differ diff --git a/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/filters/IsValidFilter.class b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/filters/IsValidFilter.class new file mode 100644 index 00000000..74f13618 Binary files /dev/null and b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/filters/IsValidFilter.class differ diff --git a/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/filters/NotValidFilter.class b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/filters/NotValidFilter.class new file mode 100644 index 00000000..e4737a38 Binary files /dev/null and b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/filters/NotValidFilter.class differ diff --git a/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/filters/SFPTwoToolsFilter.class b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/filters/SFPTwoToolsFilter.class new file mode 100644 index 00000000..af7fb50c Binary files /dev/null and b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/filters/SFPTwoToolsFilter.class differ diff --git a/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/filters/TermFilter.class b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/filters/TermFilter.class new file mode 100644 index 00000000..cdec5b8a Binary files /dev/null and b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/filters/TermFilter.class differ diff --git a/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/filters/TrustFilter.class b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/filters/TrustFilter.class new file mode 100644 index 00000000..93b53b9a Binary files /dev/null and b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/filters/TrustFilter.class differ diff --git a/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/filters/TwoToolsFilter.class b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/filters/TwoToolsFilter.class new file mode 100644 index 00000000..2d3591e5 Binary files /dev/null and b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/filters/TwoToolsFilter.class differ diff --git a/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/filters/package-info.class b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/filters/package-info.class new file mode 100644 index 00000000..4ba6abdd Binary files /dev/null and b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/filters/package-info.class differ diff --git a/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/handlers/BuildDefectModelHandler.class b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/handlers/BuildDefectModelHandler.class new file mode 100644 index 00000000..329b023c Binary files /dev/null and b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/handlers/BuildDefectModelHandler.class differ diff --git a/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/handlers/ExportCitationHandler.class b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/handlers/ExportCitationHandler.class new file mode 100644 index 00000000..05a757d7 Binary files /dev/null and b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/handlers/ExportCitationHandler.class differ diff --git a/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/handlers/ExportSelectionHandler.class b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/handlers/ExportSelectionHandler.class new file mode 100644 index 00000000..fc32e260 Binary files /dev/null and b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/handlers/ExportSelectionHandler.class differ diff --git a/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/handlers/FiltersDialog$1.class b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/handlers/FiltersDialog$1.class new file mode 100644 index 00000000..4c9fe9e6 Binary files /dev/null and b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/handlers/FiltersDialog$1.class differ diff --git a/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/handlers/FiltersDialog$2.class b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/handlers/FiltersDialog$2.class new file mode 100644 index 00000000..6cabb9ef Binary files /dev/null and b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/handlers/FiltersDialog$2.class differ diff --git a/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/handlers/FiltersDialog$3.class b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/handlers/FiltersDialog$3.class new file mode 100644 index 00000000..09bed2a9 Binary files /dev/null and b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/handlers/FiltersDialog$3.class differ diff --git a/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/handlers/FiltersDialog$4.class b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/handlers/FiltersDialog$4.class new file mode 100644 index 00000000..f1465597 Binary files /dev/null and b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/handlers/FiltersDialog$4.class differ diff --git a/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/handlers/FiltersDialog$5.class b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/handlers/FiltersDialog$5.class new file mode 100644 index 00000000..45d79939 Binary files /dev/null and b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/handlers/FiltersDialog$5.class differ diff --git a/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/handlers/FiltersDialog$6.class b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/handlers/FiltersDialog$6.class new file mode 100644 index 00000000..01deef14 Binary files /dev/null and b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/handlers/FiltersDialog$6.class differ diff --git a/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/handlers/FiltersDialog$7.class b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/handlers/FiltersDialog$7.class new file mode 100644 index 00000000..986a6e9b Binary files /dev/null and b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/handlers/FiltersDialog$7.class differ diff --git a/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/handlers/FiltersDialog.class b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/handlers/FiltersDialog.class new file mode 100644 index 00000000..9c2e5394 Binary files /dev/null and b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/handlers/FiltersDialog.class differ diff --git a/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/handlers/FiltersHandler.class b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/handlers/FiltersHandler.class new file mode 100644 index 00000000..65b5d8b9 Binary files /dev/null and b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/handlers/FiltersHandler.class differ diff --git a/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/handlers/FiltersHandler.java.orig b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/handlers/FiltersHandler.java.orig new file mode 100644 index 00000000..c15a04fe --- /dev/null +++ b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/handlers/FiltersHandler.java.orig @@ -0,0 +1,144 @@ +/******************************************************************************* + * Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This program and the + * accompanying materials are made available under the terms of the Open Source + * Initiative OSI - Open Software License v3.0 which accompanies this + * distribution, and is available at http://www.opensource.org/licenses/osl-3.0.php/ + ******************************************************************************/ + +package com.kdmanalytics.toif.report.internal.handlers; + +import java.util.ArrayList; +import java.util.List; + +import org.eclipse.core.commands.AbstractHandler; +import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.core.commands.IHandler; +import org.eclipse.jface.viewers.ViewerFilter; +import org.eclipse.swt.widgets.Shell; +import org.eclipse.ui.PlatformUI; +import org.eclipse.ui.handlers.HandlerUtil; + +import com.kdmanalytics.toif.report.internal.filters.CWETwoToolsFilter; +import com.kdmanalytics.toif.report.internal.filters.IsValidFilter; +import com.kdmanalytics.toif.report.internal.filters.NotValidFilter; +import com.kdmanalytics.toif.report.internal.filters.SFPTwoToolsFilter; +import com.kdmanalytics.toif.report.internal.filters.TermFilter; +import com.kdmanalytics.toif.report.internal.filters.TrustFilter; +import com.kdmanalytics.toif.report.internal.filters.TwoToolsFilter; +import com.kdmanalytics.toif.report.internal.views.ReportView; + +public class FiltersHandler extends AbstractHandler implements IHandler +{ + + @Override + public Object execute(ExecutionEvent event) throws ExecutionException + { + Shell parentShell = PlatformUI.getWorkbench().getDisplay().getActiveShell(); + final ReportView view = (ReportView) HandlerUtil.getActivePart(event); + + FiltersDialog dialog = new FiltersDialog(parentShell, view.getFilters()); + + dialog.open(); + + List filterList = new ArrayList(); + + // Hack to ensure that the term filter is applied in addition to the + // filters that are handled by the dialog + for (ViewerFilter filter : view.getFilters()) + { + if (filter instanceof TermFilter) + { + filterList.add(filter); + } + } + + handleTrustFilter(dialog, filterList); + + handleTwoToolFilter(dialog, filterList); + handleCWETwoToolFilter(dialog, filterList); + handleSFPTwoToolFilter(dialog, filterList); + + handleIsValidFilter(dialog, filterList); + handleNotValidFilter(dialog, filterList); + + view.setFilters(filterList.toArray(new ViewerFilter[filterList.size()])); +<<<<<<< HEAD + + //view.refresh(); +======= + view.refresh(); +>>>>>>> branch 'develop' of gitolite@fry:toif + return null; + } + + private void handleNotValidFilter(FiltersDialog dialog, List filterList) + { + NotValidFilter notValidFilter = dialog.getNotValidFilter(); + if (notValidFilter != null) + { + filterList.add(notValidFilter); + } + + } + + private void handleCWETwoToolFilter(FiltersDialog dialog, List filterList) + { + CWETwoToolsFilter cweTwoToolsFilter = dialog.getCWETwoToolsFilter(); + if (cweTwoToolsFilter != null) + { + filterList.add(cweTwoToolsFilter); + } + + } + + private void handleSFPTwoToolFilter(FiltersDialog dialog, List filterList) + { + SFPTwoToolsFilter sfpTwoToolsFilter = dialog.getSFPTwoToolsFilter(); + if (sfpTwoToolsFilter != null) + { + filterList.add(sfpTwoToolsFilter); + } + + } + + /** + * @param dialog + * @param filterList + */ + private void handleTrustFilter(FiltersDialog dialog, List filterList) + { + TrustFilter trustFilter = dialog.getTrustFilter(); + if (trustFilter != null) + { + trustFilter.setAmount(dialog.getTrustAmount()); + filterList.add(trustFilter); + } + } + + /** + * @param dialog + * @param filterList + */ + private void handleTwoToolFilter(FiltersDialog dialog, List filterList) + { + TwoToolsFilter twoToolsFilter = dialog.getTwoToolsFilter(); + if (twoToolsFilter != null) + { + filterList.add(twoToolsFilter); + } + } + + /** + * @param dialog + * @param filterList + */ + private void handleIsValidFilter(FiltersDialog dialog, List filterList) + { + IsValidFilter isValidFilter = dialog.getIsValidFilter(); + if (isValidFilter != null) + { + filterList.add(isValidFilter); + } + } +} diff --git a/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/handlers/MergeTSV$1.class b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/handlers/MergeTSV$1.class new file mode 100644 index 00000000..ea53fab0 Binary files /dev/null and b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/handlers/MergeTSV$1.class differ diff --git a/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/handlers/MergeTSV.class b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/handlers/MergeTSV.class new file mode 100644 index 00000000..90a54c08 Binary files /dev/null and b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/handlers/MergeTSV.class differ diff --git a/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/handlers/ModelUtil$1$1.class b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/handlers/ModelUtil$1$1.class new file mode 100644 index 00000000..3527c91b Binary files /dev/null and b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/handlers/ModelUtil$1$1.class differ diff --git a/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/handlers/ModelUtil$1.class b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/handlers/ModelUtil$1.class new file mode 100644 index 00000000..1b34135d Binary files /dev/null and b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/handlers/ModelUtil$1.class differ diff --git a/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/handlers/ModelUtil.class b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/handlers/ModelUtil.class new file mode 100644 index 00000000..f337c5d9 Binary files /dev/null and b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/handlers/ModelUtil.class differ diff --git a/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/handlers/MoreInformationHandler.class b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/handlers/MoreInformationHandler.class new file mode 100644 index 00000000..e529b578 Binary files /dev/null and b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/handlers/MoreInformationHandler.class differ diff --git a/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/handlers/NotWeaknessPropertyTest.class b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/handlers/NotWeaknessPropertyTest.class new file mode 100644 index 00000000..d110aadd Binary files /dev/null and b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/handlers/NotWeaknessPropertyTest.class differ diff --git a/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/handlers/SetTrustHandler$1.class b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/handlers/SetTrustHandler$1.class new file mode 100644 index 00000000..d015c1de Binary files /dev/null and b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/handlers/SetTrustHandler$1.class differ diff --git a/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/handlers/SetTrustHandler$2.class b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/handlers/SetTrustHandler$2.class new file mode 100644 index 00000000..2bd4803e Binary files /dev/null and b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/handlers/SetTrustHandler$2.class differ diff --git a/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/handlers/SetTrustHandler.class b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/handlers/SetTrustHandler.class new file mode 100644 index 00000000..b51a6e78 Binary files /dev/null and b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/handlers/SetTrustHandler.class differ diff --git a/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/handlers/TraceContributionHandler.class b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/handlers/TraceContributionHandler.class new file mode 100644 index 00000000..7ebe4e96 Binary files /dev/null and b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/handlers/TraceContributionHandler.class differ diff --git a/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/handlers/TrustSelectionListener.class b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/handlers/TrustSelectionListener.class new file mode 100644 index 00000000..414ac826 Binary files /dev/null and b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/handlers/TrustSelectionListener.class differ diff --git a/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/handlers/UncitedWeaknessHandler.class b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/handlers/UncitedWeaknessHandler.class new file mode 100644 index 00000000..fffdd62e Binary files /dev/null and b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/handlers/UncitedWeaknessHandler.class differ diff --git a/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/handlers/WeaknessHandler.class b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/handlers/WeaknessHandler.class new file mode 100644 index 00000000..fa90f8fc Binary files /dev/null and b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/handlers/WeaknessHandler.class differ diff --git a/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/handlers/ccrHandler$1CcrJob.class b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/handlers/ccrHandler$1CcrJob.class new file mode 100644 index 00000000..c0c76e2c Binary files /dev/null and b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/handlers/ccrHandler$1CcrJob.class differ diff --git a/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/handlers/ccrHandler.class b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/handlers/ccrHandler.class new file mode 100644 index 00000000..ec82ac60 Binary files /dev/null and b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/handlers/ccrHandler.class differ diff --git a/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/handlers/package-info.class b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/handlers/package-info.class new file mode 100644 index 00000000..0b0e9146 Binary files /dev/null and b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/handlers/package-info.class differ diff --git a/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/importWizard/RepositoryImportWizard.class b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/importWizard/RepositoryImportWizard.class new file mode 100644 index 00000000..146fbf22 Binary files /dev/null and b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/importWizard/RepositoryImportWizard.class differ diff --git a/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/importWizard/RepositoryImportWizardPage.class b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/importWizard/RepositoryImportWizardPage.class new file mode 100644 index 00000000..2d9d6694 Binary files /dev/null and b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/importWizard/RepositoryImportWizardPage.class differ diff --git a/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/importWizard/ToifReportImportJob.class b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/importWizard/ToifReportImportJob.class new file mode 100644 index 00000000..d925cfc2 Binary files /dev/null and b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/importWizard/ToifReportImportJob.class differ diff --git a/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/importWizard/ToifReportImportWizard.class b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/importWizard/ToifReportImportWizard.class new file mode 100644 index 00000000..9fb3a30a Binary files /dev/null and b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/importWizard/ToifReportImportWizard.class differ diff --git a/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/importWizard/ToifReportImportWizardPage.class b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/importWizard/ToifReportImportWizardPage.class new file mode 100644 index 00000000..e33255a0 Binary files /dev/null and b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/importWizard/ToifReportImportWizardPage.class differ diff --git a/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/importWizard/package-info.class b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/importWizard/package-info.class new file mode 100644 index 00000000..103d289f Binary files /dev/null and b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/importWizard/package-info.class differ diff --git a/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/items/CachedCodeLocation.class b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/items/CachedCodeLocation.class new file mode 100644 index 00000000..15263d06 Binary files /dev/null and b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/items/CachedCodeLocation.class differ diff --git a/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/items/FileGroup.class b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/items/FileGroup.class new file mode 100644 index 00000000..2d75d28f Binary files /dev/null and b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/items/FileGroup.class differ diff --git a/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/items/FindingEntry$Citing.class b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/items/FindingEntry$Citing.class new file mode 100644 index 00000000..29eefe6b Binary files /dev/null and b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/items/FindingEntry$Citing.class differ diff --git a/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/items/FindingEntry.class b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/items/FindingEntry.class new file mode 100644 index 00000000..6af975e2 Binary files /dev/null and b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/items/FindingEntry.class differ diff --git a/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/items/LocationGroup.class b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/items/LocationGroup.class new file mode 100644 index 00000000..e8a68cff Binary files /dev/null and b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/items/LocationGroup.class differ diff --git a/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/items/Project.class b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/items/Project.class new file mode 100644 index 00000000..ddfb34a7 Binary files /dev/null and b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/items/Project.class differ diff --git a/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/items/ProjectFactory.class b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/items/ProjectFactory.class new file mode 100644 index 00000000..1c23aad2 Binary files /dev/null and b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/items/ProjectFactory.class differ diff --git a/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/items/ReportItem.class b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/items/ReportItem.class new file mode 100644 index 00000000..e28d0758 Binary files /dev/null and b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/items/ReportItem.class differ diff --git a/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/items/ToifReportEntry.class b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/items/ToifReportEntry.class new file mode 100644 index 00000000..c1c1144c Binary files /dev/null and b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/items/ToifReportEntry.class differ diff --git a/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/items/ToolGroup.class b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/items/ToolGroup.class new file mode 100644 index 00000000..8ad1d06a Binary files /dev/null and b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/items/ToolGroup.class differ diff --git a/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/items/Trace.class b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/items/Trace.class new file mode 100644 index 00000000..3a76f88c Binary files /dev/null and b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/items/Trace.class differ diff --git a/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/items/package-info.class b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/items/package-info.class new file mode 100644 index 00000000..7cf1dc72 Binary files /dev/null and b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/items/package-info.class differ diff --git a/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/listeners/ReportDoubleClickListener.class b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/listeners/ReportDoubleClickListener.class new file mode 100644 index 00000000..67c8f1e9 Binary files /dev/null and b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/listeners/ReportDoubleClickListener.class differ diff --git a/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/listeners/ResourceMatch.class b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/listeners/ResourceMatch.class new file mode 100644 index 00000000..078c1382 Binary files /dev/null and b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/listeners/ResourceMatch.class differ diff --git a/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/listeners/package-info.class b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/listeners/package-info.class new file mode 100644 index 00000000..271cbfea Binary files /dev/null and b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/listeners/package-info.class differ diff --git a/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/package-info.class b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/package-info.class new file mode 100644 index 00000000..f37e2967 Binary files /dev/null and b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/package-info.class differ diff --git a/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/providers/ReportContentProvider.class b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/providers/ReportContentProvider.class new file mode 100644 index 00000000..6940ab07 Binary files /dev/null and b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/providers/ReportContentProvider.class differ diff --git a/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/providers/ReportLabelProvider.class b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/providers/ReportLabelProvider.class new file mode 100644 index 00000000..631034d8 Binary files /dev/null and b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/providers/ReportLabelProvider.class differ diff --git a/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/providers/ReportStyledCellLabelProvider.class b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/providers/ReportStyledCellLabelProvider.class new file mode 100644 index 00000000..dd0c92b3 Binary files /dev/null and b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/providers/ReportStyledCellLabelProvider.class differ diff --git a/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/providers/TOIFImportTreeContentProvider.class b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/providers/TOIFImportTreeContentProvider.class new file mode 100644 index 00000000..43c87d96 Binary files /dev/null and b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/providers/TOIFImportTreeContentProvider.class differ diff --git a/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/providers/package-info.class b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/providers/package-info.class new file mode 100644 index 00000000..47c51249 Binary files /dev/null and b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/providers/package-info.class differ diff --git a/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/util/MemberUtil.class b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/util/MemberUtil.class new file mode 100644 index 00000000..d6ee9865 Binary files /dev/null and b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/util/MemberUtil.class differ diff --git a/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/views/ReportView$1.class b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/views/ReportView$1.class new file mode 100644 index 00000000..d161ac3f Binary files /dev/null and b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/views/ReportView$1.class differ diff --git a/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/views/ReportView$2.class b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/views/ReportView$2.class new file mode 100644 index 00000000..c9150d34 Binary files /dev/null and b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/views/ReportView$2.class differ diff --git a/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/views/ReportView$3.class b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/views/ReportView$3.class new file mode 100644 index 00000000..1fedce19 Binary files /dev/null and b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/views/ReportView$3.class differ diff --git a/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/views/ReportView$4.class b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/views/ReportView$4.class new file mode 100644 index 00000000..ca258305 Binary files /dev/null and b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/views/ReportView$4.class differ diff --git a/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/views/ReportView$5.class b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/views/ReportView$5.class new file mode 100644 index 00000000..1e5813a3 Binary files /dev/null and b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/views/ReportView$5.class differ diff --git a/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/views/ReportView$6.class b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/views/ReportView$6.class new file mode 100644 index 00000000..c644d91d Binary files /dev/null and b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/views/ReportView$6.class differ diff --git a/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/views/ReportView$Mode.class b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/views/ReportView$Mode.class new file mode 100644 index 00000000..c1b090c8 Binary files /dev/null and b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/views/ReportView$Mode.class differ diff --git a/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/views/ReportView.class b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/views/ReportView.class new file mode 100644 index 00000000..76fcaf36 Binary files /dev/null and b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/views/ReportView.class differ diff --git a/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/views/ReportViewerComparator.class b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/views/ReportViewerComparator.class new file mode 100644 index 00000000..6984b629 Binary files /dev/null and b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/views/ReportViewerComparator.class differ diff --git a/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/views/package-info.class b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/views/package-info.class new file mode 100644 index 00000000..6fc04295 Binary files /dev/null and b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/internal/views/package-info.class differ diff --git a/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/items/IFileGroup.class b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/items/IFileGroup.class new file mode 100644 index 00000000..4fa8905b Binary files /dev/null and b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/items/IFileGroup.class differ diff --git a/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/items/IFindingEntry.class b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/items/IFindingEntry.class new file mode 100644 index 00000000..e1322483 Binary files /dev/null and b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/items/IFindingEntry.class differ diff --git a/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/items/IReportItem.class b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/items/IReportItem.class new file mode 100644 index 00000000..1b495a57 Binary files /dev/null and b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/items/IReportItem.class differ diff --git a/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/items/IToifProject.class b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/items/IToifProject.class new file mode 100644 index 00000000..72958125 Binary files /dev/null and b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/items/IToifProject.class differ diff --git a/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/items/IToifReportEntry.class b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/items/IToifReportEntry.class new file mode 100644 index 00000000..a6c8201f Binary files /dev/null and b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/items/IToifReportEntry.class differ diff --git a/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/util/IRepositoryMaker.class b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/util/IRepositoryMaker.class new file mode 100644 index 00000000..2b6b8c3e Binary files /dev/null and b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/util/IRepositoryMaker.class differ diff --git a/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/util/package-info.class b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/util/package-info.class new file mode 100644 index 00000000..8a9f0132 Binary files /dev/null and b/com.kdmanalytics.toif.report/bin/com/kdmanalytics/toif/report/util/package-info.class differ diff --git a/com.kdmanalytics.toif.report/bin/icons/alphaSort.gif b/com.kdmanalytics.toif.report/bin/icons/alphaSort.gif new file mode 100644 index 00000000..6311cc00 Binary files /dev/null and b/com.kdmanalytics.toif.report/bin/icons/alphaSort.gif differ diff --git a/com.kdmanalytics.toif.report/bin/icons/bug.png b/com.kdmanalytics.toif.report/bin/icons/bug.png new file mode 100644 index 00000000..2d5fb90e Binary files /dev/null and b/com.kdmanalytics.toif.report/bin/icons/bug.png differ diff --git a/com.kdmanalytics.toif.report/bin/icons/bullet_white.png b/com.kdmanalytics.toif.report/bin/icons/bullet_white.png new file mode 100644 index 00000000..a9af8d44 Binary files /dev/null and b/com.kdmanalytics.toif.report/bin/icons/bullet_white.png differ diff --git a/com.kdmanalytics.toif.report/bin/icons/collapse.gif b/com.kdmanalytics.toif.report/bin/icons/collapse.gif new file mode 100644 index 00000000..a2d80a90 Binary files /dev/null and b/com.kdmanalytics.toif.report/bin/icons/collapse.gif differ diff --git a/com.kdmanalytics.toif.report/bin/icons/cross.png b/com.kdmanalytics.toif.report/bin/icons/cross.png new file mode 100644 index 00000000..1514d51a Binary files /dev/null and b/com.kdmanalytics.toif.report/bin/icons/cross.png differ diff --git a/com.kdmanalytics.toif.report/bin/icons/expandall.gif b/com.kdmanalytics.toif.report/bin/icons/expandall.gif new file mode 100644 index 00000000..c4a67bb2 Binary files /dev/null and b/com.kdmanalytics.toif.report/bin/icons/expandall.gif differ diff --git a/com.kdmanalytics.toif.report/bin/icons/export.gif b/com.kdmanalytics.toif.report/bin/icons/export.gif new file mode 100644 index 00000000..79f23532 Binary files /dev/null and b/com.kdmanalytics.toif.report/bin/icons/export.gif differ diff --git a/com.kdmanalytics.toif.report/bin/icons/filter.gif b/com.kdmanalytics.toif.report/bin/icons/filter.gif new file mode 100644 index 00000000..6fe6f0e1 Binary files /dev/null and b/com.kdmanalytics.toif.report/bin/icons/filter.gif differ diff --git a/com.kdmanalytics.toif.report/bin/icons/filter.png b/com.kdmanalytics.toif.report/bin/icons/filter.png new file mode 100644 index 00000000..4312806d Binary files /dev/null and b/com.kdmanalytics.toif.report/bin/icons/filter.png differ diff --git a/com.kdmanalytics.toif.report/bin/icons/go.gif b/com.kdmanalytics.toif.report/bin/icons/go.gif new file mode 100644 index 00000000..d6b3bdcc Binary files /dev/null and b/com.kdmanalytics.toif.report/bin/icons/go.gif differ diff --git a/com.kdmanalytics.toif.report/bin/icons/merge.png b/com.kdmanalytics.toif.report/bin/icons/merge.png new file mode 100644 index 00000000..53a5b858 Binary files /dev/null and b/com.kdmanalytics.toif.report/bin/icons/merge.png differ diff --git a/com.kdmanalytics.toif.report/bin/icons/numberSort.png b/com.kdmanalytics.toif.report/bin/icons/numberSort.png new file mode 100644 index 00000000..10db385d Binary files /dev/null and b/com.kdmanalytics.toif.report/bin/icons/numberSort.png differ diff --git a/com.kdmanalytics.toif.report/bin/icons/page.png b/com.kdmanalytics.toif.report/bin/icons/page.png new file mode 100644 index 00000000..03ddd799 Binary files /dev/null and b/com.kdmanalytics.toif.report/bin/icons/page.png differ diff --git a/com.kdmanalytics.toif.report/bin/icons/page_white_stack.png b/com.kdmanalytics.toif.report/bin/icons/page_white_stack.png new file mode 100644 index 00000000..44084add Binary files /dev/null and b/com.kdmanalytics.toif.report/bin/icons/page_white_stack.png differ diff --git a/com.kdmanalytics.toif.report/bin/icons/priority.gif b/com.kdmanalytics.toif.report/bin/icons/priority.gif new file mode 100644 index 00000000..f99bdc35 Binary files /dev/null and b/com.kdmanalytics.toif.report/bin/icons/priority.gif differ diff --git a/com.kdmanalytics.toif.report/bin/icons/question.png b/com.kdmanalytics.toif.report/bin/icons/question.png new file mode 100644 index 00000000..4db0f088 Binary files /dev/null and b/com.kdmanalytics.toif.report/bin/icons/question.png differ diff --git a/com.kdmanalytics.toif.report/bin/icons/rep.gif b/com.kdmanalytics.toif.report/bin/icons/rep.gif new file mode 100644 index 00000000..0470e158 Binary files /dev/null and b/com.kdmanalytics.toif.report/bin/icons/rep.gif differ diff --git a/com.kdmanalytics.toif.report/bin/icons/sort.gif b/com.kdmanalytics.toif.report/bin/icons/sort.gif new file mode 100644 index 00000000..166eaba9 Binary files /dev/null and b/com.kdmanalytics.toif.report/bin/icons/sort.gif differ diff --git a/com.kdmanalytics.toif.report/bin/icons/tick.png b/com.kdmanalytics.toif.report/bin/icons/tick.png new file mode 100644 index 00000000..a9925a06 Binary files /dev/null and b/com.kdmanalytics.toif.report/bin/icons/tick.png differ diff --git a/com.kdmanalytics.toif.report/bin/icons/trace.png b/com.kdmanalytics.toif.report/bin/icons/trace.png new file mode 100644 index 00000000..1a3f6a24 Binary files /dev/null and b/com.kdmanalytics.toif.report/bin/icons/trace.png differ diff --git a/com.kdmanalytics.toif.report/bin/icons/trust.png b/com.kdmanalytics.toif.report/bin/icons/trust.png new file mode 100644 index 00000000..8555cf3a Binary files /dev/null and b/com.kdmanalytics.toif.report/bin/icons/trust.png differ diff --git a/com.kdmanalytics.toif.report/bin/icons/up.png b/com.kdmanalytics.toif.report/bin/icons/up.png new file mode 100644 index 00000000..57fe9d47 Binary files /dev/null and b/com.kdmanalytics.toif.report/bin/icons/up.png differ diff --git a/com.kdmanalytics.toif.report/bin/icons/wrench.png b/com.kdmanalytics.toif.report/bin/icons/wrench.png new file mode 100644 index 00000000..5c8213fe Binary files /dev/null and b/com.kdmanalytics.toif.report/bin/icons/wrench.png differ diff --git a/com.kdmanalytics.toif.report/bin/icons/xml.png b/com.kdmanalytics.toif.report/bin/icons/xml.png new file mode 100644 index 00000000..8b36fa60 Binary files /dev/null and b/com.kdmanalytics.toif.report/bin/icons/xml.png differ diff --git a/com.kdmanalytics.toif.report/build.properties b/com.kdmanalytics.toif.report/build.properties new file mode 100644 index 00000000..e9863e28 --- /dev/null +++ b/com.kdmanalytics.toif.report/build.properties @@ -0,0 +1,5 @@ +source.. = src/ +output.. = bin/ +bin.includes = META-INF/,\ + .,\ + plugin.xml diff --git a/com.kdmanalytics.toif.report/plugin.xml b/com.kdmanalytics.toif.report/plugin.xml new file mode 100644 index 00000000..2c340ab0 --- /dev/null +++ b/com.kdmanalytics.toif.report/plugin.xml @@ -0,0 +1,349 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Import a file from the local file system into the workspace. + + + + + Import a repository from the local workspace. + + + + + diff --git a/com.kdmanalytics.toif.report/pom.xml b/com.kdmanalytics.toif.report/pom.xml new file mode 100644 index 00000000..1a28f459 --- /dev/null +++ b/com.kdmanalytics.toif.report/pom.xml @@ -0,0 +1,21 @@ + + + + 4.0.0 + + + com.kdmanalytics.toif + plugins + 1.16.0-SNAPSHOT + + + com.kdmanalytics.kdm.wb.plugins + com.kdmanalytics.toif.report + + + eclipse-plugin + + toif report view + diff --git a/com.kdmanalytics.toif.report/pom.xml~ b/com.kdmanalytics.toif.report/pom.xml~ new file mode 100644 index 00000000..fe9c1320 --- /dev/null +++ b/com.kdmanalytics.toif.report/pom.xml~ @@ -0,0 +1,21 @@ + + + + 4.0.0 + + + com.kdmanalytics.toif + plugins + 1.0.0-SNAPSHOT + + + com.kdmanalytics.kdm.wb.plugins + com.kdmanalytics.toif.report + + + eclipse-plugin + + toif report view + diff --git a/com.kdmanalytics.toif.report/schema/com.kdmanalytics.toif.report.repositoryMaker.extensionpoint.exsd b/com.kdmanalytics.toif.report/schema/com.kdmanalytics.toif.report.repositoryMaker.extensionpoint.exsd new file mode 100644 index 00000000..cdb1d22c --- /dev/null +++ b/com.kdmanalytics.toif.report/schema/com.kdmanalytics.toif.report.repositoryMaker.extensionpoint.exsd @@ -0,0 +1,102 @@ + + + + + + + + + [Enter description of this extension point.] + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + [Enter the first release in which this extension point appears.] + + + + + + + + + [Enter extension point usage example here.] + + + + + + + + + [Enter API information here.] + + + + + + + + + [Enter information about supplied implementation of this extension point.] + + + + + diff --git a/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/Activator.java b/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/Activator.java new file mode 100644 index 00000000..9e0223ba --- /dev/null +++ b/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/Activator.java @@ -0,0 +1,86 @@ +/******************************************************************************* + * Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This program and the + * accompanying materials are made available under the terms of the Open Source + * Initiative OSI - Open Software License v3.0 which accompanies this + * distribution, and is available at http://www.opensource.org/licenses/osl-3.0.php/ + ******************************************************************************/ + +package com.kdmanalytics.toif.report.internal; + +import org.eclipse.core.runtime.FileLocator; +import org.eclipse.core.runtime.Path; +import org.eclipse.core.runtime.Platform; +import org.eclipse.jface.resource.ImageDescriptor; +import org.eclipse.jface.resource.ImageRegistry; +import org.eclipse.ui.plugin.AbstractUIPlugin; +import org.osgi.framework.Bundle; +import org.osgi.framework.BundleContext; + +/** + * The activator class controls the plug-in life cycle + */ +public class Activator extends AbstractUIPlugin +{ + + // The plug-in ID + public static final String PLUGIN_ID = "com.kdmanalytics.toif.report"; //$NON-NLS-1$ + + public static final String MY_IMAGE_ID = "image.myimage"; + + // The shared instance + private static Activator plugin; + + /** + * The constructor + */ + public Activator() + { + } + + /* + * (non-Javadoc) + * + * @see + * org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext + * ) + */ + public void start(BundleContext context) throws Exception + { + super.start(context); + plugin = this; + } + + /* + * (non-Javadoc) + * + * @see + * org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext + * ) + */ + public void stop(BundleContext context) throws Exception + { + plugin = null; + super.stop(context); + } + + /** + * Returns the shared instance + * + * @return the shared instance + */ + public static Activator getDefault() + { + return plugin; + } + + @Override + protected void initializeImageRegistry(ImageRegistry registry) + { + super.initializeImageRegistry(registry); + Bundle bundle = Platform.getBundle(PLUGIN_ID); + + ImageDescriptor myImage = ImageDescriptor.createFromURL(FileLocator.find(bundle, new Path("icons/go.gif"), null)); + registry.put(MY_IMAGE_ID, myImage); + } + +} diff --git a/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/contributionItems/TraceContributionItem.java b/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/contributionItems/TraceContributionItem.java new file mode 100644 index 00000000..5158c5f0 --- /dev/null +++ b/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/contributionItems/TraceContributionItem.java @@ -0,0 +1,116 @@ +/******************************************************************************* + * Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This + * program and the // accompanying materials are made available under the terms + * of the Open Source // Initiative OSI - Open Software License v3.0 which + * accompanies this // distribution, and is available at + * http://www.opensource.org/licenses/osl-3.0.php/ + ******************************************************************************/ + +package com.kdmanalytics.toif.report.internal.contributionItems; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +import org.eclipse.jface.action.ContributionItem; +import org.eclipse.jface.action.IContributionItem; +import org.eclipse.jface.viewers.StructuredSelection; +import org.eclipse.ui.PlatformUI; +import org.eclipse.ui.actions.CompoundContributionItem; +import org.eclipse.ui.menus.CommandContributionItem; +import org.eclipse.ui.menus.CommandContributionItemParameter; + +import com.google.common.collect.Maps; +import com.kdmanalytics.toif.report.internal.items.Trace; +import com.kdmanalytics.toif.report.items.IFindingEntry; +import com.kdmanalytics.toif.report.items.IToifReportEntry; + +/** + * The Class TraceContributionItem. + * + * @author Adam Nunn + */ +public class TraceContributionItem extends CompoundContributionItem +{ + + /** The Constant LINE_NUMBER_KEY. */ + private static final String LINE_NUMBER_KEY = "com.kdmanalytics.toif.report.lineNumber"; + + /** An Empty array object to return when where are no ContributionItems */ + private static ContributionItem[] EMPTY = new ContributionItem[] {}; + + /** + * Id of the command these contribution items should represent. + */ + private static final String COMMAND_ID = "com.kdmanalytics.toif.report.traceContribution"; + + /** + * The id of the dynamic menu contribution. + */ + private static final String CONTRIBUTION_ID = "com.kdmanalytics.toif.report.traceContribution.options"; + + /** The Constant ID. */ + public static final String ID = "com.kdmanalytics.toif.report.contributionItems"; + + /** + * Instantiates a new trace contribution item. + */ + public TraceContributionItem() + { + } + + /** + * generate contribution items for the selection. + */ + @Override + protected IContributionItem[] getContributionItems() + { + Object selection = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getSelection(); + + if (!(selection instanceof StructuredSelection)) + { + return EMPTY; + } + + StructuredSelection ss = (StructuredSelection) selection; + + if (ss.isEmpty()) + { + return EMPTY; + } + + Object element = ss.getFirstElement(); + + if (!(element instanceof IToifReportEntry)) + { + return EMPTY; + } + + IToifReportEntry entry = (IToifReportEntry) element; + + final IFindingEntry fEntry = entry.getFindingEntry(); + + List traces = fEntry.getTraces(); + + List list = new ArrayList(); + + //for each of the traces for this finding entry. make contribution items for it. + for (Trace trace : traces) + { + CommandContributionItemParameter param = new CommandContributionItemParameter(PlatformUI.getWorkbench().getActiveWorkbenchWindow(), + CONTRIBUTION_ID, COMMAND_ID, CommandContributionItem.STYLE_PUSH); + + final String lineNumber = trace.getLineNumber(); + param.label = lineNumber; + Map parameters = Maps.newHashMap(); + parameters.put(LINE_NUMBER_KEY, lineNumber); + + param.parameters = parameters; + + list.add(new CommandContributionItem(param)); + } + + return list.toArray(new IContributionItem[] {}); + } + +} diff --git a/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/contributionItems/package-info.java b/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/contributionItems/package-info.java new file mode 100644 index 00000000..4d9b7f6b --- /dev/null +++ b/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/contributionItems/package-info.java @@ -0,0 +1,10 @@ +/******************************************************************************* + * Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This + * program and the // accompanying materials are made available under the terms + * of the Open Source // Initiative OSI - Open Software License v3.0 which + * accompanies this // distribution, and is available at + * http://www.opensource.org/licenses/osl-3.0.php/ + ******************************************************************************/ + +package com.kdmanalytics.toif.report.internal.contributionItems; + diff --git a/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/filters/AbstractValidFilter.java b/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/filters/AbstractValidFilter.java new file mode 100644 index 00000000..90e5f64e --- /dev/null +++ b/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/filters/AbstractValidFilter.java @@ -0,0 +1,41 @@ +/******************************************************************************* + * Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This + * program and the // accompanying materials are made available under the terms + * of the Open Source // Initiative OSI - Open Software License v3.0 which + * accompanies this // distribution, and is available at + * http://www.opensource.org/licenses/osl-3.0.php/ + ******************************************************************************/ + +package com.kdmanalytics.toif.report.internal.filters; + +import org.eclipse.jface.viewers.ViewerFilter; + +import com.kdmanalytics.toif.report.internal.items.FindingEntry.Citing; +import com.kdmanalytics.toif.report.items.IFindingEntry; +import com.kdmanalytics.toif.report.items.IToifReportEntry; + +/** + * Base class for the family of ValidFilters + * + * @author Kyle Girard + * + */ +public abstract class AbstractValidFilter extends ViewerFilter +{ + + /** + * Returns true if the finding entry of the given report entry is not OK + * + * @param element + * a toif report entry + * + * @return true if the finding entry contained within the given report entry + * isOK() returns false; + */ + protected boolean valid(IToifReportEntry element) + { + IFindingEntry entry = element.getFindingEntry(); + return (Citing.TRUE == entry.isOk()); + } + +} diff --git a/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/filters/CWETwoToolsFilter.java b/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/filters/CWETwoToolsFilter.java new file mode 100644 index 00000000..14430ae0 --- /dev/null +++ b/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/filters/CWETwoToolsFilter.java @@ -0,0 +1,157 @@ +/******************************************************************************* + * Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This program and + * the accompanying materials are made available under the terms of the Open + * Source Initiative OSI - Open Software License v3.0 which accompanies this + * distribution, and is available at + * http://www.opensource.org/licenses/osl-3.0.php/ + ******************************************************************************/ + +package com.kdmanalytics.toif.report.internal.filters; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; + +import org.eclipse.jface.viewers.Viewer; +import org.eclipse.jface.viewers.ViewerFilter; + +import com.kdmanalytics.toif.report.internal.items.FindingEntry; +import com.kdmanalytics.toif.report.internal.items.LocationGroup; +import com.kdmanalytics.toif.report.internal.items.ReportItem; +import com.kdmanalytics.toif.report.internal.items.ToolGroup; +import com.kdmanalytics.toif.report.items.IFindingEntry; +import com.kdmanalytics.toif.report.items.IReportItem; +import com.kdmanalytics.toif.report.items.IToifReportEntry; + +/** + * ViewerFilter that determines if there are ToifReportEntry's with two CWE's at + * the same location + * + * @author Adam Nunn + * @author Kyle Girard + * + */ +public class CWETwoToolsFilter extends ViewerFilter +{ + + /* + * (non-Javadoc) + * + * @see + * org.eclipse.jface.viewers.ViewerFilter#select(org.eclipse.jface.viewers + * .Viewer, java.lang.Object, java.lang.Object) + */ + @Override + public boolean select(Viewer viewer, Object parentElement, Object element) + { + if (element instanceof IToifReportEntry) + { + IToifReportEntry iToifReportEntry = (IToifReportEntry) element; + LocationGroup lg = iToifReportEntry.getLocationGroup(); + ToolGroup tg = iToifReportEntry.getToolGroup(); + IFindingEntry fe = iToifReportEntry.getFindingEntry(); + return doesLocationContainTwoSameCWE(lg, tg.toString(), fe.getCwe()); + } + return false; + } + + /** + * Returns true if the given location has at least two CWE's + * + * @param location + * the LocationGroup to test for CWE's + * @param toolNameToExclude + * the tool name to exclude + * + * @return true if we find two CWE's that are the same + */ + private boolean doesLocationContainTwoSameCWE(LocationGroup location, String toolNameToExclude, String cweToExclude) + { + + // if there are two tools contained under one location show it. + final List tools = location.getChildren(); + + final int size = tools.size(); + + // if the location group does not contain at least two tools, return + // false. + if (!(size >= 2)) + { + return false; + } + + HashMap> map = new HashMap>(); + + // for each of the tools in the location group, make a map of tool name + // and the cwes in it. + for (IReportItem tool : tools) + { + List entries = tool.getFindingEntries(); + List cwes = new ArrayList(); + + for (IFindingEntry entry : entries) + { + cwes.add(entry.getCwe()); + } + + map.put(tool.toString(), cwes); + } + + // for each of the tools in the map, we are going to compare its cwes to + // the other cwe that the other tools contain. We'll do this by removing + // a tool from a copy of the map, and comparing the results to all the + // other tools in the map. + for (String toolName : map.keySet()) + { + + // get the new copy of the map + HashMap> copyOfMap = new HashMap>(map); + + List cweList = null; + + if (toolNameToExclude != null) + { + // get the sfps for this tool. + cweList = copyOfMap.remove(toolNameToExclude); + } + else + { + + // get the sfps for this tool. + cweList = copyOfMap.remove(toolName); + } + // for each of the remaining tools, compare these sfps to the tool + // that we removed. if there is a match, then anything at this + // location or above isallowed to stay. + for (String toolNameCopy : copyOfMap.keySet()) + { + List retained = null; + + if ((cweToExclude != null)) + { + // the list of sfps from the original tool. + retained = new ArrayList(); + retained.add(cweToExclude); + } + else + { + // the list of sfps from the original tool. + retained = new ArrayList(cweList); + } + + // retain only common sfps + retained.retainAll(map.get(toolNameCopy)); + + // if the retained list is not empty then there are common sfps + // between tools, return true. + if (!retained.isEmpty()) + { + return true; + } + } + } + + return false; + + } +} diff --git a/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/filters/IsValidFilter.java b/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/filters/IsValidFilter.java new file mode 100644 index 00000000..8de99d74 --- /dev/null +++ b/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/filters/IsValidFilter.java @@ -0,0 +1,43 @@ +/******************************************************************************* + * Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This program and + * the accompanying materials are made available under the terms of the Open + * Source Initiative OSI - Open Software License v3.0 which accompanies this + * distribution, and is available at + * http://www.opensource.org/licenses/osl-3.0.php/ + ******************************************************************************/ + +package com.kdmanalytics.toif.report.internal.filters; + +import org.eclipse.jface.viewers.Viewer; + +import com.kdmanalytics.toif.report.items.IToifReportEntry; + +/** + * ViewerFilter that returns true for ToifReportEntry who's finding entries are + * found to be valid. + * + * @author Adam Nunn + * @author Kyle Girard + * + */ +public class IsValidFilter extends AbstractValidFilter +{ + + /* + * (non-Javadoc) + * + * @see + * org.eclipse.jface.viewers.ViewerFilter#select(org.eclipse.jface.viewers + * .Viewer, java.lang.Object, java.lang.Object) + */ + @Override + public boolean select(Viewer viewer, Object parentElement, Object element) + { + if (element instanceof IToifReportEntry) + { + return valid(((IToifReportEntry) element)); + } + return false; + } + +} diff --git a/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/filters/NotValidFilter.java b/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/filters/NotValidFilter.java new file mode 100644 index 00000000..c8f8e296 --- /dev/null +++ b/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/filters/NotValidFilter.java @@ -0,0 +1,43 @@ +/******************************************************************************* + * Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This program and + * the accompanying materials are made available under the terms of the Open + * Source Initiative OSI - Open Software License v3.0 which accompanies this + * distribution, and is available at + * http://www.opensource.org/licenses/osl-3.0.php/ + ******************************************************************************/ + +package com.kdmanalytics.toif.report.internal.filters; + +import org.eclipse.jface.viewers.Viewer; + +import com.kdmanalytics.toif.report.items.IToifReportEntry; + +/** + * ViewerFilter that returns true for ToifReportEntry who's finding entries are + * found to be not valid. + * + * @author Adam Nunn + * @author Kyle Girard + * + */ +public class NotValidFilter extends AbstractValidFilter +{ + + /* + * (non-Javadoc) + * + * @see + * org.eclipse.jface.viewers.ViewerFilter#select(org.eclipse.jface.viewers + * .Viewer, java.lang.Object, java.lang.Object) + */ + @Override + public boolean select(Viewer viewer, Object parentElement, Object element) + { + if (element instanceof IToifReportEntry) + { + return !valid(((IToifReportEntry) element)); + } + return false; + } + +} diff --git a/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/filters/SFPTwoToolsFilter.java b/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/filters/SFPTwoToolsFilter.java new file mode 100644 index 00000000..50f30095 --- /dev/null +++ b/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/filters/SFPTwoToolsFilter.java @@ -0,0 +1,156 @@ +/******************************************************************************* + * Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This program and + * the accompanying materials are made available under the terms of the Open + * Source Initiative OSI - Open Software License v3.0 which accompanies this + * distribution, and is available at + * http://www.opensource.org/licenses/osl-3.0.php/ + ******************************************************************************/ + +package com.kdmanalytics.toif.report.internal.filters; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; + +import org.eclipse.jface.viewers.Viewer; +import org.eclipse.jface.viewers.ViewerFilter; + +import com.kdmanalytics.toif.report.internal.items.FindingEntry; +import com.kdmanalytics.toif.report.internal.items.LocationGroup; +import com.kdmanalytics.toif.report.internal.items.ReportItem; +import com.kdmanalytics.toif.report.internal.items.ToolGroup; +import com.kdmanalytics.toif.report.items.IFindingEntry; +import com.kdmanalytics.toif.report.items.IReportItem; +import com.kdmanalytics.toif.report.items.IToifReportEntry; + +/** + * Filter that shows only findings with the same location and the same sfp + * + * @author Adam Nunn + * @author Kyle Girard + * + */ +public class SFPTwoToolsFilter extends ViewerFilter +{ + + /* + * (non-Javadoc) + * + * @see + * org.eclipse.jface.viewers.ViewerFilter#select(org.eclipse.jface.viewers + * .Viewer, java.lang.Object, java.lang.Object) + */ + @Override + public boolean select(Viewer viewer, Object parentElement, Object element) + { + if (element instanceof IToifReportEntry) + { + IToifReportEntry iToifReportEntry = (IToifReportEntry) element; + LocationGroup lg = iToifReportEntry.getLocationGroup(); + ToolGroup tg = iToifReportEntry.getToolGroup(); + IFindingEntry fe = iToifReportEntry.getFindingEntry(); + return doesLocationContainTwoSameSFP(lg, tg.toString(), fe.getSfp()); + } + return false; + } + + /** + * Returns true if the given location group contains the same two SFP's + * + * @param location + * the location group + * @param toolNameToExclude + * the tool name to exclude from the check + * + * @return true if there is two SFP's at the same location + */ + private boolean doesLocationContainTwoSameSFP(LocationGroup location, String toolNameToExclude, String sfpToExclude) + { + + // if there are two tools contained under one location show it. + final List tools = location.getChildren(); + + final int size = tools.size(); + + // if the location group does not contain at least two tools, return + // false. + if (!(size >= 2)) + { + return false; + } + + HashMap> map = new HashMap>(); + + // for each of the tools in the location group, make a map of tool name + // and the sfps in it. + for (IReportItem tool : tools) + { + List entries = tool.getFindingEntries(); + List sfps = new ArrayList(); + + for (IFindingEntry entry : entries) + { + sfps.add(entry.getSfp()); + } + + map.put(tool.toString(), sfps); + } + + // for each of the tools in the map, we are going to compare its sfps to + // the other sfp that the other tools contain. We'll do this by removing + // a tool from a copy of the map, and comparing the results to all the + // other tools in the map. + for (String toolName : map.keySet()) + { + + // get the new copy of the map + HashMap> copyOfMap = new HashMap>(map); + + List sfpList = null; + + if (toolNameToExclude != null) + { + // get the sfps for this tool. + sfpList = copyOfMap.remove(toolNameToExclude); + } + else + { + + // get the sfps for this tool. + sfpList = copyOfMap.remove(toolName); + } + // for each of the remaining tools, compare these sfps to the tool + // that we removed. if there is a match, then anything at this + // location or above isallowed to stay. + for (String toolNameCopy : copyOfMap.keySet()) + { + List retained = null; + + if ((sfpToExclude != null)) + { + // the list of sfps from the original tool. + retained = new ArrayList(); + retained.add(sfpToExclude); + } + else + { + // the list of sfps from the original tool. + retained = new ArrayList(sfpList); + } + + // retain only common sfps + retained.retainAll(map.get(toolNameCopy)); + + // if the retained list is not empty then there are common sfps + // between tools, return true. + if (!retained.isEmpty()) + { + return true; + } + } + } + + return false; + + } +} diff --git a/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/filters/TermFilter.java b/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/filters/TermFilter.java new file mode 100644 index 00000000..8baa89cf --- /dev/null +++ b/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/filters/TermFilter.java @@ -0,0 +1,91 @@ +/******************************************************************************* + * Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This program and + * the accompanying materials are made available under the terms of the Open + * Source Initiative OSI - Open Software License v3.0 which accompanies this + * distribution, and is available at + * http://www.opensource.org/licenses/osl-3.0.php/ + ******************************************************************************/ + +package com.kdmanalytics.toif.report.internal.filters; + +import org.eclipse.jface.viewers.Viewer; +import org.eclipse.jface.viewers.ViewerFilter; + +import com.kdmanalytics.toif.report.items.IFindingEntry; +import com.kdmanalytics.toif.report.items.IToifReportEntry; + +/** + * Filter ToifReportEntry based on string matches from the FindingEntry + * + * @author Adam Nunn + * @author Kyle Girard + * + */ +public class TermFilter extends ViewerFilter +{ + + /** The terms. */ + private final String[] terms; + private boolean result; + + /** + * Instantiates a new term filter. + * + * @param terms + * the terms + */ + public TermFilter(String[] terms) + { + this.terms = terms; + } + + /* + * (non-Javadoc) + * + * @see + * org.eclipse.jface.viewers.ViewerFilter#select(org.eclipse.jface.viewers + * .Viewer, java.lang.Object, java.lang.Object) + */ + @Override + public boolean select(Viewer viewer, Object parentElement, Object element) + { + if (element instanceof IToifReportEntry) + { + IToifReportEntry iToifReportEntry = (IToifReportEntry) element; + IFindingEntry findingEntry = iToifReportEntry.getFindingEntry(); + String text = findingEntry.getSearchableText().toLowerCase(); + + String[] textarray = text.split("\\|"); + + String[] terms2 = terms.clone(); + + if (terms2.length > 0) + { + String t = terms2[0].trim(); + if (t.startsWith("NOT")) + { + result = false; + terms2[0] = t.replace("NOT", ""); + } + else + { + result = true; + } + } + + for (String term : terms2) + { + for (String string : textarray) + { + if ((string.toLowerCase().trim()).contains(term.toLowerCase().trim())) + { + return result; + } + } + + } + } + return !result; + } + +} diff --git a/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/filters/TrustFilter.java b/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/filters/TrustFilter.java new file mode 100644 index 00000000..d7b42409 --- /dev/null +++ b/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/filters/TrustFilter.java @@ -0,0 +1,97 @@ +/******************************************************************************* + * Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This program and + * the accompanying materials are made available under the terms of the Open + * Source Initiative OSI - Open Software License v3.0 which accompanies this + * distribution, and is available at + * http://www.opensource.org/licenses/osl-3.0.php/ + ******************************************************************************/ + +package com.kdmanalytics.toif.report.internal.filters; + +import java.util.ArrayList; +import java.util.List; + +import org.eclipse.jface.viewers.Viewer; +import org.eclipse.jface.viewers.ViewerFilter; + +import com.kdmanalytics.toif.report.internal.items.FindingEntry; +import com.kdmanalytics.toif.report.items.IFindingEntry; +import com.kdmanalytics.toif.report.items.IToifReportEntry; + +/** + * Creates a filter which filters out all elements that don't have/aren't + * findingEntrys with a trust level above the set amount. + * + * + * @author Adam Nunn + */ +public class TrustFilter extends ViewerFilter +{ + + /** + * The trust amount that the element must be over. + */ + private int amount; + + /** + * create a new filter with the trust amount set. + * + * @param amount + */ + public TrustFilter(int amount) + { + this.amount = amount; + } + + /** + * @return the amount + */ + public int getAmount() + { + return amount; + } + + @Override + public boolean select(Viewer viewer, Object parentElement, Object element) + { + if (element instanceof IToifReportEntry) + { + FindingEntry entry = ((IToifReportEntry) element).getFindingEntry(); + List list = new ArrayList(); + list.add(entry); + return trustIsHighEnough(list); + } + return false; + } + + /** + * set the trust amount + */ + public void setAmount(int amount) + { + this.amount = amount; + } + + /** + * returns true if there is a finding with a trust higher than amount. + * + * @param element + */ + private boolean trustIsHighEnough(List list) + { + for (IFindingEntry findingEntry : list) + { + if (findingEntry instanceof IFindingEntry) + { + int trust = findingEntry.getTrust(); + if (trust >= amount) + { + return true; + } + } + } + + return false; + } + +} diff --git a/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/filters/TwoToolsFilter.java b/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/filters/TwoToolsFilter.java new file mode 100644 index 00000000..1367e1a3 --- /dev/null +++ b/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/filters/TwoToolsFilter.java @@ -0,0 +1,50 @@ +/******************************************************************************* + * Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This program and the + * accompanying materials are made available under the terms of the Open Source + * Initiative OSI - Open Software License v3.0 which accompanies this + * distribution, and is available at http://www.opensource.org/licenses/osl-3.0.php/ + ******************************************************************************/ + +package com.kdmanalytics.toif.report.internal.filters; + +import org.eclipse.jface.viewers.Viewer; +import org.eclipse.jface.viewers.ViewerFilter; + +import com.kdmanalytics.toif.report.internal.items.LocationGroup; +import com.kdmanalytics.toif.report.items.IToifReportEntry; + +/** + * ViewerFilter that filters entries where location group for a toifreport entry + * has more than 1 finding entry + * + * @author Adam Nunn + * @author Kyle Girard + * + */ +public class TwoToolsFilter extends ViewerFilter +{ + + /* + * (non-Javadoc) + * + * @see + * org.eclipse.jface.viewers.ViewerFilter#select(org.eclipse.jface.viewers + * .Viewer, java.lang.Object, java.lang.Object) + */ + @Override + public boolean select(Viewer viewer, Object parentElement, Object element) + { + if (element instanceof IToifReportEntry) + { + IToifReportEntry iToifReportEntry = (IToifReportEntry) element; + LocationGroup lg = iToifReportEntry.getLocationGroup(); + if (lg != null) + { + return lg.getToolGroups().size() >= 2; + //return lg.getFindingEntries().size() >= 2; + } + } + return false; + } + +} diff --git a/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/filters/package-info.java b/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/filters/package-info.java new file mode 100644 index 00000000..de447a55 --- /dev/null +++ b/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/filters/package-info.java @@ -0,0 +1,10 @@ +/******************************************************************************* + * Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This + * program and the // accompanying materials are made available under the terms + * of the Open Source // Initiative OSI - Open Software License v3.0 which + * accompanies this // distribution, and is available at + * http://www.opensource.org/licenses/osl-3.0.php/ + ******************************************************************************/ + +package com.kdmanalytics.toif.report.internal.filters; + diff --git a/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/handlers/BuildDefectModelHandler.java b/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/handlers/BuildDefectModelHandler.java new file mode 100644 index 00000000..69d7af4b --- /dev/null +++ b/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/handlers/BuildDefectModelHandler.java @@ -0,0 +1,41 @@ +/******************************************************************************* + * Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This program and + * the accompanying materials are made available under the terms of the Open + * Source Initiative OSI - Open Software License v3.0 which accompanies this + * distribution, and is available at + * http://www.opensource.org/licenses/osl-3.0.php/ + ******************************************************************************/ + +package com.kdmanalytics.toif.report.internal.handlers; + +import org.eclipse.core.commands.AbstractHandler; +import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.core.commands.IHandler; +import org.eclipse.jface.viewers.ISelection; +import org.eclipse.ui.handlers.HandlerUtil; + +/** + * Builds the defect model. + * + * @author Adam Nunn + * + */ +public class BuildDefectModelHandler extends AbstractHandler implements IHandler +{ + + /** + * initiate the building of the defect model. + */ + @Override + public Object execute(ExecutionEvent event) throws ExecutionException + { + ISelection s = HandlerUtil.getCurrentSelection(event); + if (s != null) + { + ModelUtil.buildModel(s); + } + return null; + } + +} diff --git a/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/handlers/ExportCitationHandler.java b/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/handlers/ExportCitationHandler.java new file mode 100644 index 00000000..ffb80a04 --- /dev/null +++ b/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/handlers/ExportCitationHandler.java @@ -0,0 +1,212 @@ +/******************************************************************************* + * Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This program and + * the accompanying materials are made available under the terms of the Open + * Source Initiative OSI - Open Software License v3.0 which accompanies this + * distribution, and is available at + * http://www.opensource.org/licenses/osl-3.0.php/ + ******************************************************************************/ + +package com.kdmanalytics.toif.report.internal.handlers; + +import java.io.FileWriter; +import java.io.IOException; +import java.util.HashSet; +import java.util.List; +import java.util.Set; + +import org.eclipse.core.commands.AbstractHandler; +import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.core.commands.IHandler; +import org.eclipse.jface.viewers.ISelection; +import org.eclipse.jface.viewers.IStructuredSelection; +import org.eclipse.swt.SWT; +import org.eclipse.swt.widgets.FileDialog; +import org.eclipse.swt.widgets.Shell; +import org.eclipse.ui.IViewPart; +import org.eclipse.ui.PlatformUI; +import org.eclipse.ui.handlers.HandlerUtil; + +import com.kdmanalytics.toif.report.internal.items.FindingEntry; +import com.kdmanalytics.toif.report.internal.items.LocationGroup; +import com.kdmanalytics.toif.report.internal.items.ToolGroup; +import com.kdmanalytics.toif.report.internal.items.FindingEntry.Citing; +import com.kdmanalytics.toif.report.internal.views.ReportView; +import com.kdmanalytics.toif.report.items.IToifReportEntry; + +/** + * + * Exports the selection to a csv file. + * + * @author Adam Nunn + * + */ +public class ExportCitationHandler extends AbstractHandler implements IHandler +{ + + /* + * (non-Javadoc) + * + * @see + * org.eclipse.core.commands.AbstractHandler#execute(org.eclipse.core.commands + * .ExecutionEvent) + */ + @Override + public Object execute(ExecutionEvent event) throws ExecutionException + { + ReportView view = (ReportView) PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().findView(ReportView.VIEW_ID); + + List findingEntries = view.getReportInput().getFindingEntries(); + + if ((findingEntries == null) || (findingEntries.size() == 0)) + { + return null; + } + + // Display display = new Display(); + Shell shell = HandlerUtil.getActiveShell(event); + shell.open(); + FileDialog dialog = new FileDialog(shell, SWT.SAVE); + dialog.setFilterNames(new String[] { "TSV Files", "All Files (*.*)" }); + dialog.setFilterExtensions(new String[] { "*.tsv", "*.*" }); + dialog.setFilterPath(System.getProperty("user.dir")); + dialog.setFileName("toif.tsv"); + String savePath = dialog.open(); + + if (savePath == null) + { + return null; + } + + try + { + FileWriter writer = new FileWriter(savePath); + + writeHeader(writer); + writeFindings(findingEntries, writer); + + writer.flush(); + writer.close(); + } + catch (IOException e) + { + System.err.println("There was a problem reading or writing to the file."); + e.printStackTrace(); + } + catch (NullPointerException e) + { + System.err.println("There was a null pointer exception."); + e.printStackTrace(); + } + + return null; + } + + @Override + public boolean isEnabled() + { + return true; + } + + /** + * write the findings to the csv file. + * + * @param findingEntries + * the selected element from the report + * @param writer + * the file writer to use to output + * @throws IOException + */ + private void writeFindings(List findingEntries, FileWriter writer) throws IOException + { + + for (FindingEntry entry : findingEntries) + { + ToolGroup tool = (ToolGroup) entry.getParent(); + LocationGroup location = (LocationGroup) tool.getParent(); + + // sfp + writer.append(entry.getSfp()); + writer.append('\t'); + + // cwe + writer.append(entry.getCwe()); + writer.append('\t'); + + String valid = ""; + // valid + if (Citing.UNKNOWN == entry.isOk()) + { + valid = "unknown"; + } + else + { + valid = "" + (Citing.TRUE == entry.isOk()); + } + writer.append(valid.toUpperCase()); + writer.append('\t'); + + // trust + writer.append(entry.getTrust() + ""); + writer.append('\t'); + + // resource + writer.append(location.getPath()); + writer.append('\t'); + + // linenumber + writer.append(location.getToifLineNumber()); + writer.append('\t'); + + // kdmLineNumber + if (location.getRealLineNumber() != null) + { + writer.append(location.getRealLineNumber()); + } + else + { + writer.append(""); + } + writer.append('\t'); + + // tool + writer.append(tool.toString()); + writer.append('\t'); + + // description + writer.append(entry.getDescription()); + writer.append('\n'); + } + + } + + /** + * @param writer + * @throws IOException + */ + private void writeHeader(FileWriter writer) throws IOException + { + writer.append("SFP"); + writer.append('\t'); + writer.append("CWE"); + writer.append('\t'); + // writer.append("Cluster"); + // writer.append('\t'); + writer.append("Valid"); + writer.append('\t'); + writer.append("Trust"); + writer.append('\t'); + + writer.append("Resource"); + writer.append('\t'); + writer.append("Line Number"); + writer.append('\t'); + writer.append("KDM Line Number"); + writer.append('\t'); + writer.append("Generator Tool"); + writer.append('\t'); + writer.append("Weakness Description"); + writer.append('\n'); + } + +} diff --git a/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/handlers/ExportSelectionHandler.java b/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/handlers/ExportSelectionHandler.java new file mode 100644 index 00000000..ee3d9343 --- /dev/null +++ b/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/handlers/ExportSelectionHandler.java @@ -0,0 +1,211 @@ +/******************************************************************************* + * Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This program and + * the accompanying materials are made available under the terms of the Open + * Source Initiative OSI - Open Software License v3.0 which accompanies this + * distribution, and is available at + * http://www.opensource.org/licenses/osl-3.0.php/ + ******************************************************************************/ + +package com.kdmanalytics.toif.report.internal.handlers; + +import java.io.FileWriter; +import java.io.IOException; +import java.util.HashSet; +import java.util.Set; + +import org.eclipse.core.commands.AbstractHandler; +import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.core.commands.IHandler; +import org.eclipse.jface.viewers.ISelection; +import org.eclipse.jface.viewers.IStructuredSelection; +import org.eclipse.swt.SWT; +import org.eclipse.swt.widgets.FileDialog; +import org.eclipse.swt.widgets.Shell; +import org.eclipse.ui.handlers.HandlerUtil; + +import com.kdmanalytics.toif.report.internal.items.FindingEntry; +import com.kdmanalytics.toif.report.internal.items.LocationGroup; +import com.kdmanalytics.toif.report.internal.items.ToolGroup; +import com.kdmanalytics.toif.report.internal.items.FindingEntry.Citing; +import com.kdmanalytics.toif.report.items.IToifReportEntry; + +/** + * + * Exports the selection to a csv file. + * + * @author Adam Nunn + * + */ +public class ExportSelectionHandler extends AbstractHandler implements IHandler +{ + + /* + * (non-Javadoc) + * + * @see + * org.eclipse.core.commands.AbstractHandler#execute(org.eclipse.core.commands + * .ExecutionEvent) + */ + @Override + public Object execute(ExecutionEvent event) throws ExecutionException + { + ISelection s = HandlerUtil.getCurrentSelection(event); + if (!(s instanceof IStructuredSelection)) + { + return null; + } + + // Display display = new Display(); + Shell shell = HandlerUtil.getActiveShell(event); + shell.open(); + FileDialog dialog = new FileDialog(shell, SWT.SAVE); + dialog.setFilterNames(new String[] { "TSV Files", "All Files (*.*)" }); + dialog.setFilterExtensions(new String[] { "*.tsv", "*.*" }); + dialog.setFilterPath(System.getProperty("user.dir")); + dialog.setFileName("toif.tsv"); + String savePath = dialog.open(); + + if (savePath == null) + { + return null; + } + + try + { + FileWriter writer = new FileWriter(savePath); + + writeHeader(writer); + writeFindings((IStructuredSelection) s, writer); + + writer.flush(); + writer.close(); + } + catch (IOException e) + { + System.err.println("There was a problem reading or writing to the file."); + e.printStackTrace(); + } + catch (NullPointerException e) + { + System.err.println("There was a null pointer exception."); + e.printStackTrace(); + } + + return null; + } + + @Override + public boolean isEnabled() + { + return true; + } + + /** + * write the findings to the csv file. + * + * @param selection + * the selected element from the report + * @param writer + * the file writer to use to output + * @throws IOException + */ + private void writeFindings(IStructuredSelection selection, FileWriter writer) throws IOException + { + Set entries = new HashSet(); + for (Object object : selection.toList()) + { + if (object instanceof IToifReportEntry) + { + IToifReportEntry reportItem = (IToifReportEntry) object; + entries.add(reportItem.getFindingEntry()); + } + } + + for (FindingEntry entry : entries) + { + ToolGroup tool = (ToolGroup) entry.getParent(); + LocationGroup location = (LocationGroup) tool.getParent(); + + // sfp + writer.append(entry.getSfp()); + writer.append('\t'); + + // cwe + writer.append(entry.getCwe()); + writer.append('\t'); + + String valid = ""; + // valid + if (Citing.UNKNOWN == entry.isOk()) { + valid = "unknown"; + } else { + valid = "" + (Citing.TRUE == entry.isOk()); + } + writer.append(valid.toUpperCase()); + writer.append('\t'); + + // trust + writer.append(entry.getTrust() + ""); + writer.append('\t'); + + // resource + writer.append(location.getPath()); + writer.append('\t'); + + // linenumber + writer.append(location.getToifLineNumber()); + writer.append('\t'); + + // kdmLineNumber + if (location.getRealLineNumber() != null) + { + writer.append(location.getRealLineNumber()); + } + else + { + writer.append(""); + } + writer.append('\t'); + + // tool + writer.append(tool.toString()); + writer.append('\t'); + + // description + writer.append(entry.getDescription()); + writer.append('\n'); + } + + } + + /** + * @param writer + * @throws IOException + */ + private void writeHeader(FileWriter writer) throws IOException + { + writer.append("SFP"); + writer.append('\t'); + writer.append("CWE"); + writer.append('\t'); + // writer.append("Cluster"); + // writer.append('\t'); + writer.append("Valid"); + writer.append('\t'); + writer.append("Trust"); + writer.append('\t'); + + writer.append("Resource"); + writer.append('\t'); + writer.append("Line Number"); + writer.append('\t'); + writer.append("KDM Line Number"); + writer.append('\t'); + writer.append("Generator Tool"); + writer.append('\t'); + writer.append("Weakness Description"); + writer.append('\n'); + } + +} diff --git a/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/handlers/FiltersDialog.java b/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/handlers/FiltersDialog.java new file mode 100644 index 00000000..6337e6d6 --- /dev/null +++ b/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/handlers/FiltersDialog.java @@ -0,0 +1,499 @@ +/******************************************************************************* + * Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This program and + * the accompanying materials are made available under the terms of the Open + * Source Initiative OSI - Open Software License v3.0 which accompanies this + * distribution, and is available at + * http://www.opensource.org/licenses/osl-3.0.php/ + ******************************************************************************/ + +package com.kdmanalytics.toif.report.internal.handlers; + +import java.util.ArrayList; +import java.util.List; + +import org.eclipse.jface.dialogs.Dialog; +import org.eclipse.jface.viewers.ViewerFilter; +import org.eclipse.swt.SWT; +import org.eclipse.swt.events.SelectionEvent; +import org.eclipse.swt.events.SelectionListener; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.widgets.Button; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Control; +import org.eclipse.swt.widgets.Event; +import org.eclipse.swt.widgets.Label; +import org.eclipse.swt.widgets.Listener; +import org.eclipse.swt.widgets.Shell; +import org.eclipse.swt.widgets.Text; + +import com.kdmanalytics.toif.report.internal.filters.CWETwoToolsFilter; +import com.kdmanalytics.toif.report.internal.filters.IsValidFilter; +import com.kdmanalytics.toif.report.internal.filters.NotValidFilter; +import com.kdmanalytics.toif.report.internal.filters.SFPTwoToolsFilter; +import com.kdmanalytics.toif.report.internal.filters.TrustFilter; +import com.kdmanalytics.toif.report.internal.filters.TwoToolsFilter; + +/** + * create the dialog for the filters. + * + * @author Adam Nunn + * + */ +public class FiltersDialog extends Dialog +{ + + private IsValidFilter isValidFilter = null; + + private NotValidFilter notValidFilter = null; + + private TwoToolsFilter twoToolsFilter = null; + + private CWETwoToolsFilter CWETwoToolsFilter = null; + + private SFPTwoToolsFilter SFPTwoToolsFilter = null; + + private TrustFilter trustFilter = null; + + private final List filters; + + private Text trustAmountText; + + private int trustAmount = 0; + + /** + * create the new filter dialog. + * + * @param parentShell + * the parent shell for this dialog. + * @param filters + * the applied filters. + */ + protected FiltersDialog(Shell parentShell, ViewerFilter[] filters) + { + super(parentShell); + this.filters = new ArrayList(); + for (ViewerFilter viewerFilter : filters) + { + this.filters.add(viewerFilter); + + if (viewerFilter instanceof IsValidFilter) + { + isValidFilter = (IsValidFilter) viewerFilter; + } + if (viewerFilter instanceof NotValidFilter) + { + notValidFilter = (NotValidFilter) viewerFilter; + } + if (viewerFilter instanceof TrustFilter) + { + trustFilter = (TrustFilter) viewerFilter; + } + if (viewerFilter instanceof TwoToolsFilter) + { + twoToolsFilter = (TwoToolsFilter) viewerFilter; + } + if (viewerFilter instanceof CWETwoToolsFilter) + { + CWETwoToolsFilter = (CWETwoToolsFilter) viewerFilter; + } + if (viewerFilter instanceof SFPTwoToolsFilter) + { + SFPTwoToolsFilter = (SFPTwoToolsFilter) viewerFilter; + } + } + } + + /** + * creat the checkboxes + * + * @param checkboxComposite + * the composite that the checkboxes belong in. + */ + private void createCheckbox(Composite checkboxComposite) + { + // filter one. + Composite comp1 = new Composite(checkboxComposite, SWT.NONE); + comp1.setLayout(new GridLayout()); + final Button sameLocButton = new Button(comp1, SWT.CHECK); + if (twoToolsFilter != null) + { + sameLocButton.setSelection(true); + } + sameLocButton.setText("2+ Tools report same location."); + sameLocButton.addSelectionListener(new SelectionListener() { + + @Override + public void widgetDefaultSelected(SelectionEvent e) + { + // TODO Auto-generated method stub + + } + + @Override + public void widgetSelected(SelectionEvent e) + { + if (sameLocButton.getSelection()) + { + twoToolsFilter = new TwoToolsFilter(); + filters.add(twoToolsFilter); + } + else + { + twoToolsFilter = null; + } + } + }); + + // filter two. + Composite comp2 = new Composite(checkboxComposite, SWT.NONE); + comp2.setLayout(new GridLayout()); + final Button sameCWEButton = new Button(comp2, SWT.CHECK); + if (CWETwoToolsFilter != null) + { + sameCWEButton.setSelection(true); + } + sameCWEButton.setText("2+ Tools report same location. With the same CWE"); + sameCWEButton.addSelectionListener(new SelectionListener() { + + @Override + public void widgetDefaultSelected(SelectionEvent e) + { + // TODO Auto-generated method stub + + } + + @Override + public void widgetSelected(SelectionEvent e) + { + if (sameCWEButton.getSelection()) + { + CWETwoToolsFilter = new CWETwoToolsFilter(); + filters.add(CWETwoToolsFilter); + } + else + { + CWETwoToolsFilter = null; + } + } + }); + + // filter 3. + Composite compSFPTwoTools = new Composite(checkboxComposite, SWT.NONE); + compSFPTwoTools.setLayout(new GridLayout()); + final Button samesfpButton = new Button(compSFPTwoTools, SWT.CHECK); + if (SFPTwoToolsFilter != null) + { + samesfpButton.setSelection(true); + } + samesfpButton.setText("2+ Tools report same location. With the same SFP"); + samesfpButton.addSelectionListener(new SelectionListener() { + + @Override + public void widgetDefaultSelected(SelectionEvent e) + { + // TODO Auto-generated method stub + + } + + @Override + public void widgetSelected(SelectionEvent e) + { + if (samesfpButton.getSelection()) + { + SFPTwoToolsFilter = new SFPTwoToolsFilter(); + filters.add(SFPTwoToolsFilter); + } + else + { + SFPTwoToolsFilter = null; + } + } + }); + + // filter 4. filter goes in its own composite to allow a text field as + // well. + Composite trustComposite = new Composite(checkboxComposite, SWT.NONE); + trustComposite.setLayout(new GridLayout(2, true)); + + // button. + final Button trustButton = new Button(trustComposite, SWT.CHECK); + trustButton.setText("Trust above:"); + + GridData gridData = new GridData(SWT.FILL, SWT.CENTER, true, true, 1, 1); + + trustAmountText = new Text(trustComposite, SWT.SINGLE | SWT.BORDER | SWT.FILL); + trustAmountText.setLayoutData(gridData); + if (trustFilter != null) + { + trustButton.setSelection(true); + trustAmountText.setText(String.valueOf(trustFilter.getAmount())); + } + else + { + trustAmountText.setText("50"); + } + trustAmountText.setTextLimit(6); + + // this is a verify listener. it makes sure that the characters punched + // into the text box are correct. + trustAmountText.addListener(SWT.Verify, new Listener() { + + @Override + public void handleEvent(Event event) + { + String input = event.text; + char[] characters = new char[input.length()]; + input.getChars(0, characters.length, characters, 0); + for (int i = 0; i < characters.length; i++) + { + if (!('0' <= characters[i] && characters[i] <= '9')) + { + event.doit = false; + return; + } + } + } + + }); + + // add the selection listener to the button. + trustButton.addSelectionListener(new TrustSelectionListener(trustAmountText) { + + @Override + public void widgetDefaultSelected(SelectionEvent e) + { + // TODO Auto-generated method stub + + } + + @Override + public void widgetSelected(SelectionEvent e) + { + if (trustButton.getSelection()) + { + String text = trustAmountText.getText(); + try + { + int amount = Integer.parseInt(text); + trustFilter = new TrustFilter(amount); + } + catch (Exception e2) + { + System.err.println("Trust filter not added. Text field could not be parsed as integer."); + } + + } + else + { + trustFilter = null; + } + + } + }); + + // filter 5. + Composite isValidComp = new Composite(checkboxComposite, SWT.NONE); + isValidComp.setLayout(new GridLayout()); + final Button isValidButton = new Button(isValidComp, SWT.CHECK); + if (isValidFilter != null) + { + isValidButton.setSelection(true); + } + isValidButton.setText("Is Valid."); + isValidButton.addSelectionListener(new SelectionListener() { + + @Override + public void widgetDefaultSelected(SelectionEvent e) + { + // TODO Auto-generated method stub + + } + + @Override + public void widgetSelected(SelectionEvent e) + { + if (isValidButton.getSelection()) + { + isValidFilter = new IsValidFilter(); + filters.add(isValidFilter); + } + else + { + isValidFilter = null; + } + } + }); + + // filter 6. + Composite notValidComp = new Composite(checkboxComposite, SWT.NONE); + notValidComp.setLayout(new GridLayout()); + final Button notValidButton = new Button(notValidComp, SWT.CHECK); + if (notValidFilter != null) + { + notValidButton.setSelection(true); + } + notValidButton.setText("Not Valid."); + notValidButton.addSelectionListener(new SelectionListener() { + + @Override + public void widgetDefaultSelected(SelectionEvent e) + { + // TODO Auto-generated method stub + + } + + @Override + public void widgetSelected(SelectionEvent e) + { + if (notValidButton.getSelection()) + { + notValidFilter = new NotValidFilter(); + filters.add(notValidFilter); + } + else + { + notValidFilter = null; + } + } + }); + + } + + /** + * + */ + @Override + protected Control createDialogArea(Composite parent) + { + Composite container = (Composite) super.createDialogArea(parent); + + GridData gridData_1 = new GridData(SWT.LEFT, GridData.FILL, true, false, 2, 1); + + Label label = new Label(container, SWT.NONE); + + label.setLayoutData(new GridData(GridData.BEGINNING, GridData.CENTER, false, false, 2, 1)); + + label.setText("Select the filters which will act upon the data: "); + + Composite checkboxComposite = new Composite(container, SWT.NONE); + + checkboxComposite.setLayoutData(gridData_1); + + GridLayout checkboxLayout = new GridLayout(1, false); + + checkboxComposite.setLayout(checkboxLayout); + + // create the check boxes + createCheckbox(checkboxComposite); + + return container; + + } + + /** + * get all the filters + * + * @return a list of the filters. + */ + public List getFilters() + { + return filters; + + } + + /** + * get the trust amount + * + * @return the trustAmount + */ + public int getTrustAmount() + { + return trustAmount; + } + + /** + * @return the trustFilter + */ + public TrustFilter getTrustFilter() + { + return trustFilter; + } + + /** + * @return the twoToolsFilter + */ + public TwoToolsFilter getTwoToolsFilter() + { + return twoToolsFilter; + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.jface.dialogs.Dialog#okPressed() + */ + @Override + protected void okPressed() + { + save(); + super.okPressed(); + } + + /** + * store the trust amount + */ + private void save() + { + try + { + trustAmount = Integer.parseInt(trustAmountText.getText()); + } + catch (NumberFormatException e) + { + + } + + } + + /** + * get teh filter for the sma cwe filter + * + * @return + */ + public CWETwoToolsFilter getCWETwoToolsFilter() + { + return CWETwoToolsFilter; + } + + /** + * get the filter for the same sfp filter + * + * @return + */ + public SFPTwoToolsFilter getSFPTwoToolsFilter() + { + return SFPTwoToolsFilter; + } + + /** + * get the is valid filter + * + * @return + */ + public IsValidFilter getIsValidFilter() + { + return isValidFilter; + } + + /** + * get the not valid filter. + * + * @return + */ + public NotValidFilter getNotValidFilter() + { + return notValidFilter; + } + +} diff --git a/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/handlers/FiltersHandler.java b/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/handlers/FiltersHandler.java new file mode 100644 index 00000000..156b3fd4 --- /dev/null +++ b/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/handlers/FiltersHandler.java @@ -0,0 +1,174 @@ +/******************************************************************************* + * Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This program and + * the accompanying materials are made available under the terms of the Open + * Source Initiative OSI - Open Software License v3.0 which accompanies this + * distribution, and is available at + * http://www.opensource.org/licenses/osl-3.0.php/ + ******************************************************************************/ + +package com.kdmanalytics.toif.report.internal.handlers; + +import java.util.ArrayList; +import java.util.List; + +import org.eclipse.core.commands.AbstractHandler; +import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.core.commands.IHandler; +import org.eclipse.jface.viewers.ViewerFilter; +import org.eclipse.swt.widgets.Shell; +import org.eclipse.ui.PlatformUI; +import org.eclipse.ui.handlers.HandlerUtil; + +import com.kdmanalytics.toif.report.internal.filters.CWETwoToolsFilter; +import com.kdmanalytics.toif.report.internal.filters.IsValidFilter; +import com.kdmanalytics.toif.report.internal.filters.NotValidFilter; +import com.kdmanalytics.toif.report.internal.filters.SFPTwoToolsFilter; +import com.kdmanalytics.toif.report.internal.filters.TermFilter; +import com.kdmanalytics.toif.report.internal.filters.TrustFilter; +import com.kdmanalytics.toif.report.internal.filters.TwoToolsFilter; +import com.kdmanalytics.toif.report.internal.views.ReportView; + +/** + * handler for the filters in the report view. + * + * @author Adam Nunn + * + */ +public class FiltersHandler extends AbstractHandler implements IHandler +{ + + /** + * create the filter dialog and execute the handling of the filters. add the + * filter list to the view and refresh + */ + @Override + public Object execute(ExecutionEvent event) throws ExecutionException + { + Shell parentShell = PlatformUI.getWorkbench().getDisplay().getActiveShell(); + final ReportView view = (ReportView) HandlerUtil.getActivePart(event); + + FiltersDialog dialog = new FiltersDialog(parentShell, view.getFilters()); + + dialog.open(); + + List filterList = new ArrayList(); + + // Hack to ensure that the term filter is applied in addition to the + // filters that are handled by the dialog + for (ViewerFilter filter : view.getFilters()) + { + if (filter instanceof TermFilter) + { + filterList.add(filter); + } + } + + handleTrustFilter(dialog, filterList); + + handleTwoToolFilter(dialog, filterList); + handleCWETwoToolFilter(dialog, filterList); + handleSFPTwoToolFilter(dialog, filterList); + + handleIsValidFilter(dialog, filterList); + handleNotValidFilter(dialog, filterList); + + view.setFilters(filterList.toArray(new ViewerFilter[filterList.size()])); + view.refresh(); + return null; + } + + /** + * handle the not valid filter. by adding it to the filterList. + * + * @param dialog + * @param filterList + */ + private void handleNotValidFilter(FiltersDialog dialog, List filterList) + { + NotValidFilter notValidFilter = dialog.getNotValidFilter(); + if (notValidFilter != null) + { + filterList.add(notValidFilter); + } + + } + + /** + * handle the same cwe filter by adding it to the filterList. + * + * @param dialog + * @param filterList + */ + private void handleCWETwoToolFilter(FiltersDialog dialog, List filterList) + { + CWETwoToolsFilter cweTwoToolsFilter = dialog.getCWETwoToolsFilter(); + if (cweTwoToolsFilter != null) + { + filterList.add(cweTwoToolsFilter); + } + + } + + /** + * handle the same sfp filter by adding it to the filterList. + * + * @param dialog + * @param filterList + */ + private void handleSFPTwoToolFilter(FiltersDialog dialog, List filterList) + { + SFPTwoToolsFilter sfpTwoToolsFilter = dialog.getSFPTwoToolsFilter(); + if (sfpTwoToolsFilter != null) + { + filterList.add(sfpTwoToolsFilter); + } + + } + + /** + * handle the trust filter by adding it to the filterList. + * + * @param dialog + * @param filterList + */ + private void handleTrustFilter(FiltersDialog dialog, List filterList) + { + TrustFilter trustFilter = dialog.getTrustFilter(); + if (trustFilter != null) + { + trustFilter.setAmount(dialog.getTrustAmount()); + filterList.add(trustFilter); + } + } + + /** + * handle the two tools filter by adding it to the filterList. + * + * @param dialog + * @param filterList + */ + private void handleTwoToolFilter(FiltersDialog dialog, List filterList) + { + TwoToolsFilter twoToolsFilter = dialog.getTwoToolsFilter(); + if (twoToolsFilter != null) + { + filterList.add(twoToolsFilter); + } + } + + /** + * handle the is valid filter by adding it to the filterList. + * + * @param dialog + * @param filterList + */ + private void handleIsValidFilter(FiltersDialog dialog, List filterList) + { + IsValidFilter isValidFilter = dialog.getIsValidFilter(); + if (isValidFilter != null) + { + filterList.add(isValidFilter); + } + } +} diff --git a/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/handlers/FiltersHandler.java.orig b/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/handlers/FiltersHandler.java.orig new file mode 100644 index 00000000..c15a04fe --- /dev/null +++ b/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/handlers/FiltersHandler.java.orig @@ -0,0 +1,144 @@ +/******************************************************************************* + * Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This program and the + * accompanying materials are made available under the terms of the Open Source + * Initiative OSI - Open Software License v3.0 which accompanies this + * distribution, and is available at http://www.opensource.org/licenses/osl-3.0.php/ + ******************************************************************************/ + +package com.kdmanalytics.toif.report.internal.handlers; + +import java.util.ArrayList; +import java.util.List; + +import org.eclipse.core.commands.AbstractHandler; +import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.core.commands.IHandler; +import org.eclipse.jface.viewers.ViewerFilter; +import org.eclipse.swt.widgets.Shell; +import org.eclipse.ui.PlatformUI; +import org.eclipse.ui.handlers.HandlerUtil; + +import com.kdmanalytics.toif.report.internal.filters.CWETwoToolsFilter; +import com.kdmanalytics.toif.report.internal.filters.IsValidFilter; +import com.kdmanalytics.toif.report.internal.filters.NotValidFilter; +import com.kdmanalytics.toif.report.internal.filters.SFPTwoToolsFilter; +import com.kdmanalytics.toif.report.internal.filters.TermFilter; +import com.kdmanalytics.toif.report.internal.filters.TrustFilter; +import com.kdmanalytics.toif.report.internal.filters.TwoToolsFilter; +import com.kdmanalytics.toif.report.internal.views.ReportView; + +public class FiltersHandler extends AbstractHandler implements IHandler +{ + + @Override + public Object execute(ExecutionEvent event) throws ExecutionException + { + Shell parentShell = PlatformUI.getWorkbench().getDisplay().getActiveShell(); + final ReportView view = (ReportView) HandlerUtil.getActivePart(event); + + FiltersDialog dialog = new FiltersDialog(parentShell, view.getFilters()); + + dialog.open(); + + List filterList = new ArrayList(); + + // Hack to ensure that the term filter is applied in addition to the + // filters that are handled by the dialog + for (ViewerFilter filter : view.getFilters()) + { + if (filter instanceof TermFilter) + { + filterList.add(filter); + } + } + + handleTrustFilter(dialog, filterList); + + handleTwoToolFilter(dialog, filterList); + handleCWETwoToolFilter(dialog, filterList); + handleSFPTwoToolFilter(dialog, filterList); + + handleIsValidFilter(dialog, filterList); + handleNotValidFilter(dialog, filterList); + + view.setFilters(filterList.toArray(new ViewerFilter[filterList.size()])); +<<<<<<< HEAD + + //view.refresh(); +======= + view.refresh(); +>>>>>>> branch 'develop' of gitolite@fry:toif + return null; + } + + private void handleNotValidFilter(FiltersDialog dialog, List filterList) + { + NotValidFilter notValidFilter = dialog.getNotValidFilter(); + if (notValidFilter != null) + { + filterList.add(notValidFilter); + } + + } + + private void handleCWETwoToolFilter(FiltersDialog dialog, List filterList) + { + CWETwoToolsFilter cweTwoToolsFilter = dialog.getCWETwoToolsFilter(); + if (cweTwoToolsFilter != null) + { + filterList.add(cweTwoToolsFilter); + } + + } + + private void handleSFPTwoToolFilter(FiltersDialog dialog, List filterList) + { + SFPTwoToolsFilter sfpTwoToolsFilter = dialog.getSFPTwoToolsFilter(); + if (sfpTwoToolsFilter != null) + { + filterList.add(sfpTwoToolsFilter); + } + + } + + /** + * @param dialog + * @param filterList + */ + private void handleTrustFilter(FiltersDialog dialog, List filterList) + { + TrustFilter trustFilter = dialog.getTrustFilter(); + if (trustFilter != null) + { + trustFilter.setAmount(dialog.getTrustAmount()); + filterList.add(trustFilter); + } + } + + /** + * @param dialog + * @param filterList + */ + private void handleTwoToolFilter(FiltersDialog dialog, List filterList) + { + TwoToolsFilter twoToolsFilter = dialog.getTwoToolsFilter(); + if (twoToolsFilter != null) + { + filterList.add(twoToolsFilter); + } + } + + /** + * @param dialog + * @param filterList + */ + private void handleIsValidFilter(FiltersDialog dialog, List filterList) + { + IsValidFilter isValidFilter = dialog.getIsValidFilter(); + if (isValidFilter != null) + { + filterList.add(isValidFilter); + } + } +} diff --git a/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/handlers/MergeTSV.java b/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/handlers/MergeTSV.java new file mode 100644 index 00000000..f69c10dc --- /dev/null +++ b/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/handlers/MergeTSV.java @@ -0,0 +1,472 @@ +/******************************************************************************* + * Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This program and + * the accompanying materials are made available under the terms of the Open + * Source Initiative OSI - Open Software License v3.0 which accompanies this + * distribution, and is available at + * http://www.opensource.org/licenses/osl-3.0.php/ + ******************************************************************************/ + +package com.kdmanalytics.toif.report.internal.handlers; + +import java.io.BufferedReader; +import java.io.File; +import java.io.FileNotFoundException; +import java.io.FileReader; +import java.io.IOException; +import java.io.LineNumberReader; +import java.lang.reflect.InvocationTargetException; + +import org.eclipse.core.commands.AbstractHandler; +import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.core.resources.IFolder; +import org.eclipse.core.resources.IProject; +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.IConfigurationElement; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.Platform; +import org.eclipse.jface.dialogs.MessageDialog; +import org.eclipse.jface.dialogs.ProgressMonitorDialog; +import org.eclipse.jface.operation.IRunnableWithProgress; +import org.eclipse.jface.viewers.ISelection; +import org.eclipse.jface.viewers.IStructuredSelection; +import org.eclipse.jface.viewers.StructuredSelection; +import org.eclipse.swt.SWT; +import org.eclipse.swt.widgets.FileDialog; +import org.eclipse.swt.widgets.Shell; +import org.eclipse.ui.PlatformUI; +import org.eclipse.ui.handlers.HandlerUtil; +import org.openrdf.model.URI; +import org.openrdf.model.Value; +import org.openrdf.query.BindingSet; +import org.openrdf.query.MalformedQueryException; +import org.openrdf.query.QueryEvaluationException; +import org.openrdf.query.QueryLanguage; +import org.openrdf.query.TupleQuery; +import org.openrdf.query.TupleQueryResult; +import org.openrdf.repository.Repository; +import org.openrdf.repository.RepositoryConnection; +import org.openrdf.repository.RepositoryException; + +import com.kdmanalytics.toif.report.internal.views.ReportView; +import com.kdmanalytics.toif.report.util.IRepositoryMaker; + +/** + * class for merging spreadsheet datat to the report view. + * + * @author Adam Nunn + * + */ +public class MergeTSV extends AbstractHandler +{ + + @Override + public Object execute(ExecutionEvent event) throws ExecutionException + { + ISelection s = HandlerUtil.getCurrentSelection(event); + + if (s instanceof StructuredSelection) + { + StructuredSelection structuredSelection = (StructuredSelection) s; + + IProject project = null; + + Object firstElement = structuredSelection.getFirstElement(); + if (firstElement instanceof IProject) { + project = (IProject) firstElement; + } + + Shell shell = HandlerUtil.getActiveShell(event); + System.err.println(s); + // make the dialog + final File file = displayFileDialog(shell); + + if (file == null) + { + return null; + } + + Repository repo = getRepositoryFromSelection(structuredSelection); + + if (repo != null) + { + if (project != null) { + File f = new File(project.getLocation() + "/.toifProject.ser"); + f.delete(); + } + processTSVFile(shell, file, repo); + ReportView view = (ReportView) PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().findView(ReportView.VIEW_ID); + + if (view != null) { + view.updateInput(null); + } + ModelUtil.buildModel(s); + + } + + + + } + + return null; + } + + /** + * Process the tsv file. this method steps through each line of the TSV + * file, extracts the details for that finding, and applies it to a matching + * finding in the repository. + * + * @param shell2 + * + * @param file + * the tsvFile that we are parsing + * @param repo + * the event from the handler. + */ + private void processTSVFile(final Shell shell, final File file, final Repository repo) + { + // count the line numbers. + final int lineNumbers = countLineNumbers(file); + + ProgressMonitorDialog dialog = new ProgressMonitorDialog(shell); + + try + { + dialog.run(true, true, new IRunnableWithProgress() { + + public void run(IProgressMonitor monitor) + { + monitor.beginTask("Importing TSV File...", lineNumbers); + + BufferedReader bufRdr = null; + try + { + bufRdr = new BufferedReader(new FileReader(file)); + + String line = null; + + RepositoryConnection con = null; + + try + { + con = repo.getConnection(); + } + catch (RepositoryException e) + { + e.printStackTrace(); + } + + if (con == null) + { + System.err.println("Could not create the repository connection..."); + return; + } + + org.openrdf.model.ValueFactory factory = con.getValueFactory(); + + // read each line of text file= + while ((line = bufRdr.readLine()) != null) + { + // split on a tab (tsv file). + String[] tokens = line.split("\t"); + + if (tokens.length != 9) + { + monitor.worked(1); + continue; + } + + // get the details + String valid = tokens[2]; + String trust = tokens[3]; + String resource = tokens[4]; + String lineNumber = tokens[5]; + String description = tokens[8]; + + try + { + String query = "SELECT ?finding ?description WHERE { ?codeLocation \"" + + resource + + "\". ?codeLocation \"" + + lineNumber + + "\". ?finding ?codeLocation . ?finding ?descriptionId . ?descriptionId ?description }"; + + TupleQuery tupleQuery = con.prepareTupleQuery(QueryLanguage.SPARQL, query); + + // query the repository. + TupleQueryResult queryResult = tupleQuery.evaluate(); + + while (queryResult.hasNext()) + { + String[] descriptionTokens = description.split(":"); + + if (descriptionTokens.length < 1) + { + continue; + } + String ident = descriptionTokens[0]; + + BindingSet adaptorSet = queryResult.next(); + Value finding = adaptorSet.getValue("finding"); + Value desc = adaptorSet.getValue("description"); + + if (!desc.stringValue().startsWith(ident)) + { + continue; + } + + URI findingURI = factory.createURI(finding.stringValue()); + + // set the trust + URI trustURI = factory.createURI("http://toif/trust"); + + con.remove(findingURI, trustURI, null); + + con.add(findingURI, trustURI, factory.createLiteral(trust)); + + // set the validity + URI validURI = factory.createURI("http://toif/isWeakness"); + + con.remove(findingURI, validURI, null); + + con.add(findingURI, validURI, factory.createLiteral(valid)); + + } + + } + catch (RepositoryException e) + { + e.printStackTrace(); + } + catch (MalformedQueryException e) + { + e.printStackTrace(); + } + catch (QueryEvaluationException e) + { + e.printStackTrace(); + } + + // update the row for the progress. + monitor.worked(1); + } + + // close the file + bufRdr.close(); + } + catch (FileNotFoundException e) + { + // TODO Auto-generated catch block + e.printStackTrace(); + } + catch (IOException e) + { + // TODO Auto-generated catch block + e.printStackTrace(); + } + finally + { + if (bufRdr != null) + { + try + { + bufRdr.close(); + } + catch (IOException e) + { + e.printStackTrace(); + } + } + } + + monitor.done(); + } + + }); + } + catch (InvocationTargetException e) + { + e.printStackTrace(); + } + catch (InterruptedException e) + { + e.printStackTrace(); + } + } + + /** + * get the repository from the selection. + * + * @param s + * the event from the handler. + * @return the repository. + */ + private Repository getRepositoryFromSelection(final IStructuredSelection selection) + { + Repository repository = null; + + Object element = selection.getFirstElement(); + + if (element instanceof IProject) + { + IProject iProject = (IProject) element; + IFolder folder = iProject.getFolder(".KDM/repository"); + repository = getRepository(folder); + + } + return repository; + } + + /** + * Count the line numbers in the file. + * + * @param file + * the file in which to count the line numbers + * @return the number of lines as an int. + */ + private int countLineNumbers(File file) + { + // count the libne numbers for the progress + LineNumberReader lnr = null; + int lineNumbers = 0; + try + { + lnr = new LineNumberReader(new FileReader(file)); + lnr.skip(Long.MAX_VALUE); + lineNumbers = lnr.getLineNumber(); + lnr.close(); + } + catch (FileNotFoundException e1) + { + e1.printStackTrace(); + } + catch (IOException e) + { + e.printStackTrace(); + } + finally + { + if (lnr != null) + { + try + { + lnr.close(); + } + catch (IOException e) + { + e.printStackTrace(); + } + } + } + return lineNumbers; + } + + /** + * display the dialog to find the tsv file. + * + * @param event + * the event from the handler execute method. + * @return the file that has been selected by the user. + */ + private File displayFileDialog(final Shell shell) + { + FileDialog dialog = new FileDialog(shell, SWT.SAVE); + + dialog.setFilterNames(new String[] { "TSV Files", "All Files (*.*)" }); + dialog.setFilterExtensions(new String[] { "*.tsv", "*.*" }); + dialog.setFilterPath(System.getProperty("user.dir")); + dialog.setFileName(""); + + final String open = dialog.open(); + if (open == null) + { + return null; + } + + File file = new File(open); + + if (!file.exists()) + { + MessageDialog.openQuestion(shell, "No File", "An incorrect file has been choosen...\nNothing will happen."); + return null; + } + + System.err.println(file.toString()); + return file; + } + + /** + * get the repository. this may be complicated by the fact that we dont know + * if we are in the workbench or not. + * + * think about turning this method into a utility... + * + * @param folder + * the folder that contains the repository. + * @return the repository. + */ + public Repository getRepository(IFolder folder) + { + + if (folder == null) + { + return null; + } + + IRepositoryMaker repMaker = getRepositoryMaker(folder); + Repository repository = repMaker.getRepository(); + + try + { + repository.initialize(); + + } + catch (RepositoryException e) + { + + e.printStackTrace(); + } + + return repository; + + } + + /** + * get the repository maker. this is so that we can retreive the repository + * if we are in the workbench or stand alone. + * + * think about turning this method into a utility... + * + * @param folder + * the folder which contains the repository. + * @return the repository maker. + */ + private IRepositoryMaker getRepositoryMaker(IFolder folder) + { + IConfigurationElement[] config = Platform.getExtensionRegistry().getConfigurationElementsFor( + "com.kdmanalytics.toif.report.repositoryMaker.extensionpoint"); + try + { + for (IConfigurationElement e : config) + { + System.out.println("Evaluating extension"); + + final Object o = e.createExecutableExtension("class"); + + if (o instanceof IRepositoryMaker) + { + IRepositoryMaker repositoryMaker = (IRepositoryMaker) o; + repositoryMaker.setFolder(folder); + repositoryMaker.createRepository(); + return repositoryMaker; + } + } + } + catch (CoreException e) + { + System.err.println("There was a core excption... " + e); + } + return null; + } + +} diff --git a/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/handlers/ModelUtil.java b/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/handlers/ModelUtil.java new file mode 100644 index 00000000..8f1e930c --- /dev/null +++ b/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/handlers/ModelUtil.java @@ -0,0 +1,386 @@ +/******************************************************************************* + * Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This program and + * the accompanying materials are made available under the terms of the Open + * Source Initiative OSI - Open Software License v3.0 which accompanies this + * distribution, and is available at + * http://www.opensource.org/licenses/osl-3.0.php/ + ******************************************************************************/ + +package com.kdmanalytics.toif.report.internal.handlers; + +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.io.ObjectInputStream; +import java.lang.reflect.InvocationTargetException; +import java.util.Collection; +import java.util.LinkedList; +import java.util.List; + +import org.eclipse.core.resources.IContainer; +import org.eclipse.core.resources.IFolder; +import org.eclipse.core.resources.IProject; +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.SubMonitor; +import org.eclipse.jdt.core.IJavaProject; +import org.eclipse.jface.dialogs.ProgressMonitorDialog; +import org.eclipse.jface.operation.IRunnableWithProgress; +import org.eclipse.jface.viewers.ISelection; +import org.eclipse.jface.viewers.IStructuredSelection; +import org.eclipse.ui.IPerspectiveDescriptor; +import org.eclipse.ui.IViewPart; +import org.eclipse.ui.IWorkbenchPage; +import org.eclipse.ui.IWorkbenchWindow; +import org.eclipse.ui.PartInitException; +import org.eclipse.ui.PlatformUI; +import org.openrdf.model.URI; +import org.openrdf.model.ValueFactory; +import org.openrdf.repository.Repository; +import org.openrdf.repository.RepositoryConnection; +import org.openrdf.repository.RepositoryException; + +import com.kdmanalytics.toif.report.internal.items.FindingEntry; +import com.kdmanalytics.toif.report.internal.items.ProjectFactory; +import com.kdmanalytics.toif.report.internal.views.ReportView; +import com.kdmanalytics.toif.report.items.IFindingEntry; +import com.kdmanalytics.toif.report.items.IToifProject; + +/** + * Utilities for the toif model. + * + * @author Adam Nunn + * + */ +public class ModelUtil +{ + + private ModelUtil() + { + // private constructor to prevent construction + } + + /** + * Sets the trust values on findings. + * + * @param ss + * the ss + * @param treeViewer + * the tree viewer + * @param value + * the value + */ + public static void setTrustValuesOnFindings(final Collection findingEntries, final IToifProject project, final Integer value, + final IProgressMonitor monitor) + { + SubMonitor progress = SubMonitor.convert(monitor, 100); + SubMonitor loopProgress = progress.newChild(100).setWorkRemaining(findingEntries.size()); + + final Repository rep = project.getRepository(); + final List entries = new LinkedList(); + for (FindingEntry entry : findingEntries) + { + // get entry tool name + String toolName = entry.getTool().toString(); + + // get entry weakness term. + String descriptor = entry.getDescription().split(":")[0]; + + List projEntries = entry.getProject().getFindingEntries(); + SubMonitor innerLoopProgress = loopProgress.newChild(100).setWorkRemaining(projEntries.size()); + + // for each finding, match the weakness term and tool + // name. + // if a match, set its trust. + for (FindingEntry finding : projEntries) + { + // get entry tool name + String findingToolName = finding.getTool().toString(); + innerLoopProgress.setTaskName(findingToolName); + + // get entry weakness term. + String findingDescriptior = finding.getDescription(); + + if (findingToolName.equals(toolName) && findingDescriptior.startsWith(descriptor)) + { + finding.setTrust(value); + // + // treeViewer.update(finding, null); + entries.add(finding); + setTrustInRepository(finding, rep, value); + } + + innerLoopProgress.worked(1); + } + + } + + } + + /** + * Sets the trust in repository. + * + * @param finding + * the finding + * @param rep + * the rep + * @param value + * the value + */ + private static void setTrustInRepository(IFindingEntry finding, Repository rep, int value) + { + try + { + ValueFactory factory = rep.getValueFactory(); + RepositoryConnection con = rep.getConnection(); + + URI trustURI = factory.createURI("http://toif/trust"); + URI findingURI = factory.createURI(finding.getFindingId()); + + con.remove(findingURI, trustURI, null); + + con.add(findingURI, trustURI, factory.createLiteral(value)); + } + catch (RepositoryException e) + { + System.err.println("Could not add or remove the trust statements in the repository: " + e); + } + + } + + /** + * Create the project model + * + * @param s + */ + public static void buildModel(ISelection s) + { + final ReportView view = (ReportView) openView(); + // final TreeViewer treeViewer = view.getViewer(); + + boolean inWorkbench = false; + IPerspectiveDescriptor[] desc = PlatformUI.getWorkbench().getPerspectiveRegistry().getPerspectives(); + + for (IPerspectiveDescriptor iPerspectiveDescriptor : desc) + { + if (iPerspectiveDescriptor.getId().equals("com.kdmanalytics.kdmwb.kdm.ui.KdmPerspective")) + { + inWorkbench = true; + break; + } + } + + if (s instanceof IStructuredSelection) + { + IProject iProject = null; + + for (Object object : ((IStructuredSelection) s).toArray()) + { + if (object instanceof IProject) + { + iProject = (IProject) object; + } + } + + if (iProject != null) + { + + File file = new File(iProject.getLocation() + "/.toifProject.ser"); + + if (file.exists()) + { + + try + { + FileInputStream fileIn = new FileInputStream(file); + ObjectInputStream in = new ObjectInputStream(fileIn); + IToifProject project = (IToifProject) in.readObject(); + in.close(); + fileIn.close(); + + if (project != null) + { + System.out.println("toif project deserialized"); + // view.getTableViewer().setInput(project); + + IFolder repoFolder = ensureKdmRepoFolderExists(iProject); + project.setRepository(repoFolder); + project.setIProject(repoFolder.getProject()); + // project.setIProject(iProject.getLocation()); + + view.clearInput(); + view.updateInput(project); + view.refresh(); + return; + } + } + catch (IOException i) + { + i.printStackTrace(); + // return; + } + catch (ClassNotFoundException c) + { + System.out.println("IToifProject class not found"); + c.printStackTrace(); + // return; + } + catch (CoreException e) + { + System.out.println("repo folder could not be found"); + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + } + + final boolean wbValue = inWorkbench; + final IFolder folder = getFolderFromSelection((IStructuredSelection) s); + if (folder != null) + { + ProgressMonitorDialog dialog = new ProgressMonitorDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell()); + try + { + IRunnableWithProgress runnable = new IRunnableWithProgress() { + + @Override + public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException + { + monitor.setTaskName("Populating TOIF View."); + final IToifProject project = ProjectFactory.createProjectModel(folder, wbValue, monitor); + + // have to set the input on the UI thread + PlatformUI.getWorkbench().getDisplay().syncExec(new Runnable() { + + @Override + public void run() + { + view.setReportInput(project); + } + }); + + } + }; + + dialog.run(true, false, runnable); + } + catch (InvocationTargetException e) + { + // TODO Auto-generated catch block + e.printStackTrace(); + } + catch (InterruptedException e) + { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + } + } + } + + /** + * open the report view. + * + * @return + */ + private static IViewPart openView() + { + try + { + IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow(); + if (window != null) + { + IWorkbenchPage page = window.getActivePage(); + if (page != null) + { + return page.showView(ReportView.VIEW_ID); + + } + + } + } + catch (PartInitException e) + { + e.printStackTrace(); + } + return null; + } + + /** + * get the project folder from the selection + * + * @param selection + * @return + */ + private static IFolder getFolderFromSelection(IStructuredSelection selection) + { + IFolder folder = null; + for (Object object : selection.toArray()) + { + try + { + if (object instanceof IProject) + { + IProject project = (IProject) object; + folder = ensureKdmRepoFolderExists(project); + } + else if (object instanceof IJavaProject) + { + IJavaProject project = (IJavaProject) object; + folder = ensureKdmRepoFolderExists(project.getProject()); + } + } + catch (CoreException ce) + { + ce.printStackTrace(); + return null; + } + } + return folder; + } + + /** + * makes sure that the kdm repository folder does exist. + * + * @param project + * the kdm project + * @throws CoreException + */ + private static IFolder ensureKdmRepoFolderExists(final IProject project) throws CoreException + { + IFolder kdmDataDir = project.getFolder(".KDM"); + if (!kdmDataDir.exists()) + { + kdmDataDir.create(true, true, null); + } + + IFolder kdmRepoDir = kdmDataDir.getFolder("repository"); + if (!kdmRepoDir.exists()) + { + kdmRepoDir.create(true, true, null); + } + return kdmRepoDir; + } + + /** + * gets the project folder ready. + * + * @param folder + * @throws CoreException + */ + public void prepareFolder(IFolder folder) throws CoreException + { + if (!folder.exists()) + { + folder.create(true, true, null); + } + + IContainer parent = folder.getParent(); + if (parent instanceof IFolder) + { + prepareFolder((IFolder) parent); + } + } + +} diff --git a/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/handlers/MoreInformationHandler.java b/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/handlers/MoreInformationHandler.java new file mode 100644 index 00000000..8a6d8c2f --- /dev/null +++ b/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/handlers/MoreInformationHandler.java @@ -0,0 +1,89 @@ +/******************************************************************************* + * Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This program and + * the accompanying materials are made available under the terms of the Open + * Source Initiative OSI - Open Software License v3.0 which accompanies this + * distribution, and is available at + * http://www.opensource.org/licenses/osl-3.0.php/ + ******************************************************************************/ + +package com.kdmanalytics.toif.report.internal.handlers; + +import java.net.MalformedURLException; +import java.net.URL; + +import org.eclipse.core.commands.AbstractHandler; +import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.core.commands.IHandler; +import org.eclipse.jface.viewers.IStructuredSelection; +import org.eclipse.ui.PartInitException; +import org.eclipse.ui.PlatformUI; +import org.eclipse.ui.browser.IWebBrowser; +import org.eclipse.ui.browser.IWorkbenchBrowserSupport; +import org.eclipse.ui.handlers.HandlerUtil; + +import com.kdmanalytics.toif.report.internal.items.ToifReportEntry; +import com.kdmanalytics.toif.report.items.IFindingEntry; +import com.kdmanalytics.toif.report.items.IToifReportEntry; + +/** + * The Class MoreInformationHandler. for displaying more information about the + * cwe. + * + * @author Kyle Girard + * @author Adam Nunn + */ +public class MoreInformationHandler extends AbstractHandler implements IHandler +{ + + /* + * (non-Javadoc) + * + * @see + * org.eclipse.core.commands.AbstractHandler#execute(org.eclipse.core.commands + * .ExecutionEvent) + */ + @Override + public Object execute(ExecutionEvent event) throws ExecutionException + { + IStructuredSelection selection = (IStructuredSelection) HandlerUtil.getCurrentSelection(event); + + for (Object o : ((IStructuredSelection) selection).toArray()) + { + if (o instanceof ToifReportEntry) + { + IFindingEntry entry = ((IToifReportEntry) o).getFindingEntry(); + String cwe = entry.getCwe(); + + IWorkbenchBrowserSupport browserSupport = PlatformUI.getWorkbench().getBrowserSupport(); + IWebBrowser browser; + try + { + browser = browserSupport.createBrowser(IWorkbenchBrowserSupport.LOCATION_BAR, null, cwe, cwe); + URL url = new URL("http://cwe.mitre.org/data/definitions/" + cwe.replace("CWE-", "") + ".html"); + browser.openURL(url); + } + catch (PartInitException e) + { + e.printStackTrace(); + } + catch (MalformedURLException e) + { + e.printStackTrace(); + } + + } + } + return null; + } + + /** + * + */ + @Override + public boolean isEnabled() + { + return true; + } + +} diff --git a/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/handlers/NotWeaknessPropertyTest.java b/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/handlers/NotWeaknessPropertyTest.java new file mode 100644 index 00000000..b3734fdd --- /dev/null +++ b/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/handlers/NotWeaknessPropertyTest.java @@ -0,0 +1,31 @@ +/******************************************************************************* + * Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This program and the + * accompanying materials are made available under the terms of the Open Source + * Initiative OSI - Open Software License v3.0 which accompanies this + * distribution, and is available at http://www.opensource.org/licenses/osl-3.0.php/ + ******************************************************************************/ + +package com.kdmanalytics.toif.report.internal.handlers; + +import org.eclipse.core.expressions.PropertyTester; + +/** + * + * @author Adam Nunn + * + */ +public class NotWeaknessPropertyTest extends PropertyTester +{ + + public NotWeaknessPropertyTest() + { + System.out.println("NotWeaknessPropertyTest.NotWeaknessPropertyTest()"); + } + + @Override + public boolean test(Object receiver, String property, Object[] args, Object expectedValue) + { + return true; + } + +} diff --git a/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/handlers/SetTrustHandler.java b/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/handlers/SetTrustHandler.java new file mode 100644 index 00000000..64f69e1b --- /dev/null +++ b/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/handlers/SetTrustHandler.java @@ -0,0 +1,134 @@ +/******************************************************************************* + * Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This program and + * the accompanying materials are made available under the terms of the Open + * Source Initiative OSI - Open Software License v3.0 which accompanies this + * distribution, and is available at + * http://www.opensource.org/licenses/osl-3.0.php/ + ******************************************************************************/ + +package com.kdmanalytics.toif.report.internal.handlers; + +import java.lang.reflect.InvocationTargetException; +import java.util.ArrayList; +import java.util.List; + +import org.eclipse.core.commands.AbstractHandler; +import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.jface.dialogs.IInputValidator; +import org.eclipse.jface.dialogs.InputDialog; +import org.eclipse.jface.dialogs.ProgressMonitorDialog; +import org.eclipse.jface.operation.IRunnableWithProgress; +import org.eclipse.jface.viewers.IStructuredSelection; +import org.eclipse.swt.widgets.Shell; +import org.eclipse.ui.handlers.HandlerUtil; + +import com.kdmanalytics.toif.report.internal.items.FindingEntry; +import com.kdmanalytics.toif.report.internal.items.ToifReportEntry; +import com.kdmanalytics.toif.report.internal.views.ReportView; +import com.kdmanalytics.toif.report.items.IToifReportEntry; + +/** + * handler for setting the trust of a finding. + * + * @author Adam Nunn + * @author Kyle Girard + * + */ +public class SetTrustHandler extends AbstractHandler +{ + + /* + * (non-Javadoc) + * + * @see + * org.eclipse.core.commands.AbstractHandler#execute(org.eclipse.core.commands + * .ExecutionEvent) + */ + @Override + public Object execute(ExecutionEvent event) throws ExecutionException + { + final IStructuredSelection ss = (IStructuredSelection) HandlerUtil.getCurrentSelection(event); + final ReportView view = (ReportView) HandlerUtil.getActivePart(event); + final Shell shell = HandlerUtil.getActiveShell(event); + final Integer value = getNewTrustValue(shell); + + IRunnableWithProgress runnable = new IRunnableWithProgress() { + + public void run(IProgressMonitor monitor) + { + if (value != null) + { + List entries = new ArrayList(ss.size()); + for (Object o : ss.toList()) + { + if (o instanceof ToifReportEntry) + { + IToifReportEntry toifReportEntry = (IToifReportEntry) o; + if (toifReportEntry.getFindingEntry() != null) + { + entries.add(toifReportEntry.getFindingEntry()); + } + } + } + ModelUtil.setTrustValuesOnFindings(entries, view.getReportInput(), value, monitor); + } + } + }; + + try + { + new ProgressMonitorDialog(shell).run(true, false, runnable); + } + catch (InvocationTargetException e) + { + System.err.println("Unable to Set trust values." + e); + } + catch (InterruptedException e) + { + System.err.println("Unable to Set trust values." + e); + } + + view.refresh(); + return null; + } + + /** + * Gets the new trust value. + * + * @param shell + * + * @return the new trust value + */ + private Integer getNewTrustValue(Shell shell) + { + InputDialog dlg = new InputDialog(shell, "Trust Level", "Set the trust level:", "0", new IInputValidator() { + + @Override + public String isValid(String newText) + { + try + { + Integer.parseInt(newText); + } + catch (NumberFormatException e) + { + return "This value should be an Integer!"; + } + return null; + } + }); + dlg.open(); + Integer value = null; + try + { + value = Integer.valueOf(dlg.getValue()); + } + catch (NumberFormatException e) + { + return null; + } + return value; + } +} diff --git a/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/handlers/TraceContributionHandler.java b/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/handlers/TraceContributionHandler.java new file mode 100644 index 00000000..9308d957 --- /dev/null +++ b/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/handlers/TraceContributionHandler.java @@ -0,0 +1,99 @@ +/******************************************************************************* + * Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This program and + * the accompanying materials are made available under the terms of the Open + * Source Initiative OSI - Open Software License v3.0 which accompanies this + * distribution, and is available at + * http://www.opensource.org/licenses/osl-3.0.php/ + ******************************************************************************/ + +package com.kdmanalytics.toif.report.internal.handlers; + +import java.util.HashMap; + +import org.eclipse.core.commands.AbstractHandler; +import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.core.resources.IMarker; +import org.eclipse.core.resources.IProject; +import org.eclipse.core.resources.IResource; +import org.eclipse.core.runtime.CoreException; +import org.eclipse.jface.dialogs.MessageDialog; +import org.eclipse.jface.viewers.IStructuredSelection; +import org.eclipse.ui.IWorkbenchPage; +import org.eclipse.ui.PlatformUI; +import org.eclipse.ui.handlers.HandlerUtil; +import org.eclipse.ui.ide.IDE; + +import com.kdmanalytics.toif.report.internal.items.FileGroup; +import com.kdmanalytics.toif.report.internal.items.FindingEntry; +import com.kdmanalytics.toif.report.internal.util.MemberUtil; +import com.kdmanalytics.toif.report.items.IToifReportEntry; + +/** + * handles the displaying of the source from the trace contributions. + * + * @author Adam Nunn + * + */ +public class TraceContributionHandler extends AbstractHandler +{ + + /* + * (non-Javadoc) + * + * @see + * org.eclipse.core.commands.AbstractHandler#execute(org.eclipse.core.commands + * .ExecutionEvent) + */ + @Override + public Object execute(ExecutionEvent event) throws ExecutionException + { + final IStructuredSelection s = (IStructuredSelection) HandlerUtil.getCurrentSelection(event); + + final String lineNumber = event.getParameter("com.kdmanalytics.toif.report.lineNumber"); + + if (s.isEmpty()) + { + return null; + } + + Object element = s.getFirstElement(); + + if (element instanceof IToifReportEntry) + { + IToifReportEntry iToifReportEntry = (IToifReportEntry) element; + + FindingEntry fEntry = iToifReportEntry.getFindingEntry(); + + IProject activeProject = iToifReportEntry.getProject().getIProject(); + + try + { + FileGroup file = (FileGroup) fEntry.getParent().getParent().getParent(); + IResource member = MemberUtil.findMembers(activeProject, file); + + if (member == null) + { + MessageDialog.openWarning(null, "No Source File Found!", "A source file could not be found for this location."); + return null; + } + + IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage(); + HashMap map = new HashMap(); + + map.put(IMarker.LINE_NUMBER, Integer.parseInt(lineNumber)); + + IMarker marker = member.createMarker(IMarker.TEXT); + marker.setAttributes(map); + IDE.openEditor(page, marker); + marker.delete(); + } + catch (CoreException exception) + { + exception.printStackTrace(); + } + } + return null; + } + +} diff --git a/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/handlers/TrustSelectionListener.java b/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/handlers/TrustSelectionListener.java new file mode 100644 index 00000000..2c7ff6bb --- /dev/null +++ b/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/handlers/TrustSelectionListener.java @@ -0,0 +1,73 @@ +/******************************************************************************* + * Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This program and the + * accompanying materials are made available under the terms of the Open Source + * Initiative OSI - Open Software License v3.0 which accompanies this + * distribution, and is available at http://www.opensource.org/licenses/osl-3.0.php/ + ******************************************************************************/ + +package com.kdmanalytics.toif.report.internal.handlers; + +import org.eclipse.swt.events.SelectionEvent; +import org.eclipse.swt.events.SelectionListener; +import org.eclipse.swt.widgets.Text; + +/** + * @Author Adam Nunn + * + */ +public class TrustSelectionListener implements SelectionListener +{ + + private Text trustAmount; + + public TrustSelectionListener(Text trustAmount) + { + this.trustAmount = trustAmount; + + } + + protected final String getTrustText() + { + return trustAmount.getText(); + } + + /** + * Sets the trustAmount + * + * @param trustAmount + * The Text Widget for the trust. + */ + public void setTrustAmount(Text trustAmount) + { + this.trustAmount = trustAmount; + + } + + /* + * (non-Javadoc) + * + * @see + * org.eclipse.swt.events.SelectionListener#widgetDefaultSelected(org.eclipse + * .swt.events.SelectionEvent) + */ + @Override + public void widgetDefaultSelected(SelectionEvent e) + { + // TODO Auto-generated method stub + + } + + /* + * (non-Javadoc) + * + * @see + * org.eclipse.swt.events.SelectionListener#widgetSelected(org.eclipse.swt + * .events.SelectionEvent) + */ + @Override + public void widgetSelected(SelectionEvent e) + { + + } + +} diff --git a/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/handlers/UncitedWeaknessHandler.java b/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/handlers/UncitedWeaknessHandler.java new file mode 100644 index 00000000..c6bee831 --- /dev/null +++ b/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/handlers/UncitedWeaknessHandler.java @@ -0,0 +1,92 @@ +/******************************************************************************* + * Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This program and + * the accompanying materials are made available under the terms of the Open + * Source Initiative OSI - Open Software License v3.0 which accompanies this + * distribution, and is available at + * http://www.opensource.org/licenses/osl-3.0.php/ + ******************************************************************************/ + +package com.kdmanalytics.toif.report.internal.handlers; + +import org.eclipse.core.commands.AbstractHandler; +import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.jface.viewers.IStructuredSelection; +import org.eclipse.ui.handlers.HandlerUtil; +import org.openrdf.model.URI; +import org.openrdf.model.ValueFactory; +import org.openrdf.repository.Repository; +import org.openrdf.repository.RepositoryConnection; +import org.openrdf.repository.RepositoryException; + +import com.kdmanalytics.toif.report.internal.items.FindingEntry.Citing; +import com.kdmanalytics.toif.report.internal.views.ReportView; +import com.kdmanalytics.toif.report.items.IFindingEntry; +import com.kdmanalytics.toif.report.items.IToifReportEntry; + +/** + * removes the isweakness in the repository + * + * @author Adam Nunn + * + */ +public class UncitedWeaknessHandler extends AbstractHandler +{ + + /* + * (non-Javadoc) + * + * @see + * org.eclipse.core.commands.AbstractHandler#execute(org.eclipse.core.commands + * .ExecutionEvent) + */ + @Override + public Object execute(ExecutionEvent event) throws ExecutionException + { + final IStructuredSelection s = (IStructuredSelection) HandlerUtil.getCurrentSelection(event); + final ReportView view = (ReportView) HandlerUtil.getActivePart(event); + + Repository rep = view.getReportInput().getRepository(); + for (Object obj : s.toArray()) + { + if (obj instanceof IToifReportEntry) + { + IToifReportEntry toifReportEntry = (IToifReportEntry) obj; + IFindingEntry entry = toifReportEntry.getFindingEntry(); + entry.setIsOk(Citing.UNKNOWN); + removeIsOkInRepository(rep, entry); + + } + } + view.refresh(); + return null; + } + + /** + * Sets the is ok in repository. + * + * @param rep + * the rep + * @param finding + * the finding + */ + private void removeIsOkInRepository(Repository rep, IFindingEntry finding) + { + try + { + ValueFactory factory = rep.getValueFactory(); + RepositoryConnection con = rep.getConnection(); + + URI isWeaknessURI = factory.createURI("http://toif/isWeakness"); + URI findingURI = factory.createURI(finding.getFindingId()); + + con.remove(findingURI, isWeaknessURI, null); + + } + catch (RepositoryException e) + { + System.err.println("Could not add or remove the trust statements in the repository: " + e); + } + + } +} diff --git a/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/handlers/WeaknessHandler.java b/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/handlers/WeaknessHandler.java new file mode 100644 index 00000000..4f404de0 --- /dev/null +++ b/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/handlers/WeaknessHandler.java @@ -0,0 +1,100 @@ +/******************************************************************************* + * Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This program and + * the accompanying materials are made available under the terms of the Open + * Source Initiative OSI - Open Software License v3.0 which accompanies this + * distribution, and is available at + * http://www.opensource.org/licenses/osl-3.0.php/ + ******************************************************************************/ + +package com.kdmanalytics.toif.report.internal.handlers; + +import org.eclipse.core.commands.AbstractHandler; +import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.jface.viewers.IStructuredSelection; +import org.eclipse.ui.handlers.HandlerUtil; +import org.openrdf.model.URI; +import org.openrdf.model.ValueFactory; +import org.openrdf.repository.Repository; +import org.openrdf.repository.RepositoryConnection; +import org.openrdf.repository.RepositoryException; + +import com.kdmanalytics.toif.report.internal.items.FindingEntry.Citing; +import com.kdmanalytics.toif.report.internal.views.ReportView; +import com.kdmanalytics.toif.report.items.IFindingEntry; +import com.kdmanalytics.toif.report.items.IToifReportEntry; + +/** + * sets the isweakness in the repository + * + * @author Adam Nunn + * @author Kyle Girard + * + */ +public class WeaknessHandler extends AbstractHandler +{ + + /* + * (non-Javadoc) + * + * @see + * org.eclipse.core.commands.AbstractHandler#execute(org.eclipse.core.commands + * .ExecutionEvent) + */ + @Override + public Object execute(ExecutionEvent event) throws ExecutionException + { + final IStructuredSelection s = (IStructuredSelection) HandlerUtil.getCurrentSelection(event); + final ReportView view = (ReportView) HandlerUtil.getActivePart(event); + + final String target = event.getParameter("com.kdmanalytics.toif.report.weaknessState"); + + boolean isWeakness = target.equals("isWeakness"); + Citing v = target.equals("isWeakness") ? Citing.TRUE : Citing.FALSE; + + + Repository rep = view.getReportInput().getRepository(); + for (Object obj : s.toArray()) + { + if (obj instanceof IToifReportEntry) + { + IToifReportEntry toifReportEntry = (IToifReportEntry) obj; + IFindingEntry entry = toifReportEntry.getFindingEntry(); + entry.setIsOk(v); + setIsOkInRepository(rep, entry); + } + } + view.refresh(); + return null; + } + + /** + * Sets the is ok in repository. + * + * @param rep + * the rep + * @param finding + * the finding + */ + private void setIsOkInRepository(Repository rep, IFindingEntry finding) + { + try + { + ValueFactory factory = rep.getValueFactory(); + RepositoryConnection con = rep.getConnection(); + + URI isWeaknessURI = factory.createURI("http://toif/isWeakness"); + URI findingURI = factory.createURI(finding.getFindingId()); + + con.remove(findingURI, isWeaknessURI, null); + + Citing citing = finding.isOk(); + con.add(findingURI, isWeaknessURI, factory.createLiteral(citing.toString())); + } + catch (RepositoryException e) + { + System.err.println("Could not add or remove the trust statements in the repository: " + e); + } + + } +} diff --git a/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/handlers/ccrHandler.java b/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/handlers/ccrHandler.java new file mode 100644 index 00000000..4c4ca1e4 --- /dev/null +++ b/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/handlers/ccrHandler.java @@ -0,0 +1,105 @@ +/******************************************************************************* + * Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This program and + * the accompanying materials are made available under the terms of the Open + * Source Initiative OSI - Open Software License v3.0 which accompanies this + * distribution, and is available at + * http://www.opensource.org/licenses/osl-3.0.php/ + ******************************************************************************/ + +package com.kdmanalytics.toif.report.internal.handlers; + +import java.io.File; + +import org.eclipse.core.commands.AbstractHandler; +import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.core.commands.IHandler; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Status; +import org.eclipse.core.runtime.SubMonitor; +import org.eclipse.core.runtime.jobs.Job; +import org.eclipse.swt.SWT; +import org.eclipse.swt.widgets.FileDialog; +import org.eclipse.swt.widgets.Shell; +import org.eclipse.ui.IWorkbenchPage; +import org.eclipse.ui.IWorkbenchWindow; +import org.eclipse.ui.handlers.HandlerUtil; + +import com.kdmanalytics.toif.ccr.CoverageClaimGenerator; +import com.kdmanalytics.toif.report.internal.views.ReportView; +import com.kdmanalytics.toif.report.items.IToifProject; + +/** + * executes the coverage claims generator. + * + * @author Adam Nunn + * @author Kyle Girard + * + */ +public class ccrHandler extends AbstractHandler implements IHandler +{ + + /* + * (non-Javadoc) + * + * @see + * org.eclipse.core.commands.AbstractHandler#execute(org.eclipse.core.commands + * .ExecutionEvent) + */ + @Override + public Object execute(ExecutionEvent event) throws ExecutionException + { + final IWorkbenchWindow window = HandlerUtil.getActiveWorkbenchWindow(event); + final IWorkbenchPage page = window.getActivePage(); + final ReportView view = (ReportView) page.findView(ReportView.VIEW_ID); + // Display display = new Display(); + Shell shell = HandlerUtil.getActiveShell(event); + shell.open(); + FileDialog dialog = new FileDialog(shell, SWT.SAVE); + dialog.setFilterNames(new String[] { "XML Files", "All Files (*.*)" }); + dialog.setFilterExtensions(new String[] { "*.xml", "*.*" }); + dialog.setFilterPath(System.getProperty("user.dir")); + dialog.setFileName("toif_Coverage.xml"); + final String savePath = dialog.open(); + + if (savePath == null) + { + return null; + } + + try + { + final IToifProject proj = (IToifProject) view.getReportInput(); + + class CcrJob extends Job + { + + public CcrJob() + { + super("Making Coverage Report..."); + } + + public IStatus run(IProgressMonitor monitor) + { + SubMonitor progress = SubMonitor.convert(monitor); + progress.beginTask("Creating Coverage Report...", IProgressMonitor.UNKNOWN); + // make and run the coverage generator. + new CoverageClaimGenerator(proj.getRepository(), new File(savePath), false); + return Status.OK_STATUS; + } + } + ; + new CcrJob().schedule(); + + } + catch (NullPointerException e) + { + System.err.println("There was a null pointer exception."); + e.printStackTrace(); + } + + return null; + } + +} diff --git a/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/handlers/package-info.java b/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/handlers/package-info.java new file mode 100644 index 00000000..90dedc61 --- /dev/null +++ b/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/handlers/package-info.java @@ -0,0 +1,10 @@ +/******************************************************************************* + * Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This + * program and the // accompanying materials are made available under the terms + * of the Open Source // Initiative OSI - Open Software License v3.0 which + * accompanies this // distribution, and is available at + * http://www.opensource.org/licenses/osl-3.0.php/ + ******************************************************************************/ + +package com.kdmanalytics.toif.report.internal.handlers; + diff --git a/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/importWizard/RepositoryImportWizard.java b/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/importWizard/RepositoryImportWizard.java new file mode 100644 index 00000000..e680a3cd --- /dev/null +++ b/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/importWizard/RepositoryImportWizard.java @@ -0,0 +1,66 @@ +/******************************************************************************* + * Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This program and the + * accompanying materials are made available under the terms of the Open Source + * Initiative OSI - Open Software License v3.0 which accompanies this + * distribution, and is available at http://www.opensource.org/licenses/osl-3.0.php/ + ******************************************************************************/ + +package com.kdmanalytics.toif.report.internal.importWizard; + +import org.eclipse.jface.viewers.IStructuredSelection; +import org.eclipse.jface.wizard.Wizard; +import org.eclipse.ui.IImportWizard; +import org.eclipse.ui.IWorkbench; + +/** + * Import a TOIF file into the internal defect database. + * + * @author Ken Duck + * @author Adam Nunn + * + */ +public class RepositoryImportWizard extends Wizard implements IImportWizard +{ + + RepositoryImportWizardPage mainPage; + + public RepositoryImportWizard() + { + super(); + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.jface.wizard.Wizard#performFinish() + */ + public boolean performFinish() + { + return mainPage.finish(); + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.ui.IWorkbenchWizard#init(org.eclipse.ui.IWorkbench, + * org.eclipse.jface.viewers.IStructuredSelection) + */ + public void init(IWorkbench workbench, IStructuredSelection selection) + { + setWindowTitle("File Import Wizard"); // NON-NLS-1 + setNeedsProgressMonitor(true); + mainPage = new RepositoryImportWizardPage("Import TOIF Data", selection); // NON-NLS-1 + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.jface.wizard.IWizard#addPages() + */ + public void addPages() + { + super.addPages(); + addPage(mainPage); + } + +} diff --git a/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/importWizard/RepositoryImportWizardPage.java b/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/importWizard/RepositoryImportWizardPage.java new file mode 100644 index 00000000..27acfc51 --- /dev/null +++ b/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/importWizard/RepositoryImportWizardPage.java @@ -0,0 +1,288 @@ +/******************************************************************************* + * Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This program and + * the accompanying materials are made available under the terms of the Open + * Source Initiative OSI - Open Software License v3.0 which accompanies this + * distribution, and is available at + * http://www.opensource.org/licenses/osl-3.0.php/ + ******************************************************************************/ + +package com.kdmanalytics.toif.report.internal.importWizard; + +import org.apache.log4j.Logger; +import org.eclipse.core.filesystem.EFS; +import org.eclipse.core.filesystem.IFileStore; +import org.eclipse.core.resources.IFolder; +import org.eclipse.core.resources.IProject; +import org.eclipse.core.resources.ResourcesPlugin; +import org.eclipse.core.runtime.IPath; +import org.eclipse.core.runtime.Path; +import org.eclipse.core.runtime.jobs.Job; +import org.eclipse.jface.preference.DirectoryFieldEditor; +import org.eclipse.jface.viewers.ISelectionChangedListener; +import org.eclipse.jface.viewers.IStructuredSelection; +import org.eclipse.jface.viewers.SelectionChangedEvent; +import org.eclipse.jface.viewers.TreeViewer; +import org.eclipse.jface.viewers.ViewerComparator; +import org.eclipse.jface.wizard.WizardPage; +import org.eclipse.swt.SWT; +import org.eclipse.swt.events.ModifyEvent; +import org.eclipse.swt.events.ModifyListener; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Event; +import org.eclipse.swt.widgets.Label; +import org.eclipse.swt.widgets.Listener; +import org.eclipse.ui.model.WorkbenchLabelProvider; +import org.eclipse.ui.part.DrillDownComposite; + +import com.kdmanalytics.toif.report.internal.providers.TOIFImportTreeContentProvider; + +/** + * import wizard to add toif data to the project. + * + * @author Adam Nunn + * + */ +public class RepositoryImportWizardPage extends WizardPage implements Listener, ISelectionChangedListener, ModifyListener +{ + + private static final Logger LOG = Logger.getLogger(RepositoryImportWizardPage.class); + + private static final int SIZING_CONTAINER_GROUP_HEIGHT = 250; + + private static final int SIZING_SELECTION_PANE_WIDTH = 320; + + protected DirectoryFieldEditor editor; + + boolean complete = false; + + /** + * Target folder + * + */ + private IFolder repositoryFolder = null; + + private IProject project; + + private TOIFImportTreeContentProvider contentprovider; + + /** + * + * @param pageName + * @param selection + */ + public RepositoryImportWizardPage(String pageName, IStructuredSelection selection) + { + super(pageName); + setPageComplete(false); + } + + /* + * (non-Javadoc) + * + * @see + * org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets + * .Composite) + */ + @Override + public void createControl(Composite parent) + { + LOG.debug("Creating import wizard page"); + // The main page + Composite page = new Composite(parent, SWT.None); + GridLayout gl = new GridLayout(); + gl.numColumns = 1; + page.setLayout(gl); + + createFileSelectionArea(page); + + createProjectTree(page); + + // Set the page's control + setControl(page); + } + + /** + * create the file selection area + * + * @param page + */ + private void createFileSelectionArea(Composite page) + { + Composite fileSelectionArea = new Composite(page, SWT.NONE); + GridData fileSelectionData = new GridData(GridData.GRAB_HORIZONTAL | GridData.FILL_HORIZONTAL); + fileSelectionArea.setLayoutData(fileSelectionData); + + GridLayout fileSelectionLayout = new GridLayout(); + fileSelectionLayout.numColumns = 3; + fileSelectionLayout.makeColumnsEqualWidth = false; + fileSelectionLayout.marginWidth = 0; + fileSelectionLayout.marginHeight = 0; + fileSelectionArea.setLayout(fileSelectionLayout); + + editor = new DirectoryFieldEditor("fileSelect", "Select TOIF Data: ", fileSelectionArea); + + editor.setStringValue(""); + editor.getTextControl(fileSelectionArea).addModifyListener(this); + + } + + /** + * create the project tree in the dialog. + * + * @param page + */ + private void createProjectTree(Composite page) + { + Label label = new Label(page, SWT.NONE); + label.setText("Select target project:"); + + DrillDownComposite drillDown = new DrillDownComposite(page, SWT.BORDER); + GridData spec = new GridData(SWT.FILL, SWT.FILL, true, true); + spec.widthHint = SIZING_SELECTION_PANE_WIDTH; + spec.heightHint = SIZING_CONTAINER_GROUP_HEIGHT; + drillDown.setLayoutData(spec); + TreeViewer tree = new TreeViewer(drillDown, SWT.NONE); + drillDown.setChildTree(tree); + contentprovider = new TOIFImportTreeContentProvider(); + tree.setContentProvider(contentprovider); + tree.setLabelProvider(WorkbenchLabelProvider.getDecoratingWorkbenchLabelProvider()); + tree.setComparator(new ViewerComparator()); + tree.setUseHashlookup(true); + tree.setInput(ResourcesPlugin.getWorkspace()); + tree.addSelectionChangedListener(this); + } + + /** + * Perform the actual load. + * + * @return + */ + public boolean finish() + { + // Check source file + String name = editor.getStringValue(); + setErrorMessage("Importing " + name + " into " + project + "..."); + + final ToifReportImportJob job = new ToifReportImportJob("Import SFP/CWE Data", project, name); + job.setUser(true); + job.setPriority(Job.BUILD); + job.setRule(project); + job.schedule(); + + return true; + } + + /* + * (non-Javadoc) + * + * @see + * org.eclipse.swt.widgets.Listener#handleEvent(org.eclipse.swt.widgets. + * Event) + */ + @Override + public void handleEvent(Event event) + { + setPageComplete(); + } + + /* + * (non-Javadoc) + * + * @see + * org.eclipse.swt.events.ModifyListener#modifyText(org.eclipse.swt.events + * .ModifyEvent) + */ + @Override + public void modifyText(ModifyEvent e) + { + setPageComplete(); + } + + /* + * (non-Javadoc) + * + * @see + * org.eclipse.jface.viewers.ISelectionChangedListener#selectionChanged( + * org.eclipse.jface.viewers.SelectionChangedEvent) + */ + @Override + public void selectionChanged(SelectionChangedEvent event) + { + IStructuredSelection selection = (IStructuredSelection) event.getSelection(); + // Unset target folder + project = null; + repositoryFolder = null; + + if (selection.isEmpty()) + { + setErrorMessage("A target project must be selected"); + return; + } + Object first = selection.getFirstElement(); + if (first instanceof IProject) + { + project = (IProject) first; + IFolder toifFolder = project.getFolder(".KDM/repository"); + repositoryFolder = toifFolder.getFolder("repository"); + setPageComplete(); + return; + } + } + + /** + * Called to determine if the data is consistent, and if it is then set the + * page complete boolean. + * + */ + private void setPageComplete() + { + // Default is page is not complete + setPageComplete(false); + setMessage(null); + setErrorMessage(null); + + // Check input file + String name = editor.getStringValue(); + if (name == null) + { + setErrorMessage("No input file specified"); + return; + } + + if (name.isEmpty()) + { + setErrorMessage("No input file specified"); + return; + } + + if (project == null) + { + setErrorMessage("Select a target project"); + return; + } + + // Check for file existence + IPath location = new Path(name); + IFileStore srcStore = EFS.getLocalFileSystem().getStore(location); + if (!srcStore.fetchInfo().exists()) + { + setErrorMessage("Source file " + srcStore + " does not exist"); + return; + } + + // Check target folder + if (repositoryFolder == null || !repositoryFolder.exists()) + { + this.setMessage("Click finish to import into empty repository"); + } + else + { + this.setMessage("Click finish to integrate with existing repository"); + } + + // If we get here the results are good. + setPageComplete(true); + } +} diff --git a/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/importWizard/ToifReportImportJob.java b/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/importWizard/ToifReportImportJob.java new file mode 100644 index 00000000..5487ed7c --- /dev/null +++ b/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/importWizard/ToifReportImportJob.java @@ -0,0 +1,204 @@ +/******************************************************************************* + * Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This program and + * the accompanying materials are made available under the terms of the Open + * Source Initiative OSI - Open Software License v3.0 which accompanies this + * distribution, and is available at + * http://www.opensource.org/licenses/osl-3.0.php/ + ******************************************************************************/ + +package com.kdmanalytics.toif.report.internal.importWizard; + +import java.io.BufferedReader; +import java.io.File; +import java.io.FileReader; +import java.io.IOException; + +import org.apache.commons.io.FileUtils; +import org.eclipse.core.resources.IProject; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Status; +import org.eclipse.core.runtime.jobs.Job; +import org.eclipse.ui.IWorkbenchPage; +import org.eclipse.ui.IWorkbenchWindow; +import org.eclipse.ui.PartInitException; +import org.eclipse.ui.PlatformUI; +import org.openrdf.model.URI; +import org.openrdf.model.Value; +import org.openrdf.model.ValueFactory; +import org.openrdf.repository.Repository; +import org.openrdf.repository.RepositoryConnection; +import org.openrdf.repository.RepositoryException; +import org.openrdf.repository.sail.SailRepository; +import org.openrdf.rio.RDFFormat; +import org.openrdf.rio.RDFParseException; +import org.openrdf.sail.nativerdf.NativeStore; + +/** + * job that actually imports the toif data. + * + * @author Adam Nunn + * + */ +public class ToifReportImportJob extends Job +{ + + private final String name; + + private final IProject project; + + /** + * new job + * + * @param name + * @param contentprovider + */ + public ToifReportImportJob(String name, IProject project, String fname) + { + super(name); + this.name = fname; + this.project = project; + } + + /** + * copy the toif data. + * + * @param sourceFile + * source + * @param destinationFile + * destination file + * @throws IOException + */ + public void copy(File sourceFile, File destinationFile) throws IOException + { + + FileUtils.copyDirectory(sourceFile, destinationFile); + + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.core.runtime.jobs.Job#run(org.eclipse.core.runtime. + * IProgressMonitor) + */ + @Override + protected IStatus run(IProgressMonitor monitor) + { + File file = new File(name); + + File dataDir = new File(project.getFolder(".KDM/repository").getLocationURI()); + + if (file.isDirectory()) + { + + monitor.beginTask("Running SFP/CWE Importer", IProgressMonitor.UNKNOWN); + + try + { + copy(file, dataDir); + } + catch (IOException e) + { + e.printStackTrace(); + } + + } + else + { + + try + { + FileUtils.deleteDirectory(dataDir); + System.err.println("deleted"); + } + catch (IOException e1) + { + e1.printStackTrace(); + } + + Repository myRepository = new SailRepository(new NativeStore(dataDir)); + RepositoryConnection con = null; + try + { + monitor.beginTask("Running SFP/CWE Importer", IProgressMonitor.UNKNOWN); + + myRepository.initialize(); + + con = myRepository.getConnection(); + + try + { + String content = FileUtils.readFileToString(file, "UTF-8"); + + content = content.replace("KDM_Triple:1", ""); + + if (!content.contains(" + * + */ +public class ToifReportImportWizard extends Wizard implements IImportWizard +{ + + ToifReportImportWizardPage mainPage; + + public ToifReportImportWizard() + { + super(); + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.jface.wizard.Wizard#performFinish() + */ + public boolean performFinish() + { + return mainPage.finish(); + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.ui.IWorkbenchWizard#init(org.eclipse.ui.IWorkbench, + * org.eclipse.jface.viewers.IStructuredSelection) + */ + public void init(IWorkbench workbench, IStructuredSelection selection) + { + setWindowTitle("File Import Wizard"); // NON-NLS-1 + setNeedsProgressMonitor(true); + mainPage = new ToifReportImportWizardPage("Import TOIF Data", selection); // NON-NLS-1 + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.jface.wizard.IWizard#addPages() + */ + public void addPages() + { + super.addPages(); + addPage(mainPage); + } + +} diff --git a/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/importWizard/ToifReportImportWizardPage.java b/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/importWizard/ToifReportImportWizardPage.java new file mode 100644 index 00000000..f27ad448 --- /dev/null +++ b/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/importWizard/ToifReportImportWizardPage.java @@ -0,0 +1,288 @@ +/******************************************************************************* + * Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This program and + * the accompanying materials are made available under the terms of the Open + * Source Initiative OSI - Open Software License v3.0 which accompanies this + * distribution, and is available at + * http://www.opensource.org/licenses/osl-3.0.php/ + ******************************************************************************/ + +package com.kdmanalytics.toif.report.internal.importWizard; + +import org.apache.log4j.Logger; +import org.eclipse.core.filesystem.EFS; +import org.eclipse.core.filesystem.IFileStore; +import org.eclipse.core.resources.IFolder; +import org.eclipse.core.resources.IProject; +import org.eclipse.core.resources.ResourcesPlugin; +import org.eclipse.core.runtime.IPath; +import org.eclipse.core.runtime.Path; +import org.eclipse.core.runtime.jobs.Job; +import org.eclipse.jface.preference.FileFieldEditor; +import org.eclipse.jface.viewers.ISelectionChangedListener; +import org.eclipse.jface.viewers.IStructuredSelection; +import org.eclipse.jface.viewers.SelectionChangedEvent; +import org.eclipse.jface.viewers.TreeViewer; +import org.eclipse.jface.viewers.ViewerComparator; +import org.eclipse.jface.wizard.WizardPage; +import org.eclipse.swt.SWT; +import org.eclipse.swt.events.ModifyEvent; +import org.eclipse.swt.events.ModifyListener; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Event; +import org.eclipse.swt.widgets.Label; +import org.eclipse.swt.widgets.Listener; +import org.eclipse.ui.model.WorkbenchLabelProvider; +import org.eclipse.ui.part.DrillDownComposite; + +import com.kdmanalytics.toif.report.internal.providers.TOIFImportTreeContentProvider; + +/** + * Import a TOIF file into the internal defect database. + * + * @author Ken Duck + * @author Adam Nunn + * + */ +public class ToifReportImportWizardPage extends WizardPage implements Listener, ISelectionChangedListener, ModifyListener +{ + + private static final Logger LOG = Logger.getLogger(ToifReportImportWizardPage.class); + + private static final int SIZING_CONTAINER_GROUP_HEIGHT = 250; + + private static final int SIZING_SELECTION_PANE_WIDTH = 320; + + protected FileFieldEditor editor; + + boolean complete = false; + + /** + * Target folder + * + */ + private IFolder repositoryFolder = null; + + private IProject project; + + private TOIFImportTreeContentProvider contentprovider; + + /** + * create the import page + * + * @param pageName + * @param selection + */ + public ToifReportImportWizardPage(String pageName, IStructuredSelection selection) + { + super(pageName); + setPageComplete(false); + } + + /* + * (non-Javadoc) + * + * @see + * org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets + * .Composite) + */ + @Override + public void createControl(Composite parent) + { + LOG.debug("Creating import page"); + // The main page + Composite page = new Composite(parent, SWT.None); + GridLayout gl = new GridLayout(); + gl.numColumns = 1; + page.setLayout(gl); + + createFileSelectionArea(page); + + createProjectTree(page); + + // Set the page's control + setControl(page); + } + + /** + * create the project tree + * + * @param page + */ + private void createProjectTree(Composite page) + { + Label label = new Label(page, SWT.NONE); + label.setText("Select target project:"); + + DrillDownComposite drillDown = new DrillDownComposite(page, SWT.BORDER); + GridData spec = new GridData(SWT.FILL, SWT.FILL, true, true); + spec.widthHint = SIZING_SELECTION_PANE_WIDTH; + spec.heightHint = SIZING_CONTAINER_GROUP_HEIGHT; + drillDown.setLayoutData(spec); + TreeViewer tree = new TreeViewer(drillDown, SWT.NONE); + drillDown.setChildTree(tree); + contentprovider = new TOIFImportTreeContentProvider(); + tree.setContentProvider(contentprovider); + tree.setLabelProvider(WorkbenchLabelProvider.getDecoratingWorkbenchLabelProvider()); + tree.setComparator(new ViewerComparator()); + tree.setUseHashlookup(true); + tree.setInput(ResourcesPlugin.getWorkspace()); + tree.addSelectionChangedListener(this); + } + + /** + * create the file selection area + * + * @param page + */ + private void createFileSelectionArea(Composite page) + { + Composite fileSelectionArea = new Composite(page, SWT.NONE); + GridData fileSelectionData = new GridData(GridData.GRAB_HORIZONTAL | GridData.FILL_HORIZONTAL); + fileSelectionArea.setLayoutData(fileSelectionData); + + GridLayout fileSelectionLayout = new GridLayout(); + fileSelectionLayout.numColumns = 3; + fileSelectionLayout.makeColumnsEqualWidth = false; + fileSelectionLayout.marginWidth = 0; + fileSelectionLayout.marginHeight = 0; + fileSelectionArea.setLayout(fileSelectionLayout); + + editor = new FileFieldEditor("fileSelect", "Select TOIF Data: ", fileSelectionArea); + + editor.setStringValue(""); + editor.getTextControl(fileSelectionArea).addModifyListener(this); + String[] extensions = new String[] { "*.kdm", "." }; + editor.setFileExtensions(extensions); + // fileSelectionArea.moveAbove(null); + } + + /* + * (non-Javadoc) + * + * @see + * org.eclipse.swt.widgets.Listener#handleEvent(org.eclipse.swt.widgets. + * Event) + */ + @Override + public void handleEvent(Event event) + { + setPageComplete(); + } + + /* + * (non-Javadoc) + * + * @see + * org.eclipse.jface.viewers.ISelectionChangedListener#selectionChanged( + * org.eclipse.jface.viewers.SelectionChangedEvent) + */ + @Override + public void selectionChanged(SelectionChangedEvent event) + { + IStructuredSelection selection = (IStructuredSelection) event.getSelection(); + // Unset target folder + project = null; + repositoryFolder = null; + + if (selection.isEmpty()) + { + setErrorMessage("A target project must be selected"); + return; + } + Object first = selection.getFirstElement(); + if (first instanceof IProject) + { + project = (IProject) first; + IFolder toifFolder = project.getFolder(".KDM/repository"); + repositoryFolder = toifFolder.getFolder("repository"); + setPageComplete(); + return; + } + } + + /* + * (non-Javadoc) + * + * @see + * org.eclipse.swt.events.ModifyListener#modifyText(org.eclipse.swt.events + * .ModifyEvent) + */ + @Override + public void modifyText(ModifyEvent e) + { + setPageComplete(); + } + + /** + * Called to determine if the data is consistent, and if it is then set the + * page complete boolean. + * + */ + private void setPageComplete() + { + // Default is page is not complete + setPageComplete(false); + setMessage(null); + setErrorMessage(null); + + // Check input file + String name = editor.getStringValue(); + if (name == null) + { + setErrorMessage("No input file specified"); + return; + } + + if (name.isEmpty()) + { + setErrorMessage("No input file specified"); + return; + } + + if (project == null) + { + setErrorMessage("Select a target project"); + return; + } + + // Check for file existence + IPath location = new Path(name); + IFileStore srcStore = EFS.getLocalFileSystem().getStore(location); + if (!srcStore.fetchInfo().exists()) + { + setErrorMessage("Source file " + srcStore + " does not exist"); + return; + } + + // Check target folder + if (repositoryFolder == null || !repositoryFolder.exists()) + this.setMessage("Click finish to import into empty repository"); + else this.setMessage("Click finish to integrate with existing repository"); + + // If we get here the results are good. + setPageComplete(true); + } + + /** + * Perform the actual load. + * + * @return + */ + public boolean finish() + { + // Check source file + String name = editor.getStringValue(); + setErrorMessage("Importing " + name + " into " + project + "..."); + + final ToifReportImportJob job = new ToifReportImportJob("Import SFP/CWE Data", project, name); + job.setUser(true); + job.setPriority(Job.BUILD); + job.setRule(project); + job.schedule(); + + return true; + } + +} diff --git a/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/importWizard/package-info.java b/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/importWizard/package-info.java new file mode 100644 index 00000000..c8faafcf --- /dev/null +++ b/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/importWizard/package-info.java @@ -0,0 +1,10 @@ +/******************************************************************************* + * Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This + * program and the // accompanying materials are made available under the terms + * of the Open Source // Initiative OSI - Open Software License v3.0 which + * accompanies this // distribution, and is available at + * http://www.opensource.org/licenses/osl-3.0.php/ + ******************************************************************************/ + +package com.kdmanalytics.toif.report.internal.importWizard; + diff --git a/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/items/CachedCodeLocation.java b/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/items/CachedCodeLocation.java new file mode 100644 index 00000000..bdccda1e --- /dev/null +++ b/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/items/CachedCodeLocation.java @@ -0,0 +1,128 @@ +/******************************************************************************* + * Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This program and + * the // accompanying materials are made available under the terms of the Open + * Source // Initiative OSI - Open Software License v3.0 which accompanies this + * // distribution, and is available at + * http://www.opensource.org/licenses/osl-3.0.php/ + ******************************************************************************/ + +package com.kdmanalytics.toif.report.internal.items; + +import java.util.LinkedList; +import java.util.List; + +import org.openrdf.model.Value; + +/** + * code locations that are stored for future use. + * + * @author Adam Nunn + * + */ +public class CachedCodeLocation +{ + + private Value id; + + private String path; + + private String line; + + private LinkedList findings; + + /** + * new cached location + * + * @param codeLocation + * toif code location + * @param path + * code location path + * @param lineno + * code location linenumber + */ + public CachedCodeLocation(Value codeLocation, String path, String lineno) + { + this.id = codeLocation; + this.path = path; + this.line = lineno; + this.findings = new LinkedList(); + } + + /** + * does the given path and line match this codelocation + * + */ + public boolean matches(String path, String line) + { + if (!this.path.equals(path)) + return false; + if (!this.line.equals(line)) + return false; + return true; + } + + /** + * get the code location id + * + * @return + */ + public Value getCodeLocation() + { + return id; + } + + /** + * get the codelocation path + * + * @return + */ + public String getPath() + { + return path; + } + + /** + * get the codelocation linenumber + * + * @return + */ + public String getLineNumber() + { + return line; + } + + @Override + public boolean equals(Object o) + { + if (!(o instanceof CachedCodeLocation)) + return false; + CachedCodeLocation loc = (CachedCodeLocation) o; + return id.equals(loc.id); + } + + @Override + public int hashCode() + { + return id.hashCode(); + } + + /** + * add an associated finding + * + * @param finding + */ + public void addFinding(Value finding) + { + findings.add(finding); + } + + /** + * get findings associated with this code location + * + * @return + */ + public List getFindings() + { + return findings; + } +} diff --git a/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/items/FileGroup.java b/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/items/FileGroup.java new file mode 100644 index 00000000..b5db7688 --- /dev/null +++ b/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/items/FileGroup.java @@ -0,0 +1,229 @@ +/******************************************************************************* + * Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This program and + * the accompanying materials are made available under the terms of the Open + * Source Initiative OSI - Open Software License v3.0 which accompanies this + * distribution, and is available at + * http://www.opensource.org/licenses/osl-3.0.php/ + ******************************************************************************/ + +package com.kdmanalytics.toif.report.internal.items; + +import java.util.ArrayList; +import java.util.List; + +import com.kdmanalytics.toif.report.items.IFileGroup; + +/** + * class representing a file group. file groups represent a file in toif. files + * contain findings and tools. + * + * @author Adam Nunn + * + */ +public class FileGroup extends ReportItem implements IFileGroup +{ + + /** + * + */ + private static final long serialVersionUID = -1315272657743409326L; + + public static int locationCount = 0; + + private final List locations; + + private String path; + + public FileGroup() + { + locations = new ArrayList(); + + } + + public FileGroup(String stringValue) + { + path = stringValue; + locations = new ArrayList(); + } + + /* + * (non-Javadoc) + * + * @see + * com.kdmanalytics.toif.report.internal.items.IFileGroup#AddLocation(com + * .kdmanalytics.toif.report.internal.items.LocationGroup) + */ + @Override + public void AddLocation(LocationGroup location) + { + if (!locations.contains(location)) + { + locations.add(location); + } + } + + @Override + public boolean equals(Object obj) + { + + if (!(obj instanceof FileGroup)) + { + return false; + } + + FileGroup other = (FileGroup) obj; + if (path == null) + { + if (other.path != null) + { + return false; + } + } + else if (!path.equals(other.path)) + { + return false; + } + return true; + } + + /* + * (non-Javadoc) + * + * @see com.kdmanalytics.toif.report.internal.items.IFileGroup#getChildren() + */ + @Override + public List getChildren() + { + List result = new ArrayList(); + for (ReportItem reportItem : locations) + { + if (!reportItem.getChildren().isEmpty()) + { + result.add(reportItem); + } + } + // result.addAll(locations); + return result; + } + + /* + * (non-Javadoc) + * + * @see + * com.kdmanalytics.toif.report.internal.items.IFileGroup#getFindingEntries + * () + */ + @Override + public List getFindingEntries() + { + List entries = new ArrayList(); + + for (LocationGroup location : locations) + { + entries.addAll(location.getFindingEntries()); + locationCount++; + } + + return entries; + } + + /* + * (non-Javadoc) + * + * @see + * com.kdmanalytics.toif.report.internal.items.IFileGroup#getFindingEntriesNotOk + * () + */ + @Override + public List getFindingEntriesNotOk() + { + List entries = new ArrayList(); + + for (LocationGroup location : locations) + { + entries.addAll(location.getFindingEntriesNotOk()); + } + + return entries; + } + + /* + * (non-Javadoc) + * + * @see com.kdmanalytics.toif.report.internal.items.IFileGroup# + * getFindingEntriesNotOkTrustSum() + */ + @Override + public int getFindingEntriesNotOkTrustSum() + { + + return 0; + } + + /* + * (non-Javadoc) + * + * @see + * com.kdmanalytics.toif.report.internal.items.IFileGroup#getLocationGroup() + */ + @Override + public List getLocationGroup() + { + return locations; + } + + /* + * (non-Javadoc) + * + * @see com.kdmanalytics.toif.report.internal.items.IFileGroup#getName() + */ + @Override + public String getName() + { + int index = path.lastIndexOf("/"); + + path = path.replaceFirst(".class", ".java"); + + return path.substring(index + 1); + } + + /* + * (non-Javadoc) + * + * @see com.kdmanalytics.toif.report.internal.items.IFileGroup#getPath() + */ + @Override + public String getPath() + { + return path; + } + + /* + * (non-Javadoc) + * + * @see + * com.kdmanalytics.toif.report.internal.items.IFileGroup#getSearchableText + * () + */ + @Override + public String getSearchableText() + { + return parent.getSearchableText() + " | " + path; + } + + @Override + public int hashCode() + { + final int prime = 31; + int result = super.hashCode(); + result = prime * result + ((path == null) ? 0 : path.hashCode()); + return result; + } + + @Override + public String toString() + { + return "File path: " + path; + } + +} diff --git a/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/items/FindingEntry.java b/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/items/FindingEntry.java new file mode 100644 index 00000000..17425cd7 --- /dev/null +++ b/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/items/FindingEntry.java @@ -0,0 +1,402 @@ +/******************************************************************************* + * Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This program and + * the accompanying materials are made available under the terms of the Open + * Source Initiative OSI - Open Software License v3.0 which accompanies this + * distribution, and is available at + * http://www.opensource.org/licenses/osl-3.0.php/ + ******************************************************************************/ + +package com.kdmanalytics.toif.report.internal.items; + +import java.util.ArrayList; +import java.util.List; + +import org.openrdf.model.Value; +import org.openrdf.repository.Repository; + +import com.kdmanalytics.toif.report.items.IFindingEntry; +import com.kdmanalytics.toif.report.items.IReportItem; + +/** + * finding entrys are the individual findings. + * + * @author Adam Nunn + * + */ +public class FindingEntry extends ReportItem implements IFindingEntry +{ + + public static enum Citing + { + TRUE, FALSE, UNKNOWN; + + }; + + /** + * + */ + private static final long serialVersionUID = -8949167670618091743L; + + String finding = "Test"; + + private Citing isOk; + + private String weaknessDescription = "Test"; + + private String sfp = "-"; + + private String cwe; + + private int trust = 0; + + String value = null; + + private List traces = new ArrayList(); + + public FindingEntry() + { + isOk = Citing.UNKNOWN; + } + + public FindingEntry(Value value, Repository repository) + { + isOk = Citing.UNKNOWN; + this.value = value.stringValue(); + } + + /* + * (non-Javadoc) + * + * @see com.kdmanalytics.toif.report.internal.items.IFindingEntry#getValue() + */ + @Override + public String getValue() + { + return value; + } + + /* + * (non-Javadoc) + * + * @see + * com.kdmanalytics.toif.report.internal.items.IFindingEntry#equals(java + * .lang.Object) + */ + @Override + public boolean equals(Object obj) + { + if (this == obj) + { + return true; + } + if (!super.equals(obj)) + { + return false; + } + if (getClass() != obj.getClass()) + { + return false; + } + FindingEntry other = (FindingEntry) obj; + if (cwe == null) + { + if (other.cwe != null) + { + return false; + } + } + else if (!cwe.equals(other.cwe)) + { + return false; + } + + if (parent == null) + { + if (other.parent != null) + { + return false; + } + } + else if (!parent.equals(other.parent)) + { + return false; + } + if (sfp == null) + { + if (other.sfp != null) + { + return false; + } + } + else if (!sfp.equals(other.sfp)) + { + return false; + } + if (weaknessDescription == null) + { + if (other.weaknessDescription != null) + { + return false; + } + } + else if (!weaknessDescription.equals(other.weaknessDescription)) + { + return false; + } + return true; + } + + /* + * (non-Javadoc) + * + * @see + * com.kdmanalytics.toif.report.internal.items.IFindingEntry#getChildren() + */ + @Override + public List getChildren() + { + return null; + } + + /* + * (non-Javadoc) + * + * @see com.kdmanalytics.toif.report.internal.items.IFindingEntry#getCwe() + */ + @Override + public String getCwe() + { + return cwe; + } + + /* + * (non-Javadoc) + * + * @see + * com.kdmanalytics.toif.report.internal.items.IFindingEntry#getDescription + * () + */ + @Override + public String getDescription() + { + return weaknessDescription; + } + + /* + * (non-Javadoc) + * + * @see + * com.kdmanalytics.toif.report.internal.items.IFindingEntry#getFindingEntries + * () + */ + @Override + public List getFindingEntries() + { + List findings = new ArrayList(); + findings.add(this); + return findings; + } + + /* + * (non-Javadoc) + * + * @see + * com.kdmanalytics.toif.report.internal.items.IFindingEntry#getFindingId() + */ + @Override + public String getFindingId() + { + return value; + } + + /* + * (non-Javadoc) + * + * @see + * com.kdmanalytics.toif.report.internal.items.IFindingEntry#getSearchableText + * () + */ + @Override + public String getSearchableText() + { + return parent.getSearchableText() + " | " + toString(); + } + + /* + * (non-Javadoc) + * + * @see com.kdmanalytics.toif.report.internal.items.IFindingEntry#getSfp() + */ + @Override + public String getSfp() + { + return sfp; + + } + + /* + * (non-Javadoc) + * + * @see com.kdmanalytics.toif.report.internal.items.IFindingEntry#getTool() + */ + @Override + public ToolGroup getTool() + { + + IReportItem item = this; + + while (item != null) + { + if (item instanceof ToolGroup) + { + return (ToolGroup) item; + } + else + { + item = item.getParent(); + } + } + + return null; + + } + + /* + * (non-Javadoc) + * + * @see com.kdmanalytics.toif.report.internal.items.IFindingEntry#getTrust() + */ + @Override + public int getTrust() + { + return trust; + } + + /* + * (non-Javadoc) + * + * @see com.kdmanalytics.toif.report.internal.items.IFindingEntry#hashCode() + */ + @Override + public int hashCode() + { + final int prime = 31; + int result = super.hashCode(); + result = prime * result + ((parent == null) ? 0 : parent.hashCode()); + result = prime * result + ((cwe == null) ? 0 : cwe.hashCode()); + // result = prime * result + ((finding == null) ? 0 : + // finding.hashCode()); + result = prime * result + ((value == null) ? 0 : value.hashCode()); + result = prime * result + ((sfp == null) ? 0 : sfp.hashCode()); + result = prime * result + ((weaknessDescription == null) ? 0 : weaknessDescription.hashCode()); + return result; + } + + /* + * (non-Javadoc) + * + * @see com.kdmanalytics.toif.report.internal.items.IFindingEntry#isOk() + */ + @Override + public Citing isOk() + { + return isOk; + } + + /* + * (non-Javadoc) + * + * @see + * com.kdmanalytics.toif.report.internal.items.IFindingEntry#setCwe(java + * .lang.String) + */ + @Override + public void setCwe(String cwe) + { + this.cwe = cwe; + + } + + /* + * (non-Javadoc) + * + * @see + * com.kdmanalytics.toif.report.internal.items.IFindingEntry#setDescription + * (java.lang.String) + */ + @Override + public void setDescription(String stringValue) + { + weaknessDescription = stringValue; + + } + + public void setIsOk(Citing isOk) + { + this.isOk = isOk; + } + + /* + * (non-Javadoc) + * + * @see + * com.kdmanalytics.toif.report.internal.items.IFindingEntry#setSfp(java + * .lang.String) + */ + @Override + public void setSfp(String sfp) + { + this.sfp = sfp; + + } + + /* + * (non-Javadoc) + * + * @see + * com.kdmanalytics.toif.report.internal.items.IFindingEntry#setTrust(int) + */ + @Override + public void setTrust(int value) + { + this.trust = value; + } + + /* + * (non-Javadoc) + * + * @see com.kdmanalytics.toif.report.internal.items.IFindingEntry#toString() + */ + @Override + public String toString() + { + return sfp + " | " + cwe + " | trust = " + trust + " | " + weaknessDescription; + } + + /* + * (non-Javadoc) + * + * @see + * com.kdmanalytics.toif.report.internal.items.IFindingEntry#getTraces() + */ + @Override + public List getTraces() + { + return traces; + } + + /* + * (non-Javadoc) + * + * @see + * com.kdmanalytics.toif.report.internal.items.IFindingEntry#setTraces(java + * .util.List) + */ + @Override + public void setTraces(List tracesList) + { + this.traces = tracesList; + + } + +} diff --git a/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/items/LocationGroup.java b/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/items/LocationGroup.java new file mode 100644 index 00000000..4c172721 --- /dev/null +++ b/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/items/LocationGroup.java @@ -0,0 +1,224 @@ +/******************************************************************************* + * Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This program and + * the accompanying materials are made available under the terms of the Open + * Source Initiative OSI - Open Software License v3.0 which accompanies this + * distribution, and is available at + * http://www.opensource.org/licenses/osl-3.0.php/ + ******************************************************************************/ + +package com.kdmanalytics.toif.report.internal.items; + +import java.util.ArrayList; +import java.util.List; + +import com.kdmanalytics.toif.report.internal.items.FindingEntry.Citing; + +/** + * location groups are the codelocations that have findings attached to them. + * + * @author Adam Nunn + * + */ +public class LocationGroup extends ReportItem +{ + + /** + * + */ + private static final long serialVersionUID = 242998160312564325L; + + private final List toolGroups; + + private String toifLineNumber; + + private String path; + + private String realLineNumber = null; + + public LocationGroup() + { + toolGroups = new ArrayList(); + } + + public LocationGroup(String path, String lineNumber) + { + toolGroups = new ArrayList(); + this.toifLineNumber = lineNumber; + this.path = path; + } + + public ToolGroup AddToolGroup(ToolGroup entry) + { + if (!toolGroups.contains(entry)) + { + toolGroups.add(entry); + return entry; + } + else + { + return toolGroups.get(toolGroups.indexOf(entry)); + } + } + + @Override + public boolean equals(Object obj) + { + if (this == obj) + { + return true; + } + if (!super.equals(obj)) + { + return false; + } + if (getClass() != obj.getClass()) + { + return false; + } + LocationGroup other = (LocationGroup) obj; + if (getLineNumber() == null) + { + if (other.getLineNumber() != null) + { + return false; + } + } + else if (!getLineNumber().equals(other.getLineNumber())) + { + return false; + } + else if (!getToifLineNumber().equals(other.getToifLineNumber())) + { + return false; + } + + if (path == null) + { + if (other.path != null) + { + return false; + } + } + else if (!path.equals(other.path)) + { + return false; + } + return true; + } + + @Override + public List getChildren() + { + List result = new ArrayList(); + result.addAll(toolGroups); + return result; + } + + @Override + public List getFindingEntries() + { + List results = new ArrayList(); + + for (ToolGroup tool : toolGroups) + { + for (FindingEntry entry : tool.getFindingEntries()) + { + results.add(entry); + + } + + } + return results; + } + + /** + * return the findings in this location group that are not ok. + * + * @return + */ + public List getFindingEntriesNotOk() + { + List results = new ArrayList(); + + for (ToolGroup tool : toolGroups) + { + for (FindingEntry entry : tool.getFindingEntries()) + { + if (Citing.FALSE == entry.isOk()) + { + results.add(entry); + } + } + + } + return results; + } + + public String getToifLineNumber() + { + return toifLineNumber; + } + + public String getLineNumber() + { + if (realLineNumber != null) + { + return realLineNumber; + } + else + { + return toifLineNumber; + } + } + + public String getPath() + { + return path; + } + + /** + * @return the realLineNumber + */ + public String getRealLineNumber() + { + return realLineNumber; + } + + @Override + public String getSearchableText() + { + return parent.getSearchableText() + " | " + toString(); + } + + public List getToolGroups() + { + return toolGroups; + } + + @Override + public int hashCode() + { + final int prime = 31; + int result = super.hashCode(); + result = prime * result + ((getLineNumber() == null) ? 0 : getLineNumber().hashCode()); + result = prime * result + ((path == null) ? 0 : path.hashCode()); + return result; + } + + /** + * @param string + */ + public void setRealLineNumber(String string) + { + + this.realLineNumber = string; + + } + + @Override + public String toString() + { + return "Line number: " + getToifLineNumber(); + } + +} diff --git a/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/items/Project.java b/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/items/Project.java new file mode 100644 index 00000000..cef9ab64 --- /dev/null +++ b/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/items/Project.java @@ -0,0 +1,386 @@ +/******************************************************************************* + * Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This program and + * the accompanying materials are made available under the terms of the Open + * Source Initiative OSI - Open Software License v3.0 which accompanies this + * distribution, and is available at + * http://www.opensource.org/licenses/osl-3.0.php/ + ******************************************************************************/ + +package com.kdmanalytics.toif.report.internal.items; + +import java.io.File; +import java.util.ArrayList; +import java.util.List; + +import org.eclipse.core.resources.IFolder; +import org.eclipse.core.resources.IProject; +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.IConfigurationElement; +import org.eclipse.core.runtime.Platform; +import org.openrdf.model.Statement; +import org.openrdf.model.ValueFactory; +import org.openrdf.repository.Repository; +import org.openrdf.repository.RepositoryConnection; +import org.openrdf.repository.RepositoryException; +import org.openrdf.repository.RepositoryResult; +import org.openrdf.repository.sail.SailRepository; +import org.openrdf.sail.nativerdf.NativeStore; + +import com.kdmanalytics.toif.report.internal.items.FindingEntry.Citing; +import com.kdmanalytics.toif.report.items.IFileGroup; +import com.kdmanalytics.toif.report.items.IToifProject; +import com.kdmanalytics.toif.report.util.IRepositoryMaker; + +/** + * + * @author Adam Nunn + * + */ +public class Project extends ReportItem implements IToifProject +{ + + /** + * + */ + private static final long serialVersionUID = -1786648025858789753L; + + private transient IProject iProject; + + /** + * the internal repository for the kdm data. + */ + private transient Repository repository; + + /** + * the connection to the internal repository + */ + private transient RepositoryConnection con; + + private List files; + + private boolean inWorkbench; + + /* + * (non-Javadoc) + * + * @see + * com.kdmanalytics.toif.report.internal.items.IToifProject#getIProject() + */ + @Override + public IProject getIProject() + { + return iProject; + } + + public Project(final IFolder kdmFolder, boolean workbenchPresent) + { + files = new ArrayList(); + IFolder kdmRepoFolder = ensureExists(kdmFolder); + setRepository(kdmRepoFolder); + iProject = kdmRepoFolder.getProject(); + inWorkbench = workbenchPresent; + } + + public void setIProject(IProject iProject) + { + this.iProject = iProject; + } + + /* + * (non-Javadoc) + * + * @see + * com.kdmanalytics.toif.report.internal.items.IToifProject#getRepository() + */ + @Override + public Repository getRepository() + { + return repository; + } + + /* + * (non-Javadoc) + * + * @see com.kdmanalytics.toif.report.internal.items.IToifProject# + * getRepositoryConnection() + */ + @Override + public RepositoryConnection getRepositoryConnection() + { + return con; + } + + /* + * (non-Javadoc) + * + * @see + * com.kdmanalytics.toif.report.internal.items.IToifProject#getValueFactory + * () + */ + @Override + public ValueFactory getValueFactory() + { + + ValueFactory factory = repository.getValueFactory(); + return factory; + } + + /** + * + * @param folder + */ + public void setRepository(IFolder folder) + { + if (folder == null) + { + return; + } + + IRepositoryMaker repMaker = getRepositoryMaker(folder); + + // if (repMaker == null) + // { + // repository = new SailRepository(new NativeStore(new + // File(folder.getRawLocationURI()))); + // } + // else + // { + + repository = repMaker.getRepository(); + // } + + if (repository == null) + { + return; + } + try + { + repository.initialize(); + con = repository.getConnection(); + + } + catch (RepositoryException e) + { + e.printStackTrace(); + } + + } + + /** + * @param folder + * @return + */ + private IRepositoryMaker getRepositoryMaker(IFolder folder) + { + IConfigurationElement[] config = Platform.getExtensionRegistry().getConfigurationElementsFor( + "com.kdmanalytics.toif.report.repositoryMaker.extensionpoint"); + try + { + for (IConfigurationElement e : config) + { + System.out.println("Evaluating extension"); + + final Object o = e.createExecutableExtension("class"); + + if (o instanceof IRepositoryMaker) + { + IRepositoryMaker repositoryMaker = (IRepositoryMaker) o; + repositoryMaker.setFolder(folder); + repositoryMaker.createRepository(); + return repositoryMaker; + } + } + } + catch (CoreException e) + { + System.err.println("There was a core excption... " + e); + } + return null; + } + + /* + * (non-Javadoc) + * + * @see com.kdmanalytics.toif.report.internal.items.IToifProject#dispose() + */ + @Override + public void dispose() + { + try + { + con.close(); + if (!inWorkbench) + { + repository.shutDown(); + } + } + catch (RepositoryException e) + { + // TODO Auto-generated catch block + e.printStackTrace(); + } + catch (Exception e) + { + + } + + } + + /** + * @param kdmFolder + * @return + */ + private IFolder ensureExists(final IFolder kdmFolder) + { + if (!kdmFolder.exists()) + { + try + { + kdmFolder.create(true, true, null); + } + catch (CoreException e1) + { + System.err.println("Folder was not created!!!"); + e1.printStackTrace(); + } + } + return kdmFolder; + } + + /* + * (non-Javadoc) + * + * @see + * com.kdmanalytics.toif.report.internal.items.IToifProject#getFileGroup() + */ + @Override + public List getFileGroup() + { + return files; + } + + /* + * (non-Javadoc) + * + * @see + * com.kdmanalytics.toif.report.internal.items.IToifProject#AddFileGroup + * (com.kdmanalytics.toif.report.internal.items.FileGroup) + */ + @Override + public void AddFileGroup(FileGroup file) + { + if (!files.contains(file)) + { + files.add(file); + } + } + + /* + * (non-Javadoc) + * + * @see com.kdmanalytics.toif.report.internal.items.IToifProject# + * getFindingEntriesNotOk() + */ + @Override + public List getFindingEntriesNotOk() + { + List results = new ArrayList(); + + for (IFileGroup file : files) + { + for (FindingEntry entry : file.getFindingEntries()) + { + if (Citing.FALSE == entry.isOk()) + { + results.add(entry); + } + } + + } + return results; + } + + @Override + public String toString() + { + return "The Project"; + } + + /* + * (non-Javadoc) + * + * @see + * com.kdmanalytics.toif.report.internal.items.IToifProject#getFindingEntries + * () + */ + @Override + public List getFindingEntries() + { + List entries = new ArrayList(); + FileGroup.locationCount = 0; + for (IFileGroup file : files) + { + List list = file.getFindingEntries(); + entries.addAll(list); + } + return entries; + } + + /* + * (non-Javadoc) + * + * @see + * com.kdmanalytics.toif.report.internal.items.IToifProject#getChildren() + */ + @Override + public List getChildren() + { + List result = new ArrayList(); + + for (ReportItem reportItem : files) + { + if (!reportItem.getChildren().isEmpty()) + { + result.add(reportItem); + } + } + // result.addAll(files); + return result; + } + + /** + * prints the contents of the repository. mainly for debug purposes. + * + * @param repository + * the repository to print. + */ + void printDB(Repository repository) + { + // RepositoryConnection con; + + try + { + // con = repository.getConnection(); + // get all statements. + final RepositoryResult statements = con.getStatements(null, null, null, true); + + // for all the statements. + while (statements.hasNext()) + { + final Statement st = statements.next(); + // print statements. + System.out.println(st.toString()); + + } + + statements.close(); + } + catch (final RepositoryException e) + { + // LOG.error("There was a repository error while printing the database. " + // + e); + } + + } + +} diff --git a/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/items/ProjectFactory.java b/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/items/ProjectFactory.java new file mode 100644 index 00000000..48aeedbf --- /dev/null +++ b/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/items/ProjectFactory.java @@ -0,0 +1,831 @@ +/******************************************************************************* + * Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This program and + * the // accompanying materials are made available under the terms of the Open + * Source // Initiative OSI - Open Software License v3.0 which accompanies this + * // distribution, and is available at + * http://www.opensource.org/licenses/osl-3.0.php/ + ******************************************************************************/ +// ///////////////////////////////////////////////////////////////////////////// +// Copyright (c) 2012 KDM Analytics, Inc. +// All rights reserved. +// ///////////////////////////////////////////////////////////////////////////// + +package com.kdmanalytics.toif.report.internal.items; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import org.eclipse.core.resources.IFolder; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.SubMonitor; +import org.openrdf.model.URI; +import org.openrdf.model.Value; +import org.openrdf.model.ValueFactory; +import org.openrdf.query.BindingSet; +import org.openrdf.query.MalformedQueryException; +import org.openrdf.query.QueryEvaluationException; +import org.openrdf.query.QueryLanguage; +import org.openrdf.query.TupleQuery; +import org.openrdf.query.TupleQueryResult; +import org.openrdf.repository.RepositoryConnection; +import org.openrdf.repository.RepositoryException; + +import com.kdmanalytics.toif.report.internal.items.FindingEntry.Citing; +import com.kdmanalytics.toif.report.items.IFindingEntry; +import com.kdmanalytics.toif.report.items.IToifProject; + +/** + * class to create the toif project + * + * @author Kyle Girard + * + */ +public class ProjectFactory +{ + + /** + * Used to cache results of a query on code locations and related + * information. + */ + public static Map> codeLocationCache; + + // DEBUG + static int countCodeLocations; + + static int countFindings; + + // DEBUG + + /** + * Instantiates a new project factory. + */ + private ProjectFactory() + { + // empty on purpose + } + + /** + * create a new toif project model. + * + * @param kdmRepoFolder + * the repository folder + * @param workbenchPresent + * is this view in the kdm workbench + * @param monitor + * the progress monitor + * @return the toif project + */ + public static IToifProject createProjectModel(IFolder kdmRepoFolder, boolean workbenchPresent, IProgressMonitor monitor) + { + SubMonitor progress = SubMonitor.convert(monitor, 100); + + // starting from scratch, so create a new project. the root of the + // defect model. + Project project = new Project(kdmRepoFolder, workbenchPresent); + + try + { + initCodeLocationCache(project); + } + catch (QueryEvaluationException e1) + { + e1.printStackTrace(); + } + catch (RepositoryException e1) + { + e1.printStackTrace(); + } + catch (MalformedQueryException e1) + { + e1.printStackTrace(); + } + + try + { + // ReportContentProvider contentProvider = (ReportContentProvider) + // viewer.getContentProvider(); + + // the connection will be used to query the repository to get the + // file-groupings, the location-groupings, and the findings. + if (!project.getRepositoryConnection().isOpen()) + { + return project; + } + // add the file to content provider. this imports the data into the + // repository so that we can then query it. + // addKdmFile(file); + + // query for the file-groupings, add them to the project and return + // the results so that they can be use to query for its children. + final List fileGroupings = addFileGroupings(project); + + SubMonitor loopProgress = progress.newChild(100); + loopProgress.beginTask("Building Defect Model", fileGroupings.size()); + + for (FileGroup fileGroup : fileGroupings) + { + + // query for the location-groupings, add them to the project and + // return the results so that they can be use to query for its + // children. + for (LocationGroup locations : addLocationGroupings(project, fileGroup)) + { + progress.setTaskName("Processing findings for location: " + fileGroup.getName() + ":" + locations.getLineNumber()); + // query for the findings based on the locations and add + // them to the project. + addFindings(project, locations); + } + loopProgress.worked(1); + } + + } + catch (RepositoryException e) + { + e.printStackTrace(); + } + catch (MalformedQueryException e) + { + e.printStackTrace(); + } + catch (QueryEvaluationException e) + { + e.printStackTrace(); + } + + // return the root of the model which should now be populated. + return project; + + } + + /** + * cache the code locations. + * + * @param project + * the toif project + * @throws QueryEvaluationException + * @throws RepositoryException + * @throws MalformedQueryException + */ + private static void initCodeLocationCache(IToifProject project) throws QueryEvaluationException, RepositoryException, MalformedQueryException + { + Set uniquePaths = new HashSet(); + int count = 0; + + codeLocationCache = new HashMap>(); + countFindings = 0; + countCodeLocations = 0; + int findingCount = 0; + + RepositoryConnection con = project.getRepositoryConnection(); + // make the query. get all the codelocations that have the + // locationgroup's linenumber and path. + String queryString = "SELECT ?codeLocation ?path ?lineno ?finding WHERE {" + "?codeLocation ?path . " + + "?codeLocation ?lineno. " + "?finding ?codeLocation ." + "}"; + + TupleQuery tupleQuery = con.prepareTupleQuery(QueryLanguage.SPARQL, queryString); + + TupleQueryResult result = tupleQuery.evaluate(); + try + { + // for each of the results, get the findings at this codelocation. + while (result.hasNext()) + { + BindingSet bindingSet = result.next(); + Value finding = bindingSet.getValue("finding"); + Value codeLocation = bindingSet.getValue("codeLocation"); + Value path = bindingSet.getValue("path"); + uniquePaths.add(path.stringValue()); + Value lineno = bindingSet.getValue("lineno"); + String pathName = path.stringValue(); + if (!codeLocationCache.containsKey(pathName)) + { + codeLocationCache.put(pathName, new HashMap()); + } + Map map = codeLocationCache.get(pathName); + CachedCodeLocation loc = null; + if (map.containsKey(codeLocation)) + loc = map.get(codeLocation); + else + { + loc = new CachedCodeLocation(codeLocation, path.stringValue(), lineno.stringValue()); + map.put(codeLocation, loc); + ++count; + } + loc.addFinding(finding); + findingCount++; + } + } + finally + { + result.close(); + } + } + + /** + * based on the parent project, query the repository for the file-groups. + * once the file-groups are found, add them to the project. return the + * file-groupings. + * + * @param project + * this is the parent of all the file-groupings which will be + * returned. + * @return the list of file-groupings in this project. + * + * @throws RepositoryException + * @throws MalformedQueryException + * @throws QueryEvaluationException + */ + private static List addFileGroupings(final Project project) throws RepositoryException, MalformedQueryException, + QueryEvaluationException + { + RepositoryConnection con = project.getRepositoryConnection(); + + List fgroups = new ArrayList(); + + if (con == null) + { + return new ArrayList(); + } + else if (!con.isOpen()) + { + return new ArrayList(); + } + // make a query. get all elements that are the object of statements with + // the predicate "". + String queryString = "SELECT ?x WHERE {?y ?x . ?z ?y .}"; + TupleQuery tupleQuery = con.prepareTupleQuery(QueryLanguage.SPARQL, queryString); + + // evaluate the query. + TupleQueryResult result = tupleQuery.evaluate(); + try + { + // for each of the results. make a new filegroup. + while (result.hasNext()) + { + // get the binding set. + BindingSet bindingSet = result.next(); + Value valueOfX = bindingSet.getValue("x"); + if (!fgroups.contains(valueOfX.stringValue())) + { + fgroups.add(valueOfX.stringValue()); + // create the filegroup. + FileGroup files = new FileGroup(valueOfX.stringValue()); + files.setParent(project); + + // add the files to the project. + project.AddFileGroup(files); + } + } + } + finally + { + result.close(); + } + // return the list of filegroups. + return project.getFileGroup(); + } + + /** + * query for the findings in the repository. + * + * @param parentElement + * @return + * @throws RepositoryException + * @throws MalformedQueryException + * @throws QueryEvaluationException + */ + private static List addFindings(final IToifProject project, LocationGroup locationGroup) throws RepositoryException, + MalformedQueryException, QueryEvaluationException + { + for (CachedCodeLocation ccl : codeLocationCache.get(locationGroup.getPath()).values()) + { + if (ccl.matches(locationGroup.getPath(), locationGroup.getToifLineNumber())) + { + ++countCodeLocations; + int findingCount = getFinding(project, locationGroup, ccl); + if (findingCount != ccl.getFindings().size()) + { + System.err.println("wut"); + } + countFindings += findingCount; + } + } + + // since there was a group that was missed (jumping from location to + // finding) we will return the tool groups. + return locationGroup.getToolGroups(); + } + + /** + * query the repository for the location groups (lineNumbers). these are + * added to the project and also returned as a list. + * + * @param file + * the file-group which is the parent for this locationgroup. + * @return a list of the locationgroups within this file group. + * + * @throws RepositoryException + * @throws MalformedQueryException + * @throws QueryEvaluationException + */ + private static List addLocationGroupings(IToifProject project, FileGroup file) throws RepositoryException, + MalformedQueryException, QueryEvaluationException + { + RepositoryConnection con = project.getRepositoryConnection(); + + // get all the code locations that fall within this file. A better way + // to do this whole method would be to use the OPTIONAL query to only + // select the kdm location if it is present. + String codeLocationString = "SELECT ?codeLocation ?lineNumber WHERE { ?codeLocation \"" + file.getPath() + + "\" . ?codeLocation ?lineNumber}"; + + TupleQuery codeLocationQuery = con.prepareTupleQuery(QueryLanguage.SPARQL, codeLocationString); + + TupleQueryResult codeLocations = codeLocationQuery.evaluate(); + + try + { + // for each of the codeLocations we need to check to see if there is + // a kdm location for them. if not, just use the toif. + while (codeLocations.hasNext()) + { + BindingSet codeLocationsBindingSet = codeLocations.next(); + + Value codeLocation = codeLocationsBindingSet.getValue("codeLocation"); + + Value toifLineNumber = codeLocationsBindingSet.getValue("lineNumber"); + + // this is the string to try to find a kdm location. + String kdmQueryString = "SELECT ?line WHERE { <" + + codeLocation + + "> ?commonView . ?commonView ?kdmElement . ?kdmElement ?line . } "; + TupleQuery kdmQuery = con.prepareTupleQuery(QueryLanguage.SPARQL, kdmQueryString); + + TupleQueryResult result = kdmQuery.evaluate(); + + // if the kdm query does not have any result, then use the toif + // query to just use the toif data. replacing the result with + // this new value. + if (!result.hasNext()) + { + String toifQueryString = "SELECT ?line WHERE { <" + codeLocation + "> ?line . }"; + + TupleQuery toifQuery = con.prepareTupleQuery(QueryLanguage.SPARQL, toifQueryString); + + // replace the result with the toif value. + result = toifQuery.evaluate(); + + if (!result.hasNext()) + { + continue; + } + } + + try + { + do + { + BindingSet lineNumberBindingSet = result.next(); + Value toifOrKdmLineNumber = lineNumberBindingSet.getValue("line"); + + // create a new location. + String toifOrKdmLineNumberValue = toifOrKdmLineNumber.stringValue(); + + // get the line number value from the string. + if (toifOrKdmLineNumberValue.contains(";")) + { + String[] sourceRefValues = toifOrKdmLineNumberValue.split(";"); + toifOrKdmLineNumberValue = sourceRefValues[1]; + } + LocationGroup location = new LocationGroup(file.getPath(), toifLineNumber.stringValue()); + + location.setRealLineNumber(toifOrKdmLineNumberValue); + + location.setParent(file); + + // add the location to the filegroup. + file.AddLocation(location); + + } + while (result.hasNext()); + } + finally + { + result.close(); + } + + } + + } + finally + { + codeLocations.close(); + } + // return the list of location groups. + return file.getLocationGroup(); + + } + + /** + * Get the finding based on the fact "FindingHasCodeLocation" we do this + * because we already have the locations. + * + * This method also adds toolgroups to the locationgroups. + * + * @param locationGroup + * The location grouping for this finding. + * @param codeLocation + * The value of the location. + * @throws RepositoryException + * @throws MalformedQueryException + * @throws QueryEvaluationException + */ + private static int getFinding(IToifProject project, LocationGroup locationGroup, CachedCodeLocation ccl) throws RepositoryException, + MalformedQueryException, QueryEvaluationException + { + int count = 0; + List findings = ccl.getFindings(); + for (Value finding : findings) + { + FindingEntry entry = new FindingEntry(finding, project.getRepository()); + + initializeTrust(project, entry); + initializeIsOk(project, entry); + + // get the tool. + ToolGroup tool = getTool(project, finding); + + // add the tool group to the location group + tool = locationGroup.AddToolGroup(tool); + + // add the finding entry to the tool group. + entry.setParent(tool); + + tool.setParent(locationGroup); + + // give the findings a weakness description. + entry.setDescription(getWeaknessDescription(project, finding)); + entry.setTraces(getTraces(project, finding)); + entry.setCwe(getCwe(project, finding)); + entry.setSfp(getSfp(project, finding)); + if (!tool.addFinding(entry)) + { + System.err.println(" - " + ccl.getPath() + " " + ccl.getLineNumber()); + } + ++count; + } + return count; + } + + /** + * get the cwe name for the finding + * + * @param project + * the toif project + * @param finding + * the finding that we wish to find the cwe for + * @return the name of the cwe. + * @throws RepositoryException + * @throws MalformedQueryException + * @throws QueryEvaluationException + */ + private static String getCwe(final IToifProject project, Value finding) throws RepositoryException, MalformedQueryException, + QueryEvaluationException + { + RepositoryConnection con = project.getRepositoryConnection(); + + // make a query. this finds the findings cwe id, then uses + // its name. + String descriptionQuery = "SELECT ?cwe WHERE {<" + finding + + "> ?id. ?id ?cwe .}"; + TupleQuery cweQuery = con.prepareTupleQuery(QueryLanguage.SPARQL, descriptionQuery); + + // evaluate the query. + TupleQueryResult cweNameResult = cweQuery.evaluate(); + + try + { + // use the first cwe name we come across. there should be only + // one anyway. + while (cweNameResult.hasNext()) + { + BindingSet cweSet = cweNameResult.next(); + Value cweName = cweSet.getValue("cwe"); + + // return the sfp name. + return cweName.stringValue(); + } + } + finally + { + cweNameResult.close(); + } + // there is no sfp name. + return " - "; + } + + /** + * Find the weakness description for this finding value. + * + * @param finding + * The finding value as found in getFinding(). + * @return The weakness description. + * + * @throws RepositoryException + * @throws MalformedQueryException + * @throws QueryEvaluationException + */ + private static String getWeaknessDescription(final IToifProject project, Value finding) throws RepositoryException, MalformedQueryException, + QueryEvaluationException + { + RepositoryConnection con = project.getRepositoryConnection(); + // make a query. this finds the findings weakness description, then uses + // its description text. + String descriptionQuery = "SELECT ?t WHERE {" + "<" + finding + "> ?d. " + + "?d ?t." + "}"; + TupleQuery descriptionTupleQuery = con.prepareTupleQuery(QueryLanguage.SPARQL, descriptionQuery); + + // evaluate the query. + TupleQueryResult descriptionResult = descriptionTupleQuery.evaluate(); + + try + { + // use the first description text we come across. there should be + // only + // one anyway. + while (descriptionResult.hasNext()) + { + BindingSet descriptionSet = descriptionResult.next(); + Value valueOfdescription = descriptionSet.getValue("t"); + + // return the description text. + return valueOfdescription.stringValue(); + } + } + finally + { + descriptionResult.close(); + } + // there is no description. however, there should always be a + // description. + return "None"; + } + + /** + * query the repository to get the tool group for this finding. + * + * @param finding + * the finding that we are trying to find a toolgroup for. + * @return the toolgroup. or 'Unknown Tool' if none can be found. + * + * @throws RepositoryException + * @throws MalformedQueryException + * @throws QueryEvaluationException + */ + private static ToolGroup getTool(IToifProject project, Value finding) throws RepositoryException, MalformedQueryException, + QueryEvaluationException + { + + RepositoryConnection con = project.getRepositoryConnection(); + // make a query to find the adaptor name. we are looking for something + // (the segment) that contains this finding, it also contains another + // element (the adaptor) with the type 'toif:Adaptor'. this adaptor has + // a name 'name'. +// String adaptorQuery = "SELECT ?name WHERE { " + +// "?id <" + finding + ">. " + +// "?id ?adaptorId. " +// + "?adaptorId \"toif:Adaptor\". " + +// "?adaptorId ?name.}"; + +// String adaptorQuery = "SELECT ?name WHERE { " + "?id <" + finding + ">. " +// + "?id ?adaptorId. " + "?adaptorId ?name.}"; + + String adaptorQuery = "SELECT ?name WHERE { " + "?id <" + finding + ">. " + + "?id ?adaptor. ?adaptor ?name}"; + + TupleQuery adaptorTupleQuery = con.prepareTupleQuery(QueryLanguage.SPARQL, adaptorQuery); + + // query the repository. + TupleQueryResult queryResult = adaptorTupleQuery.evaluate(); + + try + { + // for each of the results, create a new toolgroup. return the + // toolgroup + // if there is one. + while (queryResult.hasNext()) + { + + BindingSet adaptorSet = queryResult.next(); + Value adaptorName = adaptorSet.getValue("name"); + // return the tool group since we have one. + return new ToolGroup(adaptorName.stringValue()); + + } + } + finally + { + queryResult.close(); + } + // if we are here, then there is no tool group. return the fall back + // value. + return new ToolGroup("Unknown Tool"); + + } + + /** + * get the sfp for the given finding + * + * @param project + * the toif project + * @param finding + * the finding that we want to find the sfp for + * @return + * @throws RepositoryException + * @throws MalformedQueryException + * @throws QueryEvaluationException + */ + private static String getSfp(final IToifProject project, Value finding) throws RepositoryException, MalformedQueryException, + QueryEvaluationException + { + RepositoryConnection con = project.getRepositoryConnection(); + // make a query. this finds the findings sfp id, then uses + // its name. + String descriptionQuery = "SELECT ?sfp WHERE {" + "<" + finding + "> ?id. " + + "?id ?sfp ." + "}"; + TupleQuery sfpQuery = con.prepareTupleQuery(QueryLanguage.SPARQL, descriptionQuery); + + // evaluate the query. + TupleQueryResult descriptionResult = sfpQuery.evaluate(); + try + { + + // use the first sfp name we come across. there should be only + // one anyway. + while (descriptionResult.hasNext()) + { + BindingSet sfpSet = descriptionResult.next(); + Value sfpName = sfpSet.getValue("sfp"); + // return the sfp name. + return sfpName.stringValue(); + } + } + finally + { + descriptionResult.close(); + } + // there is no sfp name. + return " - "; + } + + /** + * get the traces for this finding from the repository. + * + * @param finding + * the finding we wwant to find traces for + * @return list of traces. + * @throws RepositoryException + * @throws MalformedQueryException + * @throws QueryEvaluationException + */ + private static List getTraces(final IToifProject project, Value finding) throws RepositoryException, MalformedQueryException, + QueryEvaluationException + { + RepositoryConnection con = project.getRepositoryConnection(); + + List traces = new ArrayList(); + + String descriptionQuery = "SELECT ?lineNumber WHERE {" + "?segment <" + finding + "> . " + + "?segment ?statement . " + "?statement <" + finding + "> . " + + "?statement ?codeLocation . " + + "?codeLocation ?lineNumber . }"; + TupleQuery traceQuery = con.prepareTupleQuery(QueryLanguage.SPARQL, descriptionQuery); + + // evaluate the query. + TupleQueryResult traceNameResult = traceQuery.evaluate(); + + try + { + + while (traceNameResult.hasNext()) + { + BindingSet traceSet = traceNameResult.next(); + Value traceName = traceSet.getValue("lineNumber"); + + Trace trace = new Trace(traceName.stringValue()); + traces.add(trace); + } + } + finally + { + traceNameResult.close(); + } + + return traces; + } + + /** + * initialize if this finding is a real weakness or not. + * + * @param project + * the toif project + * @param entry + * the finding entry in the report view. + */ + private static void initializeIsOk(final IToifProject project, IFindingEntry entry) + { + ValueFactory factory = project.getValueFactory(); + RepositoryConnection con = project.getRepositoryConnection(); + URI isWeaknessURI = factory.createURI("http://toif/isWeakness"); + URI findingURI = factory.createURI(entry.getFindingId()); + try + { + String isWeaknessQuery = "SELECT ?isWeakness WHERE {<" + entry.getValue() + "> ?isWeakness .}"; + TupleQuery isWeaknessTupleQuery = con.prepareTupleQuery(QueryLanguage.SPARQL, isWeaknessQuery); + + TupleQueryResult isWeaknessResults = isWeaknessTupleQuery.evaluate(); + + while (isWeaknessResults.hasNext()) + { + BindingSet findingSet = isWeaknessResults.next(); + Value isWeaknessValue = findingSet.getValue("isWeakness"); + entry.setIsOk(Citing.valueOf(isWeaknessValue.stringValue())); + + // there will be only one, return if we have reached this far. + return; + } + + String valid = Citing.UNKNOWN.toString(); + con.add(findingURI, isWeaknessURI, factory.createLiteral(valid)); + + } + catch (RepositoryException e) + { + System.err.println("There was a repository exception while setting whether the weakness is true or not. " + e); + } + catch (MalformedQueryException e) + { + System.err.println("There is a mal formed query while setting whether the weakness is true or not. " + e); + } + catch (QueryEvaluationException e) + { + System.err.println("There is a query exception while finding out if the finding is true or not " + e); + } + + } + + /** + * make sure that the trust statement exists. if not, make the statement and + * initialize it with the correct starting value. + * + * @param entry + * the findings for which we are doing the trust operations. + */ + private static void initializeTrust(final IToifProject project, IFindingEntry entry) + { + ValueFactory factory = project.getValueFactory(); + RepositoryConnection con = project.getRepositoryConnection(); + URI trustURI = factory.createURI("http://toif/trust"); + URI findingURI = factory.createURI(entry.getFindingId()); + try + { + String trustQuery = "SELECT ?trust WHERE {<" + entry.getValue() + "> ?trust .}"; + TupleQuery trustTupleQuery = con.prepareTupleQuery(QueryLanguage.SPARQL, trustQuery); + + TupleQueryResult trustResults = trustTupleQuery.evaluate(); + + while (trustResults.hasNext()) + { + BindingSet findingSet = trustResults.next(); + Value trust = findingSet.getValue("trust"); + + entry.setTrust(Integer.parseInt(trust.stringValue())); + + // there will be only one, return if we have reached this far. + return; + } + + // if we reach this far then there were no trusts. + con.add(findingURI, trustURI, factory.createLiteral(0)); + entry.setTrust(0); + } + catch (MalformedQueryException e) + { + e.printStackTrace(); + } + catch (QueryEvaluationException e) + { + e.printStackTrace(); + } + catch (RepositoryException e) + { + e.printStackTrace(); + } + + } + +} diff --git a/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/items/ReportItem.java b/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/items/ReportItem.java new file mode 100644 index 00000000..d1fb36d3 --- /dev/null +++ b/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/items/ReportItem.java @@ -0,0 +1,177 @@ +/******************************************************************************* + * Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This program and + * the accompanying materials are made available under the terms of the Open + * Source Initiative OSI - Open Software License v3.0 which accompanies this + * distribution, and is available at + * http://www.opensource.org/licenses/osl-3.0.php/ + ******************************************************************************/ + +package com.kdmanalytics.toif.report.internal.items; + +import java.io.IOException; +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; +import java.io.Serializable; +import java.util.List; + +import org.eclipse.core.runtime.PlatformObject; + +import com.kdmanalytics.toif.report.items.IFindingEntry; +import com.kdmanalytics.toif.report.items.IReportItem; +import com.kdmanalytics.toif.report.items.IToifProject; + +/** + * class representing the report items. + * + * @author Adam Nunn + * + */ +public abstract class ReportItem extends PlatformObject implements IReportItem, Serializable +{ + + /** + * + */ + private static final long serialVersionUID = -8611788270468710322L; + + protected IReportItem parent = null; + + protected String searchableText = ""; + + public ReportItem() + { + + } + + + + /* + * (non-Javadoc) + * + * @see + * com.kdmanalytics.toif.report.internal.items.IReportItem#setParent(com + * .kdmanalytics.toif.report.internal.items.IReportItem) + */ + @Override + public void setParent(IReportItem parent) + { + this.parent = parent; + } + + /* + * (non-Javadoc) + * + * @see + * com.kdmanalytics.toif.report.internal.items.IReportItem#getSearchableText + * () + */ + @Override + public String getSearchableText() + { + return searchableText; + } + + /* + * (non-Javadoc) + * + * @see com.kdmanalytics.toif.report.internal.items.IReportItem#getParent() + */ + @Override + public IReportItem getParent() + { + return parent; + } + + @Override + public int hashCode() + { + final int prime = 31; + int result = 1; + result = prime * result + ((parent == null) ? 0 : parent.hashCode()); + return result; + } + + @Override + public boolean equals(Object obj) + { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + ReportItem other = (ReportItem) obj; + if (parent == null) + { + if (other.parent != null) + return false; + } + else if (!parent.equals(other.parent)) + return false; + return true; + } + + /* + * (non-Javadoc) + * + * @see + * com.kdmanalytics.toif.report.internal.items.IReportItem#getChildren() + */ + @Override + public abstract List getChildren(); + + /* + * (non-Javadoc) + * + * @see + * com.kdmanalytics.toif.report.internal.items.IReportItem#getFindingEntries + * () + */ + @Override + public abstract List getFindingEntries(); + + /* + * (non-Javadoc) + * + * @see com.kdmanalytics.toif.report.internal.items.IReportItem#getProject() + */ + @Override + public IToifProject getProject() + { + IReportItem item = this; + + while (item != null) + { + if (item instanceof IToifProject) + { + return (IToifProject) item; + } + else + { + item = item.getParent(); + } + } + + return null; + } + + /* + * (non-Javadoc) + * + * @see + * com.kdmanalytics.toif.report.internal.items.IReportItem#getTrustSum() + */ + @Override + public int getTrustSum() + { + + int result = 0; + + for (IFindingEntry entry : getFindingEntries()) + { + result += entry.getTrust(); + } + return result; + } + +} diff --git a/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/items/ToifReportEntry.java b/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/items/ToifReportEntry.java new file mode 100644 index 00000000..d2170429 --- /dev/null +++ b/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/items/ToifReportEntry.java @@ -0,0 +1,224 @@ +/******************************************************************************* + * Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This program and + * the accompanying materials are made available under the terms of the Open + * Source Initiative OSI - Open Software License v3.0 which accompanies this + * distribution, and is available at + * http://www.opensource.org/licenses/osl-3.0.php/ + ******************************************************************************/ + +package com.kdmanalytics.toif.report.internal.items; + +import java.beans.PropertyChangeListener; +import java.beans.PropertyChangeSupport; + +import org.eclipse.core.runtime.PlatformObject; + +import com.kdmanalytics.toif.report.items.IFileGroup; +import com.kdmanalytics.toif.report.items.IToifProject; +import com.kdmanalytics.toif.report.items.IToifReportEntry; + +/** + * represents the report entries. + * + * @author Adam Nunn + * @author Kyle Girard + * + */ +public class ToifReportEntry extends PlatformObject implements IToifReportEntry +{ + + private IToifProject project; + + private IFileGroup fileGroup; + + private LocationGroup locationGroup; + + private ToolGroup toolGroup; + + private FindingEntry findingEntry; + + private PropertyChangeSupport propertyChangeSupport = new PropertyChangeSupport(this); + + public ToifReportEntry() + { + + } + + /** + * create a new report entry. + * + * @param project + * the toif project + * @param fileGroup + * the file + * @param locationGroup + * the code location + * @param toolGroup + * the reporting tool + * @param findingEntry + * the finding entry + */ + public ToifReportEntry(IToifProject project, IFileGroup fileGroup, LocationGroup locationGroup, ToolGroup toolGroup, FindingEntry findingEntry) + { + this.project = project; + this.fileGroup = fileGroup; + this.locationGroup = locationGroup; + this.toolGroup = toolGroup; + this.findingEntry = findingEntry; + } + + /* + * (non-Javadoc) + * + * @see com.kdmanalytics.toif.report.internal.items.IToifReportEntry# + * addPropertyChangeListener(java.lang.String, + * java.beans.PropertyChangeListener) + */ + @Override + public void addPropertyChangeListener(String propertyName, PropertyChangeListener listener) + { + propertyChangeSupport.addPropertyChangeListener(propertyName, listener); + } + + /* + * (non-Javadoc) + * + * @see com.kdmanalytics.toif.report.internal.items.IToifReportEntry# + * removePropertyChangeListener(java.beans.PropertyChangeListener) + */ + @Override + public void removePropertyChangeListener(PropertyChangeListener listener) + { + propertyChangeSupport.removePropertyChangeListener(listener); + } + + /* + * (non-Javadoc) + * + * @see + * com.kdmanalytics.toif.report.internal.items.IToifReportEntry#getProject() + */ + @Override + public IToifProject getProject() + { + return project; + } + + /* + * (non-Javadoc) + * + * @see + * com.kdmanalytics.toif.report.internal.items.IToifReportEntry#setProject + * (com.kdmanalytics.toif.report.internal.items.Project) + */ + @Override + public void setProject(IToifProject project) + { + propertyChangeSupport.firePropertyChange("project", this.project, this.project = project); + } + + /* + * (non-Javadoc) + * + * @see + * com.kdmanalytics.toif.report.internal.items.IToifReportEntry#getFileGroup + * () + */ + @Override + public IFileGroup getFileGroup() + { + return fileGroup; + } + + /* + * (non-Javadoc) + * + * @see + * com.kdmanalytics.toif.report.internal.items.IToifReportEntry#setFileGroup + * (com.kdmanalytics.toif.report.internal.items.FileGroup) + */ + @Override + public void setFileGroup(IFileGroup fileGroup) + { + propertyChangeSupport.firePropertyChange("fileGroup", this.fileGroup, this.fileGroup = fileGroup); + } + + /* + * (non-Javadoc) + * + * @see + * com.kdmanalytics.toif.report.internal.items.IToifReportEntry#getLocationGroup + * () + */ + @Override + public LocationGroup getLocationGroup() + { + return locationGroup; + } + + /* + * (non-Javadoc) + * + * @see + * com.kdmanalytics.toif.report.internal.items.IToifReportEntry#setLocationGroup + * (com.kdmanalytics.toif.report.internal.items.LocationGroup) + */ + @Override + public void setLocationGroup(LocationGroup locationGroup) + { + propertyChangeSupport.firePropertyChange("locationGroup", this.locationGroup, this.locationGroup = locationGroup); + } + + /* + * (non-Javadoc) + * + * @see + * com.kdmanalytics.toif.report.internal.items.IToifReportEntry#getToolGroup + * () + */ + @Override + public ToolGroup getToolGroup() + { + return toolGroup; + } + + /* + * (non-Javadoc) + * + * @see + * com.kdmanalytics.toif.report.internal.items.IToifReportEntry#setToolGroup + * (com.kdmanalytics.toif.report.internal.items.ToolGroup) + */ + @Override + public void setToolGroup(ToolGroup toolGroup) + { + propertyChangeSupport.firePropertyChange("toolGroup", this.toolGroup, this.toolGroup = toolGroup); + } + + /* + * (non-Javadoc) + * + * @see + * com.kdmanalytics.toif.report.internal.items.IToifReportEntry#getFindingEntry + * () + */ + @Override + public FindingEntry getFindingEntry() + { + return findingEntry; + } + + /* + * (non-Javadoc) + * + * @see + * com.kdmanalytics.toif.report.internal.items.IToifReportEntry#setFindingEntry + * (com.kdmanalytics.toif.report.internal.items.FindingEntry) + */ + @Override + public void setFindingEntry(FindingEntry findingEntry) + { + propertyChangeSupport.firePropertyChange("findingEntry", this.findingEntry, this.findingEntry = findingEntry); + } + +} diff --git a/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/items/ToolGroup.java b/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/items/ToolGroup.java new file mode 100644 index 00000000..e9ae9ceb --- /dev/null +++ b/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/items/ToolGroup.java @@ -0,0 +1,145 @@ +/******************************************************************************* + * Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This program and + * the accompanying materials are made available under the terms of the Open + * Source Initiative OSI - Open Software License v3.0 which accompanies this + * distribution, and is available at + * http://www.opensource.org/licenses/osl-3.0.php/ + ******************************************************************************/ + +package com.kdmanalytics.toif.report.internal.items; + +import java.util.ArrayList; +import java.util.List; + +import com.kdmanalytics.toif.report.internal.items.FindingEntry.Citing; + +/** + * tool group is the reporting tool that contains a finding. + * + * @author Adam Nunn + * + */ +public class ToolGroup extends ReportItem +{ + + /** + * + */ + private static final long serialVersionUID = -2194675981730565641L; + + String name; + + private List findings; + + /** + * new tool + * + * @param name + * the name of the tool + */ + public ToolGroup(String name) + { + findings = new ArrayList(); + this.name = name; + } + + /** + * get the name of the tool + * + * @return + */ + public String getName() + { + return name; + } + + @Override + public String toString() + { + return name; + } + + @Override + public String getSearchableText() + { + return parent.getSearchableText() + " | " + name; + } + + /** + * add a finding to the tool + * + * @param entry + * @return + */ + public boolean addFinding(FindingEntry entry) + { + + findings.add(entry); + return true; + } + + /** + * get the finding entries in the tool + */ + public List getFindingEntries() + { + return findings; + } + + /** + * get the finding entries that are not ok. + * + * @return + */ + public List getFindingEntriesNotOk() + { + List results = new ArrayList(); + for (FindingEntry entry : findings) + { + if (Citing.FALSE == entry.isOk()) + { + results.add(entry); + } + } + return results; + } + + @Override + public int hashCode() + { + final int prime = 31; + int result = 1; + result = prime * result + ((name == null) ? 0 : name.hashCode()); + // result = prime * result + ((parent == null) ? 0 : parent.hashCode()); + return result; + } + + @Override + public boolean equals(Object obj) + { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + ToolGroup other = (ToolGroup) obj; + if (name == null) + { + if (other.name != null) + return false; + } + else if (!name.equals(other.name)) + return false; + return true; + } + + @Override + public List getChildren() + { + List result = new ArrayList(); + result.addAll(findings); + return result; + } + +} diff --git a/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/items/Trace.java b/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/items/Trace.java new file mode 100644 index 00000000..f6401782 --- /dev/null +++ b/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/items/Trace.java @@ -0,0 +1,58 @@ +/******************************************************************************* + * Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This program and + * the accompanying materials are made available under the terms of the Open + * Source Initiative OSI - Open Software License v3.0 which accompanies this + * distribution, and is available at + * http://www.opensource.org/licenses/osl-3.0.php/ + ******************************************************************************/ + +package com.kdmanalytics.toif.report.internal.items; + +import java.io.Serializable; + +/** + * a trace is additional line numbers for the location of a finding. + * + * @author Adam Nunn + * + */ +public class Trace implements Serializable +{ + + /** + * + */ + private static final long serialVersionUID = 1373786791887348407L; + private String lineNumber; + + /** + * get the line number + * + * @return + */ + public String getLineNumber() + { + return lineNumber; + } + + /** + * set the line number + * + * @param lineNumber + */ + public void setLineNumber(String lineNumber) + { + this.lineNumber = lineNumber; + } + + /** + * create a new trace. + * + * @param lineNumber + */ + public Trace(String lineNumber) + { + this.lineNumber = lineNumber; + } + +} diff --git a/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/items/package-info.java b/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/items/package-info.java new file mode 100644 index 00000000..2b653add --- /dev/null +++ b/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/items/package-info.java @@ -0,0 +1,10 @@ +/******************************************************************************* + * Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This + * program and the // accompanying materials are made available under the terms + * of the Open Source // Initiative OSI - Open Software License v3.0 which + * accompanies this // distribution, and is available at + * http://www.opensource.org/licenses/osl-3.0.php/ + ******************************************************************************/ + +package com.kdmanalytics.toif.report.internal.items; + diff --git a/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/listeners/ReportDoubleClickListener.java b/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/listeners/ReportDoubleClickListener.java new file mode 100644 index 00000000..9775bfc9 --- /dev/null +++ b/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/listeners/ReportDoubleClickListener.java @@ -0,0 +1,99 @@ +/******************************************************************************* + * Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This program and + * the accompanying materials are made available under the terms of the Open + * Source Initiative OSI - Open Software License v3.0 which accompanies this + * distribution, and is available at + * http://www.opensource.org/licenses/osl-3.0.php/ + ******************************************************************************/ + +package com.kdmanalytics.toif.report.internal.listeners; + +import java.util.HashMap; + +import org.eclipse.core.resources.IMarker; +import org.eclipse.core.resources.IProject; +import org.eclipse.core.resources.IResource; +import org.eclipse.jface.dialogs.MessageDialog; +import org.eclipse.jface.viewers.DoubleClickEvent; +import org.eclipse.jface.viewers.IDoubleClickListener; +import org.eclipse.jface.viewers.StructuredSelection; +import org.eclipse.ui.IWorkbenchPage; +import org.eclipse.ui.PlatformUI; +import org.eclipse.ui.ide.IDE; + +import com.kdmanalytics.toif.report.internal.items.FindingEntry; +import com.kdmanalytics.toif.report.internal.items.LocationGroup; +import com.kdmanalytics.toif.report.internal.util.MemberUtil; +import com.kdmanalytics.toif.report.items.IFileGroup; +import com.kdmanalytics.toif.report.items.IToifReportEntry; + +/** + * Listens for double clicks on the report. this will take you to the source + * + * @author Adam Nunn + * + */ +public class ReportDoubleClickListener implements IDoubleClickListener +{ + + public ReportDoubleClickListener() + { + } + + @Override + public void doubleClick(DoubleClickEvent event) + { + + StructuredSelection selection = (StructuredSelection) event.getSelection(); + Object element = selection.getFirstElement(); + + if (element instanceof IToifReportEntry) + { + + IToifReportEntry iToifReportEntry = (IToifReportEntry) element; + IProject activeProject = iToifReportEntry.getProject().getIProject(); + + try + { + IToifReportEntry item = (IToifReportEntry) element; + FindingEntry entry = item.getFindingEntry(); + + LocationGroup locationGroup = (LocationGroup) entry.getParent().getParent(); + + IFileGroup file = (IFileGroup) entry.getParent().getParent().getParent(); + IResource member = MemberUtil.findMembers(activeProject, file); + + System.err.println("Member type " + member); + if (member == null) + { + MessageDialog.openWarning(null, "No Source File Found!", "A source file could not be found for this location."); + return; + } + + IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage(); + HashMap map = new HashMap(); + + if (element instanceof IFileGroup) + { + map.put(IMarker.LINE_NUMBER, 1); + } + else + { + map.put(IMarker.LINE_NUMBER, Integer.parseInt(locationGroup.getLineNumber())); + } + + IMarker marker = member.createMarker(IMarker.TEXT); + marker.setAttributes(map); + IDE.openEditor(page, marker); + marker.delete(); + } + catch (Exception e1) + { + e1.printStackTrace(); + } + + } + + } + +} diff --git a/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/listeners/ResourceMatch.java b/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/listeners/ResourceMatch.java new file mode 100644 index 00000000..2963f7f7 --- /dev/null +++ b/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/listeners/ResourceMatch.java @@ -0,0 +1,65 @@ +/** + * KDM Analytics Inc - (2012) + * + * @Author Adam Nunn + * @Date Mar 16, 2012 + */ + +package com.kdmanalytics.toif.report.internal.listeners; + +import org.eclipse.core.resources.IResource; + +/** + * A mapping of a resource and how well it matches to a path. + * + * @author Adam Nunn + */ +public class ResourceMatch +{ + + /** + * the resource which has been matched. + */ + private IResource iResource = null; + + /** + * how well the resource matches the directory structure. + */ + private int score = 0; + + /** + * + */ + public ResourceMatch() + { + } + + /** + * @param iResource + * the resource which has been matched. + * @param score + * How many directories are a match to this resource. + */ + public ResourceMatch(IResource iResource, int score) + { + this.iResource = iResource; + this.score = score; + } + + public IResource getIResource() + { + return iResource; + } + + /** + * The score is how well the resource matches the directory structure of + * another resource. + * + * @return the score + */ + public int getScore() + { + return score; + } + +} diff --git a/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/listeners/package-info.java b/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/listeners/package-info.java new file mode 100644 index 00000000..c5a3ab7e --- /dev/null +++ b/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/listeners/package-info.java @@ -0,0 +1,10 @@ +/******************************************************************************* + * Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This + * program and the // accompanying materials are made available under the terms + * of the Open Source // Initiative OSI - Open Software License v3.0 which + * accompanies this // distribution, and is available at + * http://www.opensource.org/licenses/osl-3.0.php/ + ******************************************************************************/ + +package com.kdmanalytics.toif.report.internal.listeners; + diff --git a/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/package-info.java b/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/package-info.java new file mode 100644 index 00000000..833e2e7a --- /dev/null +++ b/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/package-info.java @@ -0,0 +1,10 @@ +/******************************************************************************* + * Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This + * program and the // accompanying materials are made available under the terms + * of the Open Source // Initiative OSI - Open Software License v3.0 which + * accompanies this // distribution, and is available at + * http://www.opensource.org/licenses/osl-3.0.php/ + ******************************************************************************/ + +package com.kdmanalytics.toif.report.internal; + diff --git a/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/providers/ReportContentProvider.java b/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/providers/ReportContentProvider.java new file mode 100644 index 00000000..ed9fe850 --- /dev/null +++ b/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/providers/ReportContentProvider.java @@ -0,0 +1,120 @@ +/******************************************************************************* + * Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This program and + * the accompanying materials are made available under the terms of the Open + * Source Initiative OSI - Open Software License v3.0 which accompanies this + * distribution, and is available at + * http://www.opensource.org/licenses/osl-3.0.php/ + ******************************************************************************/ + +package com.kdmanalytics.toif.report.internal.providers; + +import java.util.LinkedList; +import java.util.List; + +import org.eclipse.jface.viewers.IStructuredContentProvider; +import org.eclipse.jface.viewers.Viewer; + +import com.kdmanalytics.toif.report.internal.items.FindingEntry; +import com.kdmanalytics.toif.report.internal.items.LocationGroup; +import com.kdmanalytics.toif.report.internal.items.ToifReportEntry; +import com.kdmanalytics.toif.report.internal.items.ToolGroup; +import com.kdmanalytics.toif.report.items.IFileGroup; +import com.kdmanalytics.toif.report.items.IToifProject; + +/** + * content provider for the report view. + * + * @author Adam Nunn + * @author Kyle Girard + * + */ +public class ReportContentProvider implements IStructuredContentProvider +{ + + private static final Object[] NO_CHILDREN = new Object[] {}; + + private IToifProject project; + + /* + * (non-Javadoc) + * + * @see org.eclipse.jface.viewers.IContentProvider#dispose() + */ + @Override + public void dispose() + { + } + + /* + * (non-Javadoc) + * + * @see + * org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface + * .viewers.Viewer, java.lang.Object, java.lang.Object) + */ + @Override + public void inputChanged(Viewer viewer, Object oldInput, Object newInput) + { + } + + /* + * (non-Javadoc) + * + * @see + * org.eclipse.jface.viewers.IStructuredContentProvider#getElements(java + * .lang.Object) + */ + @Override + public Object[] getElements(Object inputElement) + { + + if (inputElement instanceof ToifReportEntry[]) { + return (Object[]) inputElement; + } + + ToifReportEntry[] list = getElementList(inputElement); + + if (list != null) + { + return list; + } + else + { + return NO_CHILDREN; + } + } + + public ToifReportEntry[] getElementList(Object inputElement) + { + if (inputElement instanceof IToifProject) + { + project = (IToifProject) inputElement; + + List elements = new LinkedList(); + + for (IFileGroup fileGroup : project.getFileGroup()) + { + for (LocationGroup locationGroup : fileGroup.getLocationGroup()) + { + for (ToolGroup toolGroup : locationGroup.getToolGroups()) + { + for (FindingEntry findingEntry : toolGroup.getFindingEntries()) + { + ToifReportEntry entry = new ToifReportEntry(project, fileGroup, locationGroup, toolGroup, findingEntry); + elements.add(entry); + } + } + } + } + return elements.toArray(new ToifReportEntry[elements.size()]); + } + + return null; + } + + public IToifProject getProject() + { + return project; + } + +} diff --git a/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/providers/ReportLabelProvider.java b/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/providers/ReportLabelProvider.java new file mode 100644 index 00000000..2a552d00 --- /dev/null +++ b/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/providers/ReportLabelProvider.java @@ -0,0 +1,533 @@ +/******************************************************************************* + * Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This program and + * the accompanying materials are made available under the terms of the Open + * Source Initiative OSI - Open Software License v3.0 which accompanies this + * distribution, and is available at + * http://www.opensource.org/licenses/osl-3.0.php/ + ******************************************************************************/ + +package com.kdmanalytics.toif.report.internal.providers; + +import java.net.URL; + +import org.eclipse.jface.resource.ColorRegistry; +import org.eclipse.jface.resource.ImageDescriptor; +import org.eclipse.jface.resource.ImageRegistry; +import org.eclipse.jface.resource.JFaceResources; +import org.eclipse.jface.viewers.IFontProvider; +import org.eclipse.jface.viewers.ITableColorProvider; +import org.eclipse.jface.viewers.ITableLabelProvider; +import org.eclipse.jface.viewers.StyledCellLabelProvider; +import org.eclipse.jface.viewers.StyledString; +import org.eclipse.jface.viewers.ViewerCell; +import org.eclipse.swt.graphics.Color; +import org.eclipse.swt.graphics.Font; +import org.eclipse.swt.graphics.Image; +import org.eclipse.swt.graphics.RGB; +import org.eclipse.swt.widgets.Event; +import org.eclipse.ui.PlatformUI; + +import com.kdmanalytics.toif.report.internal.Activator; +import com.kdmanalytics.toif.report.internal.items.FindingEntry.Citing; +import com.kdmanalytics.toif.report.internal.items.LocationGroup; +import com.kdmanalytics.toif.report.internal.items.ToolGroup; +import com.kdmanalytics.toif.report.items.IFileGroup; +import com.kdmanalytics.toif.report.items.IFindingEntry; +import com.kdmanalytics.toif.report.items.IToifReportEntry; + +/** + * The Class ReportLabelProvider. + * + * @author Adam Nunn + */ +public class ReportLabelProvider extends StyledCellLabelProvider implements ITableLabelProvider, ITableColorProvider, IFontProvider +{ + + /** The green. */ + private static final String GREEN = "green"; + + private static final String BLUE = "blue"; + + /** The red. */ + private static final String RED = "red"; + + /** The foreground green. */ + private static final String FOREGROUND_GREEN = "foreground_green"; + + private static final String FOREGROUND_BLACK = "foreground_black"; + + /** The foreground red. */ + private static final String FOREGROUND_RED = "foreground_red"; + + /** The Constant TICK_KEY. */ + private static final String TICK_KEY = "tick"; + + /** The Constant CROSS_KEY. */ + private static final String CROSS_KEY = "cross"; + + /** The Constant PAGE_WHITE_STACK_KEY. */ + private static final String PAGE_WHITE_STACK_KEY = "PAGE_WHITE_STACK_KEY"; + + /** The Constant PAGE_KEY. */ + private static final String PAGE_KEY = "PAGE_KEY"; + + /** The Constant WRENCH_KEY. */ + private static final String WRENCH_KEY = "WRENCH_KEY"; + + private ColorRegistry colorReg; + + /** + * Instantiates a new report label provider. + */ + public ReportLabelProvider() + { + loadImagesIntoRegistry(); + loadColoursIntoRegistry(); + } + + private void loadColoursIntoRegistry() + { + colorReg = new ColorRegistry(); + if (colorReg.get(GREEN) == null) + { + colorReg.put(GREEN, new RGB(220, 255, 220)); + } + if (colorReg.get(BLUE) == null) + { + colorReg.put(BLUE, new RGB(220, 220, 255)); + } + if (colorReg.get(RED) == null) + { + colorReg.put(RED, new RGB(255, 220, 220)); + } + if (colorReg.get(FOREGROUND_GREEN) == null) + { + colorReg.put(FOREGROUND_GREEN, new RGB(0, 80, 0)); + } + if (colorReg.get(FOREGROUND_BLACK) == null) + { + colorReg.put(FOREGROUND_BLACK, new RGB(0, 0, 0)); + } + if (colorReg.get(FOREGROUND_RED) == null) + { + colorReg.put(FOREGROUND_RED, new RGB(100, 0, 0)); + } + + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.jface.viewers.StyledCellLabelProvider#dispose() + */ + @Override + public void dispose() + { + super.dispose(); + } + + /** + * Load images. + */ + private void loadImagesIntoRegistry() + { + final ImageRegistry imgReg = Activator.getDefault().getImageRegistry(); + if (imgReg.get(TICK_KEY) == null) + { + final URL url = this.getClass().getResource("/icons/tick.png"); + imgReg.put(TICK_KEY, ImageDescriptor.createFromURL(url)); + } + if (imgReg.get(CROSS_KEY) == null) + { + final URL url = this.getClass().getResource("/icons/cross.png"); + imgReg.put(CROSS_KEY, ImageDescriptor.createFromURL(url)); + } + if (imgReg.get(PAGE_WHITE_STACK_KEY) == null) + { + final URL url = this.getClass().getResource("/icons/page_white_stack.png"); + imgReg.put(PAGE_WHITE_STACK_KEY, ImageDescriptor.createFromURL(url)); + } + if (imgReg.get(PAGE_KEY) == null) + { + final URL url = this.getClass().getResource("/icons/page.png"); + imgReg.put(PAGE_KEY, ImageDescriptor.createFromURL(url)); + } + if (imgReg.get(WRENCH_KEY) == null) + { + final URL url = this.getClass().getResource("/icons/wrench.png"); + imgReg.put(WRENCH_KEY, ImageDescriptor.createFromURL(url)); + } + } + + /* + * (non-Javadoc) + * + * @see + * org.eclipse.jface.viewers.ITableColorProvider#getBackground(java.lang + * .Object, int) + */ + @Override + public Color getBackground(final Object element, final int columnIndex) + { + if (element instanceof IFindingEntry) + { + final IFindingEntry entry = (IFindingEntry) element; + + if (Citing.TRUE == entry.isOk()) + { + return colorReg.get(GREEN); + } + if (Citing.UNKNOWN == entry.isOk()) + { + return colorReg.get(BLUE); + } + else + { + return colorReg.get(RED); + } + } + + return null; + } + + /* + * (non-Javadoc) + * + * @see + * org.eclipse.jface.viewers.ITableLabelProvider#getColumnImage(java.lang + * .Object, int) + */ + @Override + public Image getColumnImage(final Object element, final int columnIndex) + { + final ImageRegistry imgReg = Activator.getDefault().getImageRegistry(); + + if (element instanceof IFindingEntry) + { + final IFindingEntry entry = (IFindingEntry) element; + + switch (columnIndex) + { + case 0: + return Citing.TRUE == entry.isOk() ? imgReg.get(TICK_KEY) : imgReg.get(CROSS_KEY); + default: + return null; + } + + } + + if (element instanceof IFileGroup) + { + final URL url = null; + switch (columnIndex) + { + case 0: + return imgReg.get(PAGE_WHITE_STACK_KEY); + default: + break; + } + + if (url == null) + { + return null; + } + + } + + if (element instanceof LocationGroup) + { + final URL url = null; + switch (columnIndex) + { + case 0: + return imgReg.get(PAGE_KEY); + default: + break; + } + + if (url == null) + { + return null; + } + + } + + if (element instanceof ToolGroup) + { + final URL url = null; + switch (columnIndex) + { + case 0: + return imgReg.get(WRENCH_KEY); + default: + break; + } + + if (url == null) + { + return null; + } + + } + // should never get here... + System.err.println("no image found " + element); + return null; + } + + /* + * (non-Javadoc) + * + * @see + * org.eclipse.jface.viewers.ITableLabelProvider#getColumnText(java.lang + * .Object, int) + */ + @Override + public String getColumnText(final Object element, final int columnIndex) + { + String result = ""; + if (element instanceof IFindingEntry) + { + final IFindingEntry entry = (IFindingEntry) element; + switch (columnIndex) + { + case 0: + if (Citing.TRUE == entry.isOk()) + { + result = "Not Weakness"; + } + if (Citing.UNKNOWN == entry.isOk()) + { + result = "Unknown"; + } + else + { + result = "Is Weakness"; + } + break; + case 1: + result = entry.getSfp(); + break; + case 2: + result = entry.getCwe(); + break; + case 3: + result = entry.getTrust() + ""; + break; + case 4: + result = entry.getDescription(); + break; + + default: + // should not reach here + result = ""; + } + } + else if (element instanceof IFileGroup) + { + final IFileGroup file = (IFileGroup) element; + + switch (columnIndex) + { + case 0: + result = file.getName() + " (" + file.getFindingEntriesNotOk().size() + ")"; + break; + default: + // should not reach here + result = ""; + } + + } + else if (element instanceof ToolGroup) + { + final ToolGroup tool = (ToolGroup) element; + + switch (columnIndex) + { + case 0: + result = tool.toString(); + break; + default: + // should not reach here + result = ""; + } + + } + else if (element instanceof LocationGroup) + { + final LocationGroup loc = (LocationGroup) element; + + switch (columnIndex) + { + case 0: + result = "Line Number: " + loc.getLineNumber(); + break; + default: + // should not reach here + result = ""; + } + + } + + return result; + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.jface.viewers.IFontProvider#getFont(java.lang.Object) + */ + @Override + public Font getFont(final Object element) + { + if (element instanceof IFileGroup) + { + return JFaceResources.getFontRegistry().getBold(JFaceResources.DIALOG_FONT); + } + return null; + } + + /* + * (non-Javadoc) + * + * @see + * org.eclipse.jface.viewers.ITableColorProvider#getForeground(java.lang + * .Object, int) + */ + @Override + public Color getForeground(final Object element, final int columnIndex) + { + if (element instanceof IFindingEntry) + { + final IFindingEntry entry = (IFindingEntry) element; + + if (Citing.UNKNOWN == entry.isOk()) + { + return colorReg.get(FOREGROUND_BLACK); + } + else + { + + return Citing.TRUE == entry.isOk() ? colorReg.get(FOREGROUND_GREEN) : colorReg.get(FOREGROUND_RED); + } + } + + return null; + } + + /** + * Gets the image. + * + * @param element + * the element + * @return the image + */ + public Image getImage(final Object element) + { + final ImageRegistry imgReg = Activator.getDefault().getImageRegistry(); + + if (element instanceof IFileGroup) + { + return imgReg.get(PAGE_WHITE_STACK_KEY); + } + if (element instanceof LocationGroup) + { + return imgReg.get(PAGE_KEY); + } + if (element instanceof ToolGroup) + { + return imgReg.get(WRENCH_KEY); + } + if (element instanceof IFindingEntry) + { + final IFindingEntry entry = (IFindingEntry) element; + return Citing.TRUE == entry.isOk() ? imgReg.get(TICK_KEY) : imgReg.get(CROSS_KEY); + } + + // should never get here + System.err.println("no image found " + element); + return null; + } + + /** + * Gets the text. + * + * @param element + * the element + * @return the text + */ + public String getText(final Object element) + { + return "test: " + element.toString(); + + } + + /* + * (non-Javadoc) + * + * @see + * org.eclipse.jface.viewers.CellLabelProvider#getToolTipText(java.lang. + * Object) + */ + @Override + public String getToolTipText(final Object element) + { + if (element instanceof IToifReportEntry) + { + IFileGroup fileGroup = ((IToifReportEntry) element).getFileGroup(); + return fileGroup.getPath(); + } + return null; + } + + /* + * (non-Javadoc) + * + * @see + * org.eclipse.jface.viewers.StyledCellLabelProvider#paint(org.eclipse.swt + * .widgets.Event, java.lang.Object) + */ + @Override + protected void paint(final Event event, final Object element) + { + // method stub + super.paint(event, element); + } + + /* + * (non-Javadoc) + * + * @see + * org.eclipse.jface.viewers.StyledCellLabelProvider#update(org.eclipse. + * jface.viewers.ViewerCell) + */ + @Override + public void update(final ViewerCell cell) + { + Object element = cell.getElement(); + final StyledString styledString = new StyledString(getColumnText(element, cell.getColumnIndex())); + + if (element instanceof IFindingEntry) + { + final IFindingEntry entry = (IFindingEntry) element; + + if (Citing.UNKNOWN == entry.isOk()) + { + cell.setForeground(colorReg.get(FOREGROUND_BLACK)); + cell.setBackground(colorReg.get(BLUE)); + } + else + { + + cell.setForeground(Citing.TRUE == entry.isOk() ? colorReg.get(FOREGROUND_GREEN) : colorReg.get(FOREGROUND_RED)); + cell.setBackground(Citing.TRUE == entry.isOk() ? colorReg.get(GREEN) : colorReg.get(RED)); + } + } + else if (element instanceof IFileGroup) + { + cell.setFont(getFont(element)); + } + cell.setText(styledString.toString()); + cell.setStyleRanges(styledString.getStyleRanges()); + cell.setImage(cell.getColumnIndex() > 0 ? null : getImage(element)); + } +} diff --git a/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/providers/ReportStyledCellLabelProvider.java b/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/providers/ReportStyledCellLabelProvider.java new file mode 100644 index 00000000..c2447ae5 --- /dev/null +++ b/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/providers/ReportStyledCellLabelProvider.java @@ -0,0 +1,251 @@ +/******************************************************************************* + * Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This program and + * the accompanying materials are made available under the terms of the Open + * Source Initiative OSI - Open Software License v3.0 which accompanies this + * distribution, and is available at + * http://www.opensource.org/licenses/osl-3.0.php/ + ******************************************************************************/ + +package com.kdmanalytics.toif.report.internal.providers; + +import java.net.URL; + +import org.eclipse.jface.resource.ImageDescriptor; +import org.eclipse.jface.resource.ImageRegistry; +import org.eclipse.jface.viewers.StyledCellLabelProvider; +import org.eclipse.jface.viewers.StyledString; +import org.eclipse.jface.viewers.ViewerCell; +import org.eclipse.swt.graphics.Color; +import org.eclipse.swt.graphics.Image; +import org.eclipse.swt.graphics.RGB; +import org.eclipse.ui.PlatformUI; + +import com.kdmanalytics.toif.report.internal.Activator; +import com.kdmanalytics.toif.report.internal.items.FindingEntry.Citing; +import com.kdmanalytics.toif.report.items.IFileGroup; +import com.kdmanalytics.toif.report.items.IFindingEntry; +import com.kdmanalytics.toif.report.items.IToifReportEntry; + +/** + * label provider of styled cells. + * + * @author Adam Nunn + * @author Kyle Girard + * + */ +public class ReportStyledCellLabelProvider extends StyledCellLabelProvider +{ + + /** The green. */ + private static final Color GREEN = new Color(PlatformUI.getWorkbench().getDisplay(), new RGB(220, 255, 220)); + + private static final Color WHITE = new Color(PlatformUI.getWorkbench().getDisplay(), new RGB(255, 255, 255)); + + /** The red. */ + private static final Color RED = new Color(PlatformUI.getWorkbench().getDisplay(), new RGB(255, 220, 220)); + + /** The foreground green. */ + private static final Color FOREGROUND_GREEN = new Color(PlatformUI.getWorkbench().getDisplay(), new RGB(0, 80, 0)); + + private static final Color FOREGROUND_BLACK = new Color(PlatformUI.getWorkbench().getDisplay(), new RGB(80, 80, 80)); + + /** The foreground red. */ + private static final Color FOREGROUND_RED = new Color(PlatformUI.getWorkbench().getDisplay(), new RGB(100, 0, 0)); + + /** The Constant TICK_KEY. */ + private static final String TICK_KEY = "tick"; + + /** The Constant CROSS_KEY. */ + private static final String CROSS_KEY = "cross"; + + /** The Constant PAGE_WHITE_STACK_KEY. */ + private static final String PAGE_WHITE_STACK_KEY = "page_stack"; + + /** The Constant PAGE_KEY. */ + private static final String PAGE_KEY = "page"; + + /** The Constant WRENCH_KEY. */ + private static final String WRENCH_KEY = "wrench"; + + public ReportStyledCellLabelProvider() + { + loadImagesIntoRegistry(); + } + + /** + * Load images. + */ + private void loadImagesIntoRegistry() + { + final ImageRegistry imgReg = Activator.getDefault().getImageRegistry(); + if (imgReg.get(TICK_KEY) == null) + { + final URL url = this.getClass().getResource("/icons/tick.png"); + imgReg.put(TICK_KEY, ImageDescriptor.createFromURL(url)); + } + if (imgReg.get(CROSS_KEY) == null) + { + final URL url = this.getClass().getResource("/icons/cross.png"); + imgReg.put(CROSS_KEY, ImageDescriptor.createFromURL(url)); + } + if (imgReg.get(PAGE_WHITE_STACK_KEY) == null) + { + final URL url = this.getClass().getResource("/icons/page_white_stack.png"); + imgReg.put(PAGE_WHITE_STACK_KEY, ImageDescriptor.createFromURL(url)); + } + if (imgReg.get(PAGE_KEY) == null) + { + final URL url = this.getClass().getResource("/icons/page.png"); + imgReg.put(PAGE_KEY, ImageDescriptor.createFromURL(url)); + } + if (imgReg.get(WRENCH_KEY) == null) + { + final URL url = this.getClass().getResource("/icons/wrench.png"); + imgReg.put(WRENCH_KEY, ImageDescriptor.createFromURL(url)); + } + } + + /** + * get eh column text. + * + * @param entry + * the entry that we need the text from + * @param colIndex + * the column index that we are getting the text for. + * @return + */ + private String getColumnText(IToifReportEntry entry, int colIndex) + { + switch (colIndex) + { + case 0: + { + return entry.getFileGroup().getName(); + } + case 1: + { + return entry.getLocationGroup().getLineNumber(); + } + case 2: + { + return entry.getToolGroup().getName(); + } + case 3: + { + return entry.getFindingEntry().getSfp(); + } + case 4: + { + return entry.getFindingEntry().getCwe(); + } + case 5: + { + return Integer.toString(entry.getFindingEntry().getTrust()); + } + case 6: + { + return entry.getFindingEntry().getDescription(); + } + } + return null; + } + + /** + * Gets the image. + * + * @param element + * the element + * @return the image + */ + public Image getImage(IToifReportEntry entry, int colIndex) + { + final ImageRegistry imgReg = Activator.getDefault().getImageRegistry(); + + switch (colIndex) + { + case 0: + { + return imgReg.get(PAGE_WHITE_STACK_KEY); + } + case 1: + { + return imgReg.get(PAGE_KEY); + } + case 2: + { + return imgReg.get(WRENCH_KEY); + } + case 3: + { + // fall through + } + case 4: + { + // fall through + } + case 5: + { + final IFindingEntry findingEntry = entry.getFindingEntry(); + if (Citing.UNKNOWN == findingEntry.isOk()) { + return null; + } + + return Citing.TRUE == findingEntry.isOk() ? imgReg.get(CROSS_KEY) : imgReg.get(TICK_KEY); + } + case 6: + { + break; + } + } + return null; + } + + /* + * (non-Javadoc) + * + * @see + * org.eclipse.jface.viewers.StyledCellLabelProvider#update(org.eclipse. + * jface.viewers.ViewerCell) + */ + @Override + public void update(final ViewerCell cell) + { + final IToifReportEntry entry = (IToifReportEntry) cell.getElement(); + final StyledString styledString = new StyledString(getColumnText(entry, cell.getColumnIndex())); + final IFindingEntry findingEntry = entry.getFindingEntry(); + + if (Citing.UNKNOWN == findingEntry.isOk()) + { + cell.setForeground(FOREGROUND_BLACK); + cell.setBackground(WHITE); + } + else + { + + cell.setForeground(Citing.TRUE == findingEntry.isOk() ? FOREGROUND_RED : FOREGROUND_GREEN); + cell.setBackground(Citing.TRUE == findingEntry.isOk() ? RED : GREEN); + } + cell.setText(styledString.toString()); + cell.setStyleRanges(styledString.getStyleRanges()); + cell.setImage(getImage(entry, cell.getColumnIndex())); + } + + /* + * (non-Javadoc) + * + * @see + * org.eclipse.jface.viewers.CellLabelProvider#getToolTipText(java.lang. + * Object) + */ + @Override + public String getToolTipText(Object element) + { + if (element instanceof IToifReportEntry) + { + IFileGroup fileGroup = ((IToifReportEntry) element).getFileGroup(); + return fileGroup.getPath(); + } + return null; + } + +} diff --git a/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/providers/TOIFImportTreeContentProvider.java b/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/providers/TOIFImportTreeContentProvider.java new file mode 100644 index 00000000..6f07fec6 --- /dev/null +++ b/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/providers/TOIFImportTreeContentProvider.java @@ -0,0 +1,86 @@ +/******************************************************************************* + * Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This program and + * the accompanying materials are made available under the terms of the Open + * Source Initiative OSI - Open Software License v3.0 which accompanies this + * distribution, and is available at + * http://www.opensource.org/licenses/osl-3.0.php/ + ******************************************************************************/ + +package com.kdmanalytics.toif.report.internal.providers; + +import java.util.ArrayList; + +import org.eclipse.core.resources.IProject; +import org.eclipse.core.resources.IResource; +import org.eclipse.core.resources.IWorkspace; +import org.eclipse.jface.viewers.ITreeContentProvider; +import org.eclipse.jface.viewers.Viewer; + +/** + * the content provider for the import of toif data. + * + * @author Adam Nunn + * + */ +public class TOIFImportTreeContentProvider implements ITreeContentProvider +{ + + @Override + public Object[] getChildren(Object element) + { + // Project list + if (element instanceof IWorkspace) + { + IProject[] allProjects = ((IWorkspace) element).getRoot().getProjects(); + ArrayList accessibleProjects = new ArrayList(); + for (int i = 0; i < allProjects.length; i++) + { + IProject project = allProjects[i]; + if (!project.isOpen()) + continue; + + accessibleProjects.add(project); + } + return accessibleProjects.toArray(); + } + + return new Object[0]; + } + + @Override + public Object getParent(Object element) + { + if (element instanceof IResource) + { + return ((IResource) element).getParent(); + } + return null; + } + + @Override + public boolean hasChildren(Object element) + { + return getChildren(element).length > 0; + } + + @Override + public Object[] getElements(Object element) + { + return getChildren(element); + } + + @Override + public void dispose() + { + // TODO Auto-generated method stub + + } + + @Override + public void inputChanged(Viewer viewer, Object oldInput, Object newInput) + { + // TODO Auto-generated method stub + + } + +} diff --git a/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/providers/package-info.java b/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/providers/package-info.java new file mode 100644 index 00000000..0a363308 --- /dev/null +++ b/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/providers/package-info.java @@ -0,0 +1,10 @@ +/******************************************************************************* + * Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This + * program and the // accompanying materials are made available under the terms + * of the Open Source // Initiative OSI - Open Software License v3.0 which + * accompanies this // distribution, and is available at + * http://www.opensource.org/licenses/osl-3.0.php/ + ******************************************************************************/ + +package com.kdmanalytics.toif.report.internal.providers; + diff --git a/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/util/MemberUtil.java b/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/util/MemberUtil.java new file mode 100644 index 00000000..d28bff31 --- /dev/null +++ b/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/util/MemberUtil.java @@ -0,0 +1,117 @@ +/******************************************************************************* + * Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This program and + * the accompanying materials are made available under the terms of the Open + * Source Initiative OSI - Open Software License v3.0 which accompanies this + * distribution, and is available at + * http://www.opensource.org/licenses/osl-3.0.php/ + ******************************************************************************/ + +package com.kdmanalytics.toif.report.internal.util; + +import java.util.ArrayList; +import java.util.List; + +import org.apache.commons.lang3.ArrayUtils; +import org.eclipse.core.resources.IContainer; +import org.eclipse.core.resources.IResource; +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.IPath; + +import com.kdmanalytics.toif.report.internal.listeners.ResourceMatch; +import com.kdmanalytics.toif.report.items.IFileGroup; + +/** + * member utilities. + * + * @author Adam Nunn + * + */ +public class MemberUtil +{ + + private MemberUtil() + { + + } + + /** + * find suitable resources + * + * @param member + * @param file + * @return + * @throws CoreException + */ + public static IResource findMembers(IResource member, IFileGroup file) throws CoreException + { + String name = file.getName(); + + String path = file.getPath(); + path = path.replace("\\", "/"); + + String[] pathArray = path.split("/"); + ArrayUtils.reverse(pathArray); + + List result = new ArrayList(); + List toDo = new ArrayList(); + + toDo.add(member); + + while (!toDo.isEmpty()) + { + IResource resource = toDo.remove(0); + + if (resource instanceof IContainer) + { + for (IResource iResource : ((IContainer) resource).members()) + { + toDo.add(iResource); + } + } + + result.add(resource); + + } + + ResourceMatch match = new ResourceMatch(); + + for (IResource iResource : result) + { + if (iResource == null) + { + continue; + } + if (iResource.getName().equals(name)) + { + IPath ipath = iResource.getLocation(); + + String stringPath = ipath.toString(); + stringPath = stringPath.replace("\\", "/"); + + String[] resourcePathArray = stringPath.split("/"); + ArrayUtils.reverse(resourcePathArray); + + int smallestSize = (pathArray.length < resourcePathArray.length) ? pathArray.length : resourcePathArray.length; + for (int i = 0; i < smallestSize; i++) + { + if (pathArray[i].equals(resourcePathArray[i])) + { + if (i >= match.getScore()) + { + match = new ResourceMatch(iResource, i); + System.err.println(stringPath); + } + } + else + { + break; + } + + } + } + } + + return match.getIResource(); + } + +} diff --git a/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/views/ReportView.java b/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/views/ReportView.java new file mode 100644 index 00000000..0074413f --- /dev/null +++ b/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/views/ReportView.java @@ -0,0 +1,713 @@ +/******************************************************************************* + * Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This program and + * the accompanying materials are made available under the terms of the Open + * Source Initiative OSI - Open Software License v3.0 which accompanies this + * distribution, and is available at + * http://www.opensource.org/licenses/osl-3.0.php/ + ******************************************************************************/ + +package com.kdmanalytics.toif.report.internal.views; + +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.EnumMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; + +import org.eclipse.core.resources.IFolder; +import org.eclipse.core.resources.IProject; +import org.eclipse.core.runtime.CoreException; +import org.eclipse.jface.action.MenuManager; +import org.eclipse.jface.layout.GridDataFactory; +import org.eclipse.jface.viewers.ColumnViewer; +import org.eclipse.jface.viewers.ColumnViewerToolTipSupport; +import org.eclipse.jface.viewers.ISelection; +import org.eclipse.jface.viewers.IStructuredSelection; +import org.eclipse.jface.viewers.TableViewer; +import org.eclipse.jface.viewers.TableViewerColumn; +import org.eclipse.jface.viewers.ViewerFilter; +import org.eclipse.swt.SWT; +import org.eclipse.swt.custom.BusyIndicator; +import org.eclipse.swt.events.SelectionAdapter; +import org.eclipse.swt.events.SelectionEvent; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.widgets.Button; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Control; +import org.eclipse.swt.widgets.Display; +import org.eclipse.swt.widgets.Event; +import org.eclipse.swt.widgets.Label; +import org.eclipse.swt.widgets.Listener; +import org.eclipse.swt.widgets.Menu; +import org.eclipse.swt.widgets.Table; +import org.eclipse.swt.widgets.TableColumn; +import org.eclipse.swt.widgets.Text; +import org.eclipse.ui.ISelectionListener; +import org.eclipse.ui.IWorkbenchPart; +import org.eclipse.ui.PlatformUI; +import org.eclipse.ui.part.PageBook; +import org.eclipse.ui.part.ViewPart; + +import com.kdmanalytics.toif.report.internal.filters.TermFilter; +import com.kdmanalytics.toif.report.internal.listeners.ReportDoubleClickListener; +import com.kdmanalytics.toif.report.internal.providers.ReportContentProvider; +import com.kdmanalytics.toif.report.internal.providers.ReportStyledCellLabelProvider; +import com.kdmanalytics.toif.report.items.IToifProject; + +/** + * the report view. + * + * @author Adam Nunn + * @author Kyle Girard + * + */ +public class ReportView extends ViewPart +{ + + public static final String VIEW_ID = "com.kdmanalytics.toif.report.view"; + + private enum Mode + { + Table, None, + } + + private Composite parent; + + private PageBook pageBook; + + private PageBook viewerBook; + + private Map viewers; + + /** + * currently only table view. + */ + private Mode currentViewerMode; + + private Composite reportPage; + + private Label numberOfDefects; + + private Label noReportPage; + + private Label emptyViewer; + + private IToifProject inputProject; + + private TableViewer tableViewer; + + protected IProject currentProject; + + /** + * selection changed listener. looks for selection of project to reload toif + * data. + */ + ISelectionListener selectionListener = new ISelectionListener() { + + public void selectionChanged(IWorkbenchPart part, ISelection sel) + { + + IProject newProject = null; + + if (sel instanceof IStructuredSelection) + { + + for (Object object : ((IStructuredSelection) sel).toArray()) + { + if (object instanceof IProject) + { + newProject = (IProject) object; + + if (currentProject == newProject) + { + return; + } else { + currentProject = newProject; + } + } + } + + if (newProject == null) + { + return; + } + + if (newProject != null) + { + persistData(); + File file = new File(newProject.getLocation() + "/.toifProject.ser"); + + if (!file.exists()) + { + pageBook.showPage(noReportPage); + return; + } + + try + { + FileInputStream fileIn = new FileInputStream(file); + ObjectInputStream in = new ObjectInputStream(fileIn); + IToifProject project = (IToifProject) in.readObject(); + in.close(); + fileIn.close(); + + if (project != null) + { + System.out.println("toif project deserialized"); + // view.getTableViewer().setInput(project); + + IFolder repoFolder = ensureKdmRepoFolderExists(newProject); + project.setRepository(repoFolder); + project.setIProject(repoFolder.getProject()); + // project.setIProject(iProject.getLocation()); + + clearInput(); + updateInput(project); + refresh(); + return; + } + } + catch (IOException i) + { + System.out.println("problem with serialization file."); + i.printStackTrace(); + // return; + } + catch (ClassNotFoundException c) + { + System.out.println("IToifProject class not found."); + c.printStackTrace(); + // return; + } + catch (CoreException e) + { + System.out.println("repo folder could not be found."); + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + } + } + }; + + /** + * makes sure that the kdm repository folder does exist. + * + * @param project + * the kdm project + * @throws CoreException + */ + private static IFolder ensureKdmRepoFolderExists(final IProject project) throws CoreException + { + IFolder kdmDataDir = project.getFolder(".KDM"); + if (!kdmDataDir.exists()) + { + kdmDataDir.create(true, true, null); + } + + IFolder kdmRepoDir = kdmDataDir.getFolder("repository"); + if (!kdmRepoDir.exists()) + { + kdmRepoDir.create(true, true, null); + } + return kdmRepoDir; + } + + public ReportView() + { + parent = null; + pageBook = null; + reportPage = null; + viewers = null; + currentViewerMode = Mode.None; + } + + protected void persistData() + { + // ReportContentProvider cp = (ReportContentProvider) + // tableViewer.getContentProvider(); + // + // IToifProject project = cp.getProject(); + + if (inputProject == null) + { + System.out.println("no project to save."); + return; + } + + if (inputProject.getIProject().getLocation() == null) + { + System.out.println("no project to save."); + return; + } + + File serFile = new File(inputProject.getIProject().getLocation() + "/.toifProject.ser"); + serFile.delete(); + + try + { + serFile.createNewFile(); + } + catch (IOException e) + { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + try + { + FileOutputStream fileOut = new FileOutputStream(serFile); + ObjectOutputStream out = new ObjectOutputStream(fileOut); + out.writeObject(inputProject); + out.close(); + fileOut.close(); + } + catch (IOException i) + { + i.printStackTrace(); + } + + return; + + } + + @Override + public void createPartControl(Composite container) + { + getSite().getPage().addSelectionListener(selectionListener); + parent = container; + pageBook = new PageBook(parent, SWT.NONE); + + // Page 1 no data loaded label + noReportPage = new Label(pageBook, SWT.TOP + SWT.LEFT + SWT.WRAP); + noReportPage.setText("No TOIF data available"); + + // Page 2 Report Composite + reportPage = new Composite(pageBook, SWT.NONE); + reportPage.setLayout(new GridLayout()); + reportPage.setLayoutData(GridDataFactory.fillDefaults().grab(true, true).create()); + + createSearchControl(reportPage); + numberOfDefects = new Label(reportPage, SWT.NONE); + numberOfDefects.setText("Number of Defects:"); + + createReportViewerControl(reportPage); + pageBook.showPage(noReportPage); + + } + + public void dispose() + { + persistData(); + System.err.println("DATA PERSISTED"); + getSite().getPage().removeSelectionListener(selectionListener); + } + + /** + * deal with the term filter. apply the term filter data to the current + * view. + * + * @param text + */ + private void handleTermFilter(Text text) + { + String[] terms = text.getText().split("OR"); + if (text.getText().isEmpty()) + { + List filters = new ArrayList(Arrays.asList(getCurrentViewer().getFilters())); + for (Iterator i = filters.iterator(); i.hasNext();) + { + ViewerFilter filter = (ViewerFilter) i.next(); + if (filter instanceof TermFilter) + { + i.remove(); + } + } + getCurrentViewer().setFilters(filters.toArray(new ViewerFilter[] {})); + } + else + { + getCurrentViewer().addFilter(new TermFilter(terms)); + } + text.setMessage("Search for Everything..."); + updateDefectCount(); + } + + + /** + * create the search bar control + * + * @param parent + * @return + */ + private Control createSearchControl(Composite parent) + { + GridData ld = new GridData(); + ld.grabExcessHorizontalSpace = true; + ld.horizontalAlignment = GridData.FILL; + + Composite search = new Composite(parent, SWT.NONE); + GridLayout layout2 = new GridLayout(2, false); + search.setLayout(layout2); + search.setLayoutData(ld); + + // create a label to display information about the view in. + final Text text = new Text(search, SWT.SINGLE | SWT.BORDER); + text.setMessage("Search for Everything..."); + + text.addListener(SWT.DefaultSelection, new Listener() { + + @Override + public void handleEvent(Event event) + { + handleTermFilter(text); + + } + }); + + GridData layoutData = new GridData(); + layoutData.grabExcessHorizontalSpace = true; + layoutData.horizontalAlignment = GridData.FILL; + text.setLayoutData(layoutData); + + Button button = new Button(search, SWT.BORDER); + button.setText("Search"); + button.addSelectionListener(new SelectionAdapter() { + + @Override + public void widgetSelected(SelectionEvent e) + { + handleTermFilter(text); + } + + }); + + return search; + } + + /** + * create the control for the viewer. + * + * @param parent + * @return + */ + private Control createReportViewerControl(Composite parent) + { + viewerBook = new PageBook(parent, SWT.NONE); + viewerBook.setLayoutData(GridDataFactory.fillDefaults().grab(true, true).create()); + TableViewer tableViewer = createReportTableViewer(viewerBook); + tableViewer.addDoubleClickListener(new ReportDoubleClickListener()); + + emptyViewer = new Label(viewerBook, SWT.TOP | SWT.LEFT | SWT.WRAP); + viewers = new EnumMap(Mode.class); + viewers.put(Mode.Table, tableViewer); + setReportMode(Mode.Table); + viewerBook.showPage(tableViewer.getControl()); + + return viewerBook; + } + + /** + * create the report table. + * + * @param parent + * @return + */ + private TableViewer createReportTableViewer(Composite parent) + { + tableViewer = new TableViewer(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.FULL_SELECTION | SWT.BORDER); + tableViewer.setContentProvider(new ReportContentProvider()); + tableViewer.setComparator(new ReportViewerComparator()); + Table table = tableViewer.getTable(); + table.setHeaderVisible(true); + table.setLinesVisible(true); + ColumnViewerToolTipSupport.enableFor(tableViewer); + + String[] titles = { "File", "Location", "Tool", "SFP", "CWE", "Trust", "Description" }; + int[] bounds = { 200, 100, 200, 70, 90, 50, 900 }; + + // File Column + TableViewerColumn col = createTableViewerColumn(tableViewer, titles[0], bounds[0], 0, true); + col.setLabelProvider(new ReportStyledCellLabelProvider()); + // Location Column + col = createTableViewerColumn(tableViewer, titles[1], bounds[1], 1, true); + col.setLabelProvider(new ReportStyledCellLabelProvider()); + + // Tool Column + col = createTableViewerColumn(tableViewer, titles[2], bounds[2], 2, true); + col.setLabelProvider(new ReportStyledCellLabelProvider()); + + // SFP Column + col = createTableViewerColumn(tableViewer, titles[3], bounds[3], 3, true); + col.setLabelProvider(new ReportStyledCellLabelProvider()); + + // CWE Column + col = createTableViewerColumn(tableViewer, titles[4], bounds[4], 4, true); + col.setLabelProvider(new ReportStyledCellLabelProvider()); + + // Trust Column + col = createTableViewerColumn(tableViewer, titles[5], bounds[5], 5, true); + col.setLabelProvider(new ReportStyledCellLabelProvider()); + + // Description Column + col = createTableViewerColumn(tableViewer, titles[6], bounds[6], 6, true); + col.setLabelProvider(new ReportStyledCellLabelProvider()); + + MenuManager menuManager = new MenuManager(); + Menu menu = menuManager.createContextMenu(tableViewer.getTable()); + + tableViewer.getTable().setMenu(menu); + getSite().registerContextMenu(menuManager, tableViewer); + + return tableViewer; + } + + /** + * Create treeViewerColumns + * + * @param title + * @param bound + * @param colNumber + * @return + */ + private TableViewerColumn createTableViewerColumn(TableViewer viewer, final String title, final int bound, final int colNumber, + boolean enableSorting) + { + TableViewerColumn viewerColumn = new TableViewerColumn(viewer, SWT.LEFT); + final TableColumn column = viewerColumn.getColumn(); + column.setText(title); + column.setWidth(bound); + column.setResizable(true); + column.setMoveable(true); + if (enableSorting == true) + { + column.addSelectionListener(getSelectionAdapter(viewer, column, colNumber)); + } + return viewerColumn; + } + + /** + * Create a Selection Adapter for the given column and index + * + * @param column + * @param index + * @return + */ + private SelectionAdapter getSelectionAdapter(final TableViewer viewer, final TableColumn column, final int index) + { + SelectionAdapter selectionAdaptor = new SelectionAdapter() { + + @Override + public void widgetSelected(SelectionEvent e) + { + ReportViewerComparator comparator = (ReportViewerComparator) viewer.getComparator(); + comparator.setColumn(index); + int dir = comparator.getDirection(); + viewer.getTable().setSortDirection(dir); + viewer.getTable().setSortColumn(column); + viewer.refresh(); + } + }; + return selectionAdaptor; + + } + + /** + * @param table + */ + private void setReportMode(Mode newMode) + { + currentViewerMode = newMode; + getSite().setSelectionProvider(getCurrentViewer()); + getCurrentViewer().getControl().setFocus(); + } + + /** + * get the mode that the view is in. eg table. + * + * @return + */ + public Mode getReportMode() + { + return currentViewerMode; + } + + /** + * @return + */ + public ColumnViewer getCurrentViewer() + { + return viewers.get(currentViewerMode); + } + + @Override + public void setFocus() + { + pageBook.setFocus(); + } + + public IToifProject getReportInput() + { + return inputProject; + } + + public void setReportInput(IToifProject project) + { + updateInput(project); + } + + /** + * sets the input. updates the defect counter + * + * @param proj + */ + public void updateInput(IToifProject proj) + { + IToifProject prevProj = inputProject; + if (proj == null) + { + clearInput(); + } + else + { + inputProject = proj; + if (!inputProject.equals(prevProj)) + { + updateReportViewer(true); + for (ColumnViewer colViewer : viewers.values()) + { + colViewer.setInput(inputProject); + colViewer.getControl().pack(); + } + updateDefectCount(); + } + + pageBook.showPage(reportPage); + } + } + + /** + * clears input + */ + public void clearInput() + { + inputProject = null; + updateReportViewer(true); + } + + /** + * update the viewer. refreshes. + */ + private void updateReportViewer(final boolean doExpand) + { + if (inputProject == null) + { + pageBook.showPage(noReportPage); + } + else + { + if (getCurrentViewer().getInput() != null) + { + Runnable runnable = new Runnable() { + + @Override + public void run() + { + getCurrentViewer().refresh(); + updateDefectCount(); + } + }; + BusyIndicator.showWhile(getDisplay(), runnable); + setViewerVisible(true); + } + } + } + + /** + * @return + */ + private Display getDisplay() + { + if (pageBook != null && !pageBook.isDisposed()) + { + return pageBook.getDisplay(); + } + return null; + } + + /** + * @param b + */ + private void setViewerVisible(boolean showReport) + { + if (showReport) + { + viewerBook.showPage(getCurrentViewer().getControl()); + } + else + { + viewerBook.showPage(emptyViewer); + } + } + + public void refresh() + { + if (inputProject == null) + { + return; + } + setViewerVisible(true); + updateReportViewer(false); + pageBook.showPage(reportPage); + } + + /** + * update the defect counter. this calculates what to display in the status + * text. + */ + public void updateDefectCount() + { + + final int totalEntries = inputProject.getFindingEntries().size(); + final int visibleEntries = ((TableViewer) getCurrentViewer()).getTable().getItemCount(); + + PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() { + + @Override + public void run() + { + numberOfDefects.setText("Number of Defects: " + visibleEntries + " (" + (totalEntries - visibleEntries) + " filtered from view)"); + numberOfDefects.getParent().layout(); + } + }); + } + + /** + * @return + */ + public ViewerFilter[] getFilters() + { + return getCurrentViewer().getFilters(); + } + + /** + * @param array + */ + public void setFilters(ViewerFilter[] array) + { + getCurrentViewer().setFilters(array); + } + + public TableViewer getTableViewer() + { + return tableViewer; + } +} diff --git a/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/views/ReportViewerComparator.java b/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/views/ReportViewerComparator.java new file mode 100644 index 00000000..a351c613 --- /dev/null +++ b/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/views/ReportViewerComparator.java @@ -0,0 +1,253 @@ +/******************************************************************************* + * Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This program and + * the accompanying materials are made available under the terms of the Open + * Source Initiative OSI - Open Software License v3.0 which accompanies this + * distribution, and is available at + * http://www.opensource.org/licenses/osl-3.0.php/ + ******************************************************************************/ + +package com.kdmanalytics.toif.report.internal.views; + +import org.eclipse.jface.viewers.Viewer; +import org.eclipse.jface.viewers.ViewerComparator; +import org.eclipse.swt.SWT; + +import com.kdmanalytics.toif.report.internal.items.LocationGroup; +import com.kdmanalytics.toif.report.internal.items.ToolGroup; +import com.kdmanalytics.toif.report.items.IFileGroup; +import com.kdmanalytics.toif.report.items.IToifReportEntry; + +/** + * The Class ReportViewerComparator. + * + * @author Kyle Girard + */ +public class ReportViewerComparator extends ViewerComparator +{ + + /** The column index. */ + private int columnIndex; + + /** The Constant DESCENDING. */ + private static final int DESCENDING = 1; + + /** The direction. */ + private int direction = DESCENDING; + + /** + * Instantiates a new report viewer comparator. + */ + public ReportViewerComparator() + { + this.columnIndex = -1; + direction = DESCENDING; + } + + /** + * Gets the direction. + * + * @return the direction + */ + public int getDirection() + { + return direction == 1 ? SWT.DOWN : SWT.UP; + } + + /** + * Sets the column. + * + * @param column + * the new column + */ + public void setColumn(int column) + { + if (column == this.columnIndex) + { + // Same column as last sort; toggle the direction + direction = 1 - direction; + } + else + { + // New column; do an ascending sort + this.columnIndex = column; + direction = DESCENDING; + } + } + + /* + * (non-Javadoc) + * + * @see + * org.eclipse.jface.viewers.ViewerComparator#compare(org.eclipse.jface. + * viewers.Viewer, java.lang.Object, java.lang.Object) + */ + @Override + public int compare(Viewer viewer, Object e1, Object e2) + { + int result = 0; + IToifReportEntry entry1 = (IToifReportEntry) e1; + IToifReportEntry entry2 = (IToifReportEntry) e2; + + switch (columnIndex) + { + case 0: + { + IFileGroup file1 = entry1.getFileGroup(); + IFileGroup file2 = entry2.getFileGroup(); + result = file1.getName().split(" ")[0].compareTo(file2.getName().split(" ")[0]); + break; + } + case 1: + { + LocationGroup group1 = entry1.getLocationGroup(); + LocationGroup group2 = entry2.getLocationGroup(); + result = compareLocationGroups(group1, group2); + break; + } + case 2: + { + ToolGroup toolGroup1 = entry1.getToolGroup(); + ToolGroup toolGropu2 = entry2.getToolGroup(); + result = super.compare(viewer, toolGroup1, toolGropu2); + break; + } + case 3: + { + String sfp1 = entry1.getFindingEntry().getSfp().replace("SFP-", ""); + String sfp2 = entry2.getFindingEntry().getSfp().replace("SFP-", ""); + int sfp1Int = 0; + int sfp2Int = 0; + + try + { + sfp1Int = Integer.parseInt(sfp1); + } + catch (NumberFormatException nfe) + { + sfp1Int = -1; + } + + try + { + sfp2Int = Integer.parseInt(sfp2); + } + catch (NumberFormatException nfe) + { + sfp2Int = -1; + } + + result = sfp1Int - sfp2Int; + break; + } + case 4: + { + String cwe1 = entry1.getFindingEntry().getCwe().replace("CWE-", ""); + String cwe2 = entry2.getFindingEntry().getCwe().replace("CWE-", ""); + + int cwe1Int = 0; + int cwe2Int = 0; + try + { + cwe1Int = Integer.parseInt(cwe1); + } + catch (NumberFormatException nfe) + { + cwe1Int = -1; + } + + try + { + cwe2Int = Integer.parseInt(cwe2); + } + catch (NumberFormatException nfe) + { + cwe2Int = -1; + } + result = cwe1Int - cwe2Int; + + break; + } + case 5: + { + int cwe1Int = entry1.getFindingEntry().getTrust(); + int cwe2Int = entry2.getFindingEntry().getTrust(); + result = cwe1Int - cwe2Int; + break; + } + case 6: + { + String desc1 = entry1.getFindingEntry().getDescription(); + String desc2 = entry2.getFindingEntry().getDescription(); + result = desc1.compareTo(desc2); + break; + } + } + + // If descending order, flip the direction + if (direction == DESCENDING) + { + result = -result; + } + + return result; + } + + /** + * Compare two int strings. + * + * @param str1 + * the str1 + * @param str2 + * the str2 + * @return the int + */ + private int compareTwoIntStrings(String str1, String str2) + { + int res1 = 0; + int res2 = 0; + int result = 0; + + try + { + res1 = Integer.parseInt(str1); + } + catch (NumberFormatException nfe) + { + res1 = -10; + } + + try + { + res2 = Integer.parseInt(str2); + } + catch (NumberFormatException nfe) + { + res2 = -10; + } + + if (res1 > res2) + { + result = 1; + } + else if (res1 < res2) + { + result = -1; + } + return result; + } + + /** + * Compare location groups. + * + * @param loc1 + * the loc1 + * @param loc2 + * the loc2 + * @return the int + */ + private int compareLocationGroups(LocationGroup loc1, LocationGroup loc2) + { + return compareTwoIntStrings(loc1.getLineNumber(), loc2.getLineNumber()); + } + +} diff --git a/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/views/package-info.java b/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/views/package-info.java new file mode 100644 index 00000000..3a65c46f --- /dev/null +++ b/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/internal/views/package-info.java @@ -0,0 +1,10 @@ +/******************************************************************************* + * Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This + * program and the // accompanying materials are made available under the terms + * of the Open Source // Initiative OSI - Open Software License v3.0 which + * accompanies this // distribution, and is available at + * http://www.opensource.org/licenses/osl-3.0.php/ + ******************************************************************************/ + +package com.kdmanalytics.toif.report.internal.views; + diff --git a/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/items/IFileGroup.java b/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/items/IFileGroup.java new file mode 100644 index 00000000..bf5eb50b --- /dev/null +++ b/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/items/IFileGroup.java @@ -0,0 +1,80 @@ +/******************************************************************************* + * Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This program and + * the accompanying materials are made available under the terms of the Open + * Source Initiative OSI - Open Software License v3.0 which accompanies this + * distribution, and is available at + * http://www.opensource.org/licenses/osl-3.0.php/ + ******************************************************************************/ + +package com.kdmanalytics.toif.report.items; + +import java.util.List; + +import com.kdmanalytics.toif.report.internal.items.FindingEntry; +import com.kdmanalytics.toif.report.internal.items.LocationGroup; +import com.kdmanalytics.toif.report.internal.items.ReportItem; + +/** + * Interface for the file group. files contain locations. + * + * @author Kyle Girard + * + */ +public interface IFileGroup extends IReportItem +{ + + /** + * add a location fo the file + * + * @param location + */ + void AddLocation(LocationGroup location); + + /** + * get the children in this file + */ + List getChildren(); + + /** + * get the findings in this file + */ + List getFindingEntries(); + + /** + * get the findings that are not ok in this file + * + * @return + */ + List getFindingEntriesNotOk(); + + /** + * get the trust sum of the findings that are not ok. + * + * @return + */ + int getFindingEntriesNotOkTrustSum(); + + /** + * get the locations within this file + * + * @return + */ + List getLocationGroup(); + + /** + * get the name of the file + * + * @return + */ + String getName(); + + /** + * get the path of the file. + * + * @return + */ + String getPath(); + + String getSearchableText(); + +} diff --git a/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/items/IFindingEntry.java b/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/items/IFindingEntry.java new file mode 100644 index 00000000..b95e28c6 --- /dev/null +++ b/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/items/IFindingEntry.java @@ -0,0 +1,144 @@ +/******************************************************************************* + * Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This program and + * the accompanying materials are made available under the terms of the Open + * Source Initiative OSI - Open Software License v3.0 which accompanies this + * distribution, and is available at + * http://www.opensource.org/licenses/osl-3.0.php/ + ******************************************************************************/ + +package com.kdmanalytics.toif.report.items; + +import java.util.List; + +import org.openrdf.model.Value; +import org.openrdf.repository.Repository; + +import com.kdmanalytics.toif.report.internal.items.FindingEntry; +import com.kdmanalytics.toif.report.internal.items.FindingEntry.Citing; +import com.kdmanalytics.toif.report.internal.items.ReportItem; +import com.kdmanalytics.toif.report.internal.items.ToolGroup; +import com.kdmanalytics.toif.report.internal.items.Trace; + +/** + * interface for the finding entries. finding-entries are the actual findings. + * + * @author Kyle Girard + * + */ +public interface IFindingEntry extends IReportItem +{ + + String getValue(); + + boolean equals(Object obj); + + /** + * get the children of this report item + */ + List getChildren(); + + /** + * get the finding's CWE + * + * @return + */ + String getCwe(); + + /** + * get the findings description + * + * @return + */ + String getDescription(); + + /** + * get the finding entries inside this report entry + */ + List getFindingEntries(); + + /** + * @return the findingId + */ + String getFindingId(); + + + + /** + * get the searchable text of this entry. + */ + String getSearchableText(); + + String getSfp(); + + /** + * + * @return + */ + ToolGroup getTool(); + + /** + * get the trust of this finding + * + * @return + */ + int getTrust(); + + /** + * is this finding ok + * + * @return + */ + Citing isOk(); + + /** + * set the cwe name for this finding + * + * @param cwe + */ + void setCwe(String cwe); + + /** + * set the description for this finding + * + * @param stringValue + */ + void setDescription(String stringValue); + + /** + * set if this finding is ok + * + * @param isOk + */ + void setIsOk(Citing isOk); + + /** + * set the sfp value for this finding + * + * @param sfp + */ + void setSfp(String sfp); + + /** + * set the trust value for this finding + * + * @param value + */ + void setTrust(int value); + + /** + * get the string value for this entry + * + * @return + */ + String toString(); + + /** + * get the traces belonging to this finding. + * + * @return + */ + List getTraces(); + + void setTraces(List tracesList); + +} diff --git a/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/items/IReportItem.java b/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/items/IReportItem.java new file mode 100644 index 00000000..38b443b9 --- /dev/null +++ b/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/items/IReportItem.java @@ -0,0 +1,76 @@ +/******************************************************************************* + * Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This program and + * the accompanying materials are made available under the terms of the Open + * Source Initiative OSI - Open Software License v3.0 which accompanies this + * distribution, and is available at + * http://www.opensource.org/licenses/osl-3.0.php/ + ******************************************************************************/ + +package com.kdmanalytics.toif.report.items; + +import java.util.List; + +import org.eclipse.core.runtime.IAdaptable; + +import com.kdmanalytics.toif.report.internal.items.FindingEntry; +import com.kdmanalytics.toif.report.internal.items.ReportItem; + +/** + * interface for all report items. + * + * @author Kyle Girard + * + */ +public interface IReportItem extends IAdaptable +{ + + /** + * set the parent. + * + * @param parent + */ + void setParent(IReportItem parent); + + /** + * get the searchable text for this item + * + * @return + */ + String getSearchableText(); + + /** + * get the parent. + * + * @return + */ + IReportItem getParent(); + + /** + * get the children contianed in this item + * + * @return + */ + List getChildren(); + + /** + * get all the finding entries in this item + * + * @return + */ + List getFindingEntries(); + + /** + * get eh project this item belongs to . + * + * @return + */ + IToifProject getProject(); + + /** + * get the sum of the trust of all the findings within this item. + * + * @return + */ + int getTrustSum(); + +} diff --git a/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/items/IToifProject.java b/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/items/IToifProject.java new file mode 100644 index 00000000..8f3c2360 --- /dev/null +++ b/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/items/IToifProject.java @@ -0,0 +1,99 @@ +/******************************************************************************* + * Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This program and + * the accompanying materials are made available under the terms of the Open + * Source Initiative OSI - Open Software License v3.0 which accompanies this + * distribution, and is available at + * http://www.opensource.org/licenses/osl-3.0.php/ + ******************************************************************************/ + +package com.kdmanalytics.toif.report.items; + +import java.util.List; + +import org.eclipse.core.resources.IFolder; +import org.eclipse.core.resources.IProject; +import org.openrdf.model.ValueFactory; +import org.openrdf.repository.Repository; +import org.openrdf.repository.RepositoryConnection; + +import com.kdmanalytics.toif.report.internal.items.FileGroup; +import com.kdmanalytics.toif.report.internal.items.FindingEntry; +import com.kdmanalytics.toif.report.internal.items.ReportItem; + +/** + * Interface for the project. projects contain all the files (first level + * children), locations, tools, and findings. + * + * @author Kyle Girard + * + */ +public interface IToifProject extends IReportItem +{ + + /** + * get the project + * + * @return + */ + IProject getIProject(); + + + void setIProject(IProject iProject); + + /** + * get the repository this project is in + * + * @return + */ + Repository getRepository(); + + + void setRepository(IFolder ifolder); + + /** + * get the repository's connection + * + * @return + */ + RepositoryConnection getRepositoryConnection(); + + /** + * get the value factory for the repository + * + * @return + */ + ValueFactory getValueFactory(); + + void dispose(); + + /** + * get the file groups in this project. + * + * @return + */ + List getFileGroup(); + + /** + * add a file group to this project + * + * @param file + */ + void AddFileGroup(FileGroup file); + + /** + * get all the finding entries that are not ok + * + * @return + */ + List getFindingEntriesNotOk(); + + /** + * get all the finding entries in this project + * + * @return + */ + List getFindingEntries(); + + List getChildren(); + +} diff --git a/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/items/IToifReportEntry.java b/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/items/IToifReportEntry.java new file mode 100644 index 00000000..0e340201 --- /dev/null +++ b/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/items/IToifReportEntry.java @@ -0,0 +1,87 @@ +/******************************************************************************* + * Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This program and + * the accompanying materials are made available under the terms of the Open + * Source Initiative OSI - Open Software License v3.0 which accompanies this + * distribution, and is available at + * http://www.opensource.org/licenses/osl-3.0.php/ + ******************************************************************************/ + +package com.kdmanalytics.toif.report.items; + +import java.beans.PropertyChangeListener; + +import org.eclipse.core.runtime.IAdaptable; + +import com.kdmanalytics.toif.report.internal.items.FindingEntry; +import com.kdmanalytics.toif.report.internal.items.LocationGroup; +import com.kdmanalytics.toif.report.internal.items.ToolGroup; + +/** + * report entry interface. the general report entry + * + * @author Kyle Girard + * + */ +public interface IToifReportEntry extends IAdaptable +{ + + void addPropertyChangeListener(String propertyName, PropertyChangeListener listener); + + void removePropertyChangeListener(PropertyChangeListener listener); + + /** + * @return the project + */ + IToifProject getProject(); + + /** + * @param project + * the project to set + */ + void setProject(IToifProject project); + + /** + * @return the fileGroup + */ + IFileGroup getFileGroup(); + + /** + * @param fileGroup + * the fileGroup to set + */ + void setFileGroup(IFileGroup fileGroup); + + /** + * @return the locationGroup + */ + LocationGroup getLocationGroup(); + + /** + * @param locationGroup + * the locationGroup to set + */ + void setLocationGroup(LocationGroup locationGroup); + + /** + * @return the toolGroup + */ + ToolGroup getToolGroup(); + + /** + * @param toolGroup + * the toolGroup to set + */ + void setToolGroup(ToolGroup toolGroup); + + /** + * @return the findingEntry + */ + FindingEntry getFindingEntry(); + + /** + * @param findingEntry + * the findingEntry to set + */ + void setFindingEntry(FindingEntry findingEntry); + +} diff --git a/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/util/IRepositoryMaker.java b/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/util/IRepositoryMaker.java new file mode 100644 index 00000000..6e235b91 --- /dev/null +++ b/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/util/IRepositoryMaker.java @@ -0,0 +1,42 @@ +/** + * KDM Analytics Inc - (2012) + * + * @Author Adam Nunn + * @Date Apr 25, 2012 + */ + +package com.kdmanalytics.toif.report.util; + +import org.eclipse.core.resources.IFolder; +import org.openrdf.repository.Repository; + +/** + * maker interface for making the repository. repositorys are created + * differently under different circumstances. + * + * @author Adam Nunn + * + */ +public interface IRepositoryMaker +{ + + /** + * create the repository + */ + public void createRepository(); + + /** + * get the repository + * + * @return + */ + public Repository getRepository(); + + /** + * set the folder for the repository + * + * @param folder + */ + public void setFolder(IFolder folder); + +} diff --git a/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/util/package-info.java b/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/util/package-info.java new file mode 100644 index 00000000..2067f611 --- /dev/null +++ b/com.kdmanalytics.toif.report/src/com/kdmanalytics/toif/report/util/package-info.java @@ -0,0 +1,10 @@ +/******************************************************************************* + * Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This + * program and the // accompanying materials are made available under the terms + * of the Open Source // Initiative OSI - Open Software License v3.0 which + * accompanies this // distribution, and is available at + * http://www.opensource.org/licenses/osl-3.0.php/ + ******************************************************************************/ + +package com.kdmanalytics.toif.report.util; + diff --git a/com.kdmanalytics.toif.report/src/icons/alphaSort.gif b/com.kdmanalytics.toif.report/src/icons/alphaSort.gif new file mode 100644 index 00000000..6311cc00 Binary files /dev/null and b/com.kdmanalytics.toif.report/src/icons/alphaSort.gif differ diff --git a/com.kdmanalytics.toif.report/src/icons/bug.png b/com.kdmanalytics.toif.report/src/icons/bug.png new file mode 100644 index 00000000..2d5fb90e Binary files /dev/null and b/com.kdmanalytics.toif.report/src/icons/bug.png differ diff --git a/com.kdmanalytics.toif.report/src/icons/bullet_white.png b/com.kdmanalytics.toif.report/src/icons/bullet_white.png new file mode 100644 index 00000000..a9af8d44 Binary files /dev/null and b/com.kdmanalytics.toif.report/src/icons/bullet_white.png differ diff --git a/com.kdmanalytics.toif.report/src/icons/collapse.gif b/com.kdmanalytics.toif.report/src/icons/collapse.gif new file mode 100644 index 00000000..a2d80a90 Binary files /dev/null and b/com.kdmanalytics.toif.report/src/icons/collapse.gif differ diff --git a/com.kdmanalytics.toif.report/src/icons/cross.png b/com.kdmanalytics.toif.report/src/icons/cross.png new file mode 100644 index 00000000..1514d51a Binary files /dev/null and b/com.kdmanalytics.toif.report/src/icons/cross.png differ diff --git a/com.kdmanalytics.toif.report/src/icons/expandall.gif b/com.kdmanalytics.toif.report/src/icons/expandall.gif new file mode 100644 index 00000000..c4a67bb2 Binary files /dev/null and b/com.kdmanalytics.toif.report/src/icons/expandall.gif differ diff --git a/com.kdmanalytics.toif.report/src/icons/export.gif b/com.kdmanalytics.toif.report/src/icons/export.gif new file mode 100644 index 00000000..79f23532 Binary files /dev/null and b/com.kdmanalytics.toif.report/src/icons/export.gif differ diff --git a/com.kdmanalytics.toif.report/src/icons/filter.gif b/com.kdmanalytics.toif.report/src/icons/filter.gif new file mode 100644 index 00000000..6fe6f0e1 Binary files /dev/null and b/com.kdmanalytics.toif.report/src/icons/filter.gif differ diff --git a/com.kdmanalytics.toif.report/src/icons/filter.png b/com.kdmanalytics.toif.report/src/icons/filter.png new file mode 100644 index 00000000..4312806d Binary files /dev/null and b/com.kdmanalytics.toif.report/src/icons/filter.png differ diff --git a/com.kdmanalytics.toif.report/src/icons/go.gif b/com.kdmanalytics.toif.report/src/icons/go.gif new file mode 100644 index 00000000..d6b3bdcc Binary files /dev/null and b/com.kdmanalytics.toif.report/src/icons/go.gif differ diff --git a/com.kdmanalytics.toif.report/src/icons/merge.png b/com.kdmanalytics.toif.report/src/icons/merge.png new file mode 100644 index 00000000..53a5b858 Binary files /dev/null and b/com.kdmanalytics.toif.report/src/icons/merge.png differ diff --git a/com.kdmanalytics.toif.report/src/icons/numberSort.png b/com.kdmanalytics.toif.report/src/icons/numberSort.png new file mode 100644 index 00000000..10db385d Binary files /dev/null and b/com.kdmanalytics.toif.report/src/icons/numberSort.png differ diff --git a/com.kdmanalytics.toif.report/src/icons/page.png b/com.kdmanalytics.toif.report/src/icons/page.png new file mode 100644 index 00000000..03ddd799 Binary files /dev/null and b/com.kdmanalytics.toif.report/src/icons/page.png differ diff --git a/com.kdmanalytics.toif.report/src/icons/page_white_stack.png b/com.kdmanalytics.toif.report/src/icons/page_white_stack.png new file mode 100644 index 00000000..44084add Binary files /dev/null and b/com.kdmanalytics.toif.report/src/icons/page_white_stack.png differ diff --git a/com.kdmanalytics.toif.report/src/icons/priority.gif b/com.kdmanalytics.toif.report/src/icons/priority.gif new file mode 100644 index 00000000..f99bdc35 Binary files /dev/null and b/com.kdmanalytics.toif.report/src/icons/priority.gif differ diff --git a/com.kdmanalytics.toif.report/src/icons/question.png b/com.kdmanalytics.toif.report/src/icons/question.png new file mode 100644 index 00000000..4db0f088 Binary files /dev/null and b/com.kdmanalytics.toif.report/src/icons/question.png differ diff --git a/com.kdmanalytics.toif.report/src/icons/rep.gif b/com.kdmanalytics.toif.report/src/icons/rep.gif new file mode 100644 index 00000000..0470e158 Binary files /dev/null and b/com.kdmanalytics.toif.report/src/icons/rep.gif differ diff --git a/com.kdmanalytics.toif.report/src/icons/sort.gif b/com.kdmanalytics.toif.report/src/icons/sort.gif new file mode 100644 index 00000000..166eaba9 Binary files /dev/null and b/com.kdmanalytics.toif.report/src/icons/sort.gif differ diff --git a/com.kdmanalytics.toif.report/src/icons/tick.png b/com.kdmanalytics.toif.report/src/icons/tick.png new file mode 100644 index 00000000..a9925a06 Binary files /dev/null and b/com.kdmanalytics.toif.report/src/icons/tick.png differ diff --git a/com.kdmanalytics.toif.report/src/icons/trace.png b/com.kdmanalytics.toif.report/src/icons/trace.png new file mode 100644 index 00000000..1a3f6a24 Binary files /dev/null and b/com.kdmanalytics.toif.report/src/icons/trace.png differ diff --git a/com.kdmanalytics.toif.report/src/icons/trust.png b/com.kdmanalytics.toif.report/src/icons/trust.png new file mode 100644 index 00000000..8555cf3a Binary files /dev/null and b/com.kdmanalytics.toif.report/src/icons/trust.png differ diff --git a/com.kdmanalytics.toif.report/src/icons/up.png b/com.kdmanalytics.toif.report/src/icons/up.png new file mode 100644 index 00000000..57fe9d47 Binary files /dev/null and b/com.kdmanalytics.toif.report/src/icons/up.png differ diff --git a/com.kdmanalytics.toif.report/src/icons/wrench.png b/com.kdmanalytics.toif.report/src/icons/wrench.png new file mode 100644 index 00000000..5c8213fe Binary files /dev/null and b/com.kdmanalytics.toif.report/src/icons/wrench.png differ diff --git a/com.kdmanalytics.toif.report/src/icons/xml.png b/com.kdmanalytics.toif.report/src/icons/xml.png new file mode 100644 index 00000000..8b36fa60 Binary files /dev/null and b/com.kdmanalytics.toif.report/src/icons/xml.png differ diff --git a/com.kdmanalytics.toif.report/target/MANIFEST.MF b/com.kdmanalytics.toif.report/target/MANIFEST.MF new file mode 100644 index 00000000..3e1c0a91 --- /dev/null +++ b/com.kdmanalytics.toif.report/target/MANIFEST.MF @@ -0,0 +1,26 @@ +Manifest-Version: 1.0 +Export-Package: com.kdmanalytics.toif.report.items,com.kdmanalytics.to + if.report.util;uses:="org.eclipse.core.resources,org.openrdf.reposito + ry" +Bundle-ActivationPolicy: lazy +Bundle-ClassPath: . +Bundle-Name: TOIF Report View +Bundle-RequiredExecutionEnvironment: JavaSE-1.6 +Require-Bundle: com.google.guava;bundle-version="[14.0.1,15.0.0)",org. + apache.log4j;bundle-version="[1.2.15,2.0.0)",org.openrdf.sesame;bundl + e-version="[2.4.0,2.5.0)",org.eclipse.ui;bundle-version="[3.7.0,4.2.0 + )",org.eclipse.core.runtime;bundle-version="[3.7.0,4.2.0)",org.eclips + e.ui.ide;bundle-version="[3.7.0,4.2.0)",org.eclipse.core.filesystem;b + undle-version="[1.3.100,2.0.0)",org.eclipse.core.expressions;bundle-v + ersion="[3.4.300,3.5.0)",org.eclipse.core.resources;bundle-version="[ + 3.7.0,4.2.0)",org.apache.commons.lang3;bundle-version="[3.1.0,4.0.0)" + ,org.apache.commons.io;bundle-version="[2.4.0,3.0.0)",org.eclipse.jdt + .core;bundle-version="[3.7.0,4.2.0)",com.kdmanalytics.toif.ccr;bundle + -version="[1.6.0,2.0.0)" +Bundle-Vendor: KDM Analytics Inc. +Bundle-Version: 1.15.5 +Bundle-ManifestVersion: 2 +Bundle-Activator: com.kdmanalytics.toif.report.internal.Activator +Bundle-SymbolicName: com.kdmanalytics.toif.report;singleton:=true +Eclipse-ExtensibleAPI: true + diff --git a/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/Activator.class b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/Activator.class new file mode 100644 index 00000000..5fd1f284 Binary files /dev/null and b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/Activator.class differ diff --git a/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/contributionItems/TraceContributionItem.class b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/contributionItems/TraceContributionItem.class new file mode 100644 index 00000000..1917814e Binary files /dev/null and b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/contributionItems/TraceContributionItem.class differ diff --git a/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/contributionItems/package-info.class b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/contributionItems/package-info.class new file mode 100644 index 00000000..d2e1cfd2 Binary files /dev/null and b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/contributionItems/package-info.class differ diff --git a/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/filters/AbstractValidFilter.class b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/filters/AbstractValidFilter.class new file mode 100644 index 00000000..bc12a62d Binary files /dev/null and b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/filters/AbstractValidFilter.class differ diff --git a/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/filters/CWETwoToolsFilter.class b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/filters/CWETwoToolsFilter.class new file mode 100644 index 00000000..bf60ad12 Binary files /dev/null and b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/filters/CWETwoToolsFilter.class differ diff --git a/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/filters/IsValidFilter.class b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/filters/IsValidFilter.class new file mode 100644 index 00000000..74f13618 Binary files /dev/null and b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/filters/IsValidFilter.class differ diff --git a/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/filters/NotValidFilter.class b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/filters/NotValidFilter.class new file mode 100644 index 00000000..e4737a38 Binary files /dev/null and b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/filters/NotValidFilter.class differ diff --git a/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/filters/SFPTwoToolsFilter.class b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/filters/SFPTwoToolsFilter.class new file mode 100644 index 00000000..af7fb50c Binary files /dev/null and b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/filters/SFPTwoToolsFilter.class differ diff --git a/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/filters/TermFilter.class b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/filters/TermFilter.class new file mode 100644 index 00000000..cdec5b8a Binary files /dev/null and b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/filters/TermFilter.class differ diff --git a/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/filters/TrustFilter.class b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/filters/TrustFilter.class new file mode 100644 index 00000000..93b53b9a Binary files /dev/null and b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/filters/TrustFilter.class differ diff --git a/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/filters/TwoToolsFilter.class b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/filters/TwoToolsFilter.class new file mode 100644 index 00000000..2d3591e5 Binary files /dev/null and b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/filters/TwoToolsFilter.class differ diff --git a/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/filters/package-info.class b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/filters/package-info.class new file mode 100644 index 00000000..4ba6abdd Binary files /dev/null and b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/filters/package-info.class differ diff --git a/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/handlers/BuildDefectModelHandler.class b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/handlers/BuildDefectModelHandler.class new file mode 100644 index 00000000..329b023c Binary files /dev/null and b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/handlers/BuildDefectModelHandler.class differ diff --git a/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/handlers/ExportCitationHandler.class b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/handlers/ExportCitationHandler.class new file mode 100644 index 00000000..05a757d7 Binary files /dev/null and b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/handlers/ExportCitationHandler.class differ diff --git a/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/handlers/ExportSelectionHandler.class b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/handlers/ExportSelectionHandler.class new file mode 100644 index 00000000..fc32e260 Binary files /dev/null and b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/handlers/ExportSelectionHandler.class differ diff --git a/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/handlers/FiltersDialog$1.class b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/handlers/FiltersDialog$1.class new file mode 100644 index 00000000..4c9fe9e6 Binary files /dev/null and b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/handlers/FiltersDialog$1.class differ diff --git a/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/handlers/FiltersDialog$2.class b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/handlers/FiltersDialog$2.class new file mode 100644 index 00000000..6cabb9ef Binary files /dev/null and b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/handlers/FiltersDialog$2.class differ diff --git a/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/handlers/FiltersDialog$3.class b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/handlers/FiltersDialog$3.class new file mode 100644 index 00000000..09bed2a9 Binary files /dev/null and b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/handlers/FiltersDialog$3.class differ diff --git a/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/handlers/FiltersDialog$4.class b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/handlers/FiltersDialog$4.class new file mode 100644 index 00000000..f1465597 Binary files /dev/null and b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/handlers/FiltersDialog$4.class differ diff --git a/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/handlers/FiltersDialog$5.class b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/handlers/FiltersDialog$5.class new file mode 100644 index 00000000..5c36e7e3 Binary files /dev/null and b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/handlers/FiltersDialog$5.class differ diff --git a/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/handlers/FiltersDialog$6.class b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/handlers/FiltersDialog$6.class new file mode 100644 index 00000000..01deef14 Binary files /dev/null and b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/handlers/FiltersDialog$6.class differ diff --git a/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/handlers/FiltersDialog$7.class b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/handlers/FiltersDialog$7.class new file mode 100644 index 00000000..986a6e9b Binary files /dev/null and b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/handlers/FiltersDialog$7.class differ diff --git a/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/handlers/FiltersDialog.class b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/handlers/FiltersDialog.class new file mode 100644 index 00000000..04452eda Binary files /dev/null and b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/handlers/FiltersDialog.class differ diff --git a/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/handlers/FiltersHandler.class b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/handlers/FiltersHandler.class new file mode 100644 index 00000000..65b5d8b9 Binary files /dev/null and b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/handlers/FiltersHandler.class differ diff --git a/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/handlers/FiltersHandler.java.orig b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/handlers/FiltersHandler.java.orig new file mode 100644 index 00000000..c15a04fe --- /dev/null +++ b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/handlers/FiltersHandler.java.orig @@ -0,0 +1,144 @@ +/******************************************************************************* + * Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This program and the + * accompanying materials are made available under the terms of the Open Source + * Initiative OSI - Open Software License v3.0 which accompanies this + * distribution, and is available at http://www.opensource.org/licenses/osl-3.0.php/ + ******************************************************************************/ + +package com.kdmanalytics.toif.report.internal.handlers; + +import java.util.ArrayList; +import java.util.List; + +import org.eclipse.core.commands.AbstractHandler; +import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.core.commands.IHandler; +import org.eclipse.jface.viewers.ViewerFilter; +import org.eclipse.swt.widgets.Shell; +import org.eclipse.ui.PlatformUI; +import org.eclipse.ui.handlers.HandlerUtil; + +import com.kdmanalytics.toif.report.internal.filters.CWETwoToolsFilter; +import com.kdmanalytics.toif.report.internal.filters.IsValidFilter; +import com.kdmanalytics.toif.report.internal.filters.NotValidFilter; +import com.kdmanalytics.toif.report.internal.filters.SFPTwoToolsFilter; +import com.kdmanalytics.toif.report.internal.filters.TermFilter; +import com.kdmanalytics.toif.report.internal.filters.TrustFilter; +import com.kdmanalytics.toif.report.internal.filters.TwoToolsFilter; +import com.kdmanalytics.toif.report.internal.views.ReportView; + +public class FiltersHandler extends AbstractHandler implements IHandler +{ + + @Override + public Object execute(ExecutionEvent event) throws ExecutionException + { + Shell parentShell = PlatformUI.getWorkbench().getDisplay().getActiveShell(); + final ReportView view = (ReportView) HandlerUtil.getActivePart(event); + + FiltersDialog dialog = new FiltersDialog(parentShell, view.getFilters()); + + dialog.open(); + + List filterList = new ArrayList(); + + // Hack to ensure that the term filter is applied in addition to the + // filters that are handled by the dialog + for (ViewerFilter filter : view.getFilters()) + { + if (filter instanceof TermFilter) + { + filterList.add(filter); + } + } + + handleTrustFilter(dialog, filterList); + + handleTwoToolFilter(dialog, filterList); + handleCWETwoToolFilter(dialog, filterList); + handleSFPTwoToolFilter(dialog, filterList); + + handleIsValidFilter(dialog, filterList); + handleNotValidFilter(dialog, filterList); + + view.setFilters(filterList.toArray(new ViewerFilter[filterList.size()])); +<<<<<<< HEAD + + //view.refresh(); +======= + view.refresh(); +>>>>>>> branch 'develop' of gitolite@fry:toif + return null; + } + + private void handleNotValidFilter(FiltersDialog dialog, List filterList) + { + NotValidFilter notValidFilter = dialog.getNotValidFilter(); + if (notValidFilter != null) + { + filterList.add(notValidFilter); + } + + } + + private void handleCWETwoToolFilter(FiltersDialog dialog, List filterList) + { + CWETwoToolsFilter cweTwoToolsFilter = dialog.getCWETwoToolsFilter(); + if (cweTwoToolsFilter != null) + { + filterList.add(cweTwoToolsFilter); + } + + } + + private void handleSFPTwoToolFilter(FiltersDialog dialog, List filterList) + { + SFPTwoToolsFilter sfpTwoToolsFilter = dialog.getSFPTwoToolsFilter(); + if (sfpTwoToolsFilter != null) + { + filterList.add(sfpTwoToolsFilter); + } + + } + + /** + * @param dialog + * @param filterList + */ + private void handleTrustFilter(FiltersDialog dialog, List filterList) + { + TrustFilter trustFilter = dialog.getTrustFilter(); + if (trustFilter != null) + { + trustFilter.setAmount(dialog.getTrustAmount()); + filterList.add(trustFilter); + } + } + + /** + * @param dialog + * @param filterList + */ + private void handleTwoToolFilter(FiltersDialog dialog, List filterList) + { + TwoToolsFilter twoToolsFilter = dialog.getTwoToolsFilter(); + if (twoToolsFilter != null) + { + filterList.add(twoToolsFilter); + } + } + + /** + * @param dialog + * @param filterList + */ + private void handleIsValidFilter(FiltersDialog dialog, List filterList) + { + IsValidFilter isValidFilter = dialog.getIsValidFilter(); + if (isValidFilter != null) + { + filterList.add(isValidFilter); + } + } +} diff --git a/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/handlers/MergeTSV$1.class b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/handlers/MergeTSV$1.class new file mode 100644 index 00000000..07c7915c Binary files /dev/null and b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/handlers/MergeTSV$1.class differ diff --git a/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/handlers/MergeTSV.class b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/handlers/MergeTSV.class new file mode 100644 index 00000000..390e22c0 Binary files /dev/null and b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/handlers/MergeTSV.class differ diff --git a/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/handlers/ModelUtil$1$1.class b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/handlers/ModelUtil$1$1.class new file mode 100644 index 00000000..3527c91b Binary files /dev/null and b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/handlers/ModelUtil$1$1.class differ diff --git a/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/handlers/ModelUtil$1.class b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/handlers/ModelUtil$1.class new file mode 100644 index 00000000..1b34135d Binary files /dev/null and b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/handlers/ModelUtil$1.class differ diff --git a/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/handlers/ModelUtil.class b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/handlers/ModelUtil.class new file mode 100644 index 00000000..8c620236 Binary files /dev/null and b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/handlers/ModelUtil.class differ diff --git a/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/handlers/MoreInformationHandler.class b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/handlers/MoreInformationHandler.class new file mode 100644 index 00000000..e529b578 Binary files /dev/null and b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/handlers/MoreInformationHandler.class differ diff --git a/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/handlers/NotWeaknessPropertyTest.class b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/handlers/NotWeaknessPropertyTest.class new file mode 100644 index 00000000..d110aadd Binary files /dev/null and b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/handlers/NotWeaknessPropertyTest.class differ diff --git a/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/handlers/SetTrustHandler$1.class b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/handlers/SetTrustHandler$1.class new file mode 100644 index 00000000..d015c1de Binary files /dev/null and b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/handlers/SetTrustHandler$1.class differ diff --git a/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/handlers/SetTrustHandler$2.class b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/handlers/SetTrustHandler$2.class new file mode 100644 index 00000000..26ab2533 Binary files /dev/null and b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/handlers/SetTrustHandler$2.class differ diff --git a/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/handlers/SetTrustHandler.class b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/handlers/SetTrustHandler.class new file mode 100644 index 00000000..1d854213 Binary files /dev/null and b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/handlers/SetTrustHandler.class differ diff --git a/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/handlers/TraceContributionHandler.class b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/handlers/TraceContributionHandler.class new file mode 100644 index 00000000..7ebe4e96 Binary files /dev/null and b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/handlers/TraceContributionHandler.class differ diff --git a/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/handlers/TrustSelectionListener.class b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/handlers/TrustSelectionListener.class new file mode 100644 index 00000000..414ac826 Binary files /dev/null and b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/handlers/TrustSelectionListener.class differ diff --git a/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/handlers/UncitedWeaknessHandler.class b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/handlers/UncitedWeaknessHandler.class new file mode 100644 index 00000000..fffdd62e Binary files /dev/null and b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/handlers/UncitedWeaknessHandler.class differ diff --git a/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/handlers/WeaknessHandler.class b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/handlers/WeaknessHandler.class new file mode 100644 index 00000000..0c4a3499 Binary files /dev/null and b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/handlers/WeaknessHandler.class differ diff --git a/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/handlers/ccrHandler$1CcrJob.class b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/handlers/ccrHandler$1CcrJob.class new file mode 100644 index 00000000..c0c76e2c Binary files /dev/null and b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/handlers/ccrHandler$1CcrJob.class differ diff --git a/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/handlers/ccrHandler.class b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/handlers/ccrHandler.class new file mode 100644 index 00000000..ec82ac60 Binary files /dev/null and b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/handlers/ccrHandler.class differ diff --git a/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/handlers/package-info.class b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/handlers/package-info.class new file mode 100644 index 00000000..0b0e9146 Binary files /dev/null and b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/handlers/package-info.class differ diff --git a/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/importWizard/RepositoryImportWizard.class b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/importWizard/RepositoryImportWizard.class new file mode 100644 index 00000000..146fbf22 Binary files /dev/null and b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/importWizard/RepositoryImportWizard.class differ diff --git a/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/importWizard/RepositoryImportWizardPage.class b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/importWizard/RepositoryImportWizardPage.class new file mode 100644 index 00000000..2d9d6694 Binary files /dev/null and b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/importWizard/RepositoryImportWizardPage.class differ diff --git a/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/importWizard/ToifReportImportJob.class b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/importWizard/ToifReportImportJob.class new file mode 100644 index 00000000..4478c3d9 Binary files /dev/null and b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/importWizard/ToifReportImportJob.class differ diff --git a/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/importWizard/ToifReportImportWizard.class b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/importWizard/ToifReportImportWizard.class new file mode 100644 index 00000000..9fb3a30a Binary files /dev/null and b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/importWizard/ToifReportImportWizard.class differ diff --git a/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/importWizard/ToifReportImportWizardPage.class b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/importWizard/ToifReportImportWizardPage.class new file mode 100644 index 00000000..e33255a0 Binary files /dev/null and b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/importWizard/ToifReportImportWizardPage.class differ diff --git a/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/importWizard/package-info.class b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/importWizard/package-info.class new file mode 100644 index 00000000..103d289f Binary files /dev/null and b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/importWizard/package-info.class differ diff --git a/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/items/CachedCodeLocation.class b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/items/CachedCodeLocation.class new file mode 100644 index 00000000..15263d06 Binary files /dev/null and b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/items/CachedCodeLocation.class differ diff --git a/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/items/FileGroup.class b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/items/FileGroup.class new file mode 100644 index 00000000..c84969ed Binary files /dev/null and b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/items/FileGroup.class differ diff --git a/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/items/FindingEntry$Citing.class b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/items/FindingEntry$Citing.class new file mode 100644 index 00000000..29eefe6b Binary files /dev/null and b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/items/FindingEntry$Citing.class differ diff --git a/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/items/FindingEntry.class b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/items/FindingEntry.class new file mode 100644 index 00000000..e6c80ed6 Binary files /dev/null and b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/items/FindingEntry.class differ diff --git a/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/items/LocationGroup.class b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/items/LocationGroup.class new file mode 100644 index 00000000..0746b98c Binary files /dev/null and b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/items/LocationGroup.class differ diff --git a/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/items/Project.class b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/items/Project.class new file mode 100644 index 00000000..96b27c97 Binary files /dev/null and b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/items/Project.class differ diff --git a/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/items/ProjectFactory.class b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/items/ProjectFactory.class new file mode 100644 index 00000000..dfc638ed Binary files /dev/null and b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/items/ProjectFactory.class differ diff --git a/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/items/ReportItem.class b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/items/ReportItem.class new file mode 100644 index 00000000..1d1da502 Binary files /dev/null and b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/items/ReportItem.class differ diff --git a/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/items/ToifReportEntry.class b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/items/ToifReportEntry.class new file mode 100644 index 00000000..c1c1144c Binary files /dev/null and b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/items/ToifReportEntry.class differ diff --git a/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/items/ToolGroup.class b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/items/ToolGroup.class new file mode 100644 index 00000000..77a44ada Binary files /dev/null and b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/items/ToolGroup.class differ diff --git a/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/items/Trace.class b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/items/Trace.class new file mode 100644 index 00000000..3a76f88c Binary files /dev/null and b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/items/Trace.class differ diff --git a/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/items/package-info.class b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/items/package-info.class new file mode 100644 index 00000000..7cf1dc72 Binary files /dev/null and b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/items/package-info.class differ diff --git a/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/listeners/ReportDoubleClickListener.class b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/listeners/ReportDoubleClickListener.class new file mode 100644 index 00000000..67c8f1e9 Binary files /dev/null and b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/listeners/ReportDoubleClickListener.class differ diff --git a/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/listeners/ResourceMatch.class b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/listeners/ResourceMatch.class new file mode 100644 index 00000000..078c1382 Binary files /dev/null and b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/listeners/ResourceMatch.class differ diff --git a/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/listeners/package-info.class b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/listeners/package-info.class new file mode 100644 index 00000000..271cbfea Binary files /dev/null and b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/listeners/package-info.class differ diff --git a/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/package-info.class b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/package-info.class new file mode 100644 index 00000000..f37e2967 Binary files /dev/null and b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/package-info.class differ diff --git a/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/providers/ReportContentProvider.class b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/providers/ReportContentProvider.class new file mode 100644 index 00000000..6940ab07 Binary files /dev/null and b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/providers/ReportContentProvider.class differ diff --git a/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/providers/ReportLabelProvider.class b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/providers/ReportLabelProvider.class new file mode 100644 index 00000000..5bffadb0 Binary files /dev/null and b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/providers/ReportLabelProvider.class differ diff --git a/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/providers/ReportStyledCellLabelProvider.class b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/providers/ReportStyledCellLabelProvider.class new file mode 100644 index 00000000..dd0c92b3 Binary files /dev/null and b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/providers/ReportStyledCellLabelProvider.class differ diff --git a/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/providers/TOIFImportTreeContentProvider.class b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/providers/TOIFImportTreeContentProvider.class new file mode 100644 index 00000000..43c87d96 Binary files /dev/null and b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/providers/TOIFImportTreeContentProvider.class differ diff --git a/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/providers/package-info.class b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/providers/package-info.class new file mode 100644 index 00000000..47c51249 Binary files /dev/null and b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/providers/package-info.class differ diff --git a/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/util/MemberUtil.class b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/util/MemberUtil.class new file mode 100644 index 00000000..d6ee9865 Binary files /dev/null and b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/util/MemberUtil.class differ diff --git a/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/views/ReportView$1.class b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/views/ReportView$1.class new file mode 100644 index 00000000..d161ac3f Binary files /dev/null and b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/views/ReportView$1.class differ diff --git a/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/views/ReportView$2.class b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/views/ReportView$2.class new file mode 100644 index 00000000..c9150d34 Binary files /dev/null and b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/views/ReportView$2.class differ diff --git a/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/views/ReportView$3.class b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/views/ReportView$3.class new file mode 100644 index 00000000..1fedce19 Binary files /dev/null and b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/views/ReportView$3.class differ diff --git a/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/views/ReportView$4.class b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/views/ReportView$4.class new file mode 100644 index 00000000..ca258305 Binary files /dev/null and b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/views/ReportView$4.class differ diff --git a/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/views/ReportView$5.class b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/views/ReportView$5.class new file mode 100644 index 00000000..1e5813a3 Binary files /dev/null and b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/views/ReportView$5.class differ diff --git a/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/views/ReportView$6.class b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/views/ReportView$6.class new file mode 100644 index 00000000..c644d91d Binary files /dev/null and b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/views/ReportView$6.class differ diff --git a/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/views/ReportView$Mode.class b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/views/ReportView$Mode.class new file mode 100644 index 00000000..c1b090c8 Binary files /dev/null and b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/views/ReportView$Mode.class differ diff --git a/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/views/ReportView.class b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/views/ReportView.class new file mode 100644 index 00000000..76fcaf36 Binary files /dev/null and b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/views/ReportView.class differ diff --git a/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/views/ReportViewerComparator.class b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/views/ReportViewerComparator.class new file mode 100644 index 00000000..7cef6745 Binary files /dev/null and b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/views/ReportViewerComparator.class differ diff --git a/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/views/package-info.class b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/views/package-info.class new file mode 100644 index 00000000..6fc04295 Binary files /dev/null and b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/internal/views/package-info.class differ diff --git a/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/items/IFileGroup.class b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/items/IFileGroup.class new file mode 100644 index 00000000..4fa8905b Binary files /dev/null and b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/items/IFileGroup.class differ diff --git a/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/items/IFindingEntry.class b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/items/IFindingEntry.class new file mode 100644 index 00000000..e1322483 Binary files /dev/null and b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/items/IFindingEntry.class differ diff --git a/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/items/IReportItem.class b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/items/IReportItem.class new file mode 100644 index 00000000..1b495a57 Binary files /dev/null and b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/items/IReportItem.class differ diff --git a/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/items/IToifProject.class b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/items/IToifProject.class new file mode 100644 index 00000000..72958125 Binary files /dev/null and b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/items/IToifProject.class differ diff --git a/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/items/IToifReportEntry.class b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/items/IToifReportEntry.class new file mode 100644 index 00000000..a6c8201f Binary files /dev/null and b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/items/IToifReportEntry.class differ diff --git a/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/util/IRepositoryMaker.class b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/util/IRepositoryMaker.class new file mode 100644 index 00000000..2b6b8c3e Binary files /dev/null and b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/util/IRepositoryMaker.class differ diff --git a/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/util/package-info.class b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/util/package-info.class new file mode 100644 index 00000000..8a9f0132 Binary files /dev/null and b/com.kdmanalytics.toif.report/target/classes/com/kdmanalytics/toif/report/util/package-info.class differ diff --git a/com.kdmanalytics.toif.report/target/classes/icons/alphaSort.gif b/com.kdmanalytics.toif.report/target/classes/icons/alphaSort.gif new file mode 100644 index 00000000..6311cc00 Binary files /dev/null and b/com.kdmanalytics.toif.report/target/classes/icons/alphaSort.gif differ diff --git a/com.kdmanalytics.toif.report/target/classes/icons/bug.png b/com.kdmanalytics.toif.report/target/classes/icons/bug.png new file mode 100644 index 00000000..2d5fb90e Binary files /dev/null and b/com.kdmanalytics.toif.report/target/classes/icons/bug.png differ diff --git a/com.kdmanalytics.toif.report/target/classes/icons/bullet_white.png b/com.kdmanalytics.toif.report/target/classes/icons/bullet_white.png new file mode 100644 index 00000000..a9af8d44 Binary files /dev/null and b/com.kdmanalytics.toif.report/target/classes/icons/bullet_white.png differ diff --git a/com.kdmanalytics.toif.report/target/classes/icons/collapse.gif b/com.kdmanalytics.toif.report/target/classes/icons/collapse.gif new file mode 100644 index 00000000..a2d80a90 Binary files /dev/null and b/com.kdmanalytics.toif.report/target/classes/icons/collapse.gif differ diff --git a/com.kdmanalytics.toif.report/target/classes/icons/cross.png b/com.kdmanalytics.toif.report/target/classes/icons/cross.png new file mode 100644 index 00000000..1514d51a Binary files /dev/null and b/com.kdmanalytics.toif.report/target/classes/icons/cross.png differ diff --git a/com.kdmanalytics.toif.report/target/classes/icons/expandall.gif b/com.kdmanalytics.toif.report/target/classes/icons/expandall.gif new file mode 100644 index 00000000..c4a67bb2 Binary files /dev/null and b/com.kdmanalytics.toif.report/target/classes/icons/expandall.gif differ diff --git a/com.kdmanalytics.toif.report/target/classes/icons/export.gif b/com.kdmanalytics.toif.report/target/classes/icons/export.gif new file mode 100644 index 00000000..79f23532 Binary files /dev/null and b/com.kdmanalytics.toif.report/target/classes/icons/export.gif differ diff --git a/com.kdmanalytics.toif.report/target/classes/icons/filter.gif b/com.kdmanalytics.toif.report/target/classes/icons/filter.gif new file mode 100644 index 00000000..6fe6f0e1 Binary files /dev/null and b/com.kdmanalytics.toif.report/target/classes/icons/filter.gif differ diff --git a/com.kdmanalytics.toif.report/target/classes/icons/filter.png b/com.kdmanalytics.toif.report/target/classes/icons/filter.png new file mode 100644 index 00000000..4312806d Binary files /dev/null and b/com.kdmanalytics.toif.report/target/classes/icons/filter.png differ diff --git a/com.kdmanalytics.toif.report/target/classes/icons/go.gif b/com.kdmanalytics.toif.report/target/classes/icons/go.gif new file mode 100644 index 00000000..d6b3bdcc Binary files /dev/null and b/com.kdmanalytics.toif.report/target/classes/icons/go.gif differ diff --git a/com.kdmanalytics.toif.report/target/classes/icons/merge.png b/com.kdmanalytics.toif.report/target/classes/icons/merge.png new file mode 100644 index 00000000..53a5b858 Binary files /dev/null and b/com.kdmanalytics.toif.report/target/classes/icons/merge.png differ diff --git a/com.kdmanalytics.toif.report/target/classes/icons/numberSort.png b/com.kdmanalytics.toif.report/target/classes/icons/numberSort.png new file mode 100644 index 00000000..10db385d Binary files /dev/null and b/com.kdmanalytics.toif.report/target/classes/icons/numberSort.png differ diff --git a/com.kdmanalytics.toif.report/target/classes/icons/page.png b/com.kdmanalytics.toif.report/target/classes/icons/page.png new file mode 100644 index 00000000..03ddd799 Binary files /dev/null and b/com.kdmanalytics.toif.report/target/classes/icons/page.png differ diff --git a/com.kdmanalytics.toif.report/target/classes/icons/page_white_stack.png b/com.kdmanalytics.toif.report/target/classes/icons/page_white_stack.png new file mode 100644 index 00000000..44084add Binary files /dev/null and b/com.kdmanalytics.toif.report/target/classes/icons/page_white_stack.png differ diff --git a/com.kdmanalytics.toif.report/target/classes/icons/priority.gif b/com.kdmanalytics.toif.report/target/classes/icons/priority.gif new file mode 100644 index 00000000..f99bdc35 Binary files /dev/null and b/com.kdmanalytics.toif.report/target/classes/icons/priority.gif differ diff --git a/com.kdmanalytics.toif.report/target/classes/icons/question.png b/com.kdmanalytics.toif.report/target/classes/icons/question.png new file mode 100644 index 00000000..4db0f088 Binary files /dev/null and b/com.kdmanalytics.toif.report/target/classes/icons/question.png differ diff --git a/com.kdmanalytics.toif.report/target/classes/icons/rep.gif b/com.kdmanalytics.toif.report/target/classes/icons/rep.gif new file mode 100644 index 00000000..0470e158 Binary files /dev/null and b/com.kdmanalytics.toif.report/target/classes/icons/rep.gif differ diff --git a/com.kdmanalytics.toif.report/target/classes/icons/sort.gif b/com.kdmanalytics.toif.report/target/classes/icons/sort.gif new file mode 100644 index 00000000..166eaba9 Binary files /dev/null and b/com.kdmanalytics.toif.report/target/classes/icons/sort.gif differ diff --git a/com.kdmanalytics.toif.report/target/classes/icons/tick.png b/com.kdmanalytics.toif.report/target/classes/icons/tick.png new file mode 100644 index 00000000..a9925a06 Binary files /dev/null and b/com.kdmanalytics.toif.report/target/classes/icons/tick.png differ diff --git a/com.kdmanalytics.toif.report/target/classes/icons/trace.png b/com.kdmanalytics.toif.report/target/classes/icons/trace.png new file mode 100644 index 00000000..1a3f6a24 Binary files /dev/null and b/com.kdmanalytics.toif.report/target/classes/icons/trace.png differ diff --git a/com.kdmanalytics.toif.report/target/classes/icons/trust.png b/com.kdmanalytics.toif.report/target/classes/icons/trust.png new file mode 100644 index 00000000..8555cf3a Binary files /dev/null and b/com.kdmanalytics.toif.report/target/classes/icons/trust.png differ diff --git a/com.kdmanalytics.toif.report/target/classes/icons/up.png b/com.kdmanalytics.toif.report/target/classes/icons/up.png new file mode 100644 index 00000000..57fe9d47 Binary files /dev/null and b/com.kdmanalytics.toif.report/target/classes/icons/up.png differ diff --git a/com.kdmanalytics.toif.report/target/classes/icons/wrench.png b/com.kdmanalytics.toif.report/target/classes/icons/wrench.png new file mode 100644 index 00000000..5c8213fe Binary files /dev/null and b/com.kdmanalytics.toif.report/target/classes/icons/wrench.png differ diff --git a/com.kdmanalytics.toif.report/target/classes/icons/xml.png b/com.kdmanalytics.toif.report/target/classes/icons/xml.png new file mode 100644 index 00000000..8b36fa60 Binary files /dev/null and b/com.kdmanalytics.toif.report/target/classes/icons/xml.png differ diff --git a/com.kdmanalytics.toif.report/target/com.kdmanalytics.toif.report-1.15.5.jar b/com.kdmanalytics.toif.report/target/com.kdmanalytics.toif.report-1.15.5.jar new file mode 100644 index 00000000..516b8f5e Binary files /dev/null and b/com.kdmanalytics.toif.report/target/com.kdmanalytics.toif.report-1.15.5.jar differ diff --git a/com.kdmanalytics.toif.report/target/local-artifacts.properties b/com.kdmanalytics.toif.report/target/local-artifacts.properties new file mode 100644 index 00000000..f51eef0f --- /dev/null +++ b/com.kdmanalytics.toif.report/target/local-artifacts.properties @@ -0,0 +1,4 @@ +#Thu May 29 09:55:54 EDT 2014 +artifact.attached.p2metadata=/home/adam/git/toif/plugins/com.kdmanalytics.toif.report/target/p2content.xml +artifact.main=/home/adam/git/toif/plugins/com.kdmanalytics.toif.report/target/com.kdmanalytics.toif.report-1.15.5.jar +artifact.attached.p2artifacts=/home/adam/git/toif/plugins/com.kdmanalytics.toif.report/target/p2artifacts.xml diff --git a/com.kdmanalytics.toif.report/target/maven-archiver/pom.properties b/com.kdmanalytics.toif.report/target/maven-archiver/pom.properties new file mode 100644 index 00000000..3935961c --- /dev/null +++ b/com.kdmanalytics.toif.report/target/maven-archiver/pom.properties @@ -0,0 +1,5 @@ +#Generated by Maven +#Thu May 29 09:55:54 EDT 2014 +version=1.15.5 +groupId=com.kdmanalytics.kdm.wb.plugins +artifactId=com.kdmanalytics.toif.report diff --git a/com.kdmanalytics.toif.report/target/p2artifacts.xml b/com.kdmanalytics.toif.report/target/p2artifacts.xml new file mode 100644 index 00000000..993b9200 --- /dev/null +++ b/com.kdmanalytics.toif.report/target/p2artifacts.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/com.kdmanalytics.toif.report/target/p2content.xml b/com.kdmanalytics.toif.report/target/p2content.xml new file mode 100644 index 00000000..b81c2b30 --- /dev/null +++ b/com.kdmanalytics.toif.report/target/p2content.xml @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Bundle-SymbolicName: com.kdmanalytics.toif.report;singleton:=true Bundle-Version: 1.15.5 + + + + + diff --git a/com.kdmanalytics.toif.splint/.classpath b/com.kdmanalytics.toif.splint/.classpath new file mode 100644 index 00000000..098194ca --- /dev/null +++ b/com.kdmanalytics.toif.splint/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/com.kdmanalytics.toif.splint/.project b/com.kdmanalytics.toif.splint/.project new file mode 100644 index 00000000..b96c4921 --- /dev/null +++ b/com.kdmanalytics.toif.splint/.project @@ -0,0 +1,28 @@ + + + com.kdmanalytics.toif.splint + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + + org.eclipse.pde.PluginNature + org.eclipse.jdt.core.javanature + + diff --git a/com.kdmanalytics.toif.splint/.settings/org.eclipse.jdt.core.prefs b/com.kdmanalytics.toif.splint/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 00000000..f42de363 --- /dev/null +++ b/com.kdmanalytics.toif.splint/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,7 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 +org.eclipse.jdt.core.compiler.compliance=1.7 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.7 diff --git a/com.kdmanalytics.toif.splint/META-INF/MANIFEST.MF b/com.kdmanalytics.toif.splint/META-INF/MANIFEST.MF new file mode 100644 index 00000000..8d8b5950 --- /dev/null +++ b/com.kdmanalytics.toif.splint/META-INF/MANIFEST.MF @@ -0,0 +1,15 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: TOIF Splint +Bundle-SymbolicName: com.kdmanalytics.toif.splint;singleton:=true +Bundle-Version: 1.16.0.qualifier +Bundle-Activator: com.kdmanalytics.toif.splint.Activator +Bundle-Vendor: KDM Analytics Inc. +Require-Bundle: org.apache.commons.lang3;bundle-version="[3.1.0,4.0.0)", + org.eclipse.core.runtime, + com.kdmanalytics.toif.framework;bundle-version="[1.15.0,2.0.0)", + org.apache.log4j;bundle-version="[1.2.15,1.3.0)", + com.kdmanalytics.toif.common;bundle-version="[1.15.0,2.0.0)" +Bundle-RequiredExecutionEnvironment: JavaSE-1.7 +Export-Package: com.kdmanalytics.toif.adaptor,com.kdmanalytics.toif.sp + lint diff --git a/com.kdmanalytics.toif.splint/bin/com/kdmanalytics/toif/adaptor/SplintAdaptor.class b/com.kdmanalytics.toif.splint/bin/com/kdmanalytics/toif/adaptor/SplintAdaptor.class new file mode 100644 index 00000000..22de21bc Binary files /dev/null and b/com.kdmanalytics.toif.splint/bin/com/kdmanalytics/toif/adaptor/SplintAdaptor.class differ diff --git a/com.kdmanalytics.toif.splint/bin/com/kdmanalytics/toif/splint/Activator.class b/com.kdmanalytics.toif.splint/bin/com/kdmanalytics/toif/splint/Activator.class new file mode 100644 index 00000000..fca20344 Binary files /dev/null and b/com.kdmanalytics.toif.splint/bin/com/kdmanalytics/toif/splint/Activator.class differ diff --git a/com.kdmanalytics.toif.splint/bin/config/SplintAdaptorConfiguration b/com.kdmanalytics.toif.splint/bin/config/SplintAdaptorConfiguration new file mode 100644 index 00000000..71ec142d --- /dev/null +++ b/com.kdmanalytics.toif.splint/bin/config/SplintAdaptorConfiguration @@ -0,0 +1,1934 @@ +syntax=Other.Implementation;SFP--1;CWE-398 +sysunrecog=;SFP--1;CWE--1; + +#/* +# ** Null Dereferences (Manual Section 2) +# */ + +preproc=Other;SFP--1;CWE--1 + +null=;SFP-7;CWE-476 +#misuses of null pointer +#A possibly null pointer is misused (sets nullderef, nullpass, nullref, nullassign, and nullstate). + +nullderef=;SFP-7;CWE-476 +#possible dereferencce of null pointer +#A possibly null pointer is dereferenced. Value is +#either the result of a function which may return null +#(in which case, code should check it is not null), or a +#global, parameter or structure field declared with the +#null qualifier. + +nullpass=;SFP-7;CWE-476 +#possibly null pointer passed as formal with no null annotation +#A possibly null pointer is passed as a parameter corresponding to +#a formal parameter with no /*@null@*/ annotation. If NULL +#may be used for this parameter, add a /*@null@*/ annotation +#to the function parameter declaration. + +nullret=;SFP-7;CWE-476 +#possibly null pointer returned as result with no null annotation +#Function returns a possibly null pointer, but is not declared +#using /*@null@*/ annotation of result. If function may +#return NULL, add /*@null@*/ annotation to the return +#value declaration. + +nullstate=;SFP-7;CWE-476 +#possibly null pointer reachable from a reference with no null annotation +#A possibly null pointer is reachable from a parameter or global +#variable that is not declared using a /*@null@*/ annotation. + +nullassign=;SFP-4;CWE-684 +#inconsistent assignment or initialization involving null pointer +#A reference with no null annotation is assigned or initialized +#to NULL. Use /*@null@*/ to declare the reference as +#a possibly null pointer. + +nullinit=;SFP-4;CWE-684 +#inconsistent initialization involving null pointer +#A reference with no null annotation is initialized +#to NULL. Use /*@null@*/ to declare the reference as +#a possibly null pointer. + + + + + +# /* +# ** Undefined Values (Section 3) +# */ + +usedef=;SFP-1;CWE-457 +#use before definition +#An rvalue is used that may not be initialized to a value on some execution path. + +mustdefine=;SFP-1;CWE-457 +#out storage not defined before return or scope exit +#An out parameter or global is not defined before control is transferred. + +uniondef=;SFP-1;CWE-456 +#at least one field of a union must be defined +#No field of a union is defined. Generally, one field of a union is +#expected to be defined. + +compdef=;SFP-1;CWE-456 +#parameter, return value or global completely defined +#Storage derivable from a parameter, return value or global is +#not defined. Use /*@out@*/ to denote passed or returned +#storage which need not be defined. + +fullinitblock=;SFP-1;CWE-456 +#initializer sets all fields +#Initializer does not set every field in the structure. + +initallelements=;SFP-1;CWE-456 +#initializer defines all array elements +#Initializer does not define all elements of a declared array. + +initsize=;SFP-1;CWE-684 +#initializer defines extra array elements +#Initializer block contains more elements than the size of a declared array. + +impouts=;SFP-1;CWE-684 +#pointer parameters to unspecified functions may be implicit out parameters + + + + + + +# /* +# ** Types (Section 4) +# */ + +incondefs=;SFP-1;CWE-710 +#A function, variable or constant is redefined with a different type. + +matchfields=;SFP--1;CWE-710 +#A struct, union or enum type is redefined with inconsistent fields or members. + +fcnderef=;SFP--1;CWE-398 +#dereferencce of a function type +#A function type is dereferenced. The ANSI standard allows this +#because of implicit conversion of function designators, however the +#dereference is unnecessary. + +realcompare=Other.Design;SFP--1;CWE-480 +#dangerous equality comparison between reals (dangerous because of inexact +#floating point representations) +#Two real (float, double, or long double) values are compared +#directly using == or != primitive. +#This may produce unexpected results since floating point +#representations are inexact. Instead, compare the difference to + +realrelatecompare=Other.Design;SFP--1;CWE-480 +#possibly dangerous relational comparison between reals (dangerous because of inexact +#floating point representations) +#Two real (float, double, or long double) values are compared +#directly using < or >. +#This may produce unexpected results since floating point +#representations are inexact. Instead, compare the difference to + +unsignedcompare=;SFP--1;CWE-398 +#comparison using <, <=, >= between an unsigned integral and zero constant +#An unsigned value is used in a comparison with zero in a way that is either a bug or confusing. + +ptrarith=;SFP-1;CWE-480 +#arithmetic involving pointer and integer +#Pointer arithmetic using pointer and integer. + +nullptrarith=;SFP-1;CWE-704 +#arithmetic involving possibly null pointer and integer +#Pointer arithmetic using a possibly null pointer and integer. + +ptrcompare=;SFP-1;CWE-480 +#comparison between pointer and number +#A pointer is compared to a number. + +strictops=;SFP-1;CWE-480 +#primitive operation does not type check strictly +#A primitive operation does not type check strictly. + +bitwisesigned=;SFP-1;CWE-480 +#a bitwise logical operator does not have unsigned operands +#An operand to a bitwise operator is not an unsigned values. This +#may have unexpected results depending on the signed +#representations. + +shiftnegative=;SFP-1;CWE-480 +#a shift right operand may be negative +#The right operand to a shift operator may be negative (behavior undefined). + +shiftimplementation=;SFP-1;CWE-480 +#a shift left operand may be negative +#The left operand to a shift operator may be negative (behavior is implementation-defined). + +sizeoftype=;SFP-1;CWE-467 +#sizeof operator has a type argument +#Operand of sizeof operator is a type. (Safer to use expression, +#int *x = sizeof (*x); instead of sizeof (int).) + +sizeofformalarray=;SFP-1;CWE-467 +#sizeof operator has an array formal parameter argument +#Operand of a sizeof operator is a function parameter declared as +#an array. The value of sizeof will be the size of a pointer to the +#element type, not the number of elements in the array. + +fixedformalarray=;SFP-7;CWE-710 +#formal parameter of type array is declared with size +#A formal parameter is declared as an array with size. The size of the array +#is ignored in this context, since the array formal parameter is treated +#as a pointer. + +incompletetype=;SFP--1;CWE-710 +#formal parameter has an incomplete type +#A formal parameter is declared with an incomplete type. + +formalarray=;SFP-7;CWE-469 +#formal parameter is an array +#A formal parameter is declared as an array. This can be confusing, since +#a formal array parameter is treated as a pointer. + + + + + + + +# /* +# ** Booleans (4.2) +# */ + +likelybool=Other.Implementation;SFP--1;CWE-710 +#type name is probably a boolean type but does not match default +#boolean type name, \bool\ and alternate name is not set +#Use the -booltype, -boolfalse and -booltrue flags to change the +#name of the default boolean type. + +boolcompare=;SFP--1;CWE-398 +#comparison between bools (dangerous because of multiple true values) +#Two bool values are compared directly using a C primitive. This +#may produce unexpected results since all non-zero values are +#considered true, so different true values may not be equal. +#The file bool.h (included in splint/lib) provides bool_equal +#for safe bool comparisons. + +boolops=;SFP-1;CWE-480 +#primitive operation (!, && or ||) does not has a boolean argument +#The operand of a boolean operator is not a boolean. Use +ptrnegate +#to allow ! to be used on pointers. + +ptrnegate=;SFP-1;CWE-480 +#allow ! to be used on pointer operand +#The operand of ! operator is a pointer. + +predassign=;SFP-1;CWE-481 +#condition test (if, while or for) is an assignment +#The condition test is an assignment expression. Probably, you mean +#to use == instead of =. If an assignment is intended, add an +#extra parentheses nesting (e.g., if ((a = b)) ...) to suppress +#this message. + +predbool=;SFP-1;CWE-480 +#type of condition test (if, while or for) not bool (sets predboolint, +#predboolptr and predboolothers) +#Test expression type is not boolean. + +predboolothers=;SFP-1;CWE-480 + +predboolint=;SFP-1;CWE-704 +#type of condition test (if, while or for) is an integral type +#Test expression type is not boolean or int. + +predboolptr=;SFP-1;CWE-704 +#type of condition test (if, while or for) is a pointer +#Test expression type is not boolean. + +predboolOthers=;SFP--1;CWE-398 +#type of condition test (if, while or for) not bool, int or pointer +#Test expression type is not boolean. + + + + + + + +# /* +# ** 4.3 Abstract types +# */ + +abstract=;SFP--1;CWE-710 +#data abstraction barriers +#An abstraction barrier is broken. If necessary, use /*@access @*/ to allow access to an abstract type. + +abstractcompare=;SFP-1;CWE-480 +#object equality comparison on abstract type operands +#An object comparison (== or !=) is used on operands of abstract type. + +numabstract=;SFP--1;CWE-710 +#data abstraction barriers +#An abstraction barrier involving a numabstract type is broken. If necessary, use /*@access @*/ to allow access to a numabstract type. + +numabstractcast=;SFP-1;CWE-710 +#numeric literal cast to numabstract type +#A numeric literal is cast to a numabstract type. + +numabstractlit=;SFP-1;CWE-710 +#numeric literal can used as numabstract type +#To allow a numeric literal to be used as a numabstract type, use +numabstractlit. + +numabstractindex=;SFP--1;CWE-398 +#a numabstract type can be used to index an array +#To allow numabstract types to index arrays, use +numabstractindex. + +numabstractprint=;SFP-1;CWE-704 +#a numabstract value is printed using %d format code +#A numabstract value is printed usind %d format code in a printf. + +impabstract=;SFP--1;CWE--1 +#assume user type definitions are abstract (unless /*@concrete@*/ is used) + + +charindex=;SFP--1;CWE-398 + + +# /* 4.3.1 Access */ + +accessmodule=;SFP--1;CWE--1 +#allow access to abstract types in definition module +#The representation of an abstract type defined in . is +#accessible anywhere in a file named .. + +#accessfile=;SFP--1;CWE--1 +#allow access to abstract types by file name convention +#The representation of an abstract type named is +#accessible anywhere in a file named .. + +accessczech=;SFP--1;CWE--1 +#allow access to abstract types by czech naming convention +#The representation of an abstract type named is accessible +#in the definition of a function or constant named _ + +accessslovak=;SFP--1;CWE--1 +#allow access to abstract types by slovak naming convention +#The representation of an abstract type named is accessible +#in the definition of a function or constant named + +accessczechoslovak=;SFP--1;CWE--1 +#allow access to abstract types by czechoslovak naming convention +#The representation of an abstract type named is accessible +#in the definition of a function or constant named _ or + +accessall=;SFP--1;CWE--1 +#set accessmodule, accessfile and accessczech +#Sets accessmodule, accessfile and accessczech + + + + + + + +# /* 4.3.2 Mutability */ + + +mutrep=;SFP--1;CWE-710 +#representation of mutable type has sharing semantics +#LCL semantics requires that a mutable type exhibits sharing semantics. +#In order for objects to be shared a indirection is necessary in the representation. +#A mutable type may be represented by a pointer or an abstract mutable type. Handles +#into static data are fine, too, but will generate this error message unless it is suppressed. + + + + + + +# /* +# ** Memory Management (5) +# */ + + +# /* Deallocation Errors */ + + +mustfreefresh=;SFP-14;CWE-401 +#freshly allocated storage not released before return or scope exit +#A memory leak has been detected. Storage allocated locally +#is not released before the last reference to it is lost. + +mustfreeonly=;SFP-14;CWE-401 +#only storage not released before return or scope exit +#A memory leak has been detected. Only-qualified storage is not released before the last +#reference to it is lost. + +mustfree=;SFP-14;CWE-401 +#fresh or only storage not released before return or scope exit (sets mustfreefresh and mustfreeonly) +#A memory leak has been detected. + +usereleased=;SFP-15;CWE-416 +#storage used after release +#Memory is used after it has been released (either by passing +#as an only param or assigning to an only global). + +strictusereleased=;SFP-15;CWE-416 +#element used after it may have been released +#Memory (through fetch) is used after it may have been released +#(either by passing as an only param or assigning to an only global). + +compdestroy=;SFP-14;CWE-401 +#all only references derivable from void pointer out only parameter are released +#A storage leak due to incomplete deallocation of a structure or deep +#pointer is suspected. Unshared storage that is reachable from +#a reference that is being deallocated has not yet been deallocated. +#Splint assumes when an object is passed +#as an out only void pointer that the outer object will be +#deallocated, but the inner objects will not. + + +branchstate=;SFP--1;CWE--1 +#storage has inconsistent states of alternate paths through a branch +#The state of a variable is different depending on which branch +#is taken. This means no annotation can sensibly be applied +#to the storage. + +strictbranchstate=;SFP--1;CWE--1 +#storage through array fetch has inconsistent states of alternate +#paths through a branch +#The state of a variable through an array fetch is different depending +#on which branch is taken. This means no annotation can sensibly be applied +#to the storage. + +compmempass=;SFP--1;CWE-710 +#actual parameter matches alias kind of formal parameter completely +#Storage derivable from a parameter does not match the alias kind +#expected for the formal parameter. + +stackref=;SFP-1;CWE-562 +#external reference to stack-allocated storage is created +#A stack reference is pointed to by an external reference when the +#function returns. The stack-allocated storage is destroyed +#after the call, leaving a dangling reference. + +memtrans=;SFP--1;CWE-710 +#memory transfer errors (sets all *trans flags) +#Memory is transferred in a way that violates annotations. + +dependenttrans=;SFP--1;CWE-710 +#dependent transfer errors +#Dependent storage is transferred to a non-dependent reference. + +newreftrans=;SFP--1;CWE--1 +#new reference transfer to reference counted reference +#A new reference is transferred to a reference counted reference. + +onlytrans=;SFP--1;CWE-701 +#only storage transferred to non-only reference (memory leak) +#The only reference to this storage is transferred to another +#reference (e.g., by returning it) that does not have the +#only annotation. This may lead to a memory leak, since the +#new reference is not necessarily released. + +onlyunqglobaltrans=;SFP-14;CWE-401 +#only storage transferred to an unqualified global or +#static reference (memory leak) +#The only reference to this storage is transferred to another +#reference that does not have an aliasing annotation. +#This may lead to a memory leak, since the +#new reference is not necessarily released. + +ownedtrans=;SFP--1;CWE-710 +#owned storage transferred to non-owned reference (memory leak) +#The owned reference to this storage is transferred to another +#reference (e.g., by returning it) that does not have the +#owned annotation. This may lead to a memory leak, since the +#new reference is not necessarily released. + +freshtrans=;SFP--1;CWE-710 +#fresh storage transferred to non-only reference (memory leak) +#Fresh storage (newly allocated in this function) is transferred +#in a way that the obligation to release storage is not +#propagated. Use the /*@only@*/ annotation to indicate +#the a return value is the only reference to the returned +#storage. + +sharedtrans=;SFP--1;CWE-710 +#shared storage transferred to non-shared reference +#Shared storage is transferred to a non-shared reference. The other +#reference may release storage needed by this reference. + +temptrans=;SFP--1;CWE-710 +#temp storage transferred to non-temporary reference +#Temp storage (associated with a formal parameter) is transferred +#to a non-temporary reference. The storage may be released +#or new aliases created. + +kepttrans=;SFP--1;CWE-710 +#kept storage transferred to non-temporary reference +#storage is transferred +#to a non-temporary reference after being passed as keep parameter. The storage may be released +#or new aliases created. + +keeptrans=;SFP--1;CWE-710 +#keep storage transferred inconsistently +#Keep storage is transferred inconsistently --- either in a way +#that may add a new alias to it, or release it. + +immediatetrans=;SFP--1;CWE-398 +#an immediate address (result of &) is transferred inconsistently +#An immediate address (result of & operator) is transferred +#inconsistently. + +refcounttrans=;SFP--1;CWE-398 +#reference counted storage is transferred in an inconsistent way +#Reference counted storage is transferred in a way that may not +#be consistent with the reference count. + +statictrans=;SFP--1;CWE-398 +#static storage is transferred in an inconsistent way +#Static storage is transferred in an inconsistent way. + +unqualifiedtrans=;SFP--1;CWE-398 +#unqualified storage is transferred in an inconsistent way +#Unqualified storage is transferred in an inconsistent way. + +staticinittrans=;SFP--1;CWE-398 +#static storage is used as an initial value in an inconsistent way +#Static storage is used as an initial value in an inconsistent way. + +unqualifiedinittrans=;SFP--1;CWE-398 +#unqualified storage is used as an initial value in an inconsistent way +#Unqualified storage is used as an initial value in an inconsistent way. + +readonlytrans=;SFP--1;CWE-398 +#report memory transfer errors for initializations to read-only string literals +#A read-only string literal is assigned to a non-observer reference. + +passunknown=;SFP--1;CWE-710 +#passing a value as an un-annotated parameter clears its annotation + + + + + +# /* 5.3 Implicit Memory Annotations */ + +readonlystrings=;SFP-12;CWE-590 +#string literals are read-only (error if one is modified or released) +#String literals are read-only. An error is reported +#if a string literal may be modified or released. + +memimp=;SFP--1;CWE--1 +#memory errors for unqualified storage + +paramimptemp=;SFP--1;CWE--1 +#assume unannotated parameter is temp + +globimponly=;SFP--1;CWE--1 +#assume unannotated global storage is only + +retimponly=;SFP--1;CWE--1 +#assume unannotated returned storage is only + +structimponly=;SFP--1;CWE--1 +#assume unannotated structure field is only + +specglobimponly=;SFP--1;CWE--1 +#assume unannotated global storage is only + +specretimponly=;SFP--1;CWE--1 +#assume unannotated returned storage is only + +specstructimponly=;SFP--1;CWE--1 +#assume unannotated structure field is only + + + + + + +# /* Reference Counting */ + +# /* +# ** 6. Sharing +# */ + +# /* 6.1 Aliasing warnings */ + +aliasunique=;SFP--1;CWE-710 +#unique parameter is aliased +#A unique or only parameter is aliased by some other parameter or visible global. + +mayaliasunique=;SFP--1;CWE-710 +#unique parameter may be aliased +#A unique or only parameter may be aliased by some other parameter or visible global. + +mustnotalias=;SFP--1;CWE-710 +#temp storage aliased at return point or scope exit +#An alias has been added to a temp-qualifier parameter or global that is visible externally when the function returns. If the aliasing is needed, use the /*@shared@*/ annotation to indicate that new aliases to the parameter may be created. + +retalias=;SFP-1;CWE-562 +#function returns alias to parameter or global +#The returned value shares storage with a parameter or global. If a parameter is to be returned, use the returned qualifier. If the result is not modified, use the observer qualifier on the result type. otherwise, exposed can be used, but limited checking is done. 0, 0 + + + + + +# /* Global aliasing */ + +globalias=;SFP--1;CWE-710 +#function returns with global aliasing external state (sets +#checkstrictglobalias, checkedglobalias, checkmodglobalias and +#uncheckedglobalias) +#A global variable aliases externally-visible state when the function returns. + +checkstrictglobalias=;SFP--1;CWE-710 +#function returns with a checkstrict global aliasing external state +#A global variable aliases externally-visible state when the function returns. + +checkedglobalias=;SFP--1;CWE-710 +#function returns with a checked global aliasing external state +#A global variable aliases externally-visible state when the function returns. + +checkmodglobalias=;SFP--1;CWE-710 +#function returns with a checkmod global aliasing external state +#A global variable aliases externally-visible state when the function returns. + +uncheckedglobalias=;SFP--1;CWE-710 +#function returns with an unchecked global aliasing external state +#A global variable aliases externally-visible state when the function returns. + + + + + + +# /* 6.2 Exposure */ + +exposetrans=;SFP-25;CWE-454 +#exposure transfer errors +#Exposed storage is transferred to a non-exposed, non-observer reference. + +observertrans=;SFP-25;CWE-454 +#observer transfer errors +#Observer storage is transferred to a non-observer reference. + +repexpose=;SFP-25;CWE-454 +#abstract representation is exposed (sets assignexpose, retexpose, and castexpose) +#The internal representation of an abstract type is visible to the +#caller. This means clients may have access to a pointer +#into the abstract representation. + +retexpose=;SFP-25;CWE-454 +#abstract representation is exposed (return values only) +#The return value shares storage with an instance of an abstract +#type. This means clients may have access to a pointer into +#the abstract representation. Use the observer qualifier to +#return exposed storage that may not be modified by the +#client. Use the exposed qualifier to return modifiable +#(but not deallocatable) exposed storage (dangerous). + +assignexpose=;SFP-25;CWE-454 +#abstract representation is exposed (assignments only) +#Storage internal to the representation of an abstract type is +#assigned to an external pointer. This means clients may +#have access to a pointer into the abstract representation. +#If the external pointer is a parameter, the exposed qualifier +#can be used to allow the assignment, however, this is +#considered dangerous programming practice. + +castexpose=;SFP-25;CWE-454 +#abstract representation is exposed through a cast +#Storage internal to the representation of an abstract type is exposed +#through a type cast. This means clients may have access to a +#pointer into the abstract representation. + +redundantsharequal=;SFP--1;CWE-710 +#declaration uses observer qualifier that is always true +#A declaration of an immutable object uses a redundant observer qualifier. + +misplacedsharequal=;SFP--1;CWE-710 +#declaration of unsharable storage uses sharing annotation +#A declaration of an unsharable object uses a sharing annotation. + + + + + + +# /* +# ** 7. Function Interfaces +# */ + +# /* 7.1 Modifications */ + +mods=Other.Implementation;SFP--1;CWE-710 +#unspecified modification of caller-visible state +#An externally-visible object is modified by a function, but not +#listed in its modifies clause. + +mustmod=Other.Implementation;SFP--1;CWE-710 +#specified modification is not detected +#An object listed in the modifies clause is not modified by the +#implementation of the function. The modification may not +#be detected if it is done through a call to an unspecified +#function. + +modobserver=Other.Implementation;SFP--1;CWE-710 +#possible modification of observer storage +#Storage declared with observer is possibly modified. Observer +#storage may not be modified. + +modobserveruncon=Other.Implementation;SFP--1;CWE-710 +#possible modification of observer storage through unconstrained call +#Storage declared with observer may be modified through a call to an +#unconstrained function. + +modinternalstrict=Other.Implementation;SFP--1;CWE-710 +#possible modification of internal storage through function call +#A function that modifies internalState is called from a function that +#does not list internalState in its modifies clause + +modunspec=Other.Implementation;SFP--1;CWE-710 +#modification in unspecified functions (sets modnomods, +#modglobunspec and modstrictglobsunspec) + +modnomods=Other.Implementation;SFP--1;CWE-710 +#modification in a function with no modifies clause +#An externally-visible object is modified by a function with no +#/*@modifies@*/ comment. The /*@modifies ... @*/ control +#comment can be used to give a modifies list for an +#unspecified function. + +moduncon=Other.Implementation;SFP--1;CWE-710 +#possible modification through a call to an unconstrained function +#An unconstrained function is called in a function body where +#modifications are checked. Since the unconstrained function +#may modify anything, there may be undetected modifications in +#the checked function. + +modunconnomods=Other.Implementation;SFP--1;CWE-710 +#possible modification through a call to an unconstrained function in +#a function with no modifies clause +#An unconstrained function is called in a function body where +#modifications are checked. Since the unconstrained function +#may modify anything, there may be undetected modifications in +#the checked function. + +globsimpmodsnothing=Other.Implementation;SFP--1;CWE-710 +#functions declared with a globals list but no modifies clause are +#assumed to modify nothing +#An implicit modifies nothing clause is assumed for a function +#declared with a globals list but not modifies clause. + +modsimpnoglobs=Other.Implementation;SFP--1;CWE-710 +#functions declared with a modifies clause but no globals list +#are assumed to use no globals +#An implicit empty globals list is assumed for a function +#declared with a modifies clause but no globals list. + + + + + + +# /* +# ** Globals +# */ + +globstate=;SFP-7;CWE-684 +#returns with global in inconsistent state (null or undefined) +#A global variable does not satisfy its annotations when control is transferred. + + +globuse=;SFP--1;CWE-710 +#global listed for a function not used +#A global variable listed in the function's globals list is not used +#in the body of the function. + +internalglobs=;SFP--1;CWE-710 +#use of internalState +#A called function uses internal state, but the globals list for the +#function being checked does not include internalState + +internalglobsnoglobs=;SFP--1;CWE-710 +#use of internalState (in function with no globals list) +#A called function uses internal state, but the function being checked +#has no globals list + +warnmissingglobs=;SFP--1;CWE-710 +#global variable used in modifies clause is not listed in globals list +#A global variable is used in the modifies clause, but it is not listed in +#the globals list. The variable will be added to the globals list. + +warnmissingglobsnoglobs=;SFP--1;CWE-710 +#global variable used in modifies clause in a function with no globals list +#A global variable is used in the modifies clause, but the function +#has no globals list. The variable will be added to the globals list. + +globnoglobs=;SFP--1;CWE-710 +#use of checked global in a function with no globals list or specification +#A specified global variable is used in the function, but not listed +#in its globals list. Without +globnoglobs, only globals +#declared with /*@checkedstrict@*/ will produce use +#errors in functions without globals +#lists. The /*@globals ... @*/ control comment can be used to give +#a globals list for an unspecified function. + +modglobs=;SFP--1;CWE-710 +#undocumented modification of a checked global variable +#A checked global variable is modified by the function, but not listed in +#its modifies clause. + +modglobsnomods=;SFP--1;CWE-710 +#undocumented modification of a checked global variable in a function +#declared with no modifies clause +#A checked global variable is modified by the function, but not listed in +#its modifies clause. + +modstrictglobsnomods=;SFP--1;CWE-710 +#undocumented modification of a strict checked global variable in a +#function declared with no modifies clause +#A checked global variable is modified by the function, but not listed in +#its modifies clause. + +modglobsunchecked=;SFP--1;CWE-710 +#undocumented modification of an unchecked checked global variable +#An unchecked global variable is modified by the function, but not listed in +#its modifies clause. + + + + + + + + +# /* +# ** State Clauses +# */ + +# /* +# ** 8. Control Flow +# */ + +# /* 8.1 Execution */ + +noret=;SFP--1;CWE-398 +#path with no return detected in non-void function +#There is a path through a function declared to return a value on +#which there is no return statement. This means the execution +#may fall through without returning a meaningful result to +#the caller. + +emptyret=;SFP--1;CWE--1 +#empty return in function declared to return value + +alwaysexits=;SFP-1;CWE-570 +#loop predicate always exits + + + + + +# /* 8.2 Undefined Behavior */ + +evalorder=;SFP--1;CWE-710 +#code has unspecified or implementation-dependent behavior +#because of order of evaluation +#Code has unspecified behavior. +#Order of evaluation of function parameters or subexpressions +#is not defined, so if a value is used and modified in different +#places not separated by a sequence point constraining +#evaluation order, then the result of the expression is +#unspecified. + +evalorderuncon=;SFP--1;CWE-88 +#code involving call to unspecified function has undefined or implementation-dependent behavior +#Code involving a call to function with no modifies or globals clause +#may have undefined or implementation-dependent behavior (Splint assumes the +#unconstrained call may modify any reachable state or use any global). Add a +#specification for the function. + + + + + + +# /* 8.3 Problematic Control Structures */ + +# /* 8.3.1 Infinite Loops */ + +infloops=;SFP--1;CWE-835 +#likely infinite loop is detected +#This appears to be an infinite loop. Nothing in the body of the +#loop or the loop test modifies the value of the loop test. +#Perhaps the specification of a function called in the loop +#body is missing a modification. + +infloopsuncon=;SFP--1;CWE-835 +#likely infinite loop is detected (may result from unconstrained function) +#This appears to be an infinite loop. Nothing in the body of the +#loop or the loop test modifies the value of the loop test. +#There may be a modification through a call to an unconstrained +#function, or an unconstrained function in the loop test may use +#a global variable modified by the loop body. + + + + + + +# /* 8.3.2 Switches */ + +casebreak=;SFP-4;CWE-484 +#non-empty case in a switch without preceding break +#Execution falls through from the previous case (use /*@fallthrough@*/ to mark fallthrough cases). 0, 0 + +misscase=;SFP--1;CWE-230 +#switch on enum type missing case for some value +#Not all values in an enumeration are present as cases in the switch. + +firstcase=;SFP--1;CWE-710 +#first statement in switch is not a case +#The first statement after a switch is not a case. + +duplicatecases=;SFP--1;CWE-697 +#duplicate cases in switch +#Duplicate cases in switch. + + + + + + +# /* 8.3.3 Deep Breaks */ + +deepbreak=;SFP--1;CWE-710 +#break inside nested while or for or switch +#A break statement appears inside the body of a nested while, for or +#switch statement. Sets looploopbreak, loopswitchbreak, +#switchloopbreak, switchswitchbreak, and looploopcontinue. + +looploopbreak=;SFP--1;CWE-710 +#break inside nested while or for +#A break statement appears inside the body of a nested while or for +#statement. This is perfectly reasonable code, but check that +#the break is intended to break only the inner loop. The +#break statement may be preceded by /*@innerbreak@*/ to suppress +#the message for this break only. + +switchloopbreak=;SFP--1;CWE-710 +#break in loop inside switch +#A break statement appears inside the body of a while or for +#statement within a switch. This is perfectly reasonable code, but check that +#the break is intended to break only the inner loop. The +#break statement may be preceded by /*@loopbreak@*/ to suppress +#the message for this break only. + +loopswitchbreak=;SFP--1;CWE-710 +#break in switch inside loop +#A break statement appears inside a switch statement within a while or +#for loop. This is perfectly reasonable code, but check that +#the break is intended to break only the inner loop. The +#break statement may be preceded by /*@switchbreak@*/ to suppress +#the message for this break only. + +switchswitchbreak=;SFP--1;CWE-710 +#break in switch inside switch +#A break statement appears inside a switch statement within another +#switch statement. This is perfectly reasonable code, but check that +#the break is intended to break only the inner switch. The +#break statement may be preceded by /*@innerbreak@*/ to suppress +#the message for this break only. + +looploopcontinue=;SFP--1;CWE-710 +#continue inside nested loop +#A continue statement appears inside a loop within a loop. +#This is perfectly reasonable code, but check that +#the continue is intended to continue only the inner loop. The +#continue statement may be preceded by /*@innercontinue@*/ to suppress +#the message for this continue only. + + + + +# /* 8.3.4 Loop and If Bodies */ + +whileempty=;SFP--1;CWE--398 +#a while statement has no body +#While statement has no body. + +whileblock=;SFP--1;CWE-710 +#the body of a while statement is not a block +#While body is a single statement, not a compound block. + +forempty=;SFP--1;CWE-398 +#a for statement has no body +#For statement has no body. + +forblock=;SFP--1;CWE-710 +#the body of a for statement is not a block +#Loop body is a single statement, not a compound block. + +ifempty=;SFP--1;CWE-710 +#an if statement has no body +#If statement has no body. + +ifblock=;SFP--1;CWE-710 +#the body of an if statement is not a block +#If body is a single statement, not a compound block. + +allempty=;SFP--1;CWE-710 +#an if, while or for statement has no body (sets ifempty, +#whileempty and forempty + +allblock=;SFP--1;CWE-710 +#the body of an if, while or for statement is not a block +#(sets ifblock, whileblock and forblock) +#Body is a single statement, not a compound block. + + + + + +# /* 8.3.5 Complete Logic */ + +elseifcomplete=;SFP--1;CWE-710 +#if ... else if chains must have final else +#There is no final else following an else if construct. + + + + + +# /* 8.4 Suspicious Statements */ + +unreachable=;SFP-2;CWE-561 +#unreachable code detected +#This code will never be reached on any possible execution. + + + + + +# /* 8.4.1 Statements with No Effects */ + +noeffect=;SFP--1;CWE-398 +#statement with no effect +#Statement has no visible effect --- no values are modified. + +noeffectuncon=;SFP--1;CWE-710 +#statement with no effect (except possibly through call to +#unconstrained function) +#Statement has no visible effect --- no values are modified. It may +#modify something through a call to an unconstrained function. + + + + + +# /* 8.4.2 Ignored Return Values */ + +retval=;SFP-4;CWE-252 +#return value ignored (sets retvalint, retvalbool and retvalother) +#Result returned by function call is not used. If this is intended, +# cast result to (void) to eliminate message. + +retvalother=;SFP-4;CWE-252 +#return value of type other than bool or int ignored +#Result returned by function call is not used. If this is intended, +# can cast result to (void) to eliminate message. + +retvalbool=;SFP-4;CWE-252 +#return value of manifest type bool ignored +#Result returned by function call is not used. If this is intended, +# can cast result to (void) to eliminate message. + +retvalint=;SFP-4;CWE-252 +#return value of type int ignored +#Result returned by function call is not used. If this is intended, +# can cast result to (void) to eliminate message. + + + + + +# /* +# ** 9. Buffer Sizes +# */ + +nullterminated=;SFP-11;CWE-170 +#misuse of nullterminated allocation +#A possibly non-nullterminated string/memory is used/referenced as a nullterminated one. + +bounds=;SFP-8;CWE-119 +#memory bounds checking (sets boundsread and boundswrite) +#Memory read or write may be out of bounds of allocated storage. + +likelybounds=;SFP-8;CWE-119 +#memory bounds checking (sets likelyboundsread and likelyboundswrite) +#Memory read or write may be out of bounds of allocated storage. + +likelyboundsread=;SFP-8;CWE-119 +#likely out of bounds read +#A memory read references memory beyond the allocated storage. + +likelyboundswrite=;SFP-8;CWE-119 +#likely buffer overflow from an out of bounds write +#A memory write may write to an address beyond the allocated buffer. + +boundsread=;SFP-8;CWE-125 +#possible out of bounds read +#A memory read references memory beyond the allocated storage. + +boundswrite=;SFP-8;CWE-787 +#possible buffer overflow from an out of bounds write +#A memory write may write to an address beyond the allocated buffer. + + + + + +/*drl7x added 6/18/01 */ + +checkpost=;SFP--1;CWE-710 +#unable to verify predicate in ensures clause +#The function implementation may not satisfy a post condition given in an ensures clause. + +impboundsconstraints=;SFP--1;CWE--1 +#generate implicit constraints for functions + + + +# /* evans added 2003-06-08 */ + +allocmismatch=;SFP-1;CWE-681 +#type conversion involves storage of non-divisble size + + + + + +# /* +# ** 10. Extensible Checking +# */ + + +statetransfer=;SFP--1;CWE-682 +#storage has been transfered with invalid state +#Transfer violates user-defined state rules. + +statemerge=;SFP--1;CWE-372 +#control paths merge with storage in incompatible states +#Control path merge violates user-defined state merge rules. + + + + + +# /* +# ** 11. Macros +# */ + +macroredef=;SFP--1;CWE-710 +#macro redefined +#A macro is defined in more than one place. + +macrounrecog=;SFP--1;CWE--1 +#unrecognized identifier in macro +#An unrecognized identifier appears in a macro. If the identifier +#is defined before the macro is used, then this is okay. + + + + + +# /* 11.1 Constant Macros */ + +macroconstdecl=;SFP--1;CWE-710 +#non-parameterized macro without prototype or specification +#Macro constant has no declaration. Use /*@constant ...@*/ to +#declare the macro. + +macroconstdistance=;SFP--1;CWE-710 +#macro constant name does not match nearby name +#Macro constant name does matches name of a previous declaration, but they are not near each other. + + + + + +# /* 11.2 Function-like Macros */ + +macrostmt=;SFP--1;CWE-710 +#macro definition is syntactically not equivalent to function +#A macro is defined in a way that may cause syntactic problems. +#If the macro returns a value, use commas to separate expressions; +#otherwise, use do while (FALSE) construct. + +macroempty=;SFP--1;CWE-398 +#macro definition for is empty +#A macro definition has no body. + +macroparams=;SFP--1;CWE-710 +#macro parameter not used exactly once +#A macro parameter is not used exactly once in all possible +#invocations of the macro. To behave like a function, +#each macro parameter must be used exactly once on all +#invocations of the macro so that parameters with +#side-effects are evaluated exactly once. Use /*@sef@*/ to +#denote parameters that must be side-effect free. + +macroret=;SFP--1;CWE-710 +#return statement in macro body +#The body of a macro declared as a function uses a return statement. +#This exhibits behavior that +#could not be implemented by a function. + +macroassign=;SFP--1;CWE-710 +#assignment to a macro parameter +#A macro parameter is used as the left side of an +#assignment expression. This exhibits behavior that +#could not be implemented by a function. + +macroparens=;SFP--1;CWE-710 +#macro parameter used without parentheses (in potentially dangerous context) +#A macro parameter is used without parentheses. This could be +#dangerous if the macro is invoked with a complex expression +#and precedence rules will change the evaluation inside the macro. + +macrodecl=;SFP--1;CWE-710 +#macro without prototype or specification (sets macrofcndecl and macroconstdecl) +#Argument checking cannot be done well for macros without prototypes +#or specifications, since the types of the arguments are unknown. + +macrofcndecl=;SFP--1;CWE-710 +#parameterized macro without prototype or specification +#Function macro has no declaration. + + + + + + +# /* 11.2.1 Side Effect Free Parameters */ + +sefparams=;SFP--1;CWE-710 +#a parameter with side-effects is passed as a sef parameter +#An actual parameter corresponding to a sef parameter may have a side-effect. + +sefuncon=;SFP--1;CWE-710 +#a parameter with unconstrained side-effects is passed as a sef parameter +#An actual parameter corresponding to a sef parameter involves a call +#to a procedure with no modifies clause that may have a side-effect. + + + + + + +# /* 11.3 Controlling Macro Checking */ + +constmacros=;SFP--1;CWE--1 +#check all macros without parameter lists as constants +#Every non-parameterized macro (not preceded by /*@notfunction@*/) +#is checked as a constant. + +fcnmacros=;SFP--1;CWE--1 +#check all macros with parameter lists as functions +#Every parameterized macro (not preceded by /*@notfunction@*/) +#is checked as a function. + +allmacros=;SFP--1;CWE--1 +#sets fcnmacros and constmacros +#All macros (not preceded by /*@notfunction@*/) are checked as functions or +#constants depending on whether or not they have parameter lists. + +libmacros=;SFP--1;CWE--1 +#check all macros with declarations in library as functions +#Every macro declared in the load library is checked. + +specmacros=;SFP--1;CWE--1 +#check all macros corresponding to specified functions or constants +#Every macro declared a specification file is checked. + +macromatchname=;SFP--1;CWE-710 +#macro definition does not match iter or constant declaration +#A iter or constant macro is defined using a different name from the +#one used in the previous syntactic comment + +nextlinemacros=;SFP--1;CWE-710 +#the line after a constant or iter declaration must be a macro definition +#A constant or iter declaration is not immediately followed by a macro definition. + + + + + +# /* 11.4 Iterators */ + +iterbalance=;SFP--1;CWE-710 +#iter is not balanced with end_ + +iteryield=;SFP--1;CWE-710 +#iter yield parameter is inappropriate + +hasyield=;SFP--1;CWE-710 +#iter declaration has no yield parameters +#An iterator has been declared with no parameters annotated with +#yield. This may be what you want, if the iterator is meant +#to do something a fixed number of times, but returns no +#information to the calling context. Probably, a parameter +#is missing the yield annotation to indicate that it is +#assigned a value in the calling context. + + + + + + +# /* +# ** 12. Naming Conventions +# */ + +namechecks=;SFP--1;CWE--1 +#controls name checking without changing other settings + + + + + +# /* 12.1.1 Czech Names */ + +czech=;SFP--1;CWE-710 +#czech naming convention (sets accessczech, czechfunctions, czechvars, +#czechconstants, czechenums, and czechmacros) +#Name is not consistent with Czech naming convention. + +czechfcns=;SFP--1;CWE-710 +#czech naming convention violated in a function or iterator declaration +#Function or iterator name is not consistent with Czech naming convention. + +czechvars=;SFP--1;CWE-710 +#czech naming convention violated in a variable declaration +#Variable name is not consistent with Czech naming convention. + +czechmacros=;SFP--1;CWE-710 +#czech naming convention violated in an expanded macro name +#Expanded macro name is not consistent with Czech naming convention. + +czechconsts=;SFP--1;CWE-710 +#czech naming convention violated in a constant declaration +#Constant name is not consistent with Czech naming convention. + +czechtypes=;SFP--1;CWE-710 +#czech naming convention violated in a user-defined type definition +#Type name is not consistent with Czech naming convention. Czech type +#names must not use the underscore character. + + + + +# /* 12.1.2 Slovak Names */ + +slovak=;SFP--1;CWE-710 +#slovak naming convention violated +#Name is not consistent with Slovak naming convention. + +slovakfcns=;SFP--1;CWE-710 +#slovak naming convention violated in a function or iterator declaration +#Function or iterator name is not consistent with Slovak naming convention. + +slovakmacros=;SFP--1;CWE-710 +#slovak naming convention violated in an expanded macro name +#Expanded macro name is not consistent with Slovak naming convention. + +slovakvars=;SFP--1;CWE-710 +#slovak naming convention violated in a variable declaration +#Variable name is not consistent with Slovak naming convention. + +slovakconsts=;SFP--1;CWE-710 +#slovak naming convention violated in a constant declaration +#Constant name is not consistent with Slovak naming convention. + +slovaktypes=;SFP--1;CWE-710 +#slovak naming convention violated in a use-defined type definition +#Type name is not consistent with Slovak naming convention. Slovak type +#names may not include uppercase letters. + + + + + +# /* 12.1.3 Czechoslovak Names */ + +czechoslovak=;SFP--1;CWE-710 +#czech or slovak naming convention violated +#Name is not consistent with either Czech or Slovak naming convention. + +czechoslovakfcns=;SFP--1;CWE-710 +#czechoslovak naming convention violated in a function or iterator declaration +#Function name is not consistent with Czechoslovak naming convention. + +czechoslovakmacros=;SFP--1;CWE-710 +#czechoslovak naming convention violated in an expanded macro name +#Expanded macro name is not consistent with Czechoslovak naming convention. + +czechoslovakvars=;SFP--1;CWE-710 +#czechoslovak naming convention violated in a variable declaration +#Variable name is not consistent with Czechoslovak naming convention. + +czechoslovakconsts=;SFP--1;CWE-710 +#czechoslovak naming convention violated in a constant declaration +#Constant name is not consistent with Czechoslovak naming convention. + +czechoslovaktypes=;SFP--1;CWE-710 +#czechoslovak naming convention violated in a user-defined type definition +#Type name is not consistent with Czechoslovak naming convention. Czechoslovak +#type names may not include uppercase letters or the underscore character. + + + + +# /* 12.2 Namespace Prefixes */ + +macrovarprefix=;SFP--1;CWE-710 +#set namespace prefix for variables declared in a macro body +#A variable declared in a macro body does not start with the macrovarprefix. + +macrovarprefixexclude=;SFP--1;CWE-710 +#the macrovarprefix may not be used for non-macro variables +#A variable declared outside a macro body starts with the macrovarprefix. + +tagprefix=;SFP--1;CWE-710 +#set namespace prefix for struct, union and enum tags +#A tag identifier does not start with the tagprefix. + +tagprefixexclude=;SFP--1;CWE-710 +#the tagprefix may not be used for non-tag identifiers +#An identifier that is not a tag starts with the tagprefix. + +enumprefix=;SFP--1;CWE-710 +#set namespace prefix for enum members +#An enum member does not start with the enumprefix. + +enumprefixexclude=;SFP--1;CWE-710 +#the enumprefix may not be used for non-enum member identifiers +#An identifier that is not an enum member starts with the enumprefix. + +filestaticprefix=;SFP--1;CWE-710 +#set namespace prefix for file static declarations +#A file-static identifier does not start with the filestaticprefix. + +filestaticprefixexclude=;SFP--1;CWE-710 +#the filestaticprefix may not be used for identifiers that are not file static +#An identifier that is not file static starts with the filestaticprefix. + +globalprefix=;SFP--1;CWE-710 +#set namespace prefix for global variables +#A global variable does not start with the globalprefix + +globalprefixexclude=;SFP--1;CWE-710 +#the globalprefix may not be used for non-global identifiers +#An identifier that is not a global variable starts with the globalprefix. + +typeprefix=;SFP--1;CWE-710 +#set namespace prefix for user-defined types +#A user-defined type does not start with the typeprefix + +typeprefixexclude=;SFP--1;CWE-710 +#the typeprefix may not be used for identifiers that are not type names +#An identifier that is not a type name starts with the typeprefix. + +externalprefix=;SFP--1;CWE-710 +#set namespace prefix for external identifiers +#An external identifier does not start with the externalprefix + +externalprefixexclude=;SFP--1;CWE-710 +#the externalprefix may not be used for non-external identifiers +#An identifier that is not external starts with the externalprefix. + +localprefix=;SFP--1;CWE-710 +#set namespace prefix for local variables +#A local variable does not start with the localprefix + +localprefixexclude=;SFP--1;CWE-710 +#the localprefix may not be used for non-local identifiers +#An identifier that is not a local variable starts with the localprefix. + +uncheckedmacroprefix=;SFP--1;CWE-710 +#set namespace prefix for unchecked macros +#An unchecked macro name does not start with the uncheckedmacroprefix + +uncheckedmacroprefixexclude=;SFP--1;CWE-710 +#the uncheckmacroprefix may not be used for identifiers that are not +#unchecked macros +#An identifier that is not the name of an unchecked macro +#starts with the uncheckedmacroprefix. + +constprefix=;SFP--1;CWE-710 +#set namespace prefix for constants +#A constant does not start with the constantprefix + +constprefixexclude=;SFP--1;CWE-710 +#the constprefix may not be used for non-constant identifiers +#An identifier that is not a constant starts with the constantprefix. + +iterprefix=;SFP--1;CWE-710 +#set namespace prefix for iterators +#An iter does not start with the iterator prefix + +iterprefixexclude=;SFP--1;CWE-710 +#the iterprefix may not be used for non-iter identifiers +#An identifier that is not a iter starts with the iterprefix. + +protoparamprefix=;SFP--1;CWE-710 +#set namespace prefix for parameters in function prototype declarations +#A parameter name in a function prototype declaration does not start with the +#declaration parameter prefix + + + + + + +# /* 12.3 Naming Restrictions */ + +isoreserved=;SFP--1;CWE-710 +#external name conflicts with name reserved for system or standard library +#External name is reserved for system use by ISO C99 standard. + +cppnames=;SFP--1;CWE-710 +#external or internal name is a C++ keyword or reserved word +#External name is a C++ keyword or reserved word. +#This could lead to problems if the +#code is compiled with a C++ compiler. + +isoreservedinternal=;SFP--1;CWE-710 +#internal name conflicts with name reserved for system or standard library +#Internal name is reserved for system in ISO C99 standard (this should not be necessary unless you are worried about C library implementations that violate the standard and use macros). + +distinctexternalnames=;SFP--1;CWE-710 +#external name is not distinguishable from another external name using +#the number of significant characters +#An external name is not distinguishable from another external name +#using the number of significant characters. According to +#ANSI Standard (3.1), an implementation may only consider the first 6 +#characters significant, and ignore alphabetical case +#distinctions (ISO C99 requires 31). The +#+externalnamelen flag may be used to change the number +#of significant characters, and -externalnamecaseinsensitive to make +#alphabetical case significant in external names. + +externalnamelen=;SFP--1;CWE-710 +#set the number of significant characters in an external name +#Sets the number of significant characters in an external name (default is 6 for old +#ANSI89 limit, C99 requires 31). +#Sets +distinctexternalnames. + +externalnamecaseinsensitive=;SFP--1;CWE-710 +#alphabetic comparisons for external names are case-insensitive +#Make alphabetic case insignificant in external names. By ANSI89 +#standard, case need not be significant in an external name. +#If +distinctexternalnames is not set, sets +#+distinctexternalnames with unlimited external name length. + +distinctinternalnames=;SFP--1;CWE-710 +#internal name is not distinguishable from another internal name using +#the number of significant characters +#An internal name is not distinguishable from another internal name +#using the number of significant characters. According to +#ANSI89 Standard (3.1), an implementation may only consider the first 31 +#characters significant (ISO C99 specified 63). The +#+internalnamelen flag changes the number +#of significant characters, -internalnamecaseinsensitive to makes +#alphabetical case significant, and +#+internalnamelookalike to make similar-looking characters +#non-distinct. + + + +internalnamelookalike=;SFP--1;CWE-710 +#lookalike characters match in internal names +#Set whether similar looking characters (e.g., \1\ and \l\) +#match in internal names. + +protoparamname=;SFP--1;CWE-710 +#a parameter in a function prototype has a name +#A parameter in a function prototype has a name. This is dangerous, +#since a macro definition could be visible here. + +protoparammatch=;SFP--1;CWE-710 +#the name of a parameter in a function prototype and corresponding +#declaration must match (after removing the protoparamprefix +#A parameter in a function definition does not have the same name as +#the corresponding in the declaration of the function after +#removing the protoparamprefix + +protoparamprefixexclude=;SFP--1;CWE-710 +#the protoparamprefix may not be used for non-declaraction parameter identifiers +#An identifier that is not a parameter name in a function prototype +#starts with the protoparamprefix. + + + + + + +# /* +# ** 13. Completeness +# */ + +# /* 13.1 Unused Declarations */ + +topuse=;SFP--1;CWE-398 +#declaration at top level not used +#An external declaration not used in any source file. + +exportlocal=;SFP--1;CWE-398 +#a declaration is exported but not used outside this module +#A declaration is exported, but not used outside this module. +#Declaration can use static qualifier. + +exportheader=;SFP--1;CWE-398 +#a declaration is exported but does not appear in a header file +#A declaration is exported, but does not appear in a header file. + +exportheadervar=;SFP-2;CWE-563 +#a variable declaration is exported but does not appear in a header file +#A variable declaration is exported, but does not appear in a header +#file. (Used with exportheader.) + +fielduse=;SFP-2;CWE-561 +#field of structure type not used +#A field is present in a structure type but never used. Use /*@unused@*/ in front of field declaration to suppress message. + +enummemuse=;SFP-2;CWE-561 +#member of an enum type not used +#A member of an enum type is never used. + +constuse=;SFP-2;CWE-563 +#constant declared but not used +#A constant is declared but not used. Use unused in the constant declaration to suppress message. + +fcnuse=;SFP-2;CWE-561 +#function declared but not used +#A function is declared but not used. Use /*@unused@*/ in front of function header to suppress message. + +paramuse=;SFP--1;CWE-398 +#function parameter not used +#A function parameter is not used in the body of the function. If the argument is needed for type compatibility or future plans, use /*@unused@*/ in the argument declaration. + +typeuse=;SFP-2;CWE-561 +#type declared but not used +#A type is declared but not used. Use /*@unused@*/ in front of typedef to suppress messages. + +varuse=;SFP-2;CWE-563 +#variable declared but not used +#A variable is declared but never used. Use /*@unused@*/ in front +#of declaration to suppress message. + +unusedspecial=;SFP-2;CWE-561 +#unused declaration in special file (corresponding to .l or .y file) + + + + + + + +# /* 13.2 Complete Programs */ + +declundef=;SFP-2;CWE-561 +#function or variable declared but never defined +#A function or variable is declared, but not defined in any source code file. + +specundef=;SFP-2;CWE-561 +#function or variable specified but never defined +#A function or variable is declared in an .lcl file, but not defined in any source code file. + +specundecl=;SFP-2;CWE-561 +#function or variable specified but never declared in a source file +#A function or variable is declared in an .lcl file, but not declared +#in any source code file. + + +needspec=;SFP--1;CWE--1 +#information in specifications is not also included in syntactic comments +#There is information in the specification that is not duplicated +#in syntactic comments. Normally, this is not an +#error, but it may be useful to detect it to make +#sure checking incomplete systems without the specifications will +#still use this information. + + + + + + +# /* +# ** 14. Libraries and Header File Inclusion +# */ + +# /* 14.1 Standard Libraries */ + +warnposixheaders=;SFP-1;CWE-561 +#a POSIX header is included, but the POSIX library is not used +#Header name matches a POSIX header, but the POSIX library is not selected. + + +usevarargs=;SFP--1;CWE-710 +#non-standard included +#Header is not part of ANSI Standard. +#Should use instead. + +caseinsensitivefilenames=;SFP--1;CWE-710 +#file names are case insensitive (file.h and FILE.H are the same file) + + + + +# /* Prototypes */ + +noparams=;SFP--1;CWE--1 +#function declaration has no parameter list +#A function declaration does not have a parameter list. + +oldstyle=;SFP--1;CWE-398 +#old style function definition +#Function definition is in old style syntax. Standard prototype +#syntax is preferred. + + + + + + +# /* +# ** System functions +# */ + +maintype=;SFP--1;CWE-710 +#type of main does not match expected type +#The function main does not match the expected type. + +exitarg=;SFP-3;CWE-474 +#argument to exit has implementation defined behavior +#The argument to exit should be 0, EXIT_SUCCESS or EXIT_FAILURE + +shadow=;SFP--1;CWE-710 +#declaration reuses name visible in outer scope +#An outer declaration is shadowed by the local declaration. + +incondefslib=;SFP--1;CWE-398 +#function, variable or constant defined in a library is redefined with inconsistent type +#A function, variable or constant previously defined in a library is +#redefined with a different type. + +overload=;SFP--1;CWE-398 +#library function overloaded +#A function, variable or constant defined in the library is redefined +#with a different type. + +nestedextern=;SFP--1;CWE-398 +#an extern declaration is inside a function scope +#An extern declaration is used inside a function scope. + +redecl=;SFP--1;CWE-398 +#function or variable redeclared +#A function or variable is declared in more than one place. This is +#not necessarily a problem, since the declarations are consistent. + +redef=;SFP--1;CWE-398 +#function or variable redefined +#A function or variable is redefined. One of the declarations should use extern. + +imptype=;SFP--1;CWE-710 +#variable declaration has unknown (implicitly int) type +#A variable declaration has no explicit type. The type is implicitly int. + +exportany=;SFP--1;CWE-710 +#variable, function or type exported but not specified +#A variable, function or type is exported, but not specified. + +exportfcn=;SFP--1;CWE-710 +#function exported but not specified +#A function is exported, but not specified. + +exportmacro=;SFP--1;CWE-710 +#expanded macro exported but not specified +#A macro is exported, but not specified. + +exporttype=;SFP--1;CWE-710 +#type definition exported but not specified +#A type is exported, but not specified. + +exportvar=;SFP--1;CWE-710 +#variable exported but not specified +#A variable is exported, but not specified. + +exportconst=;SFP--1;CWE-710 +#constant exported but not specified +#A constant is exported, but not specified. + +exportiter=;SFP--1;CWE-710 +#constant exported but not specified +#A constant is exported, but not specified. + + + + + + +# /* +# ** Limits +# */ + +type=;SFP-1;CWE-704 +#type mismatch +#Types are incompatible. + +stringliteraltoolong=;SFP-8;CWE-119 +#string literal too long for character array +#A string literal is assigned to a char array too small to hold it. + +stringliteralnoroomfinalnull=;SFP-11;CWE-170 +#string literal leaves no room for null terminator +#A string literal is assigned to a char array that is not big enough to hold the final null terminator. This may not be a problem because a null character has been explictedly included in the string literal using an escape sequence + +stringliteralnoroom=;SFP-11;CWE-170 +#string literal leaves no room for null terminator +#A string literal is assigned to a char array that is not big enough to hold the null terminator. + +stringliteralsmaller=;SFP-8;CWE-119 +#string literal is smaller than the char array it is assigned to +#A string literal is assigned to a char array that smaller than the string literal needs. + +enummembers=;SFP-1;CWE-704 +#enum members must be int values +#Type of initial values for enum members must be int. + +formattype=;SFP--1;CWE-628 +#type-mismatch in parameter corresponding to format code in a printf or scanf-like function +#Type of parameter is not consistent with corresponding code in format string. + +formatconst=;SFP--1;CWE-134 +#format parameter is not a string constant (hence variable arguments cannot be typechecked) +#Format parameter is not known at compile-time. This can lead to security vulnerabilities because the arguments cannot be type checked. + +formatcode=;SFP-24;CWE-134 +#invalid format code in format string for printf or scanf-like function +#Format code in a format string is not valid. + +forwarddecl=;SFP--1;CWE--1 +#forward declarations of pointers to abstract representation match abstract type + +voidabstract=;SFP--1;CWE-398 +#void * matches pointers to abstract types, casting ok (dangerous) +#A pointer to void is cast to a pointer to an abstract type (or vice versa). + +castfcnptr=;SFP-1;CWE-704 +#a pointer to a function is cast to a pointer to void (or vice versa) +#A pointer to a function is cast to (or used as) a pointer to void (or vice versa). + +unrecog=;SFP--1;CWE--1 +#unrecognized identifier +#Identifier used in code has not been declared. + +annotationerror=;SFP--1;CWE-546 +#annotation is used in inconsistent location +#A declaration uses an invalid annotation. + +commenterror=;SFP--1;CWE-546 +#inconsistent syntactic comment +#A syntactic comment is used inconsistently. + + + + + + + + +# /* +# ** Use Warnings +# */ + +bufferoverflow=;SFP-8;CWE-120 +#possible buffer overflow vulnerability +#Use of function that may lead to buffer overflow. + +bufferoverflowhigh=;SFP-8;CWE-120 +#likely buffer overflow vulnerability +#Use of function that may lead to buffer overflow. + +implementationoptional=;SFP--1;CWE-710 +#declarator is implementation optional (ISO99 does not require an implementation to provide it) +#Use of a declarator that is implementation optional, not required by ISO99. + +legacy=;SFP--1;CWE-710 +#legacy declaration in Unix Standard +#Use of a declarator that is marked as a legacy entry in the Unix Standard. + +multithreaded=;SFP-19;CWE-663 +#function is not reentrant +#Non-reentrant function should not be used in multithreaded code. + +portability=;SFP-3;CWE-474 +#function may have undefined behavior +#Use of function that may have implementation-dependent behavior. + +superuser=;SFP--1;CWE-710 +#function is restricted to superusers +#Call to function restricted to superusers. + +toctou=;SFP-20;CWE-367 +#possible time of check, time of use vulnerability +#Possible time of check, time of use vulnerability. + +unixstandard=;SFP--1;CWE-710 +#function is not required in Standard UNIX Specification +#Use of function that need not be provided by UNIX implementations + + + + + + +# /* +# ** Syntactic comments +# */ + +unrecogcomments=;SFP--1;CWE-546 +#stylized comment is unrecognized +#Word after a stylized comment marker does not correspond to a +#stylized comment. + + + + + + + + +# /* +# ** Comments +# */ + +continuecomment=;SFP--1;CWE-546 +#line continuation marker (\\) in comment before */ on same line +#A line continuation marker (\\) appears inside a comment on the same +#line as the comment close. Preprocessors should handle this +#correctly, but it causes problems for some preprocessors. + +slashslashcomment=;SFP--1;CWE-546 +#use of // comment +#A // comment is used. ISO C99 allows // comments, but earlier standards did not. + +nestcomment=;SFP--1;CWE-546 +#comment begins inside comment +#A comment open sequence (/*) appears within a comment. This usually +#means an earlier comment was not closed. \ No newline at end of file diff --git a/com.kdmanalytics.toif.splint/bin/config/SplintAdaptorConfigurationOriginal b/com.kdmanalytics.toif.splint/bin/config/SplintAdaptorConfigurationOriginal new file mode 100644 index 00000000..4ca1863c --- /dev/null +++ b/com.kdmanalytics.toif.splint/bin/config/SplintAdaptorConfigurationOriginal @@ -0,0 +1,1453 @@ +nestcomment=Other +preproc=Other + +#Null Dereferences (Section 2) + +null=;SFP-7;CWE-476 +#A possibly null pointer may be dereferenced, or used somewhere a nonnull pointer is expected. (sets nulldref, nullpass, nullassign, and nullstate + +nullderef=;SFP-7;CWE-476 +#A possibly null pointer is dereferenced. Value is either the result of a function which may return null (in which case, code should check it is not null), or a global, parameter or structure field declared with the null qualifier. + +nullpass=;SFP-7;CWE-476 +#A possibly null pointer is passed as a parameter corresponding to a formal parameter with no /*@null@*/ annotation. If NULL may be used for this parameter, add a /*@null@*/ annotation to the function parameter declaration. + +nullret=;SFP-7;CWE-476 +#Function returns a possibly null pointer, but is not declared using /*@null@*/ annotation of result. If function may return NULL, add /*@null@*/ annotation to the return value declaration. + +nullstate=;SFP-7;CWE-476 +#A possibly null pointer is reachable from a parameter or global variable that is not declared using a /*@null@*/ annotation. + +nullassign=;SFP-4;CWE-665 +#A reference with no null annotation is assigned or initialized to NULL. Use /*@null@*/ to declare the reference as a possibly null pointer. + + +################################################################################# + + + +#Use Before Definition (Section 3) + +usedef=;SFP-1;CWE-457 +#The value of a location that may not be initialized on some execution path is used. + +impouts=;SFP-1;CWE-457 +#Allow unannotated pointer parameters to functions to be implicit out parameters. + +compdef=;SFP-1;CWE-456 +#Storage derivable from a parameter, return value or global variable is not completely defined. + +uniondef=;SFP-1;CWE-456 +#No field of a union is defined. (No error is reported if at least one union field is defined.) + +mustdefine=;SFP-1;CWE-457 +#arameter declared with out is not defined before return or scope exit. + +fullinitblock=;SFP-1;CWE-456 +#Initializer does not set every field in the structure. + +initallelements=;SFP-1;CWE-456 +#Initializer does not define all elements of a declared array. + +initsize=;SFP-1;CWE-665 +#Initializer block contains more elements than the size of a declared array + + +################################################################################# + + +#Declarations + +incondefs=;SFP-1;CWE-704 +#A function, variable or constant is redefined with a different type. + +functionderef=Other +#A function type is dereferenced. The ANSI standard allows this because of implicit conversion of function designators, however the dereference is unnecessary. + +redundantsharequal=;SFP-4;CWE-665 +#A declaration of an immutable object uses a redundant observer qualifier. + +misplacedsharequal=;SFP-3 +#A declaration of an unsharable object uses a sharing annotation. + + +################################################################################# + + +#Types (Section 4 ) + + +type=;SFP-1;CWE-704 +#Type mismatch. + +stringliteraltoolong=;SFP-8;CWE-119 +#A string literal is assigned to a char array too small to hold it. + +stringliteralnoroom=;SFP-11;CWE-170 +#A string literal is assigned to a char array that is not big enough to hold the null terminator. + +stringliteralnoroomfinalnull=;SFP-11;CWE-170 +#A string literal is assigned to a char array that is not big enough to hold the final null terminator. This may not be a problem because a null character has been explictedly included in the string literal using an escape sequence. + +stringliteralsmaller=;SFP-8;CWE-119 +#A string literal is assigned to a char array that smaller than the string literal needs. + +enummembers=Risky values +#Type of initial values for enum members must be int. + + +################################################################################# + + +#Boolean Types (Section 4.2 ) +#These flags control the type name used to represent Booleans, and whether the Boolean type is abstract. + +bool=Other +#Boolean type is an abstract type. + +booltype=Other +#Set name of Boolean type to . + +boolfalse=Other +#Set name of Boolean false to . + +booltrue=Other +#Set name of Boolean true to . + +likelybool=;SFP-1 +#Splint has found a type which appears to be the boolean type. Use the booltype, boolfalse and booltrue flags to change the name of the default boolean type. + + + +################################################################################# + + + +#Predicates + +predboolptr=Other +#Type of condition test is a pointer. + +predboolint=;SFP-1 +#Type of condition test is an integral type. + +predboolothers=;SFP-1 +#Type of condition test is not a Boolean, pointer or integral type. + +predbool=Other +#Sets predboolint, predboolptr and preboolothers. + +predassign=Other +#The condition test is an assignment expression. If an assignment is intended, add an extra parentheses nesting (e.g., if ((a = b)) ...). + + +################################################################################# + + +#Primitive Operations + +ptrarith=Other +#Arithmetic involving pointer and integer. + +nullptrarith=;SFP-7;CWE-476 +#ointer arithmetic using a possibly null pointer and integer. + +boolops=;SFP-1 +#The operand of a boolean operator is not a boolean. Use +ptrnegate to allow ! to be used on pointers. + +ptrnegate=Other +#Allow the operand of the ! operator to be a pointer. + +bitwisesigned=;SFP-1;CWE-195 +#An operand to a bitwise operator is not an unsigned value. This may have unexpected results depending on the signed representations. + +shiftimplementation=;SFP-1 +#The left operand to a shift operator may be negative (behavior is implementationdefined). + +shiftnegative=;SFP-1 +#The right operand to a shift operator may be negative (behavior undefined). + +shiftsigned=;SFP-1 +#The left operand to a shift operator is not an unsigned value. + +strictops=;SFP-1 +#rimitive operation does not type check strictly. + +sizeoftype=;SFP-1 +#Operand of sizeof operator is a type. (Safer to use int *x = sizeof (*x); instead of sizeof (int).) + + +################################################################################# + + +#Array Formal arameters +#These flags control reporting of common errors caused by confusion about the semantics of array formal parameters. + + +sizeofformalarray=;SFP-1 +#The sizeof operator is used on a parameter declared as an array. (In many instances this has unexpected behavior, since the result is the size of a pointer to the element type, not the number of elements in the array.) + + +fixedformalarray=;SFP-1 +#An array formal parameter is declared with a fixed size (e.g., int x[20]). This is likely to be confusing, since the size is ignored. + +formalarray=;SFP-1 +#A formal parameter is declared as an array. This is probably not a problem, but can be confusing since it is treated as a pointer. + + +################################################################################# + + +#Format Codes + +formatcode=;SFP-1;CWE-686 +#Invalid format code in format string for printflike or scanflike function. + +formattype=;SFP-1;CWE-681 +#Typemismatch in parameter corresponding to format code in a printflike or scanflike function. + +formatconst=Risky Values +#Format parameter is not known at compiletime. This can lead to security vulnerabilities because the arguments cannot be type checked. + + +################################################################################# + + +#Main + +maintype=Other +#Type of main does not match expected type (function returning an int, taking no parameters or two parameters of type int and char **.) + + +################################################################################# + + +#Comparisons + +boolcompare=;SFP-1 +#Comparison between Boolean values. This is dangerous since there may be multiple true values as any nonzero value is interpreted as true. + +realcompare=;SFP-1 +#Comparison involving float or double values. This is dangerous since it may produce unexpected results because floating point representations are inexact. + +ptrcompare=;SFP-1 +#Comparison between pointer and number. + +unsignedcompare=;SFP-1 +#An unsigned value is used in a comparison with zero in a way that is either a bug or confusing. + + +################################################################################# + + +#Type Equivalence + +voidabstract=;SFP-1;CWE-704 +#Allow void * to match pointers to abstract types. (Casting a pointer to an abstract type to a pointer to void is okay if +voidabstract is set.) + +castfcnptr=;SFP-1;CWE-704 + A pointer to a function is cast to (or used as) a pointer to void (or vice versa). + +forwarddecl=;SFP-1;CWE-704 +#Forward declarations of pointers to abstract representation match abstract type. + +imptype=;SFP-1;CWE-665 +#A variable declaration has no explicit type. The type is implicitly int. + +incompletetype=;SFP-4;CWE-665 +#A formal parameter is declared with an incomplete type (e.g., int[][]). + +charindex=;SFP-8 +#Allow char to index arrays. + +enumindex=;SFP-8 +#Allow members of enumtype to index arrays. + +boolint=Other +#Make bool and int are equivalent. (No type errors are reported when a Boolean is used where an integral type is expected and vice versa.) + +charint=Other +#Make char and int types equivalent + +charunsignedchar=Other +#To allow char and unsigned char types to match use +charunsignedchar + +enumint=Other +#Make enum and int types equivalent + +floatdouble=Other +#Make float and double types equivalent + +ignorequals=Other +#Ignore type qualifiers (long, short, unsigned). + +relaxquals=Other +#Report qualifier mismatches only if dangerous (information may be lost since a larger type is assigned to (or passed as) a smaller one or a comparison uses signed and unsigned values.) + +ignoresigns=Other +#Ignore signs in type comparisons (unsigned matches signed). + +longintegral=Other +#Allow long type to match an arbitrary integral type (e.g., dev_t). + +longunsignedintegral +#Allow unsigned long type to match an arbitrary integral type (e.g., dev_t). + +matchanyintegral +#Allow any integral type to match an arbitrary + +longunsignedunsignedintegral +#Allow unsigned long type to match an arbitrary unsigned integral type (e.g., size_t).q + +longsignedintegral +#Allow long type to match an arbitrary signed integral type (e.g., ssize_t). + +numliteral +#Integer literals can be used as floats. + +charintliteral +#A character constant may be used as an int. + +zeroptr +#Literal 0 may be used as a pointer. + +zerobool +#Treat 0 as a boolean. + +relaxtypes +#Allow all numeric types to match. + +shortint +#Make short int and int types equivalent. + + +################################################################################# + + +#Abstract Types (Section 4.3 ) + +abstract +#A data abstraction barrier is violated + +impabstract +#Implicit abstract annotation for type declarations that do not use concrete. + +mutrep +#Representation of mutable type has sharing semantics. + + +################################################################################# + + +#Access (Section 4.3.1) + +accessmodule +#An abstract type defined in M.h (or specified in M.lcl) is accessible in M.c. + +accessfile +#An abstract type named type is accessible in files named type.* + +accessczech +#An abstract type named type may be accessible in a function named type_name. (Section 12.1.1) + +accessslovak +#An abstract type named type may be accessible in a function named typeName. (Section.12.1.2) + +accessczechoslovak +#An abstract type named type may be accessible in a function named type_name or typeName. (Section 12.1.3) + +accessall +#Sets accessmodule, accessfile and accessczech. + + +################################################################################# + + +#Memory Management (Section 5 ) +#Reporting of Memory Management errors is controlled by flags setting checking and implicit annotations and code annotations. + + +################################################################################# + + +#Deallocation Errors (Section 5.2) + +usereleased=;SFP-15;CWE-416 +#Storage used after it may have been released. + +strictusereleased +#An array element used after it may have been released. + + +################################################################################# + + +#Inconsistent Branches + +branchstate=Other +#Storage has inconsistent states of alternate paths through a branch (e.g., it is released in the true branch of an ifstatement, but there is no else branch.) + +strictbranchstate=Other +#Storage through array fetch has inconsistent states of alternate paths through a branch. Since array elements are not checked accurately, this may lead to spurious errors. + +deparrays +#Treat array elements as dependent storage. Checking of array elements cannot be done accurately by Splint. If deparrays is not set, array elements are assumed to be independent, so code that releases the same element more than once will produce no error. If deparrays is set, array elements are assumed to be dependent, so code that releases the same element more that once will produce an error, but code that releases different elements correctly will produce a spurious error. + + +################################################################################# + + + +#Memory Leaks + +mustfree=;SFP-14;CWE-401 +#Allocated storage was not released before return or scope exit. Errors are reported for only, fresh or owned storage. + +mustfreefresh=;SFP-14;CWE-401 +#Allocated storage was not released before return or scope exit. Errors are reported for fresh storage + +mustfreeonly=;SFP-14;CWE-401 +#Allocated storage was not released before return or scope exit. Errors are reported for only storage + +memchecks +#Sets all dynamic memory checking flags (memimplicit, mustfree, mustdefine, mustnotalias, null, memtrans ). + +compdestroy=;SFP-14;CWE-401 +#All only references derivable from out only parameter of type void * must be released. (This is the type of the parameter to free, but may also be used for userdefined deallocation functions.) + +strictdestroy +#Report complete destruction errors for array elements that may have been released. (If strictdestroy is not set, Splint will assume that if any array element was released, the entire array was correctly released.) + + +################################################################################# + + + +#Transfer Errors +#A transfer error is reported when storage is transferred (by an assignment, passing a parameter, or returning) in a way that is inconsistent. + +memtrans +#Sets all memory transfer errors flags. + +onlytrans=;SFP-14;CWE-401 +#Only storage transferred to nononly reference (memory leak). + +ownedtrans=;SFP-14;CWE-401 +#Owned storage transferred to nonowned reference (memory leak). + +freshtrans=;SFP-14;CWE-401 +#Newlyallocated storage transferred to nononly reference (memory leak). + +sharedtrans=;SFP-12;CWE-762 +#Shared storage transferred to nonshared reference + +dependenttrans=Memory Management +#Inconsistent dependent transfer. Dependent storage is transferred to a nondependent reference. + +temptrans=Memory Management +#Temporary storage (associated with a temp formal parameter) is transferred to a nontemporary reference. The storage may be released or new aliases created. + +kepttrans=Memory Management +#Kept storage (storage what was passed as keep) transferred to nontemporary reference. + +keeptrans=;SFP-12;CWE-762 +#Keep storage is transferred in a way that may add a new alias to it, or release it. + +refcounttrans=;SFP-12;CWE-762 +#Reference counted storage is transferred in an inconsistent way. + +newreftrans=;SFP-12;CWE-762 +#A new reference transferred to a reference counted reference (reference count is not set correctly). + +immediatetrans=;SFP-1;CWE-587 +#An immediate address (result of &) is transferred inconsistently. + +statictrans=Memory Management +#Static storage is transferred in an inconsistent way. + +exposetrans=;SFP-12;CWE-762 +#Inconsistent exposure transfer. Exposed storage is transferred to a nonexposed, nonobserver reference. + +observertrans=Memory Management +#Inconsistent observer transfer. Observer storage is transferred to a nonobserver reference. + +unqualifiedtrans=Memory Management +#Unqualified storage is transferred in an inconsistent way. + +#Initializers + +onlyunqglobaltrans +#Only storage transferred to an unqualified global or static reference. This may lead to a memory leak, since the new reference is not necessarily released. + +staticinittrans +#Static storage is used as an initial value in an inconsistent way. + +unqualifiedinittrans +#Unqualified storage is used as an initial value in an inconsistent way. +#Derived Storage + +compmempass=;SFP-14;CWE-404 +#Storage derivable from a parameter does not match the alias kind expected for the formal parameter. +#Stack References + +stackref +#A stack reference is pointed to by an external reference when the function returns. Since the call frame will be destroyed when the function returns the return value will point to dead storage. (Section 5.2.6) + + +################################################################################# + + +#Implicit Memory Annotations (Section 5.3 ) + +allimponly +#Sets globimponly, retimponly, structimponly, specglobimponly, specretimponly and specstructimponly . + +globimponly +#Assume unannotated global storage is only. + +paramimptemp +#Assume unannotated parameter is temp. + +retimponly +#Assume unannotated returned storage is only. + +structimponly +#Assume unannotated structure or union field is only. + +codeimponly +#Sets globimponly, retimponly and structimponly. + +memimp +#Report memory errors for unqualified storage. + +passunknown +#assing a value as an unannotated parameter clears its annotation. This will prevent many spurious errors from being report for unannotated programs, but eliminates the possibility of detecting many errors. + +################################################################################# + + +#Sharing (Section 6) + +################################################################################# + + +#Aliasing (Section 6.1 ) + +aliasunique=;SFP-4;CWE-665 +#An actual parameter that is passed as a unique formal parameter is aliased by another parameter or global variable. + +mayaliasunique=Other +#An actual parameter that is passed as a unique formal parameter may be aliased by another parameter or global variable. + +mustnotalias +#An alias has been added to a tempqualifier parameter or global that is visible externally when the function returns. + +retalias +#A function returns an alias to parameter or global. + +################################################################################# + + +#Exposure (Section 6.2 ) + +repexpose +#The internal representation of an abstract type is visible to the caller. This means clients may have access to a pointer into the abstract representation. (Sets assignexpose, retexpose, and castexpose.) + +assignexpose +#Abstract representation is exposed by an assignment or passed parameter. + +castexpose +#Abstract representation is exposed through a cast. + +retexpose +#Abstract representation is exposed by a return value. +#Observer Modifications + +modobserver=Other +#ossible modification of observer storage. + +modobserveruncon +#Storage declared with observer may be modified through a call to an unconstrained function. +#String Literals (Section 6.2.1) + +readonlytrans +#Report memory transfer errors for initializations to readonly string literals + +readonlystrings +#String literals are readonly (ISO semantics). An error is reported if a string literal may be modified or released. + +################################################################################# + + +#Function Interfaces (Section 7 ) + + +################################################################################# + + + +#Modification (Section 7.1) + +modifies +#Undocumented modification of callervisible state. Without +moduncon, modification errors are only reported in the definitions of functions declared with a modifies clause (or specified). + +mustmod +#Documented modification is not detected. An object listed in the modifies clause for a function, is not modified by the implementation. + +moduncon +#Report modification errors in functions declared without a modifies clause.(Sets modnomods, modglobsnomods and modstrictglobsnomods.) + +modnomods +#Report modification errors (not involving global variables) in functions declared without a modifies clause. + +modunconnomods +#An unconstrained function is called in a function body where modifications are checked. Since the unconstrained function may modify anything, there may be undetected modifications in the checked function. + +modinternalstrict +#A function that modifies internalState is called from a function that does not list internalState in its modifies clause. + +modfilesys +#A function modifies the file system but does not list fileSystem in its modifies clause. + +################################################################################# + + +#Global Variables (Section 7.2 ) +#Errors involving the use and modification of global and file static variables are reported depending on flag settings, annotations where the global variable is declared, and whether or not the function where the global is used was declared with a globals clause. + +globs +#Undocumented use of a checked global variable in a function with a globals list. + +globuse +#A global listed in the globals list is not used in the implementation. + +globnoglobs +#Use of a checked global in a function with no globals list. + +internalglobs +#Undocumented use of internal state (should have globals internalState). + +internalglobsnoglobs +#Use of internal state in function with no globals list. + +globstate=;SFP-15;CWE-416 +#A function returns with global in inconsistent state (null or undefined) + +allglobs +#Report use and modification errors for globals not annotated with unchecked. + +checkstrictglobs +#Report use and modification errors for checkedstrict globals. + +#Modification of Global Variables + +modglobs +#Undocumented modification of a checked global variable. + +modglobsunchecked +#Undocumented modification of an unchecked global variable. + +modglobsnomods +#Undocumented modification of a checked global variable in a function with no modifies clause. + +modstrictglobsnomods +#Undocumented modification of a checkedstrict global variable in a function declared with no modifies clause. +#Globals Lists and Modifies Clauses + +warnmissingglobs +#Global variable used in modifies clause is not listed in globals list. (The global is added to the globals list.) + +warnmissingglobsnoglobs +#Global variable used in modifies clause of a function with no globals list. + +globsimpmodsnothing +#A function declared with a globals list but no modifies clause is assumed to modify nothing. + +modsimpnoglobs +#A function declared with a modifies clause but no globals list is assumed to use no globals. +#Implicit Checking Annotations + +impcheckedglobs +#Implicit checked annotation on global variables with no checking annotation. + +impcheckedstatics +#Implicit checked qualifier file static scope variables with no checking annotation. + +impcheckmodglobs +#Implicit checkmod qualifier on global variables with no checking annotation. + + +impcheckmodstatics +#Implicit checkmod qualifier file static scope variables with no checking annotation. + +impcheckedstrictglobs +#Implicit checked qualifier on global variables with no checking annotation. + +impcheckedstrictstatics +#Implicit checked qualifier file static scope variables with no checking annotation. + +impcheckmodinternals +#Implicit checkmod qualifier on function scope static variables with no checking annotation. + + +#Global Aliasing + +globalias +#Function returns with global aliasing external state (sets checkstrictglobalias, checkedglobalias, checkmodglobalias and uncheckedglobalias). + +checkstrictglobalias +#Function returns with a checkedstrict global aliasing external state. + +checkedglobalias +#Function returns with a checked global aliasing external state. + +checkmodglobalias +#Function returns with a checkmod global aliasing external state. + +uncheckedglobalias +#Function returns with an unchecked global aliasing external state. + +################################################################################# + + +#Declaration Consistency (Section 7.3) + +incondefs +#Identifier redeclared or redefined with inconsistent type. + +incondefslib +#Identifier defined in a library is redefined with inconsistent type. + +overload +#Standard library function overloaded. + +matchfields +#A struct or enum type is redefined with inconsistent fields or members. + + +################################################################################# + + +#Macros (Section 11 ) +#These flags control expansion and checking of macro definitions and invocations. + + +################################################################################# + + + +#Macro Expansion +#These flags control which macros are checked as functions or constants, and which are expanded in the preprocessing phase. Macros preceded by /*@notfunction@*/ are never expanded regardless of these flag settings. These flags may be used in sourcefile control comments. + + +fcnmacros +#Macros defined with parameter lists are not expanded and are checked as functions. + +constmacros +#Macros defined without parameter lists are not expanded and are checked as constants. + +allmacros +#Sets fcnmacros and constmacros. + +libmacros +#Macros defining identifiers declared in a loaded library are not expanded and are checked according to the library information. + + +################################################################################# + + +#Macro Definitions +#These flags control what errors are reported in macro definitions. + + +macrostmt +#Macro definition is not syntactically equivalent to function. This means if the macro is used as a statement (e.g., if (test) macro();) unexpected behavior may result. One fix is to surround the macro body with do { … } while (FALSE). + +macroreturn +#The body of a macro declared as a function uses a return statement. This exhibits behavior that could not be implemented by a function. + +macroassign +#A macro parameter is used as the left side of an assignment expression. + +macroparams=;SFP-2;CWE-563 + +macroparens=Other +#A macro parameter is used without parentheses (in potentially dangerous context). + +macroempty +#Macro definition of a function is empty. + +macroredef +#Macro is redefined. There is another macro defined with the same name. + +macrounrecog +#An unrecognized identifier appears in a macro definition. Since the identifier may be defined where the macro is used, this could be okay, but Splint will not be able to check the unrecognized identifier appropriately. +#Corresponding Declarations + +macromatchname +#An iter or constant macro is defined using a different name from the one used in the previous syntactic comment + +macrodecl +#A macro definition has no corresponding declaration. (Sets macrofcndecl and macroconstdecl.) + +macrofcndecl +#Macro definition with parameter list has no corresponding function prototype. Without a prototype, the types of the macro result and parameters are unknown. + +macroconstdecl +#A macro definition without parameter list has no corresponding constant declaration. + +nextlinemacros +#A constant or iter declaration is not immediately followed by a macro definition. + +################################################################################# + + +#Side Effect Free arameters (Section 11.2.1 ) +#These flags control error reporting for parameters with inconsistent side effects in invocations of checked function macros and function calls. + + +sefparams +#An actual parameter with side effects is passed as a formal parameter declared with sef. + +sefuncon +#An actual parameter involving a call to an unconstrained function (declared without modifies clause) that may modify anything is passed as a sef parameter. + + +################################################################################# + + + +#Iterators + +iterbalance +#Iter is not balanced with end . + +iteryield +#Iter yield parameter is inappropriate. + +hasyield +#An iterator has been declared with no parameters annotated with yield. + +################################################################################# + + +#Naming Conventions (Section 12) + +namechecks +#Turns all name checking on or off without changing other settings. + +################################################################################# + + +#TypeBased Naming Conventions (Section 12.1) +#Czech Naming Convention + +czech +#Selects complete Czech naming convention (sets accessczech, czechfcns, czechvars, czechconsts, czechmacros, and czechtypes). + +accessczech +#Allow access to abstract types following Czech naming convention. The representation of an abstract type named t is accessible in the definition of a function or constant named t_name. + +czechfcns +#Function or iterator name is not consistent with Czech naming convention. + +czechvars + Variable name is not consistent with Czech naming convention. + +czechmacros + Expanded macro name is not consistent with Czech naming convention. + +czechconsts +#Constant name is not consistent with Czech naming convention. + +czechtypes +#Type name is not consistent with Czech naming convention. Czech type names must not use the underscore character. +#Slovak Naming Convention + +slovak +#Selects complete Slovak naming convention (sets accessslovak, slovakfcns, slovakvars, slovakconsts, slovakmacros, and slovaktypes). + +accessslovak +#Allow access to abstract types following Slovak naming convention. The representation of an abstract type named t is accessible in the definition of a function or constant named tName. + +slovakfcns +#Function or iterator name is not consistent with Slovak naming convention. + +slovakmacros +#Expanded macro name is not consistent with Slovak naming convention. + +slovakvars + Variable name is not consistent with Slovak naming convention. + +slovakconsts + Constant name is not consistent with Slovak naming convention. + +slovaktypes +#Type name is not consistent with Slovak naming convention. Slovak type names may not include uppercase letters. +#Czechoslovak Naming Convention + +czechoslovak +#Selects complete Czechoslovak naming convention (sets accessczechoslovak, czechoslovakfcns, czechoslovakvars, czechoslovakconsts, czechoslovakmacros, and czechoslovaktypes). + +accessczechoslovak +#Allow access to abstract types by Czechoslovak naming convention. The representation of an abstract type named t is accessible in the definition of a function or constant named t_name or tName. + +czechoslovakfcns + Function name is not consistent with Czechoslovak naming convention. + +czechoslovakmacros +#Expanded macro name is not consistent with Czechoslovak naming convention. + +czechoslovakvars +#Variable name is not consistent with Czechoslovak naming convention. + +czechoslovakconsts +#Constant name is not consistent with Czechoslovak naming convention. + +czechoslovaktypes +#Type name is not consistent with Czechoslovak naming convention. Czechoslovak type names may not include uppercase letters or the underscore character. + +################################################################################# + + +#Namespace refixes (Section 12.2) +#macrovarprefix +#Set namespace prefix for variables declared in a macro body. (Default is m_.) + +macrovarprefixexclude=Other +#A variable declared outside a macro body starts with the macrovarprefix. +#tagprefix +#Set namespace prefix of struct, union or enum tag identifiers. + +tagprefixexclude +#An identifier that is not a tag starts with the tagprefix. +#enumprefix +#Set namespace prefix for enum members. + +enumprefixexclude +#An identifier that is not an enum member starts with the enumprefix. +#filestaticprefix +#Set namespace prefix for file static declarations. + +filestaticprefixexclude +#An identifier that is not file static starts with the filestaticprefix. +#globalprefix +#Set namespace prefix for global variables. + +globalprefixexclude +#An identifier that is not a global variable starts with the globalprefix. +#typeprefix +#Set namespace prefix for userdefined types. + +typeprefixexclude +#An identifier that is not a type name starts with the typeprefix. +#externalprefix +#Set namespace prefix for external identifiers. + +externalprefixexclude +#An identifier that is not external starts with the externalprefix. + +#localprefix +#Set namespace prefix for local variables. + +localprefixexclude +#An identifier that is not a local variable starts with the localprefix. + +#uncheckedmacroprefix +#Set namespace prefix for unchecked macros. + +uncheckedmacroprefixexclude +#An identifier that is not the name of an unchecked macro starts with the uncheckedmacroprefix. +#constprefix +#Set namespace prefix for constants. + +constprefixexclude +#An identifier that is not a constant starts with the constantprefix. +#iterprefix +#Set namespace prefix for iterators. + +iterprefixexclude +#An identifier that is not an iter starts with the iterprefix. +#protoparamprefix +#Set namespace prefix for parameters in function prototypes. + +protoparamprefixexclude +#An identifier that is not a parameter in a function prototype starts with the protoprarmprefix. + +protoparamname +#A parameter in a function prototype has a name (can interfere with macro definitions). + +protoparammatch +#The name of a parameter in a function definition does not match the corresponding name of the parameter in a function prototype (after removing the protoparamprefix). + + +################################################################################# + + +#Naming Restrictions (Section 12.3) + +shadow=Other +#Declaration reuses name visible in outer scope. +#Reserved Names + +ansireserved +#External name conflicts with name reserved for the compiler or standard library. + +ansireservedinternal + Internal name conflicts with name reserved for the compiler or standard library. + +isoreserved +#External name is reserved for system use by ISO C99 standard. + +isoreservedinternal +#Internal name is reserved for system in ISO C99 standard (this should not be necessary unless you are worried about C library implementations that violate the standard and use macros). + +cppnames +#Internal or external name conflicts with a C++ reserved word. (Will cause problems if program is compiled with a C++ compiler.) +#Distinct External Names + +distinctexternalnames +#An external name is not distinguishable from another external name using externalnamelen significant characters. + +externalnamelen +#Sets the number of significant characters in an external name (ANSI default minimum is 6). Sets +distinctexternalnames. + +externalnamecaseinsensitive +#Make alphabetic case insignificant in external names. According to ANSI standard, case need not be significant in an external name. If +distinctexternalnames is not set, sets +distinctexternalnames with unlimited external name length. +#Distinct Internal Names + +distinctinternalnames +#An internal name is not distinguishable from another internal name using internalnamelen significant characters. (Also effected by internalnamecaseinsensitive and internalnamelookalike.) + +internalnamelen +#Set the number of significant characters in an internal name. Sets +distinctinternalnames. + +internalnamecaseinsensitive +#Set whether case is significant an internal names (internalnamecaseinsensitive means case is significant). If +distinctinternalnames is not set, sets +distinctinternalnames with unlimited internal name length. + +internalnamelookalike + Set whether similar looking characters (e.g., “1” and “l”) match in internal names. + +################################################################################# + + +#Control Flow (Section 8) + +################################################################################# + + +#Undefined Evaluation Order (Section 8.2 ) + +evalorder=;SFP-1 +#Behavior of an expression is unspecified or implementationdependent because subexpressions contain interfering side effects that may be evaluated in any order. + +evalorderuncon +#An expression may be undefined because a subexpression contains a call to an unconstrained function (no modifies clause) that may modify something that may be modified or used by another subexpression. + +################################################################################# + + +#roblematic Control Structures (Section 8.3 ) + +infloops +#Likely infinite loop is detected (Section 8.3.1). + +infloopsuncon +#Likely infinite loop is detected. Loop test or body calls an unconstrained function that may produce an undetected modification. + +elseifcomplete +#There is no finals else following an else if construct (Section 8.3.5). + +casebreak=;SFP-4;CWE-484 +#There is a nonempty case in a switch not followed by a break(Section 8.3.2 ). + +firstcase +#The first statement after a switch is not a case. + +#Duplicatecase +#Duplicate cases in switch. + +misscase +#A switch on an enum type is missing a case for a member of the enumerator. +#+ +emptyreturn +#Empty return in function declared to return value. +#+ +alwaysexits +#Loop predicate always exits. + +loopexec +#Assume all loops execute at least once. This effects usebeforedefinition and memory checking. It should probably not be used globally, but may be used surrounding a particular loop that is known to always execute to prevent spurious messages. (sets forloopexec, whileloopexec and iterloopexec +# +forloopexec +#Assume all for loops execute at least once. This effects usebeforedefinition and memory checking. It should probably not be used globally, but may be used surrounding a particular loop that is known to always execute to prevent spurious messages. +# +whileloopexec +#Assume all while loops execute at least once. This effects usebeforedefinition and memory checking. It should probably not be used globally, but may be used surrounding a particular loop that is known to always execute to prevent spurious messages. +# +iterloopexec +#Assume all iter loops execute at least once. This effects usebeforedefinition and memory checking. It should probably not be used globally, but may be used surrounding a particular loop that is known to always execute to prevent spurious messages. +#+ +obviousloopexec +#Assume loop that can be determined to always execute always does. + +################################################################################# + + +#Deep Break (Section 8.3.3 ) + +deepbreak +#Report errors for break statements inside a nested while, for or switch. (Sets all nested break and continue flags.) + +looploopbreak +#There is a break inside a while, for or iterator loop that is inside a while, for or iterator loop. Mark with /*@innerbreak@*/ to suppress the message. + +switchloopbreak +#There is abreak inside a while, for or iterator loop that is inside a switch statement. Mark with /*@loopbreak@*/. + +loopswitchbreak +#There is abreak inside a switch statement that is inside a while, for or iterator loop. Mark with /*@switchbreak@*/. + +switchswitchbreak +#There is abreak inside a switch statement that is inside another switch statement. Mark with /*@innerbreak@*/. + +looploopcontinue +#There is a continue inside a while, for or iterator loop that is inside a while, for or iterator loop. Mark with /*@innercontinue@*/. + +################################################################################# + + +#Loop and if Bodies (Section 8.3.4) + +allempty +#An if, while or for statement has no body (sets ifempty, whileempty and forempty.) + +allblock +#The body of an if, while or for statement is not a block (sets ifblock, whileblock and forblock.) + +whileempty +#A while statement has no body. + +whileblock +#The body of a while statement is not a block + +forempty +#A for statement has no body. + +forblock +#The body of a for statement is not a block. + +ifempty=Other +#An if statement has no body. + +ifblock +#The body of an if statement is not a block. + +################################################################################# + + +#Suspicious Statements (Section 8.4) + +unreachable=;SFP-2;CWE-561 +#Code is not reached on any possible execution. + +noeffect=;SFP-1 +#Statement has no effect. + +noeffectuncon +#Statement involving call to unconstrained function may have no effect. + +noret=Other +#There is a path with no return in a function declared to return a nonvoid value. + +################################################################################# + + + +#Ignored Return Values (Section 8.4.2 ) +#These flags control when errors are reported for function calls that do not use the return value. Casting the function call to void or declaring the called function to return /*@alt void@*/. + + +retvalbool +#Return value of type bool ignored. + +retvalint=;SFP-4;CWE-252 +#Return value of type int ignored. + +retvalother=;SFP-4;CWE-252 +#Return value of type other than bool or int ignored. + +retval +#Return value ignored (Sets retvalbool, retvalint, retvalother.) + +################################################################################# + + +#Memory Bounds (Section 9) + +bounds +#Memory read or write may be out of bounds of allocated storage (sets boundsread and boundswrite + +boundsread +#A memory read references memory beyond the allocated storage (also sets likelyboundsread. + +boundswrite +#A memory write may write to an address beyond the allocated buffer (also sets likelyboundswrite. + +likelybounds +#Likely memory read or write is likely to be out of bounds of allocated storage (sets likelyboundsread and likelyboundswrite) + +likelyboundsread +#A likely memory read references memory beyond the allocated storage (also sets likelyboundsread. + +likelyboundswrite +#A memory write is likely to write to an address beyond the allocated buffer. + +fcnpost +#Display function post conditions. + +redundantconstraints +#Display seemingly redundant conditions. + +checkpost +#The functions implementation may not satidfy a post condition given in an ensures clause. +# +showconstraintparens +#Display parentheses around constraint terms. +#+ +showconstraintlocation +#Display location for every constraint generated. + +#The following flags are mainly of interest to Splint developers. The default values are adequate in normal use. They are included for completeness. + +debugfcnconstraint +#erform buffer overflow checking even if the errors would be inhibited. +# +implictconstraints +#Generate implicit constraints for functions. This is an experimental option. Currently this option reduces the number of bounds errors but causes real error to be missed. +# +orconstraint +#This flags affects the internal constraint resolution. If set, the internal constraint resolution is more accurate. The performance impact is minimal so there is little reason not to have this flag set. + +################################################################################# + + +#Extensible Checking (Section 13 ) + +mts +#Load meta state declaration and corresponding xh file. + +statetransfer +#Transfer violates userdefined state rules. + +statemerge +#Control path merge violates userdefined state merge rules. + +################################################################################# + +#Completeness (Section 13 ) + +################################################################################# +#Unused Declarations (Section 13.1 ) +#These flags control when errors are reported for declarations that are never used. The unused annotation can be used to prevent unused errors from being report for a particular declaration. + + +topuse=;SFP-2;CWE-563 +#An external declaration is not used in any file. + +constuse=;SFP-2;CWE-563 +#Constant never used. + +enummemuse=;SFP-2;CWE-563 +#Member of enumerator never used. + +varuse=;SFP-2;CWE-563 +#Variable never used. + +paramuse=SFP-2 +#Function parameter never used. + +fcnuse=;SFP-2;CWE-561 +#Function is never used. + +typeuse=;SFP-2;CWE-563 +#Defined type never used. + +fielduse=;SFP-2;CWE-563 +#Field of structure or union type is never used. + +unusedspecial +#Declaration in a special file (corresponding to .l or .y file) is unused. + +################################################################################# + +#Complete rograms (Section 13.2) + +declundef +#Function, variable, iterator or constant declared but never defined. + +partial +#Check as partial system (sets declundef, exportlocal and prevents checking of macros in headers without corresponding .c files.) + + +################################################################################# + + +#Exports + +exportlocal=;SFP-2;CWE-561 +#A declaration is exported but not used outside this module. (Declaration can use the static qualifier.) + +exportheader +#A declaration (other than a variable) is exported but does not appear in a header file. + +exportheadervar +#A variable declaration is exported but does not appear in a header file. + + +################################################################################# + +#Unrecognized Identifiers + +unrecog=;SFP-1;CWE-456 +#An unrecognized identifier is used. + +sysunrecog=;SFP-4;CWE-665 +#Report unrecognized identifiers that start with the system prefix, __ (two underscores). + +repeatunrecog=;SFP-4;CWE-665 +#Report multiple messages for unrecognized identifiers. If repeatunrecog is not set, an error is reported only the first time a particular unrecognized identifier appears in the file. + + +################################################################################# + +#Multiple Definition and Declarations + +redef=;SFP-4;CWE-665 +#A function or variable is defined more than once. + +redecl=;SFP-4;CWE-665 +#An identifier is declared more than once. + +nestedextern=;SFP-1;CWE-465 +#An extern declaration is used inside a function body. + + +################################################################################# + +#ISO Conformance + +noparams +#A function is declared without a parameter list prototype. + +oldstyle +#Function definition is in old style syntax. Standard prototype syntax is preferred. + +exitarg=Risky values +#Argument to exit has implementation defined behavior. The only valid arguments to exit are EXIT_SUCCESS, EXIT_FAILURE and 0. An error is reported if Splint can determine statically that the argument to exit is not one of these. + +usevarargs=Other +#Report if is used (should use stdarg.h). + +################################################################################# + +#Warn use + +bufferoverflow +#Use of function that may lead to buffer overflow. + +bufferoverflowhigh=;SFP-8;CWE-120 +#Use of function that may lead to buffer overflow. + +implementationoptional +#Use of a declarator that is implementation optional, not required by ISO99. + +multithreaded +#Nonreentrant function should not be used in multithreaded code. + +portability +#Use of function that may have implementationdependent behavior. + +superuser +#Call to function restricted to superusers. + +toctou +#Possible time of check, time of use vulnerability. + +unixstandard +#Use of function that need not be provided by UNIX implementations + +################################################################################# + +#Header Inclusion (Section 14.3 ) + +skipansiheaders +#Prevent inclusion of header files in a system directory with names that match standard ANSI headers. The symbolic information in the standard library is used instead. Flag in effect only if a library that includes the standard library is used. The ANSI headers are: assert, ctype, errno, float, limits, locale, math, setjmp, signal, stdarg, stddef, stdio, stdlib, strings, string, time, and wchar. + +skipisoheaders +#Prevent inclusion of header files in a system directory with names that match standard ISO C99 headers. The symbolic information in the standard library is used instead. In effect only if a library that includes the standard library is used. The ISO C99 headers are: assert, complex, ctype, errno, fenv, float, inttypes, iso646, limits, locale, math, setjmp, signal, stdarg, stdbool, stddef, stdio, stdlib, string, tgmath, time, wchar, and wctype. + +skipposixheaders +#Prevent inclusion of header files in a system directory with names that match standard POSIX headers. The symbolic information in the standard library is used instead. In effect only if a library that includes the POSIX library is used. The skipped POSIX headers are: dirent, fcntl, grp, pwd, termios, sys/stat, sys/times, sys/types, sys/utsname, sys/wait, unistd, and utime. + +warnposixheaders=Other +#Report use of a POSIX header when checking a program with a nonPOSIX library. + +warnunixheaders +#Warn the user that the unix library may not be compatible with all platforms. + +skipsysheaders +#Prevent inclusion of all header files in system directories. + +sysdirexpandmacros +#Expand macros in system directories regardless of other settings, except for macros corresponding to names defined in a load library. + +sysdirerrors +#Report errors in files in system directories (set by sysdirs). + +warnsysfiles +#Warn when a system file was listed as a command line file but Splint is not set to report errors for system files. This prevents accidentally missing warnings in system files when Splint is run in a system directory. + +singleinclude +#Optimize header inclusion to only include each header file once. + +neverinclude +#Use library information instead of including header files. + +caseinsensitivefilenames +#File names are case insensitive (file.h and FILE.H are the same file). + + + +#Comments +#These flags control how syntactic comments are interpreted. + +#commentchar +#Set the marker character for syntactic comments. Comments beginning with /* are interpreted by Splint. + +noaccess +#Ignore access comments. + +nocomments +#Ignore all stylized comments. + +supcounts +#Actual number of errors does not match number in /*@i@*/ + +lintcomments +#Interpret traditional lint comments (/*FALLTHROUGH*/, /*NOTREACHED*/, /*PRINTFLIKE*/). + +warnlintcomments=Other +#Print a warning and suggest an alternative when a traditional lint comment is used. + +unrecogcomments=Other +#Stylized comment is unrecognized. + +unrecogflagcomments +#Semantic comment attempts to set a flag that is not recognized. + +annotationerror +#A declaration uses an invalid annotation. + +commenterror +#A syntactic comment is used inconsistently. diff --git a/com.kdmanalytics.toif.splint/build.properties b/com.kdmanalytics.toif.splint/build.properties new file mode 100644 index 00000000..e9863e28 --- /dev/null +++ b/com.kdmanalytics.toif.splint/build.properties @@ -0,0 +1,5 @@ +source.. = src/ +output.. = bin/ +bin.includes = META-INF/,\ + .,\ + plugin.xml diff --git a/com.kdmanalytics.toif.splint/plugin.xml b/com.kdmanalytics.toif.splint/plugin.xml new file mode 100644 index 00000000..1c649294 --- /dev/null +++ b/com.kdmanalytics.toif.splint/plugin.xml @@ -0,0 +1,11 @@ + + + + + + + + + diff --git a/com.kdmanalytics.toif.splint/pom.xml b/com.kdmanalytics.toif.splint/pom.xml new file mode 100644 index 00000000..f79bad81 --- /dev/null +++ b/com.kdmanalytics.toif.splint/pom.xml @@ -0,0 +1,21 @@ + + + + 4.0.0 + + + com.kdmanalytics.toif + plugins + 1.16.0-SNAPSHOT + + + com.kdmanalytics.toif.compile + com.kdmanalytics.toif.splint + + + eclipse-plugin + + Splint Adaptor + \ No newline at end of file diff --git a/com.kdmanalytics.toif.splint/src/com/kdmanalytics/toif/adaptor/SplintAdaptor.java b/com.kdmanalytics.toif.splint/src/com/kdmanalytics/toif/adaptor/SplintAdaptor.java new file mode 100644 index 00000000..b76d6a00 --- /dev/null +++ b/com.kdmanalytics.toif.splint/src/com/kdmanalytics/toif/adaptor/SplintAdaptor.java @@ -0,0 +1,498 @@ + +package com.kdmanalytics.toif.adaptor; + +/******************************************************************************* + * Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This program and + * the accompanying materials are made available under the terms of the Open + * Source Initiative OSI - Open Software License v3.0 which accompanies this + * distribution, and is available at + * http://www.opensource.org/licenses/osl-3.0.php/ + ******************************************************************************/ +import java.io.BufferedReader; +import java.io.BufferedWriter; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.FileWriter; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.util.ArrayList; +import java.util.Scanner; + +import org.apache.commons.lang3.ArrayUtils; +import org.apache.commons.lang3.StringEscapeUtils; +import org.apache.log4j.Logger; + +import com.kdmanalytics.toif.common.exception.ToifException; +import com.kdmanalytics.toif.framework.toolAdaptor.AbstractAdaptor; +import com.kdmanalytics.toif.framework.toolAdaptor.AdaptorOptions; +import com.kdmanalytics.toif.framework.toolAdaptor.Language; +import com.kdmanalytics.toif.framework.utils.FindingCreator; +import com.kdmanalytics.toif.framework.xmlElements.entities.Element; + + +public class SplintAdaptor extends AbstractAdaptor +{ +/** + * the logger. + */ +private static Logger LOG = Logger.getLogger(SplintAdaptor.class); + private String path = null; + + private File tmpFile = null; + + /** + * return this adaptors name + */ + /* + * (non-Javadoc) + * + * @see + * com.kdmanalytics.toif.framework.toolAdaptor.AbstractAdaptor#getAdaptorName + * () + */ + @Override + public String getAdaptorName() + { + return "Splint"; + } + + /** + * return the adaptors description. + */ + /* + * (non-Javadoc) + * + * @see com.kdmanalytics.toif.framework.toolAdaptor.AbstractAdaptor# + * getAdaptorDescription() + */ + @Override + public String getAdaptorDescription() + { + return "Splint is a tool for statically checking C programs for security vulnerabilities and common programming mistakes. With minimal effort, splint can be used as a better lint. If additional effort is invested adding annotations to programs, splint can perform stronger checks than can be done by any standard lint."; + } + + /** + * Create the commands to run the tool. + */ + @Override + public String[] runToolCommands(AdaptorOptions options, String[] otherOpts) + { + // we need the path in order to construct the full file path. + path = options.getInputFile().getParent(); + + // this is where the output of the tool is going to be written in order + // for us to collect it. + + // File tmpdir = new + // File(options.getOutputDirectory(),options.getInputFile().getName()+"."+getGeneratorName()); + // tmpdir.mkdirs(); + tmpFile = new File(options.getOutputDirectory(),options.getInputFile().getName()+"."+getGeneratorName()); + + // tmpFile.deleteOnExit(); + // the required commands to run the tool. + final String[] commands = { "splint", options.getInputFile().toString(), "+csv", tmpFile.getPath(), "+csvoverwrite" }; + + String[] allCommands = (String[]) ArrayUtils.addAll(commands, otherOpts); + + return allCommands; + } + + public static void writeToFile(String sb) throws IOException + { + File tempDir = new File(System.getProperty("java.io.tmpdir")); + File tempFile = new File(tempDir, "toifLog"); + FileWriter fileWriter = new FileWriter(tempFile, true); + // System.out.println(tempFile.getAbsolutePath()); + BufferedWriter bw = new BufferedWriter(fileWriter); + bw.write(sb); + bw.close(); + } + + @Override + public ArrayList parse(File process, AdaptorOptions options, com.kdmanalytics.toif.framework.xmlElements.entities.File file, + boolean[] validLines, boolean unknownCWE) throws ToifException + { + // new finding creator + final FindingCreator creator = new FindingCreator(getProperties(), getAdaptorName(), unknownCWE); + + Scanner scanner = null; + try + { + scanner = new Scanner(new FileInputStream(process)); + // read from the csv file. + while (scanner.hasNextLine()) + { + final String csvLine = scanner.nextLine(); + + final String[] csvElements = csvLine.split(","); + + // Check if line is valid for parsing + if (csvElements.length <= 2) + continue; + + if ("preproc".equals(csvElements[2])) + { + continue; + } + // the first line of these csv files have the information of + // what the values are. We dont need this. + if ("Warning".equals(csvElements[0])) + { + continue; + } + + if (csvElements.length < 8) + { + continue; + } + + // continue if not same file. + String csvFileName = new File(csvElements[4]).getName(); + String inputFileName = new File(file.getPath()).getName(); + if (!csvFileName.endsWith(inputFileName)) + { + continue; + } + + // get the weakness description + String msg = csvElements[7]; + if (msg.startsWith("\"")) + { + msg = msg.substring(1, msg.length()); + } + if (msg.endsWith("\"")) + { + msg = msg.substring(0, msg.length() - 1); + } + + if (msg.trim().startsWith("Parse Error")) + { + try + { + writeToFile("splint: " + msg + "\n"); + } + catch (IOException e) + { + // TODO Auto-generated catch block + e.printStackTrace(); + } + continue; + } + + // get the weakness id. + final String id = csvElements[2]; + // get the linenumber of the weakness. + final Integer lineNumber = Integer.valueOf(csvElements[5]); + // this tool has no offset. + final Integer offset = null; + // get the position of the weakness. + final Integer position = Integer.valueOf(csvElements[6]); + + // This tool is funny in that it doesn't give you the full path + // of the file. Therefore, we must construct the full path + // ourselves. + final int index = csvFileName.lastIndexOf(File.separator) + 1; + final String fileName = path + File.separator + csvFileName.substring(index); + + // if there is a dataElement, use it. + String dataElement = null; + if (msg.split(":").length == 2) + { + dataElement = msg.split(":")[1].trim(); + } + + // if there are valid lines + if (validLines != null) + { + if (lineNumber > 0) + { + // return if the line number is greater than the array + // size. + if (lineNumber < validLines.length) + { + if (validLines[lineNumber]) + { + // pass the required information to the finding + // creator. + creator.create(StringEscapeUtils.unescapeHtml4(msg), id, lineNumber, offset, position, file, dataElement, null); + } + else + { + try + { + FindingCreator.writeToFile("Splint: Not a valid line (uncompiled) " + file.getPath() + ":" + lineNumber + "\n"); + } + catch (IOException e) + { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + } + } + + } + else + { + // pass the required information to the finding creator. + creator.create(StringEscapeUtils.unescapeHtml4(msg), id, lineNumber, offset, position, file, dataElement, null); + } + + // // pass the required information to the finding creator. + // creator.create(StringEscapeUtils.unescapeHtml4(msg), id, + // lineNumber, offset, position, file, dataElement, null); + // + // + // // if there are valid lines + // if (validLines != null) + // { + // // return if the line number is greater than the array size. + // if (lineNumber < validLines.length) + // { + // if (validLines[lineNumber]) + // { + // // create the finding. + // creator.create(StringEscapeUtils.unescapeHtml4(msg), id, + // lineNumber, offset, position, file, dataElement, null); + // } + // } + // + // } + + } + + // delete the file we made in the tmp directory. + // tmpFile.delete(); + } + catch (final FileNotFoundException e) + { + final String msg = "The tools output file could not be found. \"" + tmpFile.getAbsolutePath() + '"'; + LOG.error( msg, e); + throw new ToifException( msg, e); + } + finally + { + if (scanner != null) + scanner.close(); + } + + // return the elements from the finding creator. + return creator.getElements(); + } + + /* + * (non-Javadoc) + * + * @see com.kdmanalytics.toif.framework.toolAdaptor.AbstractAdaptor# + * getAdaptorVendorAddress() + */ + @Override + public String getAdaptorVendorAddress() + { + return "3730 Richmond Rd, Suite 204, Ottawa, ON, K2H 5B9"; + } + + /* + * (non-Javadoc) + * + * @see com.kdmanalytics.toif.framework.toolAdaptor.AbstractAdaptor# + * getAdaptorVendorDescription() + */ + @Override + public String getAdaptorVendorDescription() + { + return "KDM Analytics is a security assurance company providing products and services for threat risk assessment and management, due diligence assessments, and information and data assurance. Leveraging our decades of experience in static analysis, reverse engineering and formal methods, we have created breakthrough products for the automated and systematic investigation of code, data and networks."; + } + + /* + * (non-Javadoc) + * + * @see com.kdmanalytics.toif.framework.toolAdaptor.AbstractAdaptor# + * getAdaptorVendorEmail() + */ + @Override + public String getAdaptorVendorEmail() + { + return "adam@kdmanalytics.com"; + } + + /* + * (non-Javadoc) + * + * @see com.kdmanalytics.toif.framework.toolAdaptor.AbstractAdaptor# + * getAdaptorVendorName() + */ + @Override + public String getAdaptorVendorName() + { + return "KDM Analytics"; + } + + /* + * (non-Javadoc) + * + * @see com.kdmanalytics.toif.framework.toolAdaptor.AbstractAdaptor# + * getAdaptorVendorPhone() + */ + @Override + public String getAdaptorVendorPhone() + { + return "613-627-1011"; + } + + /* + * (non-Javadoc) + * + * @see com.kdmanalytics.toif.framework.toolAdaptor.AbstractAdaptor# + * getGeneratorDescription() + */ + @Override + public String getGeneratorDescription() + { + return "Splint is a tool for statically checking C programs for security vulnerabilities and coding mistakes."; + } + + /* + * (non-Javadoc) + * + * @see + * com.kdmanalytics.toif.framework.toolAdaptor.AbstractAdaptor#getGeneratorName + * () + */ + @Override + public String getGeneratorName() + { + return "splint"; + } + + /* + * (non-Javadoc) + * + * @see com.kdmanalytics.toif.framework.toolAdaptor.AbstractAdaptor# + * getGeneratorVendorAddress() + */ + @Override + public String getGeneratorVendorAddress() + { + return "http://www.splint.org"; + } + + /* + * (non-Javadoc) + * + * @see com.kdmanalytics.toif.framework.toolAdaptor.AbstractAdaptor# + * getGeneratorVendorDescription() + */ + @Override + public String getGeneratorVendorDescription() + { + return "University of Virginia Department of Computer Science"; + } + + /* + * (non-Javadoc) + * + * @see com.kdmanalytics.toif.framework.toolAdaptor.AbstractAdaptor# + * getGeneratorVendorEmail() + */ + @Override + public String getGeneratorVendorEmail() + { + return "info@splint.org"; + } + + /* + * (non-Javadoc) + * + * @see com.kdmanalytics.toif.framework.toolAdaptor.AbstractAdaptor# + * getGeneratorVendorName() + */ + @Override + public String getGeneratorVendorName() + { + return "David Evans"; + } + + /* + * (non-Javadoc) + * + * @see com.kdmanalytics.toif.framework.toolAdaptor.AbstractAdaptor# + * getGeneratorVendorPhone() + */ + @Override + public String getGeneratorVendorPhone() + { + return ""; + } + + /* + * (non-Javadoc) + * + * @see com.kdmanalytics.toif.framework.toolAdaptor.AbstractAdaptor# + * getGeneratorVersion() + */ + @Override + public String getGeneratorVersion() + { + final String[] commands = { "splint", "-help", "version" }; + ProcessBuilder splint = new ProcessBuilder(commands); + try + { + Process splintInstance = splint.start(); + InputStream in = splintInstance.getErrorStream(); + + BufferedReader br = new BufferedReader(new InputStreamReader(in)); + + String strLine; + + while ((strLine = br.readLine()) != null) + { + String[] stringArray = strLine.split(" "); + + if (stringArray[1].trim().equals("3.1.2")) + { + return stringArray[1].trim(); + } + else + { + System.err.println(getAdaptorName() + ": Generator " + stringArray[1] + " found, only version 3.1.2 has been tested"); + return stringArray[1].trim(); + } + } + + } + catch (IOException e) + { + e.printStackTrace(); + } + + return ""; + } + + @Override + public String getRuntoolName() + { + return "splint"; + } + + @Override + public Language getLanguage() + { + return Language.C; + } + + @Override + public boolean acceptsDOptions() + { + return false; + } + + @Override + public boolean acceptsIOptions() + { + return true; + } + +} diff --git a/com.kdmanalytics.toif.splint/src/com/kdmanalytics/toif/splint/Activator.java b/com.kdmanalytics.toif.splint/src/com/kdmanalytics/toif/splint/Activator.java new file mode 100644 index 00000000..ad90ea99 --- /dev/null +++ b/com.kdmanalytics.toif.splint/src/com/kdmanalytics/toif/splint/Activator.java @@ -0,0 +1,37 @@ +/******************************************************************************* + * Copyright (c) 2012 KDM Analytics, Inc. All rights reserved. This program and the + * accompanying materials are made available under the terms of the Open Source + * Initiative OSI - Open Software License v3.0 which accompanies this + * distribution, and is available at http://www.opensource.org/licenses/osl-3.0.php/ + ******************************************************************************/ +package com.kdmanalytics.toif.splint; + + +import org.osgi.framework.BundleActivator; +import org.osgi.framework.BundleContext; + +public class Activator implements BundleActivator { + + private static BundleContext context; + + static BundleContext getContext() { + return context; + } + + /* + * (non-Javadoc) + * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext) + */ + public void start(BundleContext bundleContext) throws Exception { + Activator.context = bundleContext; + } + + /* + * (non-Javadoc) + * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext) + */ + public void stop(BundleContext bundleContext) throws Exception { + Activator.context = null; + } + +} diff --git a/com.kdmanalytics.toif.splint/src/config/SplintAdaptorConfiguration b/com.kdmanalytics.toif.splint/src/config/SplintAdaptorConfiguration new file mode 100644 index 00000000..71ec142d --- /dev/null +++ b/com.kdmanalytics.toif.splint/src/config/SplintAdaptorConfiguration @@ -0,0 +1,1934 @@ +syntax=Other.Implementation;SFP--1;CWE-398 +sysunrecog=;SFP--1;CWE--1; + +#/* +# ** Null Dereferences (Manual Section 2) +# */ + +preproc=Other;SFP--1;CWE--1 + +null=;SFP-7;CWE-476 +#misuses of null pointer +#A possibly null pointer is misused (sets nullderef, nullpass, nullref, nullassign, and nullstate). + +nullderef=;SFP-7;CWE-476 +#possible dereferencce of null pointer +#A possibly null pointer is dereferenced. Value is +#either the result of a function which may return null +#(in which case, code should check it is not null), or a +#global, parameter or structure field declared with the +#null qualifier. + +nullpass=;SFP-7;CWE-476 +#possibly null pointer passed as formal with no null annotation +#A possibly null pointer is passed as a parameter corresponding to +#a formal parameter with no /*@null@*/ annotation. If NULL +#may be used for this parameter, add a /*@null@*/ annotation +#to the function parameter declaration. + +nullret=;SFP-7;CWE-476 +#possibly null pointer returned as result with no null annotation +#Function returns a possibly null pointer, but is not declared +#using /*@null@*/ annotation of result. If function may +#return NULL, add /*@null@*/ annotation to the return +#value declaration. + +nullstate=;SFP-7;CWE-476 +#possibly null pointer reachable from a reference with no null annotation +#A possibly null pointer is reachable from a parameter or global +#variable that is not declared using a /*@null@*/ annotation. + +nullassign=;SFP-4;CWE-684 +#inconsistent assignment or initialization involving null pointer +#A reference with no null annotation is assigned or initialized +#to NULL. Use /*@null@*/ to declare the reference as +#a possibly null pointer. + +nullinit=;SFP-4;CWE-684 +#inconsistent initialization involving null pointer +#A reference with no null annotation is initialized +#to NULL. Use /*@null@*/ to declare the reference as +#a possibly null pointer. + + + + + +# /* +# ** Undefined Values (Section 3) +# */ + +usedef=;SFP-1;CWE-457 +#use before definition +#An rvalue is used that may not be initialized to a value on some execution path. + +mustdefine=;SFP-1;CWE-457 +#out storage not defined before return or scope exit +#An out parameter or global is not defined before control is transferred. + +uniondef=;SFP-1;CWE-456 +#at least one field of a union must be defined +#No field of a union is defined. Generally, one field of a union is +#expected to be defined. + +compdef=;SFP-1;CWE-456 +#parameter, return value or global completely defined +#Storage derivable from a parameter, return value or global is +#not defined. Use /*@out@*/ to denote passed or returned +#storage which need not be defined. + +fullinitblock=;SFP-1;CWE-456 +#initializer sets all fields +#Initializer does not set every field in the structure. + +initallelements=;SFP-1;CWE-456 +#initializer defines all array elements +#Initializer does not define all elements of a declared array. + +initsize=;SFP-1;CWE-684 +#initializer defines extra array elements +#Initializer block contains more elements than the size of a declared array. + +impouts=;SFP-1;CWE-684 +#pointer parameters to unspecified functions may be implicit out parameters + + + + + + +# /* +# ** Types (Section 4) +# */ + +incondefs=;SFP-1;CWE-710 +#A function, variable or constant is redefined with a different type. + +matchfields=;SFP--1;CWE-710 +#A struct, union or enum type is redefined with inconsistent fields or members. + +fcnderef=;SFP--1;CWE-398 +#dereferencce of a function type +#A function type is dereferenced. The ANSI standard allows this +#because of implicit conversion of function designators, however the +#dereference is unnecessary. + +realcompare=Other.Design;SFP--1;CWE-480 +#dangerous equality comparison between reals (dangerous because of inexact +#floating point representations) +#Two real (float, double, or long double) values are compared +#directly using == or != primitive. +#This may produce unexpected results since floating point +#representations are inexact. Instead, compare the difference to + +realrelatecompare=Other.Design;SFP--1;CWE-480 +#possibly dangerous relational comparison between reals (dangerous because of inexact +#floating point representations) +#Two real (float, double, or long double) values are compared +#directly using < or >. +#This may produce unexpected results since floating point +#representations are inexact. Instead, compare the difference to + +unsignedcompare=;SFP--1;CWE-398 +#comparison using <, <=, >= between an unsigned integral and zero constant +#An unsigned value is used in a comparison with zero in a way that is either a bug or confusing. + +ptrarith=;SFP-1;CWE-480 +#arithmetic involving pointer and integer +#Pointer arithmetic using pointer and integer. + +nullptrarith=;SFP-1;CWE-704 +#arithmetic involving possibly null pointer and integer +#Pointer arithmetic using a possibly null pointer and integer. + +ptrcompare=;SFP-1;CWE-480 +#comparison between pointer and number +#A pointer is compared to a number. + +strictops=;SFP-1;CWE-480 +#primitive operation does not type check strictly +#A primitive operation does not type check strictly. + +bitwisesigned=;SFP-1;CWE-480 +#a bitwise logical operator does not have unsigned operands +#An operand to a bitwise operator is not an unsigned values. This +#may have unexpected results depending on the signed +#representations. + +shiftnegative=;SFP-1;CWE-480 +#a shift right operand may be negative +#The right operand to a shift operator may be negative (behavior undefined). + +shiftimplementation=;SFP-1;CWE-480 +#a shift left operand may be negative +#The left operand to a shift operator may be negative (behavior is implementation-defined). + +sizeoftype=;SFP-1;CWE-467 +#sizeof operator has a type argument +#Operand of sizeof operator is a type. (Safer to use expression, +#int *x = sizeof (*x); instead of sizeof (int).) + +sizeofformalarray=;SFP-1;CWE-467 +#sizeof operator has an array formal parameter argument +#Operand of a sizeof operator is a function parameter declared as +#an array. The value of sizeof will be the size of a pointer to the +#element type, not the number of elements in the array. + +fixedformalarray=;SFP-7;CWE-710 +#formal parameter of type array is declared with size +#A formal parameter is declared as an array with size. The size of the array +#is ignored in this context, since the array formal parameter is treated +#as a pointer. + +incompletetype=;SFP--1;CWE-710 +#formal parameter has an incomplete type +#A formal parameter is declared with an incomplete type. + +formalarray=;SFP-7;CWE-469 +#formal parameter is an array +#A formal parameter is declared as an array. This can be confusing, since +#a formal array parameter is treated as a pointer. + + + + + + + +# /* +# ** Booleans (4.2) +# */ + +likelybool=Other.Implementation;SFP--1;CWE-710 +#type name is probably a boolean type but does not match default +#boolean type name, \bool\ and alternate name is not set +#Use the -booltype, -boolfalse and -booltrue flags to change the +#name of the default boolean type. + +boolcompare=;SFP--1;CWE-398 +#comparison between bools (dangerous because of multiple true values) +#Two bool values are compared directly using a C primitive. This +#may produce unexpected results since all non-zero values are +#considered true, so different true values may not be equal. +#The file bool.h (included in splint/lib) provides bool_equal +#for safe bool comparisons. + +boolops=;SFP-1;CWE-480 +#primitive operation (!, && or ||) does not has a boolean argument +#The operand of a boolean operator is not a boolean. Use +ptrnegate +#to allow ! to be used on pointers. + +ptrnegate=;SFP-1;CWE-480 +#allow ! to be used on pointer operand +#The operand of ! operator is a pointer. + +predassign=;SFP-1;CWE-481 +#condition test (if, while or for) is an assignment +#The condition test is an assignment expression. Probably, you mean +#to use == instead of =. If an assignment is intended, add an +#extra parentheses nesting (e.g., if ((a = b)) ...) to suppress +#this message. + +predbool=;SFP-1;CWE-480 +#type of condition test (if, while or for) not bool (sets predboolint, +#predboolptr and predboolothers) +#Test expression type is not boolean. + +predboolothers=;SFP-1;CWE-480 + +predboolint=;SFP-1;CWE-704 +#type of condition test (if, while or for) is an integral type +#Test expression type is not boolean or int. + +predboolptr=;SFP-1;CWE-704 +#type of condition test (if, while or for) is a pointer +#Test expression type is not boolean. + +predboolOthers=;SFP--1;CWE-398 +#type of condition test (if, while or for) not bool, int or pointer +#Test expression type is not boolean. + + + + + + + +# /* +# ** 4.3 Abstract types +# */ + +abstract=;SFP--1;CWE-710 +#data abstraction barriers +#An abstraction barrier is broken. If necessary, use /*@access @*/ to allow access to an abstract type. + +abstractcompare=;SFP-1;CWE-480 +#object equality comparison on abstract type operands +#An object comparison (== or !=) is used on operands of abstract type. + +numabstract=;SFP--1;CWE-710 +#data abstraction barriers +#An abstraction barrier involving a numabstract type is broken. If necessary, use /*@access @*/ to allow access to a numabstract type. + +numabstractcast=;SFP-1;CWE-710 +#numeric literal cast to numabstract type +#A numeric literal is cast to a numabstract type. + +numabstractlit=;SFP-1;CWE-710 +#numeric literal can used as numabstract type +#To allow a numeric literal to be used as a numabstract type, use +numabstractlit. + +numabstractindex=;SFP--1;CWE-398 +#a numabstract type can be used to index an array +#To allow numabstract types to index arrays, use +numabstractindex. + +numabstractprint=;SFP-1;CWE-704 +#a numabstract value is printed using %d format code +#A numabstract value is printed usind %d format code in a printf. + +impabstract=;SFP--1;CWE--1 +#assume user type definitions are abstract (unless /*@concrete@*/ is used) + + +charindex=;SFP--1;CWE-398 + + +# /* 4.3.1 Access */ + +accessmodule=;SFP--1;CWE--1 +#allow access to abstract types in definition module +#The representation of an abstract type defined in . is +#accessible anywhere in a file named .. + +#accessfile=;SFP--1;CWE--1 +#allow access to abstract types by file name convention +#The representation of an abstract type named is +#accessible anywhere in a file named .. + +accessczech=;SFP--1;CWE--1 +#allow access to abstract types by czech naming convention +#The representation of an abstract type named is accessible +#in the definition of a function or constant named _ + +accessslovak=;SFP--1;CWE--1 +#allow access to abstract types by slovak naming convention +#The representation of an abstract type named is accessible +#in the definition of a function or constant named + +accessczechoslovak=;SFP--1;CWE--1 +#allow access to abstract types by czechoslovak naming convention +#The representation of an abstract type named is accessible +#in the definition of a function or constant named _ or + +accessall=;SFP--1;CWE--1 +#set accessmodule, accessfile and accessczech +#Sets accessmodule, accessfile and accessczech + + + + + + + +# /* 4.3.2 Mutability */ + + +mutrep=;SFP--1;CWE-710 +#representation of mutable type has sharing semantics +#LCL semantics requires that a mutable type exhibits sharing semantics. +#In order for objects to be shared a indirection is necessary in the representation. +#A mutable type may be represented by a pointer or an abstract mutable type. Handles +#into static data are fine, too, but will generate this error message unless it is suppressed. + + + + + + +# /* +# ** Memory Management (5) +# */ + + +# /* Deallocation Errors */ + + +mustfreefresh=;SFP-14;CWE-401 +#freshly allocated storage not released before return or scope exit +#A memory leak has been detected. Storage allocated locally +#is not released before the last reference to it is lost. + +mustfreeonly=;SFP-14;CWE-401 +#only storage not released before return or scope exit +#A memory leak has been detected. Only-qualified storage is not released before the last +#reference to it is lost. + +mustfree=;SFP-14;CWE-401 +#fresh or only storage not released before return or scope exit (sets mustfreefresh and mustfreeonly) +#A memory leak has been detected. + +usereleased=;SFP-15;CWE-416 +#storage used after release +#Memory is used after it has been released (either by passing +#as an only param or assigning to an only global). + +strictusereleased=;SFP-15;CWE-416 +#element used after it may have been released +#Memory (through fetch) is used after it may have been released +#(either by passing as an only param or assigning to an only global). + +compdestroy=;SFP-14;CWE-401 +#all only references derivable from void pointer out only parameter are released +#A storage leak due to incomplete deallocation of a structure or deep +#pointer is suspected. Unshared storage that is reachable from +#a reference that is being deallocated has not yet been deallocated. +#Splint assumes when an object is passed +#as an out only void pointer that the outer object will be +#deallocated, but the inner objects will not. + + +branchstate=;SFP--1;CWE--1 +#storage has inconsistent states of alternate paths through a branch +#The state of a variable is different depending on which branch +#is taken. This means no annotation can sensibly be applied +#to the storage. + +strictbranchstate=;SFP--1;CWE--1 +#storage through array fetch has inconsistent states of alternate +#paths through a branch +#The state of a variable through an array fetch is different depending +#on which branch is taken. This means no annotation can sensibly be applied +#to the storage. + +compmempass=;SFP--1;CWE-710 +#actual parameter matches alias kind of formal parameter completely +#Storage derivable from a parameter does not match the alias kind +#expected for the formal parameter. + +stackref=;SFP-1;CWE-562 +#external reference to stack-allocated storage is created +#A stack reference is pointed to by an external reference when the +#function returns. The stack-allocated storage is destroyed +#after the call, leaving a dangling reference. + +memtrans=;SFP--1;CWE-710 +#memory transfer errors (sets all *trans flags) +#Memory is transferred in a way that violates annotations. + +dependenttrans=;SFP--1;CWE-710 +#dependent transfer errors +#Dependent storage is transferred to a non-dependent reference. + +newreftrans=;SFP--1;CWE--1 +#new reference transfer to reference counted reference +#A new reference is transferred to a reference counted reference. + +onlytrans=;SFP--1;CWE-701 +#only storage transferred to non-only reference (memory leak) +#The only reference to this storage is transferred to another +#reference (e.g., by returning it) that does not have the +#only annotation. This may lead to a memory leak, since the +#new reference is not necessarily released. + +onlyunqglobaltrans=;SFP-14;CWE-401 +#only storage transferred to an unqualified global or +#static reference (memory leak) +#The only reference to this storage is transferred to another +#reference that does not have an aliasing annotation. +#This may lead to a memory leak, since the +#new reference is not necessarily released. + +ownedtrans=;SFP--1;CWE-710 +#owned storage transferred to non-owned reference (memory leak) +#The owned reference to this storage is transferred to another +#reference (e.g., by returning it) that does not have the +#owned annotation. This may lead to a memory leak, since the +#new reference is not necessarily released. + +freshtrans=;SFP--1;CWE-710 +#fresh storage transferred to non-only reference (memory leak) +#Fresh storage (newly allocated in this function) is transferred +#in a way that the obligation to release storage is not +#propagated. Use the /*@only@*/ annotation to indicate +#the a return value is the only reference to the returned +#storage. + +sharedtrans=;SFP--1;CWE-710 +#shared storage transferred to non-shared reference +#Shared storage is transferred to a non-shared reference. The other +#reference may release storage needed by this reference. + +temptrans=;SFP--1;CWE-710 +#temp storage transferred to non-temporary reference +#Temp storage (associated with a formal parameter) is transferred +#to a non-temporary reference. The storage may be released +#or new aliases created. + +kepttrans=;SFP--1;CWE-710 +#kept storage transferred to non-temporary reference +#storage is transferred +#to a non-temporary reference after being passed as keep parameter. The storage may be released +#or new aliases created. + +keeptrans=;SFP--1;CWE-710 +#keep storage transferred inconsistently +#Keep storage is transferred inconsistently --- either in a way +#that may add a new alias to it, or release it. + +immediatetrans=;SFP--1;CWE-398 +#an immediate address (result of &) is transferred inconsistently +#An immediate address (result of & operator) is transferred +#inconsistently. + +refcounttrans=;SFP--1;CWE-398 +#reference counted storage is transferred in an inconsistent way +#Reference counted storage is transferred in a way that may not +#be consistent with the reference count. + +statictrans=;SFP--1;CWE-398 +#static storage is transferred in an inconsistent way +#Static storage is transferred in an inconsistent way. + +unqualifiedtrans=;SFP--1;CWE-398 +#unqualified storage is transferred in an inconsistent way +#Unqualified storage is transferred in an inconsistent way. + +staticinittrans=;SFP--1;CWE-398 +#static storage is used as an initial value in an inconsistent way +#Static storage is used as an initial value in an inconsistent way. + +unqualifiedinittrans=;SFP--1;CWE-398 +#unqualified storage is used as an initial value in an inconsistent way +#Unqualified storage is used as an initial value in an inconsistent way. + +readonlytrans=;SFP--1;CWE-398 +#report memory transfer errors for initializations to read-only string literals +#A read-only string literal is assigned to a non-observer reference. + +passunknown=;SFP--1;CWE-710 +#passing a value as an un-annotated parameter clears its annotation + + + + + +# /* 5.3 Implicit Memory Annotations */ + +readonlystrings=;SFP-12;CWE-590 +#string literals are read-only (error if one is modified or released) +#String literals are read-only. An error is reported +#if a string literal may be modified or released. + +memimp=;SFP--1;CWE--1 +#memory errors for unqualified storage + +paramimptemp=;SFP--1;CWE--1 +#assume unannotated parameter is temp + +globimponly=;SFP--1;CWE--1 +#assume unannotated global storage is only + +retimponly=;SFP--1;CWE--1 +#assume unannotated returned storage is only + +structimponly=;SFP--1;CWE--1 +#assume unannotated structure field is only + +specglobimponly=;SFP--1;CWE--1 +#assume unannotated global storage is only + +specretimponly=;SFP--1;CWE--1 +#assume unannotated returned storage is only + +specstructimponly=;SFP--1;CWE--1 +#assume unannotated structure field is only + + + + + + +# /* Reference Counting */ + +# /* +# ** 6. Sharing +# */ + +# /* 6.1 Aliasing warnings */ + +aliasunique=;SFP--1;CWE-710 +#unique parameter is aliased +#A unique or only parameter is aliased by some other parameter or visible global. + +mayaliasunique=;SFP--1;CWE-710 +#unique parameter may be aliased +#A unique or only parameter may be aliased by some other parameter or visible global. + +mustnotalias=;SFP--1;CWE-710 +#temp storage aliased at return point or scope exit +#An alias has been added to a temp-qualifier parameter or global that is visible externally when the function returns. If the aliasing is needed, use the /*@shared@*/ annotation to indicate that new aliases to the parameter may be created. + +retalias=;SFP-1;CWE-562 +#function returns alias to parameter or global +#The returned value shares storage with a parameter or global. If a parameter is to be returned, use the returned qualifier. If the result is not modified, use the observer qualifier on the result type. otherwise, exposed can be used, but limited checking is done. 0, 0 + + + + + +# /* Global aliasing */ + +globalias=;SFP--1;CWE-710 +#function returns with global aliasing external state (sets +#checkstrictglobalias, checkedglobalias, checkmodglobalias and +#uncheckedglobalias) +#A global variable aliases externally-visible state when the function returns. + +checkstrictglobalias=;SFP--1;CWE-710 +#function returns with a checkstrict global aliasing external state +#A global variable aliases externally-visible state when the function returns. + +checkedglobalias=;SFP--1;CWE-710 +#function returns with a checked global aliasing external state +#A global variable aliases externally-visible state when the function returns. + +checkmodglobalias=;SFP--1;CWE-710 +#function returns with a checkmod global aliasing external state +#A global variable aliases externally-visible state when the function returns. + +uncheckedglobalias=;SFP--1;CWE-710 +#function returns with an unchecked global aliasing external state +#A global variable aliases externally-visible state when the function returns. + + + + + + +# /* 6.2 Exposure */ + +exposetrans=;SFP-25;CWE-454 +#exposure transfer errors +#Exposed storage is transferred to a non-exposed, non-observer reference. + +observertrans=;SFP-25;CWE-454 +#observer transfer errors +#Observer storage is transferred to a non-observer reference. + +repexpose=;SFP-25;CWE-454 +#abstract representation is exposed (sets assignexpose, retexpose, and castexpose) +#The internal representation of an abstract type is visible to the +#caller. This means clients may have access to a pointer +#into the abstract representation. + +retexpose=;SFP-25;CWE-454 +#abstract representation is exposed (return values only) +#The return value shares storage with an instance of an abstract +#type. This means clients may have access to a pointer into +#the abstract representation. Use the observer qualifier to +#return exposed storage that may not be modified by the +#client. Use the exposed qualifier to return modifiable +#(but not deallocatable) exposed storage (dangerous). + +assignexpose=;SFP-25;CWE-454 +#abstract representation is exposed (assignments only) +#Storage internal to the representation of an abstract type is +#assigned to an external pointer. This means clients may +#have access to a pointer into the abstract representation. +#If the external pointer is a parameter, the exposed qualifier +#can be used to allow the assignment, however, this is +#considered dangerous programming practice. + +castexpose=;SFP-25;CWE-454 +#abstract representation is exposed through a cast +#Storage internal to the representation of an abstract type is exposed +#through a type cast. This means clients may have access to a +#pointer into the abstract representation. + +redundantsharequal=;SFP--1;CWE-710 +#declaration uses observer qualifier that is always true +#A declaration of an immutable object uses a redundant observer qualifier. + +misplacedsharequal=;SFP--1;CWE-710 +#declaration of unsharable storage uses sharing annotation +#A declaration of an unsharable object uses a sharing annotation. + + + + + + +# /* +# ** 7. Function Interfaces +# */ + +# /* 7.1 Modifications */ + +mods=Other.Implementation;SFP--1;CWE-710 +#unspecified modification of caller-visible state +#An externally-visible object is modified by a function, but not +#listed in its modifies clause. + +mustmod=Other.Implementation;SFP--1;CWE-710 +#specified modification is not detected +#An object listed in the modifies clause is not modified by the +#implementation of the function. The modification may not +#be detected if it is done through a call to an unspecified +#function. + +modobserver=Other.Implementation;SFP--1;CWE-710 +#possible modification of observer storage +#Storage declared with observer is possibly modified. Observer +#storage may not be modified. + +modobserveruncon=Other.Implementation;SFP--1;CWE-710 +#possible modification of observer storage through unconstrained call +#Storage declared with observer may be modified through a call to an +#unconstrained function. + +modinternalstrict=Other.Implementation;SFP--1;CWE-710 +#possible modification of internal storage through function call +#A function that modifies internalState is called from a function that +#does not list internalState in its modifies clause + +modunspec=Other.Implementation;SFP--1;CWE-710 +#modification in unspecified functions (sets modnomods, +#modglobunspec and modstrictglobsunspec) + +modnomods=Other.Implementation;SFP--1;CWE-710 +#modification in a function with no modifies clause +#An externally-visible object is modified by a function with no +#/*@modifies@*/ comment. The /*@modifies ... @*/ control +#comment can be used to give a modifies list for an +#unspecified function. + +moduncon=Other.Implementation;SFP--1;CWE-710 +#possible modification through a call to an unconstrained function +#An unconstrained function is called in a function body where +#modifications are checked. Since the unconstrained function +#may modify anything, there may be undetected modifications in +#the checked function. + +modunconnomods=Other.Implementation;SFP--1;CWE-710 +#possible modification through a call to an unconstrained function in +#a function with no modifies clause +#An unconstrained function is called in a function body where +#modifications are checked. Since the unconstrained function +#may modify anything, there may be undetected modifications in +#the checked function. + +globsimpmodsnothing=Other.Implementation;SFP--1;CWE-710 +#functions declared with a globals list but no modifies clause are +#assumed to modify nothing +#An implicit modifies nothing clause is assumed for a function +#declared with a globals list but not modifies clause. + +modsimpnoglobs=Other.Implementation;SFP--1;CWE-710 +#functions declared with a modifies clause but no globals list +#are assumed to use no globals +#An implicit empty globals list is assumed for a function +#declared with a modifies clause but no globals list. + + + + + + +# /* +# ** Globals +# */ + +globstate=;SFP-7;CWE-684 +#returns with global in inconsistent state (null or undefined) +#A global variable does not satisfy its annotations when control is transferred. + + +globuse=;SFP--1;CWE-710 +#global listed for a function not used +#A global variable listed in the function's globals list is not used +#in the body of the function. + +internalglobs=;SFP--1;CWE-710 +#use of internalState +#A called function uses internal state, but the globals list for the +#function being checked does not include internalState + +internalglobsnoglobs=;SFP--1;CWE-710 +#use of internalState (in function with no globals list) +#A called function uses internal state, but the function being checked +#has no globals list + +warnmissingglobs=;SFP--1;CWE-710 +#global variable used in modifies clause is not listed in globals list +#A global variable is used in the modifies clause, but it is not listed in +#the globals list. The variable will be added to the globals list. + +warnmissingglobsnoglobs=;SFP--1;CWE-710 +#global variable used in modifies clause in a function with no globals list +#A global variable is used in the modifies clause, but the function +#has no globals list. The variable will be added to the globals list. + +globnoglobs=;SFP--1;CWE-710 +#use of checked global in a function with no globals list or specification +#A specified global variable is used in the function, but not listed +#in its globals list. Without +globnoglobs, only globals +#declared with /*@checkedstrict@*/ will produce use +#errors in functions without globals +#lists. The /*@globals ... @*/ control comment can be used to give +#a globals list for an unspecified function. + +modglobs=;SFP--1;CWE-710 +#undocumented modification of a checked global variable +#A checked global variable is modified by the function, but not listed in +#its modifies clause. + +modglobsnomods=;SFP--1;CWE-710 +#undocumented modification of a checked global variable in a function +#declared with no modifies clause +#A checked global variable is modified by the function, but not listed in +#its modifies clause. + +modstrictglobsnomods=;SFP--1;CWE-710 +#undocumented modification of a strict checked global variable in a +#function declared with no modifies clause +#A checked global variable is modified by the function, but not listed in +#its modifies clause. + +modglobsunchecked=;SFP--1;CWE-710 +#undocumented modification of an unchecked checked global variable +#An unchecked global variable is modified by the function, but not listed in +#its modifies clause. + + + + + + + + +# /* +# ** State Clauses +# */ + +# /* +# ** 8. Control Flow +# */ + +# /* 8.1 Execution */ + +noret=;SFP--1;CWE-398 +#path with no return detected in non-void function +#There is a path through a function declared to return a value on +#which there is no return statement. This means the execution +#may fall through without returning a meaningful result to +#the caller. + +emptyret=;SFP--1;CWE--1 +#empty return in function declared to return value + +alwaysexits=;SFP-1;CWE-570 +#loop predicate always exits + + + + + +# /* 8.2 Undefined Behavior */ + +evalorder=;SFP--1;CWE-710 +#code has unspecified or implementation-dependent behavior +#because of order of evaluation +#Code has unspecified behavior. +#Order of evaluation of function parameters or subexpressions +#is not defined, so if a value is used and modified in different +#places not separated by a sequence point constraining +#evaluation order, then the result of the expression is +#unspecified. + +evalorderuncon=;SFP--1;CWE-88 +#code involving call to unspecified function has undefined or implementation-dependent behavior +#Code involving a call to function with no modifies or globals clause +#may have undefined or implementation-dependent behavior (Splint assumes the +#unconstrained call may modify any reachable state or use any global). Add a +#specification for the function. + + + + + + +# /* 8.3 Problematic Control Structures */ + +# /* 8.3.1 Infinite Loops */ + +infloops=;SFP--1;CWE-835 +#likely infinite loop is detected +#This appears to be an infinite loop. Nothing in the body of the +#loop or the loop test modifies the value of the loop test. +#Perhaps the specification of a function called in the loop +#body is missing a modification. + +infloopsuncon=;SFP--1;CWE-835 +#likely infinite loop is detected (may result from unconstrained function) +#This appears to be an infinite loop. Nothing in the body of the +#loop or the loop test modifies the value of the loop test. +#There may be a modification through a call to an unconstrained +#function, or an unconstrained function in the loop test may use +#a global variable modified by the loop body. + + + + + + +# /* 8.3.2 Switches */ + +casebreak=;SFP-4;CWE-484 +#non-empty case in a switch without preceding break +#Execution falls through from the previous case (use /*@fallthrough@*/ to mark fallthrough cases). 0, 0 + +misscase=;SFP--1;CWE-230 +#switch on enum type missing case for some value +#Not all values in an enumeration are present as cases in the switch. + +firstcase=;SFP--1;CWE-710 +#first statement in switch is not a case +#The first statement after a switch is not a case. + +duplicatecases=;SFP--1;CWE-697 +#duplicate cases in switch +#Duplicate cases in switch. + + + + + + +# /* 8.3.3 Deep Breaks */ + +deepbreak=;SFP--1;CWE-710 +#break inside nested while or for or switch +#A break statement appears inside the body of a nested while, for or +#switch statement. Sets looploopbreak, loopswitchbreak, +#switchloopbreak, switchswitchbreak, and looploopcontinue. + +looploopbreak=;SFP--1;CWE-710 +#break inside nested while or for +#A break statement appears inside the body of a nested while or for +#statement. This is perfectly reasonable code, but check that +#the break is intended to break only the inner loop. The +#break statement may be preceded by /*@innerbreak@*/ to suppress +#the message for this break only. + +switchloopbreak=;SFP--1;CWE-710 +#break in loop inside switch +#A break statement appears inside the body of a while or for +#statement within a switch. This is perfectly reasonable code, but check that +#the break is intended to break only the inner loop. The +#break statement may be preceded by /*@loopbreak@*/ to suppress +#the message for this break only. + +loopswitchbreak=;SFP--1;CWE-710 +#break in switch inside loop +#A break statement appears inside a switch statement within a while or +#for loop. This is perfectly reasonable code, but check that +#the break is intended to break only the inner loop. The +#break statement may be preceded by /*@switchbreak@*/ to suppress +#the message for this break only. + +switchswitchbreak=;SFP--1;CWE-710 +#break in switch inside switch +#A break statement appears inside a switch statement within another +#switch statement. This is perfectly reasonable code, but check that +#the break is intended to break only the inner switch. The +#break statement may be preceded by /*@innerbreak@*/ to suppress +#the message for this break only. + +looploopcontinue=;SFP--1;CWE-710 +#continue inside nested loop +#A continue statement appears inside a loop within a loop. +#This is perfectly reasonable code, but check that +#the continue is intended to continue only the inner loop. The +#continue statement may be preceded by /*@innercontinue@*/ to suppress +#the message for this continue only. + + + + +# /* 8.3.4 Loop and If Bodies */ + +whileempty=;SFP--1;CWE--398 +#a while statement has no body +#While statement has no body. + +whileblock=;SFP--1;CWE-710 +#the body of a while statement is not a block +#While body is a single statement, not a compound block. + +forempty=;SFP--1;CWE-398 +#a for statement has no body +#For statement has no body. + +forblock=;SFP--1;CWE-710 +#the body of a for statement is not a block +#Loop body is a single statement, not a compound block. + +ifempty=;SFP--1;CWE-710 +#an if statement has no body +#If statement has no body. + +ifblock=;SFP--1;CWE-710 +#the body of an if statement is not a block +#If body is a single statement, not a compound block. + +allempty=;SFP--1;CWE-710 +#an if, while or for statement has no body (sets ifempty, +#whileempty and forempty + +allblock=;SFP--1;CWE-710 +#the body of an if, while or for statement is not a block +#(sets ifblock, whileblock and forblock) +#Body is a single statement, not a compound block. + + + + + +# /* 8.3.5 Complete Logic */ + +elseifcomplete=;SFP--1;CWE-710 +#if ... else if chains must have final else +#There is no final else following an else if construct. + + + + + +# /* 8.4 Suspicious Statements */ + +unreachable=;SFP-2;CWE-561 +#unreachable code detected +#This code will never be reached on any possible execution. + + + + + +# /* 8.4.1 Statements with No Effects */ + +noeffect=;SFP--1;CWE-398 +#statement with no effect +#Statement has no visible effect --- no values are modified. + +noeffectuncon=;SFP--1;CWE-710 +#statement with no effect (except possibly through call to +#unconstrained function) +#Statement has no visible effect --- no values are modified. It may +#modify something through a call to an unconstrained function. + + + + + +# /* 8.4.2 Ignored Return Values */ + +retval=;SFP-4;CWE-252 +#return value ignored (sets retvalint, retvalbool and retvalother) +#Result returned by function call is not used. If this is intended, +# cast result to (void) to eliminate message. + +retvalother=;SFP-4;CWE-252 +#return value of type other than bool or int ignored +#Result returned by function call is not used. If this is intended, +# can cast result to (void) to eliminate message. + +retvalbool=;SFP-4;CWE-252 +#return value of manifest type bool ignored +#Result returned by function call is not used. If this is intended, +# can cast result to (void) to eliminate message. + +retvalint=;SFP-4;CWE-252 +#return value of type int ignored +#Result returned by function call is not used. If this is intended, +# can cast result to (void) to eliminate message. + + + + + +# /* +# ** 9. Buffer Sizes +# */ + +nullterminated=;SFP-11;CWE-170 +#misuse of nullterminated allocation +#A possibly non-nullterminated string/memory is used/referenced as a nullterminated one. + +bounds=;SFP-8;CWE-119 +#memory bounds checking (sets boundsread and boundswrite) +#Memory read or write may be out of bounds of allocated storage. + +likelybounds=;SFP-8;CWE-119 +#memory bounds checking (sets likelyboundsread and likelyboundswrite) +#Memory read or write may be out of bounds of allocated storage. + +likelyboundsread=;SFP-8;CWE-119 +#likely out of bounds read +#A memory read references memory beyond the allocated storage. + +likelyboundswrite=;SFP-8;CWE-119 +#likely buffer overflow from an out of bounds write +#A memory write may write to an address beyond the allocated buffer. + +boundsread=;SFP-8;CWE-125 +#possible out of bounds read +#A memory read references memory beyond the allocated storage. + +boundswrite=;SFP-8;CWE-787 +#possible buffer overflow from an out of bounds write +#A memory write may write to an address beyond the allocated buffer. + + + + + +/*drl7x added 6/18/01 */ + +checkpost=;SFP--1;CWE-710 +#unable to verify predicate in ensures clause +#The function implementation may not satisfy a post condition given in an ensures clause. + +impboundsconstraints=;SFP--1;CWE--1 +#generate implicit constraints for functions + + + +# /* evans added 2003-06-08 */ + +allocmismatch=;SFP-1;CWE-681 +#type conversion involves storage of non-divisble size + + + + + +# /* +# ** 10. Extensible Checking +# */ + + +statetransfer=;SFP--1;CWE-682 +#storage has been transfered with invalid state +#Transfer violates user-defined state rules. + +statemerge=;SFP--1;CWE-372 +#control paths merge with storage in incompatible states +#Control path merge violates user-defined state merge rules. + + + + + +# /* +# ** 11. Macros +# */ + +macroredef=;SFP--1;CWE-710 +#macro redefined +#A macro is defined in more than one place. + +macrounrecog=;SFP--1;CWE--1 +#unrecognized identifier in macro +#An unrecognized identifier appears in a macro. If the identifier +#is defined before the macro is used, then this is okay. + + + + + +# /* 11.1 Constant Macros */ + +macroconstdecl=;SFP--1;CWE-710 +#non-parameterized macro without prototype or specification +#Macro constant has no declaration. Use /*@constant ...@*/ to +#declare the macro. + +macroconstdistance=;SFP--1;CWE-710 +#macro constant name does not match nearby name +#Macro constant name does matches name of a previous declaration, but they are not near each other. + + + + + +# /* 11.2 Function-like Macros */ + +macrostmt=;SFP--1;CWE-710 +#macro definition is syntactically not equivalent to function +#A macro is defined in a way that may cause syntactic problems. +#If the macro returns a value, use commas to separate expressions; +#otherwise, use do while (FALSE) construct. + +macroempty=;SFP--1;CWE-398 +#macro definition for is empty +#A macro definition has no body. + +macroparams=;SFP--1;CWE-710 +#macro parameter not used exactly once +#A macro parameter is not used exactly once in all possible +#invocations of the macro. To behave like a function, +#each macro parameter must be used exactly once on all +#invocations of the macro so that parameters with +#side-effects are evaluated exactly once. Use /*@sef@*/ to +#denote parameters that must be side-effect free. + +macroret=;SFP--1;CWE-710 +#return statement in macro body +#The body of a macro declared as a function uses a return statement. +#This exhibits behavior that +#could not be implemented by a function. + +macroassign=;SFP--1;CWE-710 +#assignment to a macro parameter +#A macro parameter is used as the left side of an +#assignment expression. This exhibits behavior that +#could not be implemented by a function. + +macroparens=;SFP--1;CWE-710 +#macro parameter used without parentheses (in potentially dangerous context) +#A macro parameter is used without parentheses. This could be +#dangerous if the macro is invoked with a complex expression +#and precedence rules will change the evaluation inside the macro. + +macrodecl=;SFP--1;CWE-710 +#macro without prototype or specification (sets macrofcndecl and macroconstdecl) +#Argument checking cannot be done well for macros without prototypes +#or specifications, since the types of the arguments are unknown. + +macrofcndecl=;SFP--1;CWE-710 +#parameterized macro without prototype or specification +#Function macro has no declaration. + + + + + + +# /* 11.2.1 Side Effect Free Parameters */ + +sefparams=;SFP--1;CWE-710 +#a parameter with side-effects is passed as a sef parameter +#An actual parameter corresponding to a sef parameter may have a side-effect. + +sefuncon=;SFP--1;CWE-710 +#a parameter with unconstrained side-effects is passed as a sef parameter +#An actual parameter corresponding to a sef parameter involves a call +#to a procedure with no modifies clause that may have a side-effect. + + + + + + +# /* 11.3 Controlling Macro Checking */ + +constmacros=;SFP--1;CWE--1 +#check all macros without parameter lists as constants +#Every non-parameterized macro (not preceded by /*@notfunction@*/) +#is checked as a constant. + +fcnmacros=;SFP--1;CWE--1 +#check all macros with parameter lists as functions +#Every parameterized macro (not preceded by /*@notfunction@*/) +#is checked as a function. + +allmacros=;SFP--1;CWE--1 +#sets fcnmacros and constmacros +#All macros (not preceded by /*@notfunction@*/) are checked as functions or +#constants depending on whether or not they have parameter lists. + +libmacros=;SFP--1;CWE--1 +#check all macros with declarations in library as functions +#Every macro declared in the load library is checked. + +specmacros=;SFP--1;CWE--1 +#check all macros corresponding to specified functions or constants +#Every macro declared a specification file is checked. + +macromatchname=;SFP--1;CWE-710 +#macro definition does not match iter or constant declaration +#A iter or constant macro is defined using a different name from the +#one used in the previous syntactic comment + +nextlinemacros=;SFP--1;CWE-710 +#the line after a constant or iter declaration must be a macro definition +#A constant or iter declaration is not immediately followed by a macro definition. + + + + + +# /* 11.4 Iterators */ + +iterbalance=;SFP--1;CWE-710 +#iter is not balanced with end_ + +iteryield=;SFP--1;CWE-710 +#iter yield parameter is inappropriate + +hasyield=;SFP--1;CWE-710 +#iter declaration has no yield parameters +#An iterator has been declared with no parameters annotated with +#yield. This may be what you want, if the iterator is meant +#to do something a fixed number of times, but returns no +#information to the calling context. Probably, a parameter +#is missing the yield annotation to indicate that it is +#assigned a value in the calling context. + + + + + + +# /* +# ** 12. Naming Conventions +# */ + +namechecks=;SFP--1;CWE--1 +#controls name checking without changing other settings + + + + + +# /* 12.1.1 Czech Names */ + +czech=;SFP--1;CWE-710 +#czech naming convention (sets accessczech, czechfunctions, czechvars, +#czechconstants, czechenums, and czechmacros) +#Name is not consistent with Czech naming convention. + +czechfcns=;SFP--1;CWE-710 +#czech naming convention violated in a function or iterator declaration +#Function or iterator name is not consistent with Czech naming convention. + +czechvars=;SFP--1;CWE-710 +#czech naming convention violated in a variable declaration +#Variable name is not consistent with Czech naming convention. + +czechmacros=;SFP--1;CWE-710 +#czech naming convention violated in an expanded macro name +#Expanded macro name is not consistent with Czech naming convention. + +czechconsts=;SFP--1;CWE-710 +#czech naming convention violated in a constant declaration +#Constant name is not consistent with Czech naming convention. + +czechtypes=;SFP--1;CWE-710 +#czech naming convention violated in a user-defined type definition +#Type name is not consistent with Czech naming convention. Czech type +#names must not use the underscore character. + + + + +# /* 12.1.2 Slovak Names */ + +slovak=;SFP--1;CWE-710 +#slovak naming convention violated +#Name is not consistent with Slovak naming convention. + +slovakfcns=;SFP--1;CWE-710 +#slovak naming convention violated in a function or iterator declaration +#Function or iterator name is not consistent with Slovak naming convention. + +slovakmacros=;SFP--1;CWE-710 +#slovak naming convention violated in an expanded macro name +#Expanded macro name is not consistent with Slovak naming convention. + +slovakvars=;SFP--1;CWE-710 +#slovak naming convention violated in a variable declaration +#Variable name is not consistent with Slovak naming convention. + +slovakconsts=;SFP--1;CWE-710 +#slovak naming convention violated in a constant declaration +#Constant name is not consistent with Slovak naming convention. + +slovaktypes=;SFP--1;CWE-710 +#slovak naming convention violated in a use-defined type definition +#Type name is not consistent with Slovak naming convention. Slovak type +#names may not include uppercase letters. + + + + + +# /* 12.1.3 Czechoslovak Names */ + +czechoslovak=;SFP--1;CWE-710 +#czech or slovak naming convention violated +#Name is not consistent with either Czech or Slovak naming convention. + +czechoslovakfcns=;SFP--1;CWE-710 +#czechoslovak naming convention violated in a function or iterator declaration +#Function name is not consistent with Czechoslovak naming convention. + +czechoslovakmacros=;SFP--1;CWE-710 +#czechoslovak naming convention violated in an expanded macro name +#Expanded macro name is not consistent with Czechoslovak naming convention. + +czechoslovakvars=;SFP--1;CWE-710 +#czechoslovak naming convention violated in a variable declaration +#Variable name is not consistent with Czechoslovak naming convention. + +czechoslovakconsts=;SFP--1;CWE-710 +#czechoslovak naming convention violated in a constant declaration +#Constant name is not consistent with Czechoslovak naming convention. + +czechoslovaktypes=;SFP--1;CWE-710 +#czechoslovak naming convention violated in a user-defined type definition +#Type name is not consistent with Czechoslovak naming convention. Czechoslovak +#type names may not include uppercase letters or the underscore character. + + + + +# /* 12.2 Namespace Prefixes */ + +macrovarprefix=;SFP--1;CWE-710 +#set namespace prefix for variables declared in a macro body +#A variable declared in a macro body does not start with the macrovarprefix. + +macrovarprefixexclude=;SFP--1;CWE-710 +#the macrovarprefix may not be used for non-macro variables +#A variable declared outside a macro body starts with the macrovarprefix. + +tagprefix=;SFP--1;CWE-710 +#set namespace prefix for struct, union and enum tags +#A tag identifier does not start with the tagprefix. + +tagprefixexclude=;SFP--1;CWE-710 +#the tagprefix may not be used for non-tag identifiers +#An identifier that is not a tag starts with the tagprefix. + +enumprefix=;SFP--1;CWE-710 +#set namespace prefix for enum members +#An enum member does not start with the enumprefix. + +enumprefixexclude=;SFP--1;CWE-710 +#the enumprefix may not be used for non-enum member identifiers +#An identifier that is not an enum member starts with the enumprefix. + +filestaticprefix=;SFP--1;CWE-710 +#set namespace prefix for file static declarations +#A file-static identifier does not start with the filestaticprefix. + +filestaticprefixexclude=;SFP--1;CWE-710 +#the filestaticprefix may not be used for identifiers that are not file static +#An identifier that is not file static starts with the filestaticprefix. + +globalprefix=;SFP--1;CWE-710 +#set namespace prefix for global variables +#A global variable does not start with the globalprefix + +globalprefixexclude=;SFP--1;CWE-710 +#the globalprefix may not be used for non-global identifiers +#An identifier that is not a global variable starts with the globalprefix. + +typeprefix=;SFP--1;CWE-710 +#set namespace prefix for user-defined types +#A user-defined type does not start with the typeprefix + +typeprefixexclude=;SFP--1;CWE-710 +#the typeprefix may not be used for identifiers that are not type names +#An identifier that is not a type name starts with the typeprefix. + +externalprefix=;SFP--1;CWE-710 +#set namespace prefix for external identifiers +#An external identifier does not start with the externalprefix + +externalprefixexclude=;SFP--1;CWE-710 +#the externalprefix may not be used for non-external identifiers +#An identifier that is not external starts with the externalprefix. + +localprefix=;SFP--1;CWE-710 +#set namespace prefix for local variables +#A local variable does not start with the localprefix + +localprefixexclude=;SFP--1;CWE-710 +#the localprefix may not be used for non-local identifiers +#An identifier that is not a local variable starts with the localprefix. + +uncheckedmacroprefix=;SFP--1;CWE-710 +#set namespace prefix for unchecked macros +#An unchecked macro name does not start with the uncheckedmacroprefix + +uncheckedmacroprefixexclude=;SFP--1;CWE-710 +#the uncheckmacroprefix may not be used for identifiers that are not +#unchecked macros +#An identifier that is not the name of an unchecked macro +#starts with the uncheckedmacroprefix. + +constprefix=;SFP--1;CWE-710 +#set namespace prefix for constants +#A constant does not start with the constantprefix + +constprefixexclude=;SFP--1;CWE-710 +#the constprefix may not be used for non-constant identifiers +#An identifier that is not a constant starts with the constantprefix. + +iterprefix=;SFP--1;CWE-710 +#set namespace prefix for iterators +#An iter does not start with the iterator prefix + +iterprefixexclude=;SFP--1;CWE-710 +#the iterprefix may not be used for non-iter identifiers +#An identifier that is not a iter starts with the iterprefix. + +protoparamprefix=;SFP--1;CWE-710 +#set namespace prefix for parameters in function prototype declarations +#A parameter name in a function prototype declaration does not start with the +#declaration parameter prefix + + + + + + +# /* 12.3 Naming Restrictions */ + +isoreserved=;SFP--1;CWE-710 +#external name conflicts with name reserved for system or standard library +#External name is reserved for system use by ISO C99 standard. + +cppnames=;SFP--1;CWE-710 +#external or internal name is a C++ keyword or reserved word +#External name is a C++ keyword or reserved word. +#This could lead to problems if the +#code is compiled with a C++ compiler. + +isoreservedinternal=;SFP--1;CWE-710 +#internal name conflicts with name reserved for system or standard library +#Internal name is reserved for system in ISO C99 standard (this should not be necessary unless you are worried about C library implementations that violate the standard and use macros). + +distinctexternalnames=;SFP--1;CWE-710 +#external name is not distinguishable from another external name using +#the number of significant characters +#An external name is not distinguishable from another external name +#using the number of significant characters. According to +#ANSI Standard (3.1), an implementation may only consider the first 6 +#characters significant, and ignore alphabetical case +#distinctions (ISO C99 requires 31). The +#+externalnamelen flag may be used to change the number +#of significant characters, and -externalnamecaseinsensitive to make +#alphabetical case significant in external names. + +externalnamelen=;SFP--1;CWE-710 +#set the number of significant characters in an external name +#Sets the number of significant characters in an external name (default is 6 for old +#ANSI89 limit, C99 requires 31). +#Sets +distinctexternalnames. + +externalnamecaseinsensitive=;SFP--1;CWE-710 +#alphabetic comparisons for external names are case-insensitive +#Make alphabetic case insignificant in external names. By ANSI89 +#standard, case need not be significant in an external name. +#If +distinctexternalnames is not set, sets +#+distinctexternalnames with unlimited external name length. + +distinctinternalnames=;SFP--1;CWE-710 +#internal name is not distinguishable from another internal name using +#the number of significant characters +#An internal name is not distinguishable from another internal name +#using the number of significant characters. According to +#ANSI89 Standard (3.1), an implementation may only consider the first 31 +#characters significant (ISO C99 specified 63). The +#+internalnamelen flag changes the number +#of significant characters, -internalnamecaseinsensitive to makes +#alphabetical case significant, and +#+internalnamelookalike to make similar-looking characters +#non-distinct. + + + +internalnamelookalike=;SFP--1;CWE-710 +#lookalike characters match in internal names +#Set whether similar looking characters (e.g., \1\ and \l\) +#match in internal names. + +protoparamname=;SFP--1;CWE-710 +#a parameter in a function prototype has a name +#A parameter in a function prototype has a name. This is dangerous, +#since a macro definition could be visible here. + +protoparammatch=;SFP--1;CWE-710 +#the name of a parameter in a function prototype and corresponding +#declaration must match (after removing the protoparamprefix +#A parameter in a function definition does not have the same name as +#the corresponding in the declaration of the function after +#removing the protoparamprefix + +protoparamprefixexclude=;SFP--1;CWE-710 +#the protoparamprefix may not be used for non-declaraction parameter identifiers +#An identifier that is not a parameter name in a function prototype +#starts with the protoparamprefix. + + + + + + +# /* +# ** 13. Completeness +# */ + +# /* 13.1 Unused Declarations */ + +topuse=;SFP--1;CWE-398 +#declaration at top level not used +#An external declaration not used in any source file. + +exportlocal=;SFP--1;CWE-398 +#a declaration is exported but not used outside this module +#A declaration is exported, but not used outside this module. +#Declaration can use static qualifier. + +exportheader=;SFP--1;CWE-398 +#a declaration is exported but does not appear in a header file +#A declaration is exported, but does not appear in a header file. + +exportheadervar=;SFP-2;CWE-563 +#a variable declaration is exported but does not appear in a header file +#A variable declaration is exported, but does not appear in a header +#file. (Used with exportheader.) + +fielduse=;SFP-2;CWE-561 +#field of structure type not used +#A field is present in a structure type but never used. Use /*@unused@*/ in front of field declaration to suppress message. + +enummemuse=;SFP-2;CWE-561 +#member of an enum type not used +#A member of an enum type is never used. + +constuse=;SFP-2;CWE-563 +#constant declared but not used +#A constant is declared but not used. Use unused in the constant declaration to suppress message. + +fcnuse=;SFP-2;CWE-561 +#function declared but not used +#A function is declared but not used. Use /*@unused@*/ in front of function header to suppress message. + +paramuse=;SFP--1;CWE-398 +#function parameter not used +#A function parameter is not used in the body of the function. If the argument is needed for type compatibility or future plans, use /*@unused@*/ in the argument declaration. + +typeuse=;SFP-2;CWE-561 +#type declared but not used +#A type is declared but not used. Use /*@unused@*/ in front of typedef to suppress messages. + +varuse=;SFP-2;CWE-563 +#variable declared but not used +#A variable is declared but never used. Use /*@unused@*/ in front +#of declaration to suppress message. + +unusedspecial=;SFP-2;CWE-561 +#unused declaration in special file (corresponding to .l or .y file) + + + + + + + +# /* 13.2 Complete Programs */ + +declundef=;SFP-2;CWE-561 +#function or variable declared but never defined +#A function or variable is declared, but not defined in any source code file. + +specundef=;SFP-2;CWE-561 +#function or variable specified but never defined +#A function or variable is declared in an .lcl file, but not defined in any source code file. + +specundecl=;SFP-2;CWE-561 +#function or variable specified but never declared in a source file +#A function or variable is declared in an .lcl file, but not declared +#in any source code file. + + +needspec=;SFP--1;CWE--1 +#information in specifications is not also included in syntactic comments +#There is information in the specification that is not duplicated +#in syntactic comments. Normally, this is not an +#error, but it may be useful to detect it to make +#sure checking incomplete systems without the specifications will +#still use this information. + + + + + + +# /* +# ** 14. Libraries and Header File Inclusion +# */ + +# /* 14.1 Standard Libraries */ + +warnposixheaders=;SFP-1;CWE-561 +#a POSIX header is included, but the POSIX library is not used +#Header name matches a POSIX header, but the POSIX library is not selected. + + +usevarargs=;SFP--1;CWE-710 +#non-standard included +#Header is not part of ANSI Standard. +#Should use instead. + +caseinsensitivefilenames=;SFP--1;CWE-710 +#file names are case insensitive (file.h and FILE.H are the same file) + + + + +# /* Prototypes */ + +noparams=;SFP--1;CWE--1 +#function declaration has no parameter list +#A function declaration does not have a parameter list. + +oldstyle=;SFP--1;CWE-398 +#old style function definition +#Function definition is in old style syntax. Standard prototype +#syntax is preferred. + + + + + + +# /* +# ** System functions +# */ + +maintype=;SFP--1;CWE-710 +#type of main does not match expected type +#The function main does not match the expected type. + +exitarg=;SFP-3;CWE-474 +#argument to exit has implementation defined behavior +#The argument to exit should be 0, EXIT_SUCCESS or EXIT_FAILURE + +shadow=;SFP--1;CWE-710 +#declaration reuses name visible in outer scope +#An outer declaration is shadowed by the local declaration. + +incondefslib=;SFP--1;CWE-398 +#function, variable or constant defined in a library is redefined with inconsistent type +#A function, variable or constant previously defined in a library is +#redefined with a different type. + +overload=;SFP--1;CWE-398 +#library function overloaded +#A function, variable or constant defined in the library is redefined +#with a different type. + +nestedextern=;SFP--1;CWE-398 +#an extern declaration is inside a function scope +#An extern declaration is used inside a function scope. + +redecl=;SFP--1;CWE-398 +#function or variable redeclared +#A function or variable is declared in more than one place. This is +#not necessarily a problem, since the declarations are consistent. + +redef=;SFP--1;CWE-398 +#function or variable redefined +#A function or variable is redefined. One of the declarations should use extern. + +imptype=;SFP--1;CWE-710 +#variable declaration has unknown (implicitly int) type +#A variable declaration has no explicit type. The type is implicitly int. + +exportany=;SFP--1;CWE-710 +#variable, function or type exported but not specified +#A variable, function or type is exported, but not specified. + +exportfcn=;SFP--1;CWE-710 +#function exported but not specified +#A function is exported, but not specified. + +exportmacro=;SFP--1;CWE-710 +#expanded macro exported but not specified +#A macro is exported, but not specified. + +exporttype=;SFP--1;CWE-710 +#type definition exported but not specified +#A type is exported, but not specified. + +exportvar=;SFP--1;CWE-710 +#variable exported but not specified +#A variable is exported, but not specified. + +exportconst=;SFP--1;CWE-710 +#constant exported but not specified +#A constant is exported, but not specified. + +exportiter=;SFP--1;CWE-710 +#constant exported but not specified +#A constant is exported, but not specified. + + + + + + +# /* +# ** Limits +# */ + +type=;SFP-1;CWE-704 +#type mismatch +#Types are incompatible. + +stringliteraltoolong=;SFP-8;CWE-119 +#string literal too long for character array +#A string literal is assigned to a char array too small to hold it. + +stringliteralnoroomfinalnull=;SFP-11;CWE-170 +#string literal leaves no room for null terminator +#A string literal is assigned to a char array that is not big enough to hold the final null terminator. This may not be a problem because a null character has been explictedly included in the string literal using an escape sequence + +stringliteralnoroom=;SFP-11;CWE-170 +#string literal leaves no room for null terminator +#A string literal is assigned to a char array that is not big enough to hold the null terminator. + +stringliteralsmaller=;SFP-8;CWE-119 +#string literal is smaller than the char array it is assigned to +#A string literal is assigned to a char array that smaller than the string literal needs. + +enummembers=;SFP-1;CWE-704 +#enum members must be int values +#Type of initial values for enum members must be int. + +formattype=;SFP--1;CWE-628 +#type-mismatch in parameter corresponding to format code in a printf or scanf-like function +#Type of parameter is not consistent with corresponding code in format string. + +formatconst=;SFP--1;CWE-134 +#format parameter is not a string constant (hence variable arguments cannot be typechecked) +#Format parameter is not known at compile-time. This can lead to security vulnerabilities because the arguments cannot be type checked. + +formatcode=;SFP-24;CWE-134 +#invalid format code in format string for printf or scanf-like function +#Format code in a format string is not valid. + +forwarddecl=;SFP--1;CWE--1 +#forward declarations of pointers to abstract representation match abstract type + +voidabstract=;SFP--1;CWE-398 +#void * matches pointers to abstract types, casting ok (dangerous) +#A pointer to void is cast to a pointer to an abstract type (or vice versa). + +castfcnptr=;SFP-1;CWE-704 +#a pointer to a function is cast to a pointer to void (or vice versa) +#A pointer to a function is cast to (or used as) a pointer to void (or vice versa). + +unrecog=;SFP--1;CWE--1 +#unrecognized identifier +#Identifier used in code has not been declared. + +annotationerror=;SFP--1;CWE-546 +#annotation is used in inconsistent location +#A declaration uses an invalid annotation. + +commenterror=;SFP--1;CWE-546 +#inconsistent syntactic comment +#A syntactic comment is used inconsistently. + + + + + + + + +# /* +# ** Use Warnings +# */ + +bufferoverflow=;SFP-8;CWE-120 +#possible buffer overflow vulnerability +#Use of function that may lead to buffer overflow. + +bufferoverflowhigh=;SFP-8;CWE-120 +#likely buffer overflow vulnerability +#Use of function that may lead to buffer overflow. + +implementationoptional=;SFP--1;CWE-710 +#declarator is implementation optional (ISO99 does not require an implementation to provide it) +#Use of a declarator that is implementation optional, not required by ISO99. + +legacy=;SFP--1;CWE-710 +#legacy declaration in Unix Standard +#Use of a declarator that is marked as a legacy entry in the Unix Standard. + +multithreaded=;SFP-19;CWE-663 +#function is not reentrant +#Non-reentrant function should not be used in multithreaded code. + +portability=;SFP-3;CWE-474 +#function may have undefined behavior +#Use of function that may have implementation-dependent behavior. + +superuser=;SFP--1;CWE-710 +#function is restricted to superusers +#Call to function restricted to superusers. + +toctou=;SFP-20;CWE-367 +#possible time of check, time of use vulnerability +#Possible time of check, time of use vulnerability. + +unixstandard=;SFP--1;CWE-710 +#function is not required in Standard UNIX Specification +#Use of function that need not be provided by UNIX implementations + + + + + + +# /* +# ** Syntactic comments +# */ + +unrecogcomments=;SFP--1;CWE-546 +#stylized comment is unrecognized +#Word after a stylized comment marker does not correspond to a +#stylized comment. + + + + + + + + +# /* +# ** Comments +# */ + +continuecomment=;SFP--1;CWE-546 +#line continuation marker (\\) in comment before */ on same line +#A line continuation marker (\\) appears inside a comment on the same +#line as the comment close. Preprocessors should handle this +#correctly, but it causes problems for some preprocessors. + +slashslashcomment=;SFP--1;CWE-546 +#use of // comment +#A // comment is used. ISO C99 allows // comments, but earlier standards did not. + +nestcomment=;SFP--1;CWE-546 +#comment begins inside comment +#A comment open sequence (/*) appears within a comment. This usually +#means an earlier comment was not closed. \ No newline at end of file diff --git a/com.kdmanalytics.toif.splint/src/config/SplintAdaptorConfigurationOriginal b/com.kdmanalytics.toif.splint/src/config/SplintAdaptorConfigurationOriginal new file mode 100644 index 00000000..4ca1863c --- /dev/null +++ b/com.kdmanalytics.toif.splint/src/config/SplintAdaptorConfigurationOriginal @@ -0,0 +1,1453 @@ +nestcomment=Other +preproc=Other + +#Null Dereferences (Section 2) + +null=;SFP-7;CWE-476 +#A possibly null pointer may be dereferenced, or used somewhere a nonnull pointer is expected. (sets nulldref, nullpass, nullassign, and nullstate + +nullderef=;SFP-7;CWE-476 +#A possibly null pointer is dereferenced. Value is either the result of a function which may return null (in which case, code should check it is not null), or a global, parameter or structure field declared with the null qualifier. + +nullpass=;SFP-7;CWE-476 +#A possibly null pointer is passed as a parameter corresponding to a formal parameter with no /*@null@*/ annotation. If NULL may be used for this parameter, add a /*@null@*/ annotation to the function parameter declaration. + +nullret=;SFP-7;CWE-476 +#Function returns a possibly null pointer, but is not declared using /*@null@*/ annotation of result. If function may return NULL, add /*@null@*/ annotation to the return value declaration. + +nullstate=;SFP-7;CWE-476 +#A possibly null pointer is reachable from a parameter or global variable that is not declared using a /*@null@*/ annotation. + +nullassign=;SFP-4;CWE-665 +#A reference with no null annotation is assigned or initialized to NULL. Use /*@null@*/ to declare the reference as a possibly null pointer. + + +################################################################################# + + + +#Use Before Definition (Section 3) + +usedef=;SFP-1;CWE-457 +#The value of a location that may not be initialized on some execution path is used. + +impouts=;SFP-1;CWE-457 +#Allow unannotated pointer parameters to functions to be implicit out parameters. + +compdef=;SFP-1;CWE-456 +#Storage derivable from a parameter, return value or global variable is not completely defined. + +uniondef=;SFP-1;CWE-456 +#No field of a union is defined. (No error is reported if at least one union field is defined.) + +mustdefine=;SFP-1;CWE-457 +#arameter declared with out is not defined before return or scope exit. + +fullinitblock=;SFP-1;CWE-456 +#Initializer does not set every field in the structure. + +initallelements=;SFP-1;CWE-456 +#Initializer does not define all elements of a declared array. + +initsize=;SFP-1;CWE-665 +#Initializer block contains more elements than the size of a declared array + + +################################################################################# + + +#Declarations + +incondefs=;SFP-1;CWE-704 +#A function, variable or constant is redefined with a different type. + +functionderef=Other +#A function type is dereferenced. The ANSI standard allows this because of implicit conversion of function designators, however the dereference is unnecessary. + +redundantsharequal=;SFP-4;CWE-665 +#A declaration of an immutable object uses a redundant observer qualifier. + +misplacedsharequal=;SFP-3 +#A declaration of an unsharable object uses a sharing annotation. + + +################################################################################# + + +#Types (Section 4 ) + + +type=;SFP-1;CWE-704 +#Type mismatch. + +stringliteraltoolong=;SFP-8;CWE-119 +#A string literal is assigned to a char array too small to hold it. + +stringliteralnoroom=;SFP-11;CWE-170 +#A string literal is assigned to a char array that is not big enough to hold the null terminator. + +stringliteralnoroomfinalnull=;SFP-11;CWE-170 +#A string literal is assigned to a char array that is not big enough to hold the final null terminator. This may not be a problem because a null character has been explictedly included in the string literal using an escape sequence. + +stringliteralsmaller=;SFP-8;CWE-119 +#A string literal is assigned to a char array that smaller than the string literal needs. + +enummembers=Risky values +#Type of initial values for enum members must be int. + + +################################################################################# + + +#Boolean Types (Section 4.2 ) +#These flags control the type name used to represent Booleans, and whether the Boolean type is abstract. + +bool=Other +#Boolean type is an abstract type. + +booltype=Other +#Set name of Boolean type to . + +boolfalse=Other +#Set name of Boolean false to . + +booltrue=Other +#Set name of Boolean true to . + +likelybool=;SFP-1 +#Splint has found a type which appears to be the boolean type. Use the booltype, boolfalse and booltrue flags to change the name of the default boolean type. + + + +################################################################################# + + + +#Predicates + +predboolptr=Other +#Type of condition test is a pointer. + +predboolint=;SFP-1 +#Type of condition test is an integral type. + +predboolothers=;SFP-1 +#Type of condition test is not a Boolean, pointer or integral type. + +predbool=Other +#Sets predboolint, predboolptr and preboolothers. + +predassign=Other +#The condition test is an assignment expression. If an assignment is intended, add an extra parentheses nesting (e.g., if ((a = b)) ...). + + +################################################################################# + + +#Primitive Operations + +ptrarith=Other +#Arithmetic involving pointer and integer. + +nullptrarith=;SFP-7;CWE-476 +#ointer arithmetic using a possibly null pointer and integer. + +boolops=;SFP-1 +#The operand of a boolean operator is not a boolean. Use +ptrnegate to allow ! to be used on pointers. + +ptrnegate=Other +#Allow the operand of the ! operator to be a pointer. + +bitwisesigned=;SFP-1;CWE-195 +#An operand to a bitwise operator is not an unsigned value. This may have unexpected results depending on the signed representations. + +shiftimplementation=;SFP-1 +#The left operand to a shift operator may be negative (behavior is implementationdefined). + +shiftnegative=;SFP-1 +#The right operand to a shift operator may be negative (behavior undefined). + +shiftsigned=;SFP-1 +#The left operand to a shift operator is not an unsigned value. + +strictops=;SFP-1 +#rimitive operation does not type check strictly. + +sizeoftype=;SFP-1 +#Operand of sizeof operator is a type. (Safer to use int *x = sizeof (*x); instead of sizeof (int).) + + +################################################################################# + + +#Array Formal arameters +#These flags control reporting of common errors caused by confusion about the semantics of array formal parameters. + + +sizeofformalarray=;SFP-1 +#The sizeof operator is used on a parameter declared as an array. (In many instances this has unexpected behavior, since the result is the size of a pointer to the element type, not the number of elements in the array.) + + +fixedformalarray=;SFP-1 +#An array formal parameter is declared with a fixed size (e.g., int x[20]). This is likely to be confusing, since the size is ignored. + +formalarray=;SFP-1 +#A formal parameter is declared as an array. This is probably not a problem, but can be confusing since it is treated as a pointer. + + +################################################################################# + + +#Format Codes + +formatcode=;SFP-1;CWE-686 +#Invalid format code in format string for printflike or scanflike function. + +formattype=;SFP-1;CWE-681 +#Typemismatch in parameter corresponding to format code in a printflike or scanflike function. + +formatconst=Risky Values +#Format parameter is not known at compiletime. This can lead to security vulnerabilities because the arguments cannot be type checked. + + +################################################################################# + + +#Main + +maintype=Other +#Type of main does not match expected type (function returning an int, taking no parameters or two parameters of type int and char **.) + + +################################################################################# + + +#Comparisons + +boolcompare=;SFP-1 +#Comparison between Boolean values. This is dangerous since there may be multiple true values as any nonzero value is interpreted as true. + +realcompare=;SFP-1 +#Comparison involving float or double values. This is dangerous since it may produce unexpected results because floating point representations are inexact. + +ptrcompare=;SFP-1 +#Comparison between pointer and number. + +unsignedcompare=;SFP-1 +#An unsigned value is used in a comparison with zero in a way that is either a bug or confusing. + + +################################################################################# + + +#Type Equivalence + +voidabstract=;SFP-1;CWE-704 +#Allow void * to match pointers to abstract types. (Casting a pointer to an abstract type to a pointer to void is okay if +voidabstract is set.) + +castfcnptr=;SFP-1;CWE-704 + A pointer to a function is cast to (or used as) a pointer to void (or vice versa). + +forwarddecl=;SFP-1;CWE-704 +#Forward declarations of pointers to abstract representation match abstract type. + +imptype=;SFP-1;CWE-665 +#A variable declaration has no explicit type. The type is implicitly int. + +incompletetype=;SFP-4;CWE-665 +#A formal parameter is declared with an incomplete type (e.g., int[][]). + +charindex=;SFP-8 +#Allow char to index arrays. + +enumindex=;SFP-8 +#Allow members of enumtype to index arrays. + +boolint=Other +#Make bool and int are equivalent. (No type errors are reported when a Boolean is used where an integral type is expected and vice versa.) + +charint=Other +#Make char and int types equivalent + +charunsignedchar=Other +#To allow char and unsigned char types to match use +charunsignedchar + +enumint=Other +#Make enum and int types equivalent + +floatdouble=Other +#Make float and double types equivalent + +ignorequals=Other +#Ignore type qualifiers (long, short, unsigned). + +relaxquals=Other +#Report qualifier mismatches only if dangerous (information may be lost since a larger type is assigned to (or passed as) a smaller one or a comparison uses signed and unsigned values.) + +ignoresigns=Other +#Ignore signs in type comparisons (unsigned matches signed). + +longintegral=Other +#Allow long type to match an arbitrary integral type (e.g., dev_t). + +longunsignedintegral +#Allow unsigned long type to match an arbitrary integral type (e.g., dev_t). + +matchanyintegral +#Allow any integral type to match an arbitrary + +longunsignedunsignedintegral +#Allow unsigned long type to match an arbitrary unsigned integral type (e.g., size_t).q + +longsignedintegral +#Allow long type to match an arbitrary signed integral type (e.g., ssize_t). + +numliteral +#Integer literals can be used as floats. + +charintliteral +#A character constant may be used as an int. + +zeroptr +#Literal 0 may be used as a pointer. + +zerobool +#Treat 0 as a boolean. + +relaxtypes +#Allow all numeric types to match. + +shortint +#Make short int and int types equivalent. + + +################################################################################# + + +#Abstract Types (Section 4.3 ) + +abstract +#A data abstraction barrier is violated + +impabstract +#Implicit abstract annotation for type declarations that do not use concrete. + +mutrep +#Representation of mutable type has sharing semantics. + + +################################################################################# + + +#Access (Section 4.3.1) + +accessmodule +#An abstract type defined in M.h (or specified in M.lcl) is accessible in M.c. + +accessfile +#An abstract type named type is accessible in files named type.* + +accessczech +#An abstract type named type may be accessible in a function named type_name. (Section 12.1.1) + +accessslovak +#An abstract type named type may be accessible in a function named typeName. (Section.12.1.2) + +accessczechoslovak +#An abstract type named type may be accessible in a function named type_name or typeName. (Section 12.1.3) + +accessall +#Sets accessmodule, accessfile and accessczech. + + +################################################################################# + + +#Memory Management (Section 5 ) +#Reporting of Memory Management errors is controlled by flags setting checking and implicit annotations and code annotations. + + +################################################################################# + + +#Deallocation Errors (Section 5.2) + +usereleased=;SFP-15;CWE-416 +#Storage used after it may have been released. + +strictusereleased +#An array element used after it may have been released. + + +################################################################################# + + +#Inconsistent Branches + +branchstate=Other +#Storage has inconsistent states of alternate paths through a branch (e.g., it is released in the true branch of an ifstatement, but there is no else branch.) + +strictbranchstate=Other +#Storage through array fetch has inconsistent states of alternate paths through a branch. Since array elements are not checked accurately, this may lead to spurious errors. + +deparrays +#Treat array elements as dependent storage. Checking of array elements cannot be done accurately by Splint. If deparrays is not set, array elements are assumed to be independent, so code that releases the same element more than once will produce no error. If deparrays is set, array elements are assumed to be dependent, so code that releases the same element more that once will produce an error, but code that releases different elements correctly will produce a spurious error. + + +################################################################################# + + + +#Memory Leaks + +mustfree=;SFP-14;CWE-401 +#Allocated storage was not released before return or scope exit. Errors are reported for only, fresh or owned storage. + +mustfreefresh=;SFP-14;CWE-401 +#Allocated storage was not released before return or scope exit. Errors are reported for fresh storage + +mustfreeonly=;SFP-14;CWE-401 +#Allocated storage was not released before return or scope exit. Errors are reported for only storage + +memchecks +#Sets all dynamic memory checking flags (memimplicit, mustfree, mustdefine, mustnotalias, null, memtrans ). + +compdestroy=;SFP-14;CWE-401 +#All only references derivable from out only parameter of type void * must be released. (This is the type of the parameter to free, but may also be used for userdefined deallocation functions.) + +strictdestroy +#Report complete destruction errors for array elements that may have been released. (If strictdestroy is not set, Splint will assume that if any array element was released, the entire array was correctly released.) + + +################################################################################# + + + +#Transfer Errors +#A transfer error is reported when storage is transferred (by an assignment, passing a parameter, or returning) in a way that is inconsistent. + +memtrans +#Sets all memory transfer errors flags. + +onlytrans=;SFP-14;CWE-401 +#Only storage transferred to nononly reference (memory leak). + +ownedtrans=;SFP-14;CWE-401 +#Owned storage transferred to nonowned reference (memory leak). + +freshtrans=;SFP-14;CWE-401 +#Newlyallocated storage transferred to nononly reference (memory leak). + +sharedtrans=;SFP-12;CWE-762 +#Shared storage transferred to nonshared reference + +dependenttrans=Memory Management +#Inconsistent dependent transfer. Dependent storage is transferred to a nondependent reference. + +temptrans=Memory Management +#Temporary storage (associated with a temp formal parameter) is transferred to a nontemporary reference. The storage may be released or new aliases created. + +kepttrans=Memory Management +#Kept storage (storage what was passed as keep) transferred to nontemporary reference. + +keeptrans=;SFP-12;CWE-762 +#Keep storage is transferred in a way that may add a new alias to it, or release it. + +refcounttrans=;SFP-12;CWE-762 +#Reference counted storage is transferred in an inconsistent way. + +newreftrans=;SFP-12;CWE-762 +#A new reference transferred to a reference counted reference (reference count is not set correctly). + +immediatetrans=;SFP-1;CWE-587 +#An immediate address (result of &) is transferred inconsistently. + +statictrans=Memory Management +#Static storage is transferred in an inconsistent way. + +exposetrans=;SFP-12;CWE-762 +#Inconsistent exposure transfer. Exposed storage is transferred to a nonexposed, nonobserver reference. + +observertrans=Memory Management +#Inconsistent observer transfer. Observer storage is transferred to a nonobserver reference. + +unqualifiedtrans=Memory Management +#Unqualified storage is transferred in an inconsistent way. + +#Initializers + +onlyunqglobaltrans +#Only storage transferred to an unqualified global or static reference. This may lead to a memory leak, since the new reference is not necessarily released. + +staticinittrans +#Static storage is used as an initial value in an inconsistent way. + +unqualifiedinittrans +#Unqualified storage is used as an initial value in an inconsistent way. +#Derived Storage + +compmempass=;SFP-14;CWE-404 +#Storage derivable from a parameter does not match the alias kind expected for the formal parameter. +#Stack References + +stackref +#A stack reference is pointed to by an external reference when the function returns. Since the call frame will be destroyed when the function returns the return value will point to dead storage. (Section 5.2.6) + + +################################################################################# + + +#Implicit Memory Annotations (Section 5.3 ) + +allimponly +#Sets globimponly, retimponly, structimponly, specglobimponly, specretimponly and specstructimponly . + +globimponly +#Assume unannotated global storage is only. + +paramimptemp +#Assume unannotated parameter is temp. + +retimponly +#Assume unannotated returned storage is only. + +structimponly +#Assume unannotated structure or union field is only. + +codeimponly +#Sets globimponly, retimponly and structimponly. + +memimp +#Report memory errors for unqualified storage. + +passunknown +#assing a value as an unannotated parameter clears its annotation. This will prevent many spurious errors from being report for unannotated programs, but eliminates the possibility of detecting many errors. + +################################################################################# + + +#Sharing (Section 6) + +################################################################################# + + +#Aliasing (Section 6.1 ) + +aliasunique=;SFP-4;CWE-665 +#An actual parameter that is passed as a unique formal parameter is aliased by another parameter or global variable. + +mayaliasunique=Other +#An actual parameter that is passed as a unique formal parameter may be aliased by another parameter or global variable. + +mustnotalias +#An alias has been added to a tempqualifier parameter or global that is visible externally when the function returns. + +retalias +#A function returns an alias to parameter or global. + +################################################################################# + + +#Exposure (Section 6.2 ) + +repexpose +#The internal representation of an abstract type is visible to the caller. This means clients may have access to a pointer into the abstract representation. (Sets assignexpose, retexpose, and castexpose.) + +assignexpose +#Abstract representation is exposed by an assignment or passed parameter. + +castexpose +#Abstract representation is exposed through a cast. + +retexpose +#Abstract representation is exposed by a return value. +#Observer Modifications + +modobserver=Other +#ossible modification of observer storage. + +modobserveruncon +#Storage declared with observer may be modified through a call to an unconstrained function. +#String Literals (Section 6.2.1) + +readonlytrans +#Report memory transfer errors for initializations to readonly string literals + +readonlystrings +#String literals are readonly (ISO semantics). An error is reported if a string literal may be modified or released. + +################################################################################# + + +#Function Interfaces (Section 7 ) + + +################################################################################# + + + +#Modification (Section 7.1) + +modifies +#Undocumented modification of callervisible state. Without +moduncon, modification errors are only reported in the definitions of functions declared with a modifies clause (or specified). + +mustmod +#Documented modification is not detected. An object listed in the modifies clause for a function, is not modified by the implementation. + +moduncon +#Report modification errors in functions declared without a modifies clause.(Sets modnomods, modglobsnomods and modstrictglobsnomods.) + +modnomods +#Report modification errors (not involving global variables) in functions declared without a modifies clause. + +modunconnomods +#An unconstrained function is called in a function body where modifications are checked. Since the unconstrained function may modify anything, there may be undetected modifications in the checked function. + +modinternalstrict +#A function that modifies internalState is called from a function that does not list internalState in its modifies clause. + +modfilesys +#A function modifies the file system but does not list fileSystem in its modifies clause. + +################################################################################# + + +#Global Variables (Section 7.2 ) +#Errors involving the use and modification of global and file static variables are reported depending on flag settings, annotations where the global variable is declared, and whether or not the function where the global is used was declared with a globals clause. + +globs +#Undocumented use of a checked global variable in a function with a globals list. + +globuse +#A global listed in the globals list is not used in the implementation. + +globnoglobs +#Use of a checked global in a function with no globals list. + +internalglobs +#Undocumented use of internal state (should have globals internalState). + +internalglobsnoglobs +#Use of internal state in function with no globals list. + +globstate=;SFP-15;CWE-416 +#A function returns with global in inconsistent state (null or undefined) + +allglobs +#Report use and modification errors for globals not annotated with unchecked. + +checkstrictglobs +#Report use and modification errors for checkedstrict globals. + +#Modification of Global Variables + +modglobs +#Undocumented modification of a checked global variable. + +modglobsunchecked +#Undocumented modification of an unchecked global variable. + +modglobsnomods +#Undocumented modification of a checked global variable in a function with no modifies clause. + +modstrictglobsnomods +#Undocumented modification of a checkedstrict global variable in a function declared with no modifies clause. +#Globals Lists and Modifies Clauses + +warnmissingglobs +#Global variable used in modifies clause is not listed in globals list. (The global is added to the globals list.) + +warnmissingglobsnoglobs +#Global variable used in modifies clause of a function with no globals list. + +globsimpmodsnothing +#A function declared with a globals list but no modifies clause is assumed to modify nothing. + +modsimpnoglobs +#A function declared with a modifies clause but no globals list is assumed to use no globals. +#Implicit Checking Annotations + +impcheckedglobs +#Implicit checked annotation on global variables with no checking annotation. + +impcheckedstatics +#Implicit checked qualifier file static scope variables with no checking annotation. + +impcheckmodglobs +#Implicit checkmod qualifier on global variables with no checking annotation. + + +impcheckmodstatics +#Implicit checkmod qualifier file static scope variables with no checking annotation. + +impcheckedstrictglobs +#Implicit checked qualifier on global variables with no checking annotation. + +impcheckedstrictstatics +#Implicit checked qualifier file static scope variables with no checking annotation. + +impcheckmodinternals +#Implicit checkmod qualifier on function scope static variables with no checking annotation. + + +#Global Aliasing + +globalias +#Function returns with global aliasing external state (sets checkstrictglobalias, checkedglobalias, checkmodglobalias and uncheckedglobalias). + +checkstrictglobalias +#Function returns with a checkedstrict global aliasing external state. + +checkedglobalias +#Function returns with a checked global aliasing external state. + +checkmodglobalias +#Function returns with a checkmod global aliasing external state. + +uncheckedglobalias +#Function returns with an unchecked global aliasing external state. + +################################################################################# + + +#Declaration Consistency (Section 7.3) + +incondefs +#Identifier redeclared or redefined with inconsistent type. + +incondefslib +#Identifier defined in a library is redefined with inconsistent type. + +overload +#Standard library function overloaded. + +matchfields +#A struct or enum type is redefined with inconsistent fields or members. + + +################################################################################# + + +#Macros (Section 11 ) +#These flags control expansion and checking of macro definitions and invocations. + + +################################################################################# + + + +#Macro Expansion +#These flags control which macros are checked as functions or constants, and which are expanded in the preprocessing phase. Macros preceded by /*@notfunction@*/ are never expanded regardless of these flag settings. These flags may be used in sourcefile control comments. + + +fcnmacros +#Macros defined with parameter lists are not expanded and are checked as functions. + +constmacros +#Macros defined without parameter lists are not expanded and are checked as constants. + +allmacros +#Sets fcnmacros and constmacros. + +libmacros +#Macros defining identifiers declared in a loaded library are not expanded and are checked according to the library information. + + +################################################################################# + + +#Macro Definitions +#These flags control what errors are reported in macro definitions. + + +macrostmt +#Macro definition is not syntactically equivalent to function. This means if the macro is used as a statement (e.g., if (test) macro();) unexpected behavior may result. One fix is to surround the macro body with do { … } while (FALSE). + +macroreturn +#The body of a macro declared as a function uses a return statement. This exhibits behavior that could not be implemented by a function. + +macroassign +#A macro parameter is used as the left side of an assignment expression. + +macroparams=;SFP-2;CWE-563 + +macroparens=Other +#A macro parameter is used without parentheses (in potentially dangerous context). + +macroempty +#Macro definition of a function is empty. + +macroredef +#Macro is redefined. There is another macro defined with the same name. + +macrounrecog +#An unrecognized identifier appears in a macro definition. Since the identifier may be defined where the macro is used, this could be okay, but Splint will not be able to check the unrecognized identifier appropriately. +#Corresponding Declarations + +macromatchname +#An iter or constant macro is defined using a different name from the one used in the previous syntactic comment + +macrodecl +#A macro definition has no corresponding declaration. (Sets macrofcndecl and macroconstdecl.) + +macrofcndecl +#Macro definition with parameter list has no corresponding function prototype. Without a prototype, the types of the macro result and parameters are unknown. + +macroconstdecl +#A macro definition without parameter list has no corresponding constant declaration. + +nextlinemacros +#A constant or iter declaration is not immediately followed by a macro definition. + +################################################################################# + + +#Side Effect Free arameters (Section 11.2.1 ) +#These flags control error reporting for parameters with inconsistent side effects in invocations of checked function macros and function calls. + + +sefparams +#An actual parameter with side effects is passed as a formal parameter declared with sef. + +sefuncon +#An actual parameter involving a call to an unconstrained function (declared without modifies clause) that may modify anything is passed as a sef parameter. + + +################################################################################# + + + +#Iterators + +iterbalance +#Iter is not balanced with end . + +iteryield +#Iter yield parameter is inappropriate. + +hasyield +#An iterator has been declared with no parameters annotated with yield. + +################################################################################# + + +#Naming Conventions (Section 12) + +namechecks +#Turns all name checking on or off without changing other settings. + +################################################################################# + + +#TypeBased Naming Conventions (Section 12.1) +#Czech Naming Convention + +czech +#Selects complete Czech naming convention (sets accessczech, czechfcns, czechvars, czechconsts, czechmacros, and czechtypes). + +accessczech +#Allow access to abstract types following Czech naming convention. The representation of an abstract type named t is accessible in the definition of a function or constant named t_name. + +czechfcns +#Function or iterator name is not consistent with Czech naming convention. + +czechvars + Variable name is not consistent with Czech naming convention. + +czechmacros + Expanded macro name is not consistent with Czech naming convention. + +czechconsts +#Constant name is not consistent with Czech naming convention. + +czechtypes +#Type name is not consistent with Czech naming convention. Czech type names must not use the underscore character. +#Slovak Naming Convention + +slovak +#Selects complete Slovak naming convention (sets accessslovak, slovakfcns, slovakvars, slovakconsts, slovakmacros, and slovaktypes). + +accessslovak +#Allow access to abstract types following Slovak naming convention. The representation of an abstract type named t is accessible in the definition of a function or constant named tName. + +slovakfcns +#Function or iterator name is not consistent with Slovak naming convention. + +slovakmacros +#Expanded macro name is not consistent with Slovak naming convention. + +slovakvars + Variable name is not consistent with Slovak naming convention. + +slovakconsts + Constant name is not consistent with Slovak naming convention. + +slovaktypes +#Type name is not consistent with Slovak naming convention. Slovak type names may not include uppercase letters. +#Czechoslovak Naming Convention + +czechoslovak +#Selects complete Czechoslovak naming convention (sets accessczechoslovak, czechoslovakfcns, czechoslovakvars, czechoslovakconsts, czechoslovakmacros, and czechoslovaktypes). + +accessczechoslovak +#Allow access to abstract types by Czechoslovak naming convention. The representation of an abstract type named t is accessible in the definition of a function or constant named t_name or tName. + +czechoslovakfcns + Function name is not consistent with Czechoslovak naming convention. + +czechoslovakmacros +#Expanded macro name is not consistent with Czechoslovak naming convention. + +czechoslovakvars +#Variable name is not consistent with Czechoslovak naming convention. + +czechoslovakconsts +#Constant name is not consistent with Czechoslovak naming convention. + +czechoslovaktypes +#Type name is not consistent with Czechoslovak naming convention. Czechoslovak type names may not include uppercase letters or the underscore character. + +################################################################################# + + +#Namespace refixes (Section 12.2) +#macrovarprefix +#Set namespace prefix for variables declared in a macro body. (Default is m_.) + +macrovarprefixexclude=Other +#A variable declared outside a macro body starts with the macrovarprefix. +#tagprefix +#Set namespace prefix of struct, union or enum tag identifiers. + +tagprefixexclude +#An identifier that is not a tag starts with the tagprefix. +#enumprefix +#Set namespace prefix for enum members. + +enumprefixexclude +#An identifier that is not an enum member starts with the enumprefix. +#filestaticprefix +#Set namespace prefix for file static declarations. + +filestaticprefixexclude +#An identifier that is not file static starts with the filestaticprefix. +#globalprefix +#Set namespace prefix for global variables. + +globalprefixexclude +#An identifier that is not a global variable starts with the globalprefix. +#typeprefix +#Set namespace prefix for userdefined types. + +typeprefixexclude +#An identifier that is not a type name starts with the typeprefix. +#externalprefix +#Set namespace prefix for external identifiers. + +externalprefixexclude +#An identifier that is not external starts with the externalprefix. + +#localprefix +#Set namespace prefix for local variables. + +localprefixexclude +#An identifier that is not a local variable starts with the localprefix. + +#uncheckedmacroprefix +#Set namespace prefix for unchecked macros. + +uncheckedmacroprefixexclude +#An identifier that is not the name of an unchecked macro starts with the uncheckedmacroprefix. +#constprefix +#Set namespace prefix for constants. + +constprefixexclude +#An identifier that is not a constant starts with the constantprefix. +#iterprefix +#Set namespace prefix for iterators. + +iterprefixexclude +#An identifier that is not an iter starts with the iterprefix. +#protoparamprefix +#Set namespace prefix for parameters in function prototypes. + +protoparamprefixexclude +#An identifier that is not a parameter in a function prototype starts with the protoprarmprefix. + +protoparamname +#A parameter in a function prototype has a name (can interfere with macro definitions). + +protoparammatch +#The name of a parameter in a function definition does not match the corresponding name of the parameter in a function prototype (after removing the protoparamprefix). + + +################################################################################# + + +#Naming Restrictions (Section 12.3) + +shadow=Other +#Declaration reuses name visible in outer scope. +#Reserved Names + +ansireserved +#External name conflicts with name reserved for the compiler or standard library. + +ansireservedinternal + Internal name conflicts with name reserved for the compiler or standard library. + +isoreserved +#External name is reserved for system use by ISO C99 standard. + +isoreservedinternal +#Internal name is reserved for system in ISO C99 standard (this should not be necessary unless you are worried about C library implementations that violate the standard and use macros). + +cppnames +#Internal or external name conflicts with a C++ reserved word. (Will cause problems if program is compiled with a C++ compiler.) +#Distinct External Names + +distinctexternalnames +#An external name is not distinguishable from another external name using externalnamelen significant characters. + +externalnamelen +#Sets the number of significant characters in an external name (ANSI default minimum is 6). Sets +distinctexternalnames. + +externalnamecaseinsensitive +#Make alphabetic case insignificant in external names. According to ANSI standard, case need not be significant in an external name. If +distinctexternalnames is not set, sets +distinctexternalnames with unlimited external name length. +#Distinct Internal Names + +distinctinternalnames +#An internal name is not distinguishable from another internal name using internalnamelen significant characters. (Also effected by internalnamecaseinsensitive and internalnamelookalike.) + +internalnamelen +#Set the number of significant characters in an internal name. Sets +distinctinternalnames. + +internalnamecaseinsensitive +#Set whether case is significant an internal names (internalnamecaseinsensitive means case is significant). If +distinctinternalnames is not set, sets +distinctinternalnames with unlimited internal name length. + +internalnamelookalike + Set whether similar looking characters (e.g., “1” and “l”) match in internal names. + +################################################################################# + + +#Control Flow (Section 8) + +################################################################################# + + +#Undefined Evaluation Order (Section 8.2 ) + +evalorder=;SFP-1 +#Behavior of an expression is unspecified or implementationdependent because subexpressions contain interfering side effects that may be evaluated in any order. + +evalorderuncon +#An expression may be undefined because a subexpression contains a call to an unconstrained function (no modifies clause) that may modify something that may be modified or used by another subexpression. + +################################################################################# + + +#roblematic Control Structures (Section 8.3 ) + +infloops +#Likely infinite loop is detected (Section 8.3.1). + +infloopsuncon +#Likely infinite loop is detected. Loop test or body calls an unconstrained function that may produce an undetected modification. + +elseifcomplete +#There is no finals else following an else if construct (Section 8.3.5). + +casebreak=;SFP-4;CWE-484 +#There is a nonempty case in a switch not followed by a break(Section 8.3.2 ). + +firstcase +#The first statement after a switch is not a case. + +#Duplicatecase +#Duplicate cases in switch. + +misscase +#A switch on an enum type is missing a case for a member of the enumerator. +#+ +emptyreturn +#Empty return in function declared to return value. +#+ +alwaysexits +#Loop predicate always exits. + +loopexec +#Assume all loops execute at least once. This effects usebeforedefinition and memory checking. It should probably not be used globally, but may be used surrounding a particular loop that is known to always execute to prevent spurious messages. (sets forloopexec, whileloopexec and iterloopexec +# +forloopexec +#Assume all for loops execute at least once. This effects usebeforedefinition and memory checking. It should probably not be used globally, but may be used surrounding a particular loop that is known to always execute to prevent spurious messages. +# +whileloopexec +#Assume all while loops execute at least once. This effects usebeforedefinition and memory checking. It should probably not be used globally, but may be used surrounding a particular loop that is known to always execute to prevent spurious messages. +# +iterloopexec +#Assume all iter loops execute at least once. This effects usebeforedefinition and memory checking. It should probably not be used globally, but may be used surrounding a particular loop that is known to always execute to prevent spurious messages. +#+ +obviousloopexec +#Assume loop that can be determined to always execute always does. + +################################################################################# + + +#Deep Break (Section 8.3.3 ) + +deepbreak +#Report errors for break statements inside a nested while, for or switch. (Sets all nested break and continue flags.) + +looploopbreak +#There is a break inside a while, for or iterator loop that is inside a while, for or iterator loop. Mark with /*@innerbreak@*/ to suppress the message. + +switchloopbreak +#There is abreak inside a while, for or iterator loop that is inside a switch statement. Mark with /*@loopbreak@*/. + +loopswitchbreak +#There is abreak inside a switch statement that is inside a while, for or iterator loop. Mark with /*@switchbreak@*/. + +switchswitchbreak +#There is abreak inside a switch statement that is inside another switch statement. Mark with /*@innerbreak@*/. + +looploopcontinue +#There is a continue inside a while, for or iterator loop that is inside a while, for or iterator loop. Mark with /*@innercontinue@*/. + +################################################################################# + + +#Loop and if Bodies (Section 8.3.4) + +allempty +#An if, while or for statement has no body (sets ifempty, whileempty and forempty.) + +allblock +#The body of an if, while or for statement is not a block (sets ifblock, whileblock and forblock.) + +whileempty +#A while statement has no body. + +whileblock +#The body of a while statement is not a block + +forempty +#A for statement has no body. + +forblock +#The body of a for statement is not a block. + +ifempty=Other +#An if statement has no body. + +ifblock +#The body of an if statement is not a block. + +################################################################################# + + +#Suspicious Statements (Section 8.4) + +unreachable=;SFP-2;CWE-561 +#Code is not reached on any possible execution. + +noeffect=;SFP-1 +#Statement has no effect. + +noeffectuncon +#Statement involving call to unconstrained function may have no effect. + +noret=Other +#There is a path with no return in a function declared to return a nonvoid value. + +################################################################################# + + + +#Ignored Return Values (Section 8.4.2 ) +#These flags control when errors are reported for function calls that do not use the return value. Casting the function call to void or declaring the called function to return /*@alt void@*/. + + +retvalbool +#Return value of type bool ignored. + +retvalint=;SFP-4;CWE-252 +#Return value of type int ignored. + +retvalother=;SFP-4;CWE-252 +#Return value of type other than bool or int ignored. + +retval +#Return value ignored (Sets retvalbool, retvalint, retvalother.) + +################################################################################# + + +#Memory Bounds (Section 9) + +bounds +#Memory read or write may be out of bounds of allocated storage (sets boundsread and boundswrite + +boundsread +#A memory read references memory beyond the allocated storage (also sets likelyboundsread. + +boundswrite +#A memory write may write to an address beyond the allocated buffer (also sets likelyboundswrite. + +likelybounds +#Likely memory read or write is likely to be out of bounds of allocated storage (sets likelyboundsread and likelyboundswrite) + +likelyboundsread +#A likely memory read references memory beyond the allocated storage (also sets likelyboundsread. + +likelyboundswrite +#A memory write is likely to write to an address beyond the allocated buffer. + +fcnpost +#Display function post conditions. + +redundantconstraints +#Display seemingly redundant conditions. + +checkpost +#The functions implementation may not satidfy a post condition given in an ensures clause. +# +showconstraintparens +#Display parentheses around constraint terms. +#+ +showconstraintlocation +#Display location for every constraint generated. + +#The following flags are mainly of interest to Splint developers. The default values are adequate in normal use. They are included for completeness. + +debugfcnconstraint +#erform buffer overflow checking even if the errors would be inhibited. +# +implictconstraints +#Generate implicit constraints for functions. This is an experimental option. Currently this option reduces the number of bounds errors but causes real error to be missed. +# +orconstraint +#This flags affects the internal constraint resolution. If set, the internal constraint resolution is more accurate. The performance impact is minimal so there is little reason not to have this flag set. + +################################################################################# + + +#Extensible Checking (Section 13 ) + +mts +#Load meta state declaration and corresponding xh file. + +statetransfer +#Transfer violates userdefined state rules. + +statemerge +#Control path merge violates userdefined state merge rules. + +################################################################################# + +#Completeness (Section 13 ) + +################################################################################# +#Unused Declarations (Section 13.1 ) +#These flags control when errors are reported for declarations that are never used. The unused annotation can be used to prevent unused errors from being report for a particular declaration. + + +topuse=;SFP-2;CWE-563 +#An external declaration is not used in any file. + +constuse=;SFP-2;CWE-563 +#Constant never used. + +enummemuse=;SFP-2;CWE-563 +#Member of enumerator never used. + +varuse=;SFP-2;CWE-563 +#Variable never used. + +paramuse=SFP-2 +#Function parameter never used. + +fcnuse=;SFP-2;CWE-561 +#Function is never used. + +typeuse=;SFP-2;CWE-563 +#Defined type never used. + +fielduse=;SFP-2;CWE-563 +#Field of structure or union type is never used. + +unusedspecial +#Declaration in a special file (corresponding to .l or .y file) is unused. + +################################################################################# + +#Complete rograms (Section 13.2) + +declundef +#Function, variable, iterator or constant declared but never defined. + +partial +#Check as partial system (sets declundef, exportlocal and prevents checking of macros in headers without corresponding .c files.) + + +################################################################################# + + +#Exports + +exportlocal=;SFP-2;CWE-561 +#A declaration is exported but not used outside this module. (Declaration can use the static qualifier.) + +exportheader +#A declaration (other than a variable) is exported but does not appear in a header file. + +exportheadervar +#A variable declaration is exported but does not appear in a header file. + + +################################################################################# + +#Unrecognized Identifiers + +unrecog=;SFP-1;CWE-456 +#An unrecognized identifier is used. + +sysunrecog=;SFP-4;CWE-665 +#Report unrecognized identifiers that start with the system prefix, __ (two underscores). + +repeatunrecog=;SFP-4;CWE-665 +#Report multiple messages for unrecognized identifiers. If repeatunrecog is not set, an error is reported only the first time a particular unrecognized identifier appears in the file. + + +################################################################################# + +#Multiple Definition and Declarations + +redef=;SFP-4;CWE-665 +#A function or variable is defined more than once. + +redecl=;SFP-4;CWE-665 +#An identifier is declared more than once. + +nestedextern=;SFP-1;CWE-465 +#An extern declaration is used inside a function body. + + +################################################################################# + +#ISO Conformance + +noparams +#A function is declared without a parameter list prototype. + +oldstyle +#Function definition is in old style syntax. Standard prototype syntax is preferred. + +exitarg=Risky values +#Argument to exit has implementation defined behavior. The only valid arguments to exit are EXIT_SUCCESS, EXIT_FAILURE and 0. An error is reported if Splint can determine statically that the argument to exit is not one of these. + +usevarargs=Other +#Report if is used (should use stdarg.h). + +################################################################################# + +#Warn use + +bufferoverflow +#Use of function that may lead to buffer overflow. + +bufferoverflowhigh=;SFP-8;CWE-120 +#Use of function that may lead to buffer overflow. + +implementationoptional +#Use of a declarator that is implementation optional, not required by ISO99. + +multithreaded +#Nonreentrant function should not be used in multithreaded code. + +portability +#Use of function that may have implementationdependent behavior. + +superuser +#Call to function restricted to superusers. + +toctou +#Possible time of check, time of use vulnerability. + +unixstandard +#Use of function that need not be provided by UNIX implementations + +################################################################################# + +#Header Inclusion (Section 14.3 ) + +skipansiheaders +#Prevent inclusion of header files in a system directory with names that match standard ANSI headers. The symbolic information in the standard library is used instead. Flag in effect only if a library that includes the standard library is used. The ANSI headers are: assert, ctype, errno, float, limits, locale, math, setjmp, signal, stdarg, stddef, stdio, stdlib, strings, string, time, and wchar. + +skipisoheaders +#Prevent inclusion of header files in a system directory with names that match standard ISO C99 headers. The symbolic information in the standard library is used instead. In effect only if a library that includes the standard library is used. The ISO C99 headers are: assert, complex, ctype, errno, fenv, float, inttypes, iso646, limits, locale, math, setjmp, signal, stdarg, stdbool, stddef, stdio, stdlib, string, tgmath, time, wchar, and wctype. + +skipposixheaders +#Prevent inclusion of header files in a system directory with names that match standard POSIX headers. The symbolic information in the standard library is used instead. In effect only if a library that includes the POSIX library is used. The skipped POSIX headers are: dirent, fcntl, grp, pwd, termios, sys/stat, sys/times, sys/types, sys/utsname, sys/wait, unistd, and utime. + +warnposixheaders=Other +#Report use of a POSIX header when checking a program with a nonPOSIX library. + +warnunixheaders +#Warn the user that the unix library may not be compatible with all platforms. + +skipsysheaders +#Prevent inclusion of all header files in system directories. + +sysdirexpandmacros +#Expand macros in system directories regardless of other settings, except for macros corresponding to names defined in a load library. + +sysdirerrors +#Report errors in files in system directories (set by sysdirs). + +warnsysfiles +#Warn when a system file was listed as a command line file but Splint is not set to report errors for system files. This prevents accidentally missing warnings in system files when Splint is run in a system directory. + +singleinclude +#Optimize header inclusion to only include each header file once. + +neverinclude +#Use library information instead of including header files. + +caseinsensitivefilenames +#File names are case insensitive (file.h and FILE.H are the same file). + + + +#Comments +#These flags control how syntactic comments are interpreted. + +#commentchar +#Set the marker character for syntactic comments. Comments beginning with /* are interpreted by Splint. + +noaccess +#Ignore access comments. + +nocomments +#Ignore all stylized comments. + +supcounts +#Actual number of errors does not match number in /*@i@*/ + +lintcomments +#Interpret traditional lint comments (/*FALLTHROUGH*/, /*NOTREACHED*/, /*PRINTFLIKE*/). + +warnlintcomments=Other +#Print a warning and suggest an alternative when a traditional lint comment is used. + +unrecogcomments=Other +#Stylized comment is unrecognized. + +unrecogflagcomments +#Semantic comment attempts to set a flag that is not recognized. + +annotationerror +#A declaration uses an invalid annotation. + +commenterror +#A syntactic comment is used inconsistently. diff --git a/com.kdmanalytics.toif.splint/target/MANIFEST.MF b/com.kdmanalytics.toif.splint/target/MANIFEST.MF new file mode 100644 index 00000000..c6932ff2 --- /dev/null +++ b/com.kdmanalytics.toif.splint/target/MANIFEST.MF @@ -0,0 +1,15 @@ +Manifest-Version: 1.0 +Export-Package: com.kdmanalytics.toif.adaptor,com.kdmanalytics.toif.sp + lint +Require-Bundle: org.apache.commons.lang3;bundle-version="[3.1.0,4.0.0) + ",org.eclipse.core.runtime,com.kdmanalytics.toif.framework;bundle-ver + sion="[1.15.0,2.0.0)",org.apache.log4j;bundle-version="[1.2.15,1.3.0) + ",com.kdmanalytics.toif.common;bundle-version="[1.15.0,2.0.0)" +Bundle-Vendor: KDM Analytics Inc. +Bundle-Version: 1.15.5 +Bundle-Name: TOIF Splint +Bundle-Activator: com.kdmanalytics.toif.splint.Activator +Bundle-ManifestVersion: 2 +Bundle-SymbolicName: com.kdmanalytics.toif.splint;singleton:=true +Bundle-RequiredExecutionEnvironment: JavaSE-1.7 + diff --git a/com.kdmanalytics.toif.splint/target/classes/com/kdmanalytics/toif/adaptor/SplintAdaptor.class b/com.kdmanalytics.toif.splint/target/classes/com/kdmanalytics/toif/adaptor/SplintAdaptor.class new file mode 100644 index 00000000..6ee356a1 Binary files /dev/null and b/com.kdmanalytics.toif.splint/target/classes/com/kdmanalytics/toif/adaptor/SplintAdaptor.class differ diff --git a/com.kdmanalytics.toif.splint/target/classes/com/kdmanalytics/toif/splint/Activator.class b/com.kdmanalytics.toif.splint/target/classes/com/kdmanalytics/toif/splint/Activator.class new file mode 100644 index 00000000..fca20344 Binary files /dev/null and b/com.kdmanalytics.toif.splint/target/classes/com/kdmanalytics/toif/splint/Activator.class differ diff --git a/com.kdmanalytics.toif.splint/target/classes/config/SplintAdaptorConfiguration b/com.kdmanalytics.toif.splint/target/classes/config/SplintAdaptorConfiguration new file mode 100644 index 00000000..71ec142d --- /dev/null +++ b/com.kdmanalytics.toif.splint/target/classes/config/SplintAdaptorConfiguration @@ -0,0 +1,1934 @@ +syntax=Other.Implementation;SFP--1;CWE-398 +sysunrecog=;SFP--1;CWE--1; + +#/* +# ** Null Dereferences (Manual Section 2) +# */ + +preproc=Other;SFP--1;CWE--1 + +null=;SFP-7;CWE-476 +#misuses of null pointer +#A possibly null pointer is misused (sets nullderef, nullpass, nullref, nullassign, and nullstate). + +nullderef=;SFP-7;CWE-476 +#possible dereferencce of null pointer +#A possibly null pointer is dereferenced. Value is +#either the result of a function which may return null +#(in which case, code should check it is not null), or a +#global, parameter or structure field declared with the +#null qualifier. + +nullpass=;SFP-7;CWE-476 +#possibly null pointer passed as formal with no null annotation +#A possibly null pointer is passed as a parameter corresponding to +#a formal parameter with no /*@null@*/ annotation. If NULL +#may be used for this parameter, add a /*@null@*/ annotation +#to the function parameter declaration. + +nullret=;SFP-7;CWE-476 +#possibly null pointer returned as result with no null annotation +#Function returns a possibly null pointer, but is not declared +#using /*@null@*/ annotation of result. If function may +#return NULL, add /*@null@*/ annotation to the return +#value declaration. + +nullstate=;SFP-7;CWE-476 +#possibly null pointer reachable from a reference with no null annotation +#A possibly null pointer is reachable from a parameter or global +#variable that is not declared using a /*@null@*/ annotation. + +nullassign=;SFP-4;CWE-684 +#inconsistent assignment or initialization involving null pointer +#A reference with no null annotation is assigned or initialized +#to NULL. Use /*@null@*/ to declare the reference as +#a possibly null pointer. + +nullinit=;SFP-4;CWE-684 +#inconsistent initialization involving null pointer +#A reference with no null annotation is initialized +#to NULL. Use /*@null@*/ to declare the reference as +#a possibly null pointer. + + + + + +# /* +# ** Undefined Values (Section 3) +# */ + +usedef=;SFP-1;CWE-457 +#use before definition +#An rvalue is used that may not be initialized to a value on some execution path. + +mustdefine=;SFP-1;CWE-457 +#out storage not defined before return or scope exit +#An out parameter or global is not defined before control is transferred. + +uniondef=;SFP-1;CWE-456 +#at least one field of a union must be defined +#No field of a union is defined. Generally, one field of a union is +#expected to be defined. + +compdef=;SFP-1;CWE-456 +#parameter, return value or global completely defined +#Storage derivable from a parameter, return value or global is +#not defined. Use /*@out@*/ to denote passed or returned +#storage which need not be defined. + +fullinitblock=;SFP-1;CWE-456 +#initializer sets all fields +#Initializer does not set every field in the structure. + +initallelements=;SFP-1;CWE-456 +#initializer defines all array elements +#Initializer does not define all elements of a declared array. + +initsize=;SFP-1;CWE-684 +#initializer defines extra array elements +#Initializer block contains more elements than the size of a declared array. + +impouts=;SFP-1;CWE-684 +#pointer parameters to unspecified functions may be implicit out parameters + + + + + + +# /* +# ** Types (Section 4) +# */ + +incondefs=;SFP-1;CWE-710 +#A function, variable or constant is redefined with a different type. + +matchfields=;SFP--1;CWE-710 +#A struct, union or enum type is redefined with inconsistent fields or members. + +fcnderef=;SFP--1;CWE-398 +#dereferencce of a function type +#A function type is dereferenced. The ANSI standard allows this +#because of implicit conversion of function designators, however the +#dereference is unnecessary. + +realcompare=Other.Design;SFP--1;CWE-480 +#dangerous equality comparison between reals (dangerous because of inexact +#floating point representations) +#Two real (float, double, or long double) values are compared +#directly using == or != primitive. +#This may produce unexpected results since floating point +#representations are inexact. Instead, compare the difference to + +realrelatecompare=Other.Design;SFP--1;CWE-480 +#possibly dangerous relational comparison between reals (dangerous because of inexact +#floating point representations) +#Two real (float, double, or long double) values are compared +#directly using < or >. +#This may produce unexpected results since floating point +#representations are inexact. Instead, compare the difference to + +unsignedcompare=;SFP--1;CWE-398 +#comparison using <, <=, >= between an unsigned integral and zero constant +#An unsigned value is used in a comparison with zero in a way that is either a bug or confusing. + +ptrarith=;SFP-1;CWE-480 +#arithmetic involving pointer and integer +#Pointer arithmetic using pointer and integer. + +nullptrarith=;SFP-1;CWE-704 +#arithmetic involving possibly null pointer and integer +#Pointer arithmetic using a possibly null pointer and integer. + +ptrcompare=;SFP-1;CWE-480 +#comparison between pointer and number +#A pointer is compared to a number. + +strictops=;SFP-1;CWE-480 +#primitive operation does not type check strictly +#A primitive operation does not type check strictly. + +bitwisesigned=;SFP-1;CWE-480 +#a bitwise logical operator does not have unsigned operands +#An operand to a bitwise operator is not an unsigned values. This +#may have unexpected results depending on the signed +#representations. + +shiftnegative=;SFP-1;CWE-480 +#a shift right operand may be negative +#The right operand to a shift operator may be negative (behavior undefined). + +shiftimplementation=;SFP-1;CWE-480 +#a shift left operand may be negative +#The left operand to a shift operator may be negative (behavior is implementation-defined). + +sizeoftype=;SFP-1;CWE-467 +#sizeof operator has a type argument +#Operand of sizeof operator is a type. (Safer to use expression, +#int *x = sizeof (*x); instead of sizeof (int).) + +sizeofformalarray=;SFP-1;CWE-467 +#sizeof operator has an array formal parameter argument +#Operand of a sizeof operator is a function parameter declared as +#an array. The value of sizeof will be the size of a pointer to the +#element type, not the number of elements in the array. + +fixedformalarray=;SFP-7;CWE-710 +#formal parameter of type array is declared with size +#A formal parameter is declared as an array with size. The size of the array +#is ignored in this context, since the array formal parameter is treated +#as a pointer. + +incompletetype=;SFP--1;CWE-710 +#formal parameter has an incomplete type +#A formal parameter is declared with an incomplete type. + +formalarray=;SFP-7;CWE-469 +#formal parameter is an array +#A formal parameter is declared as an array. This can be confusing, since +#a formal array parameter is treated as a pointer. + + + + + + + +# /* +# ** Booleans (4.2) +# */ + +likelybool=Other.Implementation;SFP--1;CWE-710 +#type name is probably a boolean type but does not match default +#boolean type name, \bool\ and alternate name is not set +#Use the -booltype, -boolfalse and -booltrue flags to change the +#name of the default boolean type. + +boolcompare=;SFP--1;CWE-398 +#comparison between bools (dangerous because of multiple true values) +#Two bool values are compared directly using a C primitive. This +#may produce unexpected results since all non-zero values are +#considered true, so different true values may not be equal. +#The file bool.h (included in splint/lib) provides bool_equal +#for safe bool comparisons. + +boolops=;SFP-1;CWE-480 +#primitive operation (!, && or ||) does not has a boolean argument +#The operand of a boolean operator is not a boolean. Use +ptrnegate +#to allow ! to be used on pointers. + +ptrnegate=;SFP-1;CWE-480 +#allow ! to be used on pointer operand +#The operand of ! operator is a pointer. + +predassign=;SFP-1;CWE-481 +#condition test (if, while or for) is an assignment +#The condition test is an assignment expression. Probably, you mean +#to use == instead of =. If an assignment is intended, add an +#extra parentheses nesting (e.g., if ((a = b)) ...) to suppress +#this message. + +predbool=;SFP-1;CWE-480 +#type of condition test (if, while or for) not bool (sets predboolint, +#predboolptr and predboolothers) +#Test expression type is not boolean. + +predboolothers=;SFP-1;CWE-480 + +predboolint=;SFP-1;CWE-704 +#type of condition test (if, while or for) is an integral type +#Test expression type is not boolean or int. + +predboolptr=;SFP-1;CWE-704 +#type of condition test (if, while or for) is a pointer +#Test expression type is not boolean. + +predboolOthers=;SFP--1;CWE-398 +#type of condition test (if, while or for) not bool, int or pointer +#Test expression type is not boolean. + + + + + + + +# /* +# ** 4.3 Abstract types +# */ + +abstract=;SFP--1;CWE-710 +#data abstraction barriers +#An abstraction barrier is broken. If necessary, use /*@access @*/ to allow access to an abstract type. + +abstractcompare=;SFP-1;CWE-480 +#object equality comparison on abstract type operands +#An object comparison (== or !=) is used on operands of abstract type. + +numabstract=;SFP--1;CWE-710 +#data abstraction barriers +#An abstraction barrier involving a numabstract type is broken. If necessary, use /*@access @*/ to allow access to a numabstract type. + +numabstractcast=;SFP-1;CWE-710 +#numeric literal cast to numabstract type +#A numeric literal is cast to a numabstract type. + +numabstractlit=;SFP-1;CWE-710 +#numeric literal can used as numabstract type +#To allow a numeric literal to be used as a numabstract type, use +numabstractlit. + +numabstractindex=;SFP--1;CWE-398 +#a numabstract type can be used to index an array +#To allow numabstract types to index arrays, use +numabstractindex. + +numabstractprint=;SFP-1;CWE-704 +#a numabstract value is printed using %d format code +#A numabstract value is printed usind %d format code in a printf. + +impabstract=;SFP--1;CWE--1 +#assume user type definitions are abstract (unless /*@concrete@*/ is used) + + +charindex=;SFP--1;CWE-398 + + +# /* 4.3.1 Access */ + +accessmodule=;SFP--1;CWE--1 +#allow access to abstract types in definition module +#The representation of an abstract type defined in . is +#accessible anywhere in a file named .. + +#accessfile=;SFP--1;CWE--1 +#allow access to abstract types by file name convention +#The representation of an abstract type named is +#accessible anywhere in a file named .. + +accessczech=;SFP--1;CWE--1 +#allow access to abstract types by czech naming convention +#The representation of an abstract type named is accessible +#in the definition of a function or constant named _ + +accessslovak=;SFP--1;CWE--1 +#allow access to abstract types by slovak naming convention +#The representation of an abstract type named is accessible +#in the definition of a function or constant named + +accessczechoslovak=;SFP--1;CWE--1 +#allow access to abstract types by czechoslovak naming convention +#The representation of an abstract type named is accessible +#in the definition of a function or constant named _ or + +accessall=;SFP--1;CWE--1 +#set accessmodule, accessfile and accessczech +#Sets accessmodule, accessfile and accessczech + + + + + + + +# /* 4.3.2 Mutability */ + + +mutrep=;SFP--1;CWE-710 +#representation of mutable type has sharing semantics +#LCL semantics requires that a mutable type exhibits sharing semantics. +#In order for objects to be shared a indirection is necessary in the representation. +#A mutable type may be represented by a pointer or an abstract mutable type. Handles +#into static data are fine, too, but will generate this error message unless it is suppressed. + + + + + + +# /* +# ** Memory Management (5) +# */ + + +# /* Deallocation Errors */ + + +mustfreefresh=;SFP-14;CWE-401 +#freshly allocated storage not released before return or scope exit +#A memory leak has been detected. Storage allocated locally +#is not released before the last reference to it is lost. + +mustfreeonly=;SFP-14;CWE-401 +#only storage not released before return or scope exit +#A memory leak has been detected. Only-qualified storage is not released before the last +#reference to it is lost. + +mustfree=;SFP-14;CWE-401 +#fresh or only storage not released before return or scope exit (sets mustfreefresh and mustfreeonly) +#A memory leak has been detected. + +usereleased=;SFP-15;CWE-416 +#storage used after release +#Memory is used after it has been released (either by passing +#as an only param or assigning to an only global). + +strictusereleased=;SFP-15;CWE-416 +#element used after it may have been released +#Memory (through fetch) is used after it may have been released +#(either by passing as an only param or assigning to an only global). + +compdestroy=;SFP-14;CWE-401 +#all only references derivable from void pointer out only parameter are released +#A storage leak due to incomplete deallocation of a structure or deep +#pointer is suspected. Unshared storage that is reachable from +#a reference that is being deallocated has not yet been deallocated. +#Splint assumes when an object is passed +#as an out only void pointer that the outer object will be +#deallocated, but the inner objects will not. + + +branchstate=;SFP--1;CWE--1 +#storage has inconsistent states of alternate paths through a branch +#The state of a variable is different depending on which branch +#is taken. This means no annotation can sensibly be applied +#to the storage. + +strictbranchstate=;SFP--1;CWE--1 +#storage through array fetch has inconsistent states of alternate +#paths through a branch +#The state of a variable through an array fetch is different depending +#on which branch is taken. This means no annotation can sensibly be applied +#to the storage. + +compmempass=;SFP--1;CWE-710 +#actual parameter matches alias kind of formal parameter completely +#Storage derivable from a parameter does not match the alias kind +#expected for the formal parameter. + +stackref=;SFP-1;CWE-562 +#external reference to stack-allocated storage is created +#A stack reference is pointed to by an external reference when the +#function returns. The stack-allocated storage is destroyed +#after the call, leaving a dangling reference. + +memtrans=;SFP--1;CWE-710 +#memory transfer errors (sets all *trans flags) +#Memory is transferred in a way that violates annotations. + +dependenttrans=;SFP--1;CWE-710 +#dependent transfer errors +#Dependent storage is transferred to a non-dependent reference. + +newreftrans=;SFP--1;CWE--1 +#new reference transfer to reference counted reference +#A new reference is transferred to a reference counted reference. + +onlytrans=;SFP--1;CWE-701 +#only storage transferred to non-only reference (memory leak) +#The only reference to this storage is transferred to another +#reference (e.g., by returning it) that does not have the +#only annotation. This may lead to a memory leak, since the +#new reference is not necessarily released. + +onlyunqglobaltrans=;SFP-14;CWE-401 +#only storage transferred to an unqualified global or +#static reference (memory leak) +#The only reference to this storage is transferred to another +#reference that does not have an aliasing annotation. +#This may lead to a memory leak, since the +#new reference is not necessarily released. + +ownedtrans=;SFP--1;CWE-710 +#owned storage transferred to non-owned reference (memory leak) +#The owned reference to this storage is transferred to another +#reference (e.g., by returning it) that does not have the +#owned annotation. This may lead to a memory leak, since the +#new reference is not necessarily released. + +freshtrans=;SFP--1;CWE-710 +#fresh storage transferred to non-only reference (memory leak) +#Fresh storage (newly allocated in this function) is transferred +#in a way that the obligation to release storage is not +#propagated. Use the /*@only@*/ annotation to indicate +#the a return value is the only reference to the returned +#storage. + +sharedtrans=;SFP--1;CWE-710 +#shared storage transferred to non-shared reference +#Shared storage is transferred to a non-shared reference. The other +#reference may release storage needed by this reference. + +temptrans=;SFP--1;CWE-710 +#temp storage transferred to non-temporary reference +#Temp storage (associated with a formal parameter) is transferred +#to a non-temporary reference. The storage may be released +#or new aliases created. + +kepttrans=;SFP--1;CWE-710 +#kept storage transferred to non-temporary reference +#storage is transferred +#to a non-temporary reference after being passed as keep parameter. The storage may be released +#or new aliases created. + +keeptrans=;SFP--1;CWE-710 +#keep storage transferred inconsistently +#Keep storage is transferred inconsistently --- either in a way +#that may add a new alias to it, or release it. + +immediatetrans=;SFP--1;CWE-398 +#an immediate address (result of &) is transferred inconsistently +#An immediate address (result of & operator) is transferred +#inconsistently. + +refcounttrans=;SFP--1;CWE-398 +#reference counted storage is transferred in an inconsistent way +#Reference counted storage is transferred in a way that may not +#be consistent with the reference count. + +statictrans=;SFP--1;CWE-398 +#static storage is transferred in an inconsistent way +#Static storage is transferred in an inconsistent way. + +unqualifiedtrans=;SFP--1;CWE-398 +#unqualified storage is transferred in an inconsistent way +#Unqualified storage is transferred in an inconsistent way. + +staticinittrans=;SFP--1;CWE-398 +#static storage is used as an initial value in an inconsistent way +#Static storage is used as an initial value in an inconsistent way. + +unqualifiedinittrans=;SFP--1;CWE-398 +#unqualified storage is used as an initial value in an inconsistent way +#Unqualified storage is used as an initial value in an inconsistent way. + +readonlytrans=;SFP--1;CWE-398 +#report memory transfer errors for initializations to read-only string literals +#A read-only string literal is assigned to a non-observer reference. + +passunknown=;SFP--1;CWE-710 +#passing a value as an un-annotated parameter clears its annotation + + + + + +# /* 5.3 Implicit Memory Annotations */ + +readonlystrings=;SFP-12;CWE-590 +#string literals are read-only (error if one is modified or released) +#String literals are read-only. An error is reported +#if a string literal may be modified or released. + +memimp=;SFP--1;CWE--1 +#memory errors for unqualified storage + +paramimptemp=;SFP--1;CWE--1 +#assume unannotated parameter is temp + +globimponly=;SFP--1;CWE--1 +#assume unannotated global storage is only + +retimponly=;SFP--1;CWE--1 +#assume unannotated returned storage is only + +structimponly=;SFP--1;CWE--1 +#assume unannotated structure field is only + +specglobimponly=;SFP--1;CWE--1 +#assume unannotated global storage is only + +specretimponly=;SFP--1;CWE--1 +#assume unannotated returned storage is only + +specstructimponly=;SFP--1;CWE--1 +#assume unannotated structure field is only + + + + + + +# /* Reference Counting */ + +# /* +# ** 6. Sharing +# */ + +# /* 6.1 Aliasing warnings */ + +aliasunique=;SFP--1;CWE-710 +#unique parameter is aliased +#A unique or only parameter is aliased by some other parameter or visible global. + +mayaliasunique=;SFP--1;CWE-710 +#unique parameter may be aliased +#A unique or only parameter may be aliased by some other parameter or visible global. + +mustnotalias=;SFP--1;CWE-710 +#temp storage aliased at return point or scope exit +#An alias has been added to a temp-qualifier parameter or global that is visible externally when the function returns. If the aliasing is needed, use the /*@shared@*/ annotation to indicate that new aliases to the parameter may be created. + +retalias=;SFP-1;CWE-562 +#function returns alias to parameter or global +#The returned value shares storage with a parameter or global. If a parameter is to be returned, use the returned qualifier. If the result is not modified, use the observer qualifier on the result type. otherwise, exposed can be used, but limited checking is done. 0, 0 + + + + + +# /* Global aliasing */ + +globalias=;SFP--1;CWE-710 +#function returns with global aliasing external state (sets +#checkstrictglobalias, checkedglobalias, checkmodglobalias and +#uncheckedglobalias) +#A global variable aliases externally-visible state when the function returns. + +checkstrictglobalias=;SFP--1;CWE-710 +#function returns with a checkstrict global aliasing external state +#A global variable aliases externally-visible state when the function returns. + +checkedglobalias=;SFP--1;CWE-710 +#function returns with a checked global aliasing external state +#A global variable aliases externally-visible state when the function returns. + +checkmodglobalias=;SFP--1;CWE-710 +#function returns with a checkmod global aliasing external state +#A global variable aliases externally-visible state when the function returns. + +uncheckedglobalias=;SFP--1;CWE-710 +#function returns with an unchecked global aliasing external state +#A global variable aliases externally-visible state when the function returns. + + + + + + +# /* 6.2 Exposure */ + +exposetrans=;SFP-25;CWE-454 +#exposure transfer errors +#Exposed storage is transferred to a non-exposed, non-observer reference. + +observertrans=;SFP-25;CWE-454 +#observer transfer errors +#Observer storage is transferred to a non-observer reference. + +repexpose=;SFP-25;CWE-454 +#abstract representation is exposed (sets assignexpose, retexpose, and castexpose) +#The internal representation of an abstract type is visible to the +#caller. This means clients may have access to a pointer +#into the abstract representation. + +retexpose=;SFP-25;CWE-454 +#abstract representation is exposed (return values only) +#The return value shares storage with an instance of an abstract +#type. This means clients may have access to a pointer into +#the abstract representation. Use the observer qualifier to +#return exposed storage that may not be modified by the +#client. Use the exposed qualifier to return modifiable +#(but not deallocatable) exposed storage (dangerous). + +assignexpose=;SFP-25;CWE-454 +#abstract representation is exposed (assignments only) +#Storage internal to the representation of an abstract type is +#assigned to an external pointer. This means clients may +#have access to a pointer into the abstract representation. +#If the external pointer is a parameter, the exposed qualifier +#can be used to allow the assignment, however, this is +#considered dangerous programming practice. + +castexpose=;SFP-25;CWE-454 +#abstract representation is exposed through a cast +#Storage internal to the representation of an abstract type is exposed +#through a type cast. This means clients may have access to a +#pointer into the abstract representation. + +redundantsharequal=;SFP--1;CWE-710 +#declaration uses observer qualifier that is always true +#A declaration of an immutable object uses a redundant observer qualifier. + +misplacedsharequal=;SFP--1;CWE-710 +#declaration of unsharable storage uses sharing annotation +#A declaration of an unsharable object uses a sharing annotation. + + + + + + +# /* +# ** 7. Function Interfaces +# */ + +# /* 7.1 Modifications */ + +mods=Other.Implementation;SFP--1;CWE-710 +#unspecified modification of caller-visible state +#An externally-visible object is modified by a function, but not +#listed in its modifies clause. + +mustmod=Other.Implementation;SFP--1;CWE-710 +#specified modification is not detected +#An object listed in the modifies clause is not modified by the +#implementation of the function. The modification may not +#be detected if it is done through a call to an unspecified +#function. + +modobserver=Other.Implementation;SFP--1;CWE-710 +#possible modification of observer storage +#Storage declared with observer is possibly modified. Observer +#storage may not be modified. + +modobserveruncon=Other.Implementation;SFP--1;CWE-710 +#possible modification of observer storage through unconstrained call +#Storage declared with observer may be modified through a call to an +#unconstrained function. + +modinternalstrict=Other.Implementation;SFP--1;CWE-710 +#possible modification of internal storage through function call +#A function that modifies internalState is called from a function that +#does not list internalState in its modifies clause + +modunspec=Other.Implementation;SFP--1;CWE-710 +#modification in unspecified functions (sets modnomods, +#modglobunspec and modstrictglobsunspec) + +modnomods=Other.Implementation;SFP--1;CWE-710 +#modification in a function with no modifies clause +#An externally-visible object is modified by a function with no +#/*@modifies@*/ comment. The /*@modifies ... @*/ control +#comment can be used to give a modifies list for an +#unspecified function. + +moduncon=Other.Implementation;SFP--1;CWE-710 +#possible modification through a call to an unconstrained function +#An unconstrained function is called in a function body where +#modifications are checked. Since the unconstrained function +#may modify anything, there may be undetected modifications in +#the checked function. + +modunconnomods=Other.Implementation;SFP--1;CWE-710 +#possible modification through a call to an unconstrained function in +#a function with no modifies clause +#An unconstrained function is called in a function body where +#modifications are checked. Since the unconstrained function +#may modify anything, there may be undetected modifications in +#the checked function. + +globsimpmodsnothing=Other.Implementation;SFP--1;CWE-710 +#functions declared with a globals list but no modifies clause are +#assumed to modify nothing +#An implicit modifies nothing clause is assumed for a function +#declared with a globals list but not modifies clause. + +modsimpnoglobs=Other.Implementation;SFP--1;CWE-710 +#functions declared with a modifies clause but no globals list +#are assumed to use no globals +#An implicit empty globals list is assumed for a function +#declared with a modifies clause but no globals list. + + + + + + +# /* +# ** Globals +# */ + +globstate=;SFP-7;CWE-684 +#returns with global in inconsistent state (null or undefined) +#A global variable does not satisfy its annotations when control is transferred. + + +globuse=;SFP--1;CWE-710 +#global listed for a function not used +#A global variable listed in the function's globals list is not used +#in the body of the function. + +internalglobs=;SFP--1;CWE-710 +#use of internalState +#A called function uses internal state, but the globals list for the +#function being checked does not include internalState + +internalglobsnoglobs=;SFP--1;CWE-710 +#use of internalState (in function with no globals list) +#A called function uses internal state, but the function being checked +#has no globals list + +warnmissingglobs=;SFP--1;CWE-710 +#global variable used in modifies clause is not listed in globals list +#A global variable is used in the modifies clause, but it is not listed in +#the globals list. The variable will be added to the globals list. + +warnmissingglobsnoglobs=;SFP--1;CWE-710 +#global variable used in modifies clause in a function with no globals list +#A global variable is used in the modifies clause, but the function +#has no globals list. The variable will be added to the globals list. + +globnoglobs=;SFP--1;CWE-710 +#use of checked global in a function with no globals list or specification +#A specified global variable is used in the function, but not listed +#in its globals list. Without +globnoglobs, only globals +#declared with /*@checkedstrict@*/ will produce use +#errors in functions without globals +#lists. The /*@globals ... @*/ control comment can be used to give +#a globals list for an unspecified function. + +modglobs=;SFP--1;CWE-710 +#undocumented modification of a checked global variable +#A checked global variable is modified by the function, but not listed in +#its modifies clause. + +modglobsnomods=;SFP--1;CWE-710 +#undocumented modification of a checked global variable in a function +#declared with no modifies clause +#A checked global variable is modified by the function, but not listed in +#its modifies clause. + +modstrictglobsnomods=;SFP--1;CWE-710 +#undocumented modification of a strict checked global variable in a +#function declared with no modifies clause +#A checked global variable is modified by the function, but not listed in +#its modifies clause. + +modglobsunchecked=;SFP--1;CWE-710 +#undocumented modification of an unchecked checked global variable +#An unchecked global variable is modified by the function, but not listed in +#its modifies clause. + + + + + + + + +# /* +# ** State Clauses +# */ + +# /* +# ** 8. Control Flow +# */ + +# /* 8.1 Execution */ + +noret=;SFP--1;CWE-398 +#path with no return detected in non-void function +#There is a path through a function declared to return a value on +#which there is no return statement. This means the execution +#may fall through without returning a meaningful result to +#the caller. + +emptyret=;SFP--1;CWE--1 +#empty return in function declared to return value + +alwaysexits=;SFP-1;CWE-570 +#loop predicate always exits + + + + + +# /* 8.2 Undefined Behavior */ + +evalorder=;SFP--1;CWE-710 +#code has unspecified or implementation-dependent behavior +#because of order of evaluation +#Code has unspecified behavior. +#Order of evaluation of function parameters or subexpressions +#is not defined, so if a value is used and modified in different +#places not separated by a sequence point constraining +#evaluation order, then the result of the expression is +#unspecified. + +evalorderuncon=;SFP--1;CWE-88 +#code involving call to unspecified function has undefined or implementation-dependent behavior +#Code involving a call to function with no modifies or globals clause +#may have undefined or implementation-dependent behavior (Splint assumes the +#unconstrained call may modify any reachable state or use any global). Add a +#specification for the function. + + + + + + +# /* 8.3 Problematic Control Structures */ + +# /* 8.3.1 Infinite Loops */ + +infloops=;SFP--1;CWE-835 +#likely infinite loop is detected +#This appears to be an infinite loop. Nothing in the body of the +#loop or the loop test modifies the value of the loop test. +#Perhaps the specification of a function called in the loop +#body is missing a modification. + +infloopsuncon=;SFP--1;CWE-835 +#likely infinite loop is detected (may result from unconstrained function) +#This appears to be an infinite loop. Nothing in the body of the +#loop or the loop test modifies the value of the loop test. +#There may be a modification through a call to an unconstrained +#function, or an unconstrained function in the loop test may use +#a global variable modified by the loop body. + + + + + + +# /* 8.3.2 Switches */ + +casebreak=;SFP-4;CWE-484 +#non-empty case in a switch without preceding break +#Execution falls through from the previous case (use /*@fallthrough@*/ to mark fallthrough cases). 0, 0 + +misscase=;SFP--1;CWE-230 +#switch on enum type missing case for some value +#Not all values in an enumeration are present as cases in the switch. + +firstcase=;SFP--1;CWE-710 +#first statement in switch is not a case +#The first statement after a switch is not a case. + +duplicatecases=;SFP--1;CWE-697 +#duplicate cases in switch +#Duplicate cases in switch. + + + + + + +# /* 8.3.3 Deep Breaks */ + +deepbreak=;SFP--1;CWE-710 +#break inside nested while or for or switch +#A break statement appears inside the body of a nested while, for or +#switch statement. Sets looploopbreak, loopswitchbreak, +#switchloopbreak, switchswitchbreak, and looploopcontinue. + +looploopbreak=;SFP--1;CWE-710 +#break inside nested while or for +#A break statement appears inside the body of a nested while or for +#statement. This is perfectly reasonable code, but check that +#the break is intended to break only the inner loop. The +#break statement may be preceded by /*@innerbreak@*/ to suppress +#the message for this break only. + +switchloopbreak=;SFP--1;CWE-710 +#break in loop inside switch +#A break statement appears inside the body of a while or for +#statement within a switch. This is perfectly reasonable code, but check that +#the break is intended to break only the inner loop. The +#break statement may be preceded by /*@loopbreak@*/ to suppress +#the message for this break only. + +loopswitchbreak=;SFP--1;CWE-710 +#break in switch inside loop +#A break statement appears inside a switch statement within a while or +#for loop. This is perfectly reasonable code, but check that +#the break is intended to break only the inner loop. The +#break statement may be preceded by /*@switchbreak@*/ to suppress +#the message for this break only. + +switchswitchbreak=;SFP--1;CWE-710 +#break in switch inside switch +#A break statement appears inside a switch statement within another +#switch statement. This is perfectly reasonable code, but check that +#the break is intended to break only the inner switch. The +#break statement may be preceded by /*@innerbreak@*/ to suppress +#the message for this break only. + +looploopcontinue=;SFP--1;CWE-710 +#continue inside nested loop +#A continue statement appears inside a loop within a loop. +#This is perfectly reasonable code, but check that +#the continue is intended to continue only the inner loop. The +#continue statement may be preceded by /*@innercontinue@*/ to suppress +#the message for this continue only. + + + + +# /* 8.3.4 Loop and If Bodies */ + +whileempty=;SFP--1;CWE--398 +#a while statement has no body +#While statement has no body. + +whileblock=;SFP--1;CWE-710 +#the body of a while statement is not a block +#While body is a single statement, not a compound block. + +forempty=;SFP--1;CWE-398 +#a for statement has no body +#For statement has no body. + +forblock=;SFP--1;CWE-710 +#the body of a for statement is not a block +#Loop body is a single statement, not a compound block. + +ifempty=;SFP--1;CWE-710 +#an if statement has no body +#If statement has no body. + +ifblock=;SFP--1;CWE-710 +#the body of an if statement is not a block +#If body is a single statement, not a compound block. + +allempty=;SFP--1;CWE-710 +#an if, while or for statement has no body (sets ifempty, +#whileempty and forempty + +allblock=;SFP--1;CWE-710 +#the body of an if, while or for statement is not a block +#(sets ifblock, whileblock and forblock) +#Body is a single statement, not a compound block. + + + + + +# /* 8.3.5 Complete Logic */ + +elseifcomplete=;SFP--1;CWE-710 +#if ... else if chains must have final else +#There is no final else following an else if construct. + + + + + +# /* 8.4 Suspicious Statements */ + +unreachable=;SFP-2;CWE-561 +#unreachable code detected +#This code will never be reached on any possible execution. + + + + + +# /* 8.4.1 Statements with No Effects */ + +noeffect=;SFP--1;CWE-398 +#statement with no effect +#Statement has no visible effect --- no values are modified. + +noeffectuncon=;SFP--1;CWE-710 +#statement with no effect (except possibly through call to +#unconstrained function) +#Statement has no visible effect --- no values are modified. It may +#modify something through a call to an unconstrained function. + + + + + +# /* 8.4.2 Ignored Return Values */ + +retval=;SFP-4;CWE-252 +#return value ignored (sets retvalint, retvalbool and retvalother) +#Result returned by function call is not used. If this is intended, +# cast result to (void) to eliminate message. + +retvalother=;SFP-4;CWE-252 +#return value of type other than bool or int ignored +#Result returned by function call is not used. If this is intended, +# can cast result to (void) to eliminate message. + +retvalbool=;SFP-4;CWE-252 +#return value of manifest type bool ignored +#Result returned by function call is not used. If this is intended, +# can cast result to (void) to eliminate message. + +retvalint=;SFP-4;CWE-252 +#return value of type int ignored +#Result returned by function call is not used. If this is intended, +# can cast result to (void) to eliminate message. + + + + + +# /* +# ** 9. Buffer Sizes +# */ + +nullterminated=;SFP-11;CWE-170 +#misuse of nullterminated allocation +#A possibly non-nullterminated string/memory is used/referenced as a nullterminated one. + +bounds=;SFP-8;CWE-119 +#memory bounds checking (sets boundsread and boundswrite) +#Memory read or write may be out of bounds of allocated storage. + +likelybounds=;SFP-8;CWE-119 +#memory bounds checking (sets likelyboundsread and likelyboundswrite) +#Memory read or write may be out of bounds of allocated storage. + +likelyboundsread=;SFP-8;CWE-119 +#likely out of bounds read +#A memory read references memory beyond the allocated storage. + +likelyboundswrite=;SFP-8;CWE-119 +#likely buffer overflow from an out of bounds write +#A memory write may write to an address beyond the allocated buffer. + +boundsread=;SFP-8;CWE-125 +#possible out of bounds read +#A memory read references memory beyond the allocated storage. + +boundswrite=;SFP-8;CWE-787 +#possible buffer overflow from an out of bounds write +#A memory write may write to an address beyond the allocated buffer. + + + + + +/*drl7x added 6/18/01 */ + +checkpost=;SFP--1;CWE-710 +#unable to verify predicate in ensures clause +#The function implementation may not satisfy a post condition given in an ensures clause. + +impboundsconstraints=;SFP--1;CWE--1 +#generate implicit constraints for functions + + + +# /* evans added 2003-06-08 */ + +allocmismatch=;SFP-1;CWE-681 +#type conversion involves storage of non-divisble size + + + + + +# /* +# ** 10. Extensible Checking +# */ + + +statetransfer=;SFP--1;CWE-682 +#storage has been transfered with invalid state +#Transfer violates user-defined state rules. + +statemerge=;SFP--1;CWE-372 +#control paths merge with storage in incompatible states +#Control path merge violates user-defined state merge rules. + + + + + +# /* +# ** 11. Macros +# */ + +macroredef=;SFP--1;CWE-710 +#macro redefined +#A macro is defined in more than one place. + +macrounrecog=;SFP--1;CWE--1 +#unrecognized identifier in macro +#An unrecognized identifier appears in a macro. If the identifier +#is defined before the macro is used, then this is okay. + + + + + +# /* 11.1 Constant Macros */ + +macroconstdecl=;SFP--1;CWE-710 +#non-parameterized macro without prototype or specification +#Macro constant has no declaration. Use /*@constant ...@*/ to +#declare the macro. + +macroconstdistance=;SFP--1;CWE-710 +#macro constant name does not match nearby name +#Macro constant name does matches name of a previous declaration, but they are not near each other. + + + + + +# /* 11.2 Function-like Macros */ + +macrostmt=;SFP--1;CWE-710 +#macro definition is syntactically not equivalent to function +#A macro is defined in a way that may cause syntactic problems. +#If the macro returns a value, use commas to separate expressions; +#otherwise, use do while (FALSE) construct. + +macroempty=;SFP--1;CWE-398 +#macro definition for is empty +#A macro definition has no body. + +macroparams=;SFP--1;CWE-710 +#macro parameter not used exactly once +#A macro parameter is not used exactly once in all possible +#invocations of the macro. To behave like a function, +#each macro parameter must be used exactly once on all +#invocations of the macro so that parameters with +#side-effects are evaluated exactly once. Use /*@sef@*/ to +#denote parameters that must be side-effect free. + +macroret=;SFP--1;CWE-710 +#return statement in macro body +#The body of a macro declared as a function uses a return statement. +#This exhibits behavior that +#could not be implemented by a function. + +macroassign=;SFP--1;CWE-710 +#assignment to a macro parameter +#A macro parameter is used as the left side of an +#assignment expression. This exhibits behavior that +#could not be implemented by a function. + +macroparens=;SFP--1;CWE-710 +#macro parameter used without parentheses (in potentially dangerous context) +#A macro parameter is used without parentheses. This could be +#dangerous if the macro is invoked with a complex expression +#and precedence rules will change the evaluation inside the macro. + +macrodecl=;SFP--1;CWE-710 +#macro without prototype or specification (sets macrofcndecl and macroconstdecl) +#Argument checking cannot be done well for macros without prototypes +#or specifications, since the types of the arguments are unknown. + +macrofcndecl=;SFP--1;CWE-710 +#parameterized macro without prototype or specification +#Function macro has no declaration. + + + + + + +# /* 11.2.1 Side Effect Free Parameters */ + +sefparams=;SFP--1;CWE-710 +#a parameter with side-effects is passed as a sef parameter +#An actual parameter corresponding to a sef parameter may have a side-effect. + +sefuncon=;SFP--1;CWE-710 +#a parameter with unconstrained side-effects is passed as a sef parameter +#An actual parameter corresponding to a sef parameter involves a call +#to a procedure with no modifies clause that may have a side-effect. + + + + + + +# /* 11.3 Controlling Macro Checking */ + +constmacros=;SFP--1;CWE--1 +#check all macros without parameter lists as constants +#Every non-parameterized macro (not preceded by /*@notfunction@*/) +#is checked as a constant. + +fcnmacros=;SFP--1;CWE--1 +#check all macros with parameter lists as functions +#Every parameterized macro (not preceded by /*@notfunction@*/) +#is checked as a function. + +allmacros=;SFP--1;CWE--1 +#sets fcnmacros and constmacros +#All macros (not preceded by /*@notfunction@*/) are checked as functions or +#constants depending on whether or not they have parameter lists. + +libmacros=;SFP--1;CWE--1 +#check all macros with declarations in library as functions +#Every macro declared in the load library is checked. + +specmacros=;SFP--1;CWE--1 +#check all macros corresponding to specified functions or constants +#Every macro declared a specification file is checked. + +macromatchname=;SFP--1;CWE-710 +#macro definition does not match iter or constant declaration +#A iter or constant macro is defined using a different name from the +#one used in the previous syntactic comment + +nextlinemacros=;SFP--1;CWE-710 +#the line after a constant or iter declaration must be a macro definition +#A constant or iter declaration is not immediately followed by a macro definition. + + + + + +# /* 11.4 Iterators */ + +iterbalance=;SFP--1;CWE-710 +#iter is not balanced with end_ + +iteryield=;SFP--1;CWE-710 +#iter yield parameter is inappropriate + +hasyield=;SFP--1;CWE-710 +#iter declaration has no yield parameters +#An iterator has been declared with no parameters annotated with +#yield. This may be what you want, if the iterator is meant +#to do something a fixed number of times, but returns no +#information to the calling context. Probably, a parameter +#is missing the yield annotation to indicate that it is +#assigned a value in the calling context. + + + + + + +# /* +# ** 12. Naming Conventions +# */ + +namechecks=;SFP--1;CWE--1 +#controls name checking without changing other settings + + + + + +# /* 12.1.1 Czech Names */ + +czech=;SFP--1;CWE-710 +#czech naming convention (sets accessczech, czechfunctions, czechvars, +#czechconstants, czechenums, and czechmacros) +#Name is not consistent with Czech naming convention. + +czechfcns=;SFP--1;CWE-710 +#czech naming convention violated in a function or iterator declaration +#Function or iterator name is not consistent with Czech naming convention. + +czechvars=;SFP--1;CWE-710 +#czech naming convention violated in a variable declaration +#Variable name is not consistent with Czech naming convention. + +czechmacros=;SFP--1;CWE-710 +#czech naming convention violated in an expanded macro name +#Expanded macro name is not consistent with Czech naming convention. + +czechconsts=;SFP--1;CWE-710 +#czech naming convention violated in a constant declaration +#Constant name is not consistent with Czech naming convention. + +czechtypes=;SFP--1;CWE-710 +#czech naming convention violated in a user-defined type definition +#Type name is not consistent with Czech naming convention. Czech type +#names must not use the underscore character. + + + + +# /* 12.1.2 Slovak Names */ + +slovak=;SFP--1;CWE-710 +#slovak naming convention violated +#Name is not consistent with Slovak naming convention. + +slovakfcns=;SFP--1;CWE-710 +#slovak naming convention violated in a function or iterator declaration +#Function or iterator name is not consistent with Slovak naming convention. + +slovakmacros=;SFP--1;CWE-710 +#slovak naming convention violated in an expanded macro name +#Expanded macro name is not consistent with Slovak naming convention. + +slovakvars=;SFP--1;CWE-710 +#slovak naming convention violated in a variable declaration +#Variable name is not consistent with Slovak naming convention. + +slovakconsts=;SFP--1;CWE-710 +#slovak naming convention violated in a constant declaration +#Constant name is not consistent with Slovak naming convention. + +slovaktypes=;SFP--1;CWE-710 +#slovak naming convention violated in a use-defined type definition +#Type name is not consistent with Slovak naming convention. Slovak type +#names may not include uppercase letters. + + + + + +# /* 12.1.3 Czechoslovak Names */ + +czechoslovak=;SFP--1;CWE-710 +#czech or slovak naming convention violated +#Name is not consistent with either Czech or Slovak naming convention. + +czechoslovakfcns=;SFP--1;CWE-710 +#czechoslovak naming convention violated in a function or iterator declaration +#Function name is not consistent with Czechoslovak naming convention. + +czechoslovakmacros=;SFP--1;CWE-710 +#czechoslovak naming convention violated in an expanded macro name +#Expanded macro name is not consistent with Czechoslovak naming convention. + +czechoslovakvars=;SFP--1;CWE-710 +#czechoslovak naming convention violated in a variable declaration +#Variable name is not consistent with Czechoslovak naming convention. + +czechoslovakconsts=;SFP--1;CWE-710 +#czechoslovak naming convention violated in a constant declaration +#Constant name is not consistent with Czechoslovak naming convention. + +czechoslovaktypes=;SFP--1;CWE-710 +#czechoslovak naming convention violated in a user-defined type definition +#Type name is not consistent with Czechoslovak naming convention. Czechoslovak +#type names may not include uppercase letters or the underscore character. + + + + +# /* 12.2 Namespace Prefixes */ + +macrovarprefix=;SFP--1;CWE-710 +#set namespace prefix for variables declared in a macro body +#A variable declared in a macro body does not start with the macrovarprefix. + +macrovarprefixexclude=;SFP--1;CWE-710 +#the macrovarprefix may not be used for non-macro variables +#A variable declared outside a macro body starts with the macrovarprefix. + +tagprefix=;SFP--1;CWE-710 +#set namespace prefix for struct, union and enum tags +#A tag identifier does not start with the tagprefix. + +tagprefixexclude=;SFP--1;CWE-710 +#the tagprefix may not be used for non-tag identifiers +#An identifier that is not a tag starts with the tagprefix. + +enumprefix=;SFP--1;CWE-710 +#set namespace prefix for enum members +#An enum member does not start with the enumprefix. + +enumprefixexclude=;SFP--1;CWE-710 +#the enumprefix may not be used for non-enum member identifiers +#An identifier that is not an enum member starts with the enumprefix. + +filestaticprefix=;SFP--1;CWE-710 +#set namespace prefix for file static declarations +#A file-static identifier does not start with the filestaticprefix. + +filestaticprefixexclude=;SFP--1;CWE-710 +#the filestaticprefix may not be used for identifiers that are not file static +#An identifier that is not file static starts with the filestaticprefix. + +globalprefix=;SFP--1;CWE-710 +#set namespace prefix for global variables +#A global variable does not start with the globalprefix + +globalprefixexclude=;SFP--1;CWE-710 +#the globalprefix may not be used for non-global identifiers +#An identifier that is not a global variable starts with the globalprefix. + +typeprefix=;SFP--1;CWE-710 +#set namespace prefix for user-defined types +#A user-defined type does not start with the typeprefix + +typeprefixexclude=;SFP--1;CWE-710 +#the typeprefix may not be used for identifiers that are not type names +#An identifier that is not a type name starts with the typeprefix. + +externalprefix=;SFP--1;CWE-710 +#set namespace prefix for external identifiers +#An external identifier does not start with the externalprefix + +externalprefixexclude=;SFP--1;CWE-710 +#the externalprefix may not be used for non-external identifiers +#An identifier that is not external starts with the externalprefix. + +localprefix=;SFP--1;CWE-710 +#set namespace prefix for local variables +#A local variable does not start with the localprefix + +localprefixexclude=;SFP--1;CWE-710 +#the localprefix may not be used for non-local identifiers +#An identifier that is not a local variable starts with the localprefix. + +uncheckedmacroprefix=;SFP--1;CWE-710 +#set namespace prefix for unchecked macros +#An unchecked macro name does not start with the uncheckedmacroprefix + +uncheckedmacroprefixexclude=;SFP--1;CWE-710 +#the uncheckmacroprefix may not be used for identifiers that are not +#unchecked macros +#An identifier that is not the name of an unchecked macro +#starts with the uncheckedmacroprefix. + +constprefix=;SFP--1;CWE-710 +#set namespace prefix for constants +#A constant does not start with the constantprefix + +constprefixexclude=;SFP--1;CWE-710 +#the constprefix may not be used for non-constant identifiers +#An identifier that is not a constant starts with the constantprefix. + +iterprefix=;SFP--1;CWE-710 +#set namespace prefix for iterators +#An iter does not start with the iterator prefix + +iterprefixexclude=;SFP--1;CWE-710 +#the iterprefix may not be used for non-iter identifiers +#An identifier that is not a iter starts with the iterprefix. + +protoparamprefix=;SFP--1;CWE-710 +#set namespace prefix for parameters in function prototype declarations +#A parameter name in a function prototype declaration does not start with the +#declaration parameter prefix + + + + + + +# /* 12.3 Naming Restrictions */ + +isoreserved=;SFP--1;CWE-710 +#external name conflicts with name reserved for system or standard library +#External name is reserved for system use by ISO C99 standard. + +cppnames=;SFP--1;CWE-710 +#external or internal name is a C++ keyword or reserved word +#External name is a C++ keyword or reserved word. +#This could lead to problems if the +#code is compiled with a C++ compiler. + +isoreservedinternal=;SFP--1;CWE-710 +#internal name conflicts with name reserved for system or standard library +#Internal name is reserved for system in ISO C99 standard (this should not be necessary unless you are worried about C library implementations that violate the standard and use macros). + +distinctexternalnames=;SFP--1;CWE-710 +#external name is not distinguishable from another external name using +#the number of significant characters +#An external name is not distinguishable from another external name +#using the number of significant characters. According to +#ANSI Standard (3.1), an implementation may only consider the first 6 +#characters significant, and ignore alphabetical case +#distinctions (ISO C99 requires 31). The +#+externalnamelen flag may be used to change the number +#of significant characters, and -externalnamecaseinsensitive to make +#alphabetical case significant in external names. + +externalnamelen=;SFP--1;CWE-710 +#set the number of significant characters in an external name +#Sets the number of significant characters in an external name (default is 6 for old +#ANSI89 limit, C99 requires 31). +#Sets +distinctexternalnames. + +externalnamecaseinsensitive=;SFP--1;CWE-710 +#alphabetic comparisons for external names are case-insensitive +#Make alphabetic case insignificant in external names. By ANSI89 +#standard, case need not be significant in an external name. +#If +distinctexternalnames is not set, sets +#+distinctexternalnames with unlimited external name length. + +distinctinternalnames=;SFP--1;CWE-710 +#internal name is not distinguishable from another internal name using +#the number of significant characters +#An internal name is not distinguishable from another internal name +#using the number of significant characters. According to +#ANSI89 Standard (3.1), an implementation may only consider the first 31 +#characters significant (ISO C99 specified 63). The +#+internalnamelen flag changes the number +#of significant characters, -internalnamecaseinsensitive to makes +#alphabetical case significant, and +#+internalnamelookalike to make similar-looking characters +#non-distinct. + + + +internalnamelookalike=;SFP--1;CWE-710 +#lookalike characters match in internal names +#Set whether similar looking characters (e.g., \1\ and \l\) +#match in internal names. + +protoparamname=;SFP--1;CWE-710 +#a parameter in a function prototype has a name +#A parameter in a function prototype has a name. This is dangerous, +#since a macro definition could be visible here. + +protoparammatch=;SFP--1;CWE-710 +#the name of a parameter in a function prototype and corresponding +#declaration must match (after removing the protoparamprefix +#A parameter in a function definition does not have the same name as +#the corresponding in the declaration of the function after +#removing the protoparamprefix + +protoparamprefixexclude=;SFP--1;CWE-710 +#the protoparamprefix may not be used for non-declaraction parameter identifiers +#An identifier that is not a parameter name in a function prototype +#starts with the protoparamprefix. + + + + + + +# /* +# ** 13. Completeness +# */ + +# /* 13.1 Unused Declarations */ + +topuse=;SFP--1;CWE-398 +#declaration at top level not used +#An external declaration not used in any source file. + +exportlocal=;SFP--1;CWE-398 +#a declaration is exported but not used outside this module +#A declaration is exported, but not used outside this module. +#Declaration can use static qualifier. + +exportheader=;SFP--1;CWE-398 +#a declaration is exported but does not appear in a header file +#A declaration is exported, but does not appear in a header file. + +exportheadervar=;SFP-2;CWE-563 +#a variable declaration is exported but does not appear in a header file +#A variable declaration is exported, but does not appear in a header +#file. (Used with exportheader.) + +fielduse=;SFP-2;CWE-561 +#field of structure type not used +#A field is present in a structure type but never used. Use /*@unused@*/ in front of field declaration to suppress message. + +enummemuse=;SFP-2;CWE-561 +#member of an enum type not used +#A member of an enum type is never used. + +constuse=;SFP-2;CWE-563 +#constant declared but not used +#A constant is declared but not used. Use unused in the constant declaration to suppress message. + +fcnuse=;SFP-2;CWE-561 +#function declared but not used +#A function is declared but not used. Use /*@unused@*/ in front of function header to suppress message. + +paramuse=;SFP--1;CWE-398 +#function parameter not used +#A function parameter is not used in the body of the function. If the argument is needed for type compatibility or future plans, use /*@unused@*/ in the argument declaration. + +typeuse=;SFP-2;CWE-561 +#type declared but not used +#A type is declared but not used. Use /*@unused@*/ in front of typedef to suppress messages. + +varuse=;SFP-2;CWE-563 +#variable declared but not used +#A variable is declared but never used. Use /*@unused@*/ in front +#of declaration to suppress message. + +unusedspecial=;SFP-2;CWE-561 +#unused declaration in special file (corresponding to .l or .y file) + + + + + + + +# /* 13.2 Complete Programs */ + +declundef=;SFP-2;CWE-561 +#function or variable declared but never defined +#A function or variable is declared, but not defined in any source code file. + +specundef=;SFP-2;CWE-561 +#function or variable specified but never defined +#A function or variable is declared in an .lcl file, but not defined in any source code file. + +specundecl=;SFP-2;CWE-561 +#function or variable specified but never declared in a source file +#A function or variable is declared in an .lcl file, but not declared +#in any source code file. + + +needspec=;SFP--1;CWE--1 +#information in specifications is not also included in syntactic comments +#There is information in the specification that is not duplicated +#in syntactic comments. Normally, this is not an +#error, but it may be useful to detect it to make +#sure checking incomplete systems without the specifications will +#still use this information. + + + + + + +# /* +# ** 14. Libraries and Header File Inclusion +# */ + +# /* 14.1 Standard Libraries */ + +warnposixheaders=;SFP-1;CWE-561 +#a POSIX header is included, but the POSIX library is not used +#Header name matches a POSIX header, but the POSIX library is not selected. + + +usevarargs=;SFP--1;CWE-710 +#non-standard included +#Header is not part of ANSI Standard. +#Should use instead. + +caseinsensitivefilenames=;SFP--1;CWE-710 +#file names are case insensitive (file.h and FILE.H are the same file) + + + + +# /* Prototypes */ + +noparams=;SFP--1;CWE--1 +#function declaration has no parameter list +#A function declaration does not have a parameter list. + +oldstyle=;SFP--1;CWE-398 +#old style function definition +#Function definition is in old style syntax. Standard prototype +#syntax is preferred. + + + + + + +# /* +# ** System functions +# */ + +maintype=;SFP--1;CWE-710 +#type of main does not match expected type +#The function main does not match the expected type. + +exitarg=;SFP-3;CWE-474 +#argument to exit has implementation defined behavior +#The argument to exit should be 0, EXIT_SUCCESS or EXIT_FAILURE + +shadow=;SFP--1;CWE-710 +#declaration reuses name visible in outer scope +#An outer declaration is shadowed by the local declaration. + +incondefslib=;SFP--1;CWE-398 +#function, variable or constant defined in a library is redefined with inconsistent type +#A function, variable or constant previously defined in a library is +#redefined with a different type. + +overload=;SFP--1;CWE-398 +#library function overloaded +#A function, variable or constant defined in the library is redefined +#with a different type. + +nestedextern=;SFP--1;CWE-398 +#an extern declaration is inside a function scope +#An extern declaration is used inside a function scope. + +redecl=;SFP--1;CWE-398 +#function or variable redeclared +#A function or variable is declared in more than one place. This is +#not necessarily a problem, since the declarations are consistent. + +redef=;SFP--1;CWE-398 +#function or variable redefined +#A function or variable is redefined. One of the declarations should use extern. + +imptype=;SFP--1;CWE-710 +#variable declaration has unknown (implicitly int) type +#A variable declaration has no explicit type. The type is implicitly int. + +exportany=;SFP--1;CWE-710 +#variable, function or type exported but not specified +#A variable, function or type is exported, but not specified. + +exportfcn=;SFP--1;CWE-710 +#function exported but not specified +#A function is exported, but not specified. + +exportmacro=;SFP--1;CWE-710 +#expanded macro exported but not specified +#A macro is exported, but not specified. + +exporttype=;SFP--1;CWE-710 +#type definition exported but not specified +#A type is exported, but not specified. + +exportvar=;SFP--1;CWE-710 +#variable exported but not specified +#A variable is exported, but not specified. + +exportconst=;SFP--1;CWE-710 +#constant exported but not specified +#A constant is exported, but not specified. + +exportiter=;SFP--1;CWE-710 +#constant exported but not specified +#A constant is exported, but not specified. + + + + + + +# /* +# ** Limits +# */ + +type=;SFP-1;CWE-704 +#type mismatch +#Types are incompatible. + +stringliteraltoolong=;SFP-8;CWE-119 +#string literal too long for character array +#A string literal is assigned to a char array too small to hold it. + +stringliteralnoroomfinalnull=;SFP-11;CWE-170 +#string literal leaves no room for null terminator +#A string literal is assigned to a char array that is not big enough to hold the final null terminator. This may not be a problem because a null character has been explictedly included in the string literal using an escape sequence + +stringliteralnoroom=;SFP-11;CWE-170 +#string literal leaves no room for null terminator +#A string literal is assigned to a char array that is not big enough to hold the null terminator. + +stringliteralsmaller=;SFP-8;CWE-119 +#string literal is smaller than the char array it is assigned to +#A string literal is assigned to a char array that smaller than the string literal needs. + +enummembers=;SFP-1;CWE-704 +#enum members must be int values +#Type of initial values for enum members must be int. + +formattype=;SFP--1;CWE-628 +#type-mismatch in parameter corresponding to format code in a printf or scanf-like function +#Type of parameter is not consistent with corresponding code in format string. + +formatconst=;SFP--1;CWE-134 +#format parameter is not a string constant (hence variable arguments cannot be typechecked) +#Format parameter is not known at compile-time. This can lead to security vulnerabilities because the arguments cannot be type checked. + +formatcode=;SFP-24;CWE-134 +#invalid format code in format string for printf or scanf-like function +#Format code in a format string is not valid. + +forwarddecl=;SFP--1;CWE--1 +#forward declarations of pointers to abstract representation match abstract type + +voidabstract=;SFP--1;CWE-398 +#void * matches pointers to abstract types, casting ok (dangerous) +#A pointer to void is cast to a pointer to an abstract type (or vice versa). + +castfcnptr=;SFP-1;CWE-704 +#a pointer to a function is cast to a pointer to void (or vice versa) +#A pointer to a function is cast to (or used as) a pointer to void (or vice versa). + +unrecog=;SFP--1;CWE--1 +#unrecognized identifier +#Identifier used in code has not been declared. + +annotationerror=;SFP--1;CWE-546 +#annotation is used in inconsistent location +#A declaration uses an invalid annotation. + +commenterror=;SFP--1;CWE-546 +#inconsistent syntactic comment +#A syntactic comment is used inconsistently. + + + + + + + + +# /* +# ** Use Warnings +# */ + +bufferoverflow=;SFP-8;CWE-120 +#possible buffer overflow vulnerability +#Use of function that may lead to buffer overflow. + +bufferoverflowhigh=;SFP-8;CWE-120 +#likely buffer overflow vulnerability +#Use of function that may lead to buffer overflow. + +implementationoptional=;SFP--1;CWE-710 +#declarator is implementation optional (ISO99 does not require an implementation to provide it) +#Use of a declarator that is implementation optional, not required by ISO99. + +legacy=;SFP--1;CWE-710 +#legacy declaration in Unix Standard +#Use of a declarator that is marked as a legacy entry in the Unix Standard. + +multithreaded=;SFP-19;CWE-663 +#function is not reentrant +#Non-reentrant function should not be used in multithreaded code. + +portability=;SFP-3;CWE-474 +#function may have undefined behavior +#Use of function that may have implementation-dependent behavior. + +superuser=;SFP--1;CWE-710 +#function is restricted to superusers +#Call to function restricted to superusers. + +toctou=;SFP-20;CWE-367 +#possible time of check, time of use vulnerability +#Possible time of check, time of use vulnerability. + +unixstandard=;SFP--1;CWE-710 +#function is not required in Standard UNIX Specification +#Use of function that need not be provided by UNIX implementations + + + + + + +# /* +# ** Syntactic comments +# */ + +unrecogcomments=;SFP--1;CWE-546 +#stylized comment is unrecognized +#Word after a stylized comment marker does not correspond to a +#stylized comment. + + + + + + + + +# /* +# ** Comments +# */ + +continuecomment=;SFP--1;CWE-546 +#line continuation marker (\\) in comment before */ on same line +#A line continuation marker (\\) appears inside a comment on the same +#line as the comment close. Preprocessors should handle this +#correctly, but it causes problems for some preprocessors. + +slashslashcomment=;SFP--1;CWE-546 +#use of // comment +#A // comment is used. ISO C99 allows // comments, but earlier standards did not. + +nestcomment=;SFP--1;CWE-546 +#comment begins inside comment +#A comment open sequence (/*) appears within a comment. This usually +#means an earlier comment was not closed. \ No newline at end of file diff --git a/com.kdmanalytics.toif.splint/target/classes/config/SplintAdaptorConfigurationOriginal b/com.kdmanalytics.toif.splint/target/classes/config/SplintAdaptorConfigurationOriginal new file mode 100644 index 00000000..4ca1863c --- /dev/null +++ b/com.kdmanalytics.toif.splint/target/classes/config/SplintAdaptorConfigurationOriginal @@ -0,0 +1,1453 @@ +nestcomment=Other +preproc=Other + +#Null Dereferences (Section 2) + +null=;SFP-7;CWE-476 +#A possibly null pointer may be dereferenced, or used somewhere a nonnull pointer is expected. (sets nulldref, nullpass, nullassign, and nullstate + +nullderef=;SFP-7;CWE-476 +#A possibly null pointer is dereferenced. Value is either the result of a function which may return null (in which case, code should check it is not null), or a global, parameter or structure field declared with the null qualifier. + +nullpass=;SFP-7;CWE-476 +#A possibly null pointer is passed as a parameter corresponding to a formal parameter with no /*@null@*/ annotation. If NULL may be used for this parameter, add a /*@null@*/ annotation to the function parameter declaration. + +nullret=;SFP-7;CWE-476 +#Function returns a possibly null pointer, but is not declared using /*@null@*/ annotation of result. If function may return NULL, add /*@null@*/ annotation to the return value declaration. + +nullstate=;SFP-7;CWE-476 +#A possibly null pointer is reachable from a parameter or global variable that is not declared using a /*@null@*/ annotation. + +nullassign=;SFP-4;CWE-665 +#A reference with no null annotation is assigned or initialized to NULL. Use /*@null@*/ to declare the reference as a possibly null pointer. + + +################################################################################# + + + +#Use Before Definition (Section 3) + +usedef=;SFP-1;CWE-457 +#The value of a location that may not be initialized on some execution path is used. + +impouts=;SFP-1;CWE-457 +#Allow unannotated pointer parameters to functions to be implicit out parameters. + +compdef=;SFP-1;CWE-456 +#Storage derivable from a parameter, return value or global variable is not completely defined. + +uniondef=;SFP-1;CWE-456 +#No field of a union is defined. (No error is reported if at least one union field is defined.) + +mustdefine=;SFP-1;CWE-457 +#arameter declared with out is not defined before return or scope exit. + +fullinitblock=;SFP-1;CWE-456 +#Initializer does not set every field in the structure. + +initallelements=;SFP-1;CWE-456 +#Initializer does not define all elements of a declared array. + +initsize=;SFP-1;CWE-665 +#Initializer block contains more elements than the size of a declared array + + +################################################################################# + + +#Declarations + +incondefs=;SFP-1;CWE-704 +#A function, variable or constant is redefined with a different type. + +functionderef=Other +#A function type is dereferenced. The ANSI standard allows this because of implicit conversion of function designators, however the dereference is unnecessary. + +redundantsharequal=;SFP-4;CWE-665 +#A declaration of an immutable object uses a redundant observer qualifier. + +misplacedsharequal=;SFP-3 +#A declaration of an unsharable object uses a sharing annotation. + + +################################################################################# + + +#Types (Section 4 ) + + +type=;SFP-1;CWE-704 +#Type mismatch. + +stringliteraltoolong=;SFP-8;CWE-119 +#A string literal is assigned to a char array too small to hold it. + +stringliteralnoroom=;SFP-11;CWE-170 +#A string literal is assigned to a char array that is not big enough to hold the null terminator. + +stringliteralnoroomfinalnull=;SFP-11;CWE-170 +#A string literal is assigned to a char array that is not big enough to hold the final null terminator. This may not be a problem because a null character has been explictedly included in the string literal using an escape sequence. + +stringliteralsmaller=;SFP-8;CWE-119 +#A string literal is assigned to a char array that smaller than the string literal needs. + +enummembers=Risky values +#Type of initial values for enum members must be int. + + +################################################################################# + + +#Boolean Types (Section 4.2 ) +#These flags control the type name used to represent Booleans, and whether the Boolean type is abstract. + +bool=Other +#Boolean type is an abstract type. + +booltype=Other +#Set name of Boolean type to . + +boolfalse=Other +#Set name of Boolean false to . + +booltrue=Other +#Set name of Boolean true to . + +likelybool=;SFP-1 +#Splint has found a type which appears to be the boolean type. Use the booltype, boolfalse and booltrue flags to change the name of the default boolean type. + + + +################################################################################# + + + +#Predicates + +predboolptr=Other +#Type of condition test is a pointer. + +predboolint=;SFP-1 +#Type of condition test is an integral type. + +predboolothers=;SFP-1 +#Type of condition test is not a Boolean, pointer or integral type. + +predbool=Other +#Sets predboolint, predboolptr and preboolothers. + +predassign=Other +#The condition test is an assignment expression. If an assignment is intended, add an extra parentheses nesting (e.g., if ((a = b)) ...). + + +################################################################################# + + +#Primitive Operations + +ptrarith=Other +#Arithmetic involving pointer and integer. + +nullptrarith=;SFP-7;CWE-476 +#ointer arithmetic using a possibly null pointer and integer. + +boolops=;SFP-1 +#The operand of a boolean operator is not a boolean. Use +ptrnegate to allow ! to be used on pointers. + +ptrnegate=Other +#Allow the operand of the ! operator to be a pointer. + +bitwisesigned=;SFP-1;CWE-195 +#An operand to a bitwise operator is not an unsigned value. This may have unexpected results depending on the signed representations. + +shiftimplementation=;SFP-1 +#The left operand to a shift operator may be negative (behavior is implementationdefined). + +shiftnegative=;SFP-1 +#The right operand to a shift operator may be negative (behavior undefined). + +shiftsigned=;SFP-1 +#The left operand to a shift operator is not an unsigned value. + +strictops=;SFP-1 +#rimitive operation does not type check strictly. + +sizeoftype=;SFP-1 +#Operand of sizeof operator is a type. (Safer to use int *x = sizeof (*x); instead of sizeof (int).) + + +################################################################################# + + +#Array Formal arameters +#These flags control reporting of common errors caused by confusion about the semantics of array formal parameters. + + +sizeofformalarray=;SFP-1 +#The sizeof operator is used on a parameter declared as an array. (In many instances this has unexpected behavior, since the result is the size of a pointer to the element type, not the number of elements in the array.) + + +fixedformalarray=;SFP-1 +#An array formal parameter is declared with a fixed size (e.g., int x[20]). This is likely to be confusing, since the size is ignored. + +formalarray=;SFP-1 +#A formal parameter is declared as an array. This is probably not a problem, but can be confusing since it is treated as a pointer. + + +################################################################################# + + +#Format Codes + +formatcode=;SFP-1;CWE-686 +#Invalid format code in format string for printflike or scanflike function. + +formattype=;SFP-1;CWE-681 +#Typemismatch in parameter corresponding to format code in a printflike or scanflike function. + +formatconst=Risky Values +#Format parameter is not known at compiletime. This can lead to security vulnerabilities because the arguments cannot be type checked. + + +################################################################################# + + +#Main + +maintype=Other +#Type of main does not match expected type (function returning an int, taking no parameters or two parameters of type int and char **.) + + +################################################################################# + + +#Comparisons + +boolcompare=;SFP-1 +#Comparison between Boolean values. This is dangerous since there may be multiple true values as any nonzero value is interpreted as true. + +realcompare=;SFP-1 +#Comparison involving float or double values. This is dangerous since it may produce unexpected results because floating point representations are inexact. + +ptrcompare=;SFP-1 +#Comparison between pointer and number. + +unsignedcompare=;SFP-1 +#An unsigned value is used in a comparison with zero in a way that is either a bug or confusing. + + +################################################################################# + + +#Type Equivalence + +voidabstract=;SFP-1;CWE-704 +#Allow void * to match pointers to abstract types. (Casting a pointer to an abstract type to a pointer to void is okay if +voidabstract is set.) + +castfcnptr=;SFP-1;CWE-704 + A pointer to a function is cast to (or used as) a pointer to void (or vice versa). + +forwarddecl=;SFP-1;CWE-704 +#Forward declarations of pointers to abstract representation match abstract type. + +imptype=;SFP-1;CWE-665 +#A variable declaration has no explicit type. The type is implicitly int. + +incompletetype=;SFP-4;CWE-665 +#A formal parameter is declared with an incomplete type (e.g., int[][]). + +charindex=;SFP-8 +#Allow char to index arrays. + +enumindex=;SFP-8 +#Allow members of enumtype to index arrays. + +boolint=Other +#Make bool and int are equivalent. (No type errors are reported when a Boolean is used where an integral type is expected and vice versa.) + +charint=Other +#Make char and int types equivalent + +charunsignedchar=Other +#To allow char and unsigned char types to match use +charunsignedchar + +enumint=Other +#Make enum and int types equivalent + +floatdouble=Other +#Make float and double types equivalent + +ignorequals=Other +#Ignore type qualifiers (long, short, unsigned). + +relaxquals=Other +#Report qualifier mismatches only if dangerous (information may be lost since a larger type is assigned to (or passed as) a smaller one or a comparison uses signed and unsigned values.) + +ignoresigns=Other +#Ignore signs in type comparisons (unsigned matches signed). + +longintegral=Other +#Allow long type to match an arbitrary integral type (e.g., dev_t). + +longunsignedintegral +#Allow unsigned long type to match an arbitrary integral type (e.g., dev_t). + +matchanyintegral +#Allow any integral type to match an arbitrary + +longunsignedunsignedintegral +#Allow unsigned long type to match an arbitrary unsigned integral type (e.g., size_t).q + +longsignedintegral +#Allow long type to match an arbitrary signed integral type (e.g., ssize_t). + +numliteral +#Integer literals can be used as floats. + +charintliteral +#A character constant may be used as an int. + +zeroptr +#Literal 0 may be used as a pointer. + +zerobool +#Treat 0 as a boolean. + +relaxtypes +#Allow all numeric types to match. + +shortint +#Make short int and int types equivalent. + + +################################################################################# + + +#Abstract Types (Section 4.3 ) + +abstract +#A data abstraction barrier is violated + +impabstract +#Implicit abstract annotation for type declarations that do not use concrete. + +mutrep +#Representation of mutable type has sharing semantics. + + +################################################################################# + + +#Access (Section 4.3.1) + +accessmodule +#An abstract type defined in M.h (or specified in M.lcl) is accessible in M.c. + +accessfile +#An abstract type named type is accessible in files named type.* + +accessczech +#An abstract type named type may be accessible in a function named type_name. (Section 12.1.1) + +accessslovak +#An abstract type named type may be accessible in a function named typeName. (Section.12.1.2) + +accessczechoslovak +#An abstract type named type may be accessible in a function named type_name or typeName. (Section 12.1.3) + +accessall +#Sets accessmodule, accessfile and accessczech. + + +################################################################################# + + +#Memory Management (Section 5 ) +#Reporting of Memory Management errors is controlled by flags setting checking and implicit annotations and code annotations. + + +################################################################################# + + +#Deallocation Errors (Section 5.2) + +usereleased=;SFP-15;CWE-416 +#Storage used after it may have been released. + +strictusereleased +#An array element used after it may have been released. + + +################################################################################# + + +#Inconsistent Branches + +branchstate=Other +#Storage has inconsistent states of alternate paths through a branch (e.g., it is released in the true branch of an ifstatement, but there is no else branch.) + +strictbranchstate=Other +#Storage through array fetch has inconsistent states of alternate paths through a branch. Since array elements are not checked accurately, this may lead to spurious errors. + +deparrays +#Treat array elements as dependent storage. Checking of array elements cannot be done accurately by Splint. If deparrays is not set, array elements are assumed to be independent, so code that releases the same element more than once will produce no error. If deparrays is set, array elements are assumed to be dependent, so code that releases the same element more that once will produce an error, but code that releases different elements correctly will produce a spurious error. + + +################################################################################# + + + +#Memory Leaks + +mustfree=;SFP-14;CWE-401 +#Allocated storage was not released before return or scope exit. Errors are reported for only, fresh or owned storage. + +mustfreefresh=;SFP-14;CWE-401 +#Allocated storage was not released before return or scope exit. Errors are reported for fresh storage + +mustfreeonly=;SFP-14;CWE-401 +#Allocated storage was not released before return or scope exit. Errors are reported for only storage + +memchecks +#Sets all dynamic memory checking flags (memimplicit, mustfree, mustdefine, mustnotalias, null, memtrans ). + +compdestroy=;SFP-14;CWE-401 +#All only references derivable from out only parameter of type void * must be released. (This is the type of the parameter to free, but may also be used for userdefined deallocation functions.) + +strictdestroy +#Report complete destruction errors for array elements that may have been released. (If strictdestroy is not set, Splint will assume that if any array element was released, the entire array was correctly released.) + + +################################################################################# + + + +#Transfer Errors +#A transfer error is reported when storage is transferred (by an assignment, passing a parameter, or returning) in a way that is inconsistent. + +memtrans +#Sets all memory transfer errors flags. + +onlytrans=;SFP-14;CWE-401 +#Only storage transferred to nononly reference (memory leak). + +ownedtrans=;SFP-14;CWE-401 +#Owned storage transferred to nonowned reference (memory leak). + +freshtrans=;SFP-14;CWE-401 +#Newlyallocated storage transferred to nononly reference (memory leak). + +sharedtrans=;SFP-12;CWE-762 +#Shared storage transferred to nonshared reference + +dependenttrans=Memory Management +#Inconsistent dependent transfer. Dependent storage is transferred to a nondependent reference. + +temptrans=Memory Management +#Temporary storage (associated with a temp formal parameter) is transferred to a nontemporary reference. The storage may be released or new aliases created. + +kepttrans=Memory Management +#Kept storage (storage what was passed as keep) transferred to nontemporary reference. + +keeptrans=;SFP-12;CWE-762 +#Keep storage is transferred in a way that may add a new alias to it, or release it. + +refcounttrans=;SFP-12;CWE-762 +#Reference counted storage is transferred in an inconsistent way. + +newreftrans=;SFP-12;CWE-762 +#A new reference transferred to a reference counted reference (reference count is not set correctly). + +immediatetrans=;SFP-1;CWE-587 +#An immediate address (result of &) is transferred inconsistently. + +statictrans=Memory Management +#Static storage is transferred in an inconsistent way. + +exposetrans=;SFP-12;CWE-762 +#Inconsistent exposure transfer. Exposed storage is transferred to a nonexposed, nonobserver reference. + +observertrans=Memory Management +#Inconsistent observer transfer. Observer storage is transferred to a nonobserver reference. + +unqualifiedtrans=Memory Management +#Unqualified storage is transferred in an inconsistent way. + +#Initializers + +onlyunqglobaltrans +#Only storage transferred to an unqualified global or static reference. This may lead to a memory leak, since the new reference is not necessarily released. + +staticinittrans +#Static storage is used as an initial value in an inconsistent way. + +unqualifiedinittrans +#Unqualified storage is used as an initial value in an inconsistent way. +#Derived Storage + +compmempass=;SFP-14;CWE-404 +#Storage derivable from a parameter does not match the alias kind expected for the formal parameter. +#Stack References + +stackref +#A stack reference is pointed to by an external reference when the function returns. Since the call frame will be destroyed when the function returns the return value will point to dead storage. (Section 5.2.6) + + +################################################################################# + + +#Implicit Memory Annotations (Section 5.3 ) + +allimponly +#Sets globimponly, retimponly, structimponly, specglobimponly, specretimponly and specstructimponly . + +globimponly +#Assume unannotated global storage is only. + +paramimptemp +#Assume unannotated parameter is temp. + +retimponly +#Assume unannotated returned storage is only. + +structimponly +#Assume unannotated structure or union field is only. + +codeimponly +#Sets globimponly, retimponly and structimponly. + +memimp +#Report memory errors for unqualified storage. + +passunknown +#assing a value as an unannotated parameter clears its annotation. This will prevent many spurious errors from being report for unannotated programs, but eliminates the possibility of detecting many errors. + +################################################################################# + + +#Sharing (Section 6) + +################################################################################# + + +#Aliasing (Section 6.1 ) + +aliasunique=;SFP-4;CWE-665 +#An actual parameter that is passed as a unique formal parameter is aliased by another parameter or global variable. + +mayaliasunique=Other +#An actual parameter that is passed as a unique formal parameter may be aliased by another parameter or global variable. + +mustnotalias +#An alias has been added to a tempqualifier parameter or global that is visible externally when the function returns. + +retalias +#A function returns an alias to parameter or global. + +################################################################################# + + +#Exposure (Section 6.2 ) + +repexpose +#The internal representation of an abstract type is visible to the caller. This means clients may have access to a pointer into the abstract representation. (Sets assignexpose, retexpose, and castexpose.) + +assignexpose +#Abstract representation is exposed by an assignment or passed parameter. + +castexpose +#Abstract representation is exposed through a cast. + +retexpose +#Abstract representation is exposed by a return value. +#Observer Modifications + +modobserver=Other +#ossible modification of observer storage. + +modobserveruncon +#Storage declared with observer may be modified through a call to an unconstrained function. +#String Literals (Section 6.2.1) + +readonlytrans +#Report memory transfer errors for initializations to readonly string literals + +readonlystrings +#String literals are readonly (ISO semantics). An error is reported if a string literal may be modified or released. + +################################################################################# + + +#Function Interfaces (Section 7 ) + + +################################################################################# + + + +#Modification (Section 7.1) + +modifies +#Undocumented modification of callervisible state. Without +moduncon, modification errors are only reported in the definitions of functions declared with a modifies clause (or specified). + +mustmod +#Documented modification is not detected. An object listed in the modifies clause for a function, is not modified by the implementation. + +moduncon +#Report modification errors in functions declared without a modifies clause.(Sets modnomods, modglobsnomods and modstrictglobsnomods.) + +modnomods +#Report modification errors (not involving global variables) in functions declared without a modifies clause. + +modunconnomods +#An unconstrained function is called in a function body where modifications are checked. Since the unconstrained function may modify anything, there may be undetected modifications in the checked function. + +modinternalstrict +#A function that modifies internalState is called from a function that does not list internalState in its modifies clause. + +modfilesys +#A function modifies the file system but does not list fileSystem in its modifies clause. + +################################################################################# + + +#Global Variables (Section 7.2 ) +#Errors involving the use and modification of global and file static variables are reported depending on flag settings, annotations where the global variable is declared, and whether or not the function where the global is used was declared with a globals clause. + +globs +#Undocumented use of a checked global variable in a function with a globals list. + +globuse +#A global listed in the globals list is not used in the implementation. + +globnoglobs +#Use of a checked global in a function with no globals list. + +internalglobs +#Undocumented use of internal state (should have globals internalState). + +internalglobsnoglobs +#Use of internal state in function with no globals list. + +globstate=;SFP-15;CWE-416 +#A function returns with global in inconsistent state (null or undefined) + +allglobs +#Report use and modification errors for globals not annotated with unchecked. + +checkstrictglobs +#Report use and modification errors for checkedstrict globals. + +#Modification of Global Variables + +modglobs +#Undocumented modification of a checked global variable. + +modglobsunchecked +#Undocumented modification of an unchecked global variable. + +modglobsnomods +#Undocumented modification of a checked global variable in a function with no modifies clause. + +modstrictglobsnomods +#Undocumented modification of a checkedstrict global variable in a function declared with no modifies clause. +#Globals Lists and Modifies Clauses + +warnmissingglobs +#Global variable used in modifies clause is not listed in globals list. (The global is added to the globals list.) + +warnmissingglobsnoglobs +#Global variable used in modifies clause of a function with no globals list. + +globsimpmodsnothing +#A function declared with a globals list but no modifies clause is assumed to modify nothing. + +modsimpnoglobs +#A function declared with a modifies clause but no globals list is assumed to use no globals. +#Implicit Checking Annotations + +impcheckedglobs +#Implicit checked annotation on global variables with no checking annotation. + +impcheckedstatics +#Implicit checked qualifier file static scope variables with no checking annotation. + +impcheckmodglobs +#Implicit checkmod qualifier on global variables with no checking annotation. + + +impcheckmodstatics +#Implicit checkmod qualifier file static scope variables with no checking annotation. + +impcheckedstrictglobs +#Implicit checked qualifier on global variables with no checking annotation. + +impcheckedstrictstatics +#Implicit checked qualifier file static scope variables with no checking annotation. + +impcheckmodinternals +#Implicit checkmod qualifier on function scope static variables with no checking annotation. + + +#Global Aliasing + +globalias +#Function returns with global aliasing external state (sets checkstrictglobalias, checkedglobalias, checkmodglobalias and uncheckedglobalias). + +checkstrictglobalias +#Function returns with a checkedstrict global aliasing external state. + +checkedglobalias +#Function returns with a checked global aliasing external state. + +checkmodglobalias +#Function returns with a checkmod global aliasing external state. + +uncheckedglobalias +#Function returns with an unchecked global aliasing external state. + +################################################################################# + + +#Declaration Consistency (Section 7.3) + +incondefs +#Identifier redeclared or redefined with inconsistent type. + +incondefslib +#Identifier defined in a library is redefined with inconsistent type. + +overload +#Standard library function overloaded. + +matchfields +#A struct or enum type is redefined with inconsistent fields or members. + + +################################################################################# + + +#Macros (Section 11 ) +#These flags control expansion and checking of macro definitions and invocations. + + +################################################################################# + + + +#Macro Expansion +#These flags control which macros are checked as functions or constants, and which are expanded in the preprocessing phase. Macros preceded by /*@notfunction@*/ are never expanded regardless of these flag settings. These flags may be used in sourcefile control comments. + + +fcnmacros +#Macros defined with parameter lists are not expanded and are checked as functions. + +constmacros +#Macros defined without parameter lists are not expanded and are checked as constants. + +allmacros +#Sets fcnmacros and constmacros. + +libmacros +#Macros defining identifiers declared in a loaded library are not expanded and are checked according to the library information. + + +################################################################################# + + +#Macro Definitions +#These flags control what errors are reported in macro definitions. + + +macrostmt +#Macro definition is not syntactically equivalent to function. This means if the macro is used as a statement (e.g., if (test) macro();) unexpected behavior may result. One fix is to surround the macro body with do { … } while (FALSE). + +macroreturn +#The body of a macro declared as a function uses a return statement. This exhibits behavior that could not be implemented by a function. + +macroassign +#A macro parameter is used as the left side of an assignment expression. + +macroparams=;SFP-2;CWE-563 + +macroparens=Other +#A macro parameter is used without parentheses (in potentially dangerous context). + +macroempty +#Macro definition of a function is empty. + +macroredef +#Macro is redefined. There is another macro defined with the same name. + +macrounrecog +#An unrecognized identifier appears in a macro definition. Since the identifier may be defined where the macro is used, this could be okay, but Splint will not be able to check the unrecognized identifier appropriately. +#Corresponding Declarations + +macromatchname +#An iter or constant macro is defined using a different name from the one used in the previous syntactic comment + +macrodecl +#A macro definition has no corresponding declaration. (Sets macrofcndecl and macroconstdecl.) + +macrofcndecl +#Macro definition with parameter list has no corresponding function prototype. Without a prototype, the types of the macro result and parameters are unknown. + +macroconstdecl +#A macro definition without parameter list has no corresponding constant declaration. + +nextlinemacros +#A constant or iter declaration is not immediately followed by a macro definition. + +################################################################################# + + +#Side Effect Free arameters (Section 11.2.1 ) +#These flags control error reporting for parameters with inconsistent side effects in invocations of checked function macros and function calls. + + +sefparams +#An actual parameter with side effects is passed as a formal parameter declared with sef. + +sefuncon +#An actual parameter involving a call to an unconstrained function (declared without modifies clause) that may modify anything is passed as a sef parameter. + + +################################################################################# + + + +#Iterators + +iterbalance +#Iter is not balanced with end . + +iteryield +#Iter yield parameter is inappropriate. + +hasyield +#An iterator has been declared with no parameters annotated with yield. + +################################################################################# + + +#Naming Conventions (Section 12) + +namechecks +#Turns all name checking on or off without changing other settings. + +################################################################################# + + +#TypeBased Naming Conventions (Section 12.1) +#Czech Naming Convention + +czech +#Selects complete Czech naming convention (sets accessczech, czechfcns, czechvars, czechconsts, czechmacros, and czechtypes). + +accessczech +#Allow access to abstract types following Czech naming convention. The representation of an abstract type named t is accessible in the definition of a function or constant named t_name. + +czechfcns +#Function or iterator name is not consistent with Czech naming convention. + +czechvars + Variable name is not consistent with Czech naming convention. + +czechmacros + Expanded macro name is not consistent with Czech naming convention. + +czechconsts +#Constant name is not consistent with Czech naming convention. + +czechtypes +#Type name is not consistent with Czech naming convention. Czech type names must not use the underscore character. +#Slovak Naming Convention + +slovak +#Selects complete Slovak naming convention (sets accessslovak, slovakfcns, slovakvars, slovakconsts, slovakmacros, and slovaktypes). + +accessslovak +#Allow access to abstract types following Slovak naming convention. The representation of an abstract type named t is accessible in the definition of a function or constant named tName. + +slovakfcns +#Function or iterator name is not consistent with Slovak naming convention. + +slovakmacros +#Expanded macro name is not consistent with Slovak naming convention. + +slovakvars + Variable name is not consistent with Slovak naming convention. + +slovakconsts + Constant name is not consistent with Slovak naming convention. + +slovaktypes +#Type name is not consistent with Slovak naming convention. Slovak type names may not include uppercase letters. +#Czechoslovak Naming Convention + +czechoslovak +#Selects complete Czechoslovak naming convention (sets accessczechoslovak, czechoslovakfcns, czechoslovakvars, czechoslovakconsts, czechoslovakmacros, and czechoslovaktypes). + +accessczechoslovak +#Allow access to abstract types by Czechoslovak naming convention. The representation of an abstract type named t is accessible in the definition of a function or constant named t_name or tName. + +czechoslovakfcns + Function name is not consistent with Czechoslovak naming convention. + +czechoslovakmacros +#Expanded macro name is not consistent with Czechoslovak naming convention. + +czechoslovakvars +#Variable name is not consistent with Czechoslovak naming convention. + +czechoslovakconsts +#Constant name is not consistent with Czechoslovak naming convention. + +czechoslovaktypes +#Type name is not consistent with Czechoslovak naming convention. Czechoslovak type names may not include uppercase letters or the underscore character. + +################################################################################# + + +#Namespace refixes (Section 12.2) +#macrovarprefix +#Set namespace prefix for variables declared in a macro body. (Default is m_.) + +macrovarprefixexclude=Other +#A variable declared outside a macro body starts with the macrovarprefix. +#tagprefix +#Set namespace prefix of struct, union or enum tag identifiers. + +tagprefixexclude +#An identifier that is not a tag starts with the tagprefix. +#enumprefix +#Set namespace prefix for enum members. + +enumprefixexclude +#An identifier that is not an enum member starts with the enumprefix. +#filestaticprefix +#Set namespace prefix for file static declarations. + +filestaticprefixexclude +#An identifier that is not file static starts with the filestaticprefix. +#globalprefix +#Set namespace prefix for global variables. + +globalprefixexclude +#An identifier that is not a global variable starts with the globalprefix. +#typeprefix +#Set namespace prefix for userdefined types. + +typeprefixexclude +#An identifier that is not a type name starts with the typeprefix. +#externalprefix +#Set namespace prefix for external identifiers. + +externalprefixexclude +#An identifier that is not external starts with the externalprefix. + +#localprefix +#Set namespace prefix for local variables. + +localprefixexclude +#An identifier that is not a local variable starts with the localprefix. + +#uncheckedmacroprefix +#Set namespace prefix for unchecked macros. + +uncheckedmacroprefixexclude +#An identifier that is not the name of an unchecked macro starts with the uncheckedmacroprefix. +#constprefix +#Set namespace prefix for constants. + +constprefixexclude +#An identifier that is not a constant starts with the constantprefix. +#iterprefix +#Set namespace prefix for iterators. + +iterprefixexclude +#An identifier that is not an iter starts with the iterprefix. +#protoparamprefix +#Set namespace prefix for parameters in function prototypes. + +protoparamprefixexclude +#An identifier that is not a parameter in a function prototype starts with the protoprarmprefix. + +protoparamname +#A parameter in a function prototype has a name (can interfere with macro definitions). + +protoparammatch +#The name of a parameter in a function definition does not match the corresponding name of the parameter in a function prototype (after removing the protoparamprefix). + + +################################################################################# + + +#Naming Restrictions (Section 12.3) + +shadow=Other +#Declaration reuses name visible in outer scope. +#Reserved Names + +ansireserved +#External name conflicts with name reserved for the compiler or standard library. + +ansireservedinternal + Internal name conflicts with name reserved for the compiler or standard library. + +isoreserved +#External name is reserved for system use by ISO C99 standard. + +isoreservedinternal +#Internal name is reserved for system in ISO C99 standard (this should not be necessary unless you are worried about C library implementations that violate the standard and use macros). + +cppnames +#Internal or external name conflicts with a C++ reserved word. (Will cause problems if program is compiled with a C++ compiler.) +#Distinct External Names + +distinctexternalnames +#An external name is not distinguishable from another external name using externalnamelen significant characters. + +externalnamelen +#Sets the number of significant characters in an external name (ANSI default minimum is 6). Sets +distinctexternalnames. + +externalnamecaseinsensitive +#Make alphabetic case insignificant in external names. According to ANSI standard, case need not be significant in an external name. If +distinctexternalnames is not set, sets +distinctexternalnames with unlimited external name length. +#Distinct Internal Names + +distinctinternalnames +#An internal name is not distinguishable from another internal name using internalnamelen significant characters. (Also effected by internalnamecaseinsensitive and internalnamelookalike.) + +internalnamelen +#Set the number of significant characters in an internal name. Sets +distinctinternalnames. + +internalnamecaseinsensitive +#Set whether case is significant an internal names (internalnamecaseinsensitive means case is significant). If +distinctinternalnames is not set, sets +distinctinternalnames with unlimited internal name length. + +internalnamelookalike + Set whether similar looking characters (e.g., “1” and “l”) match in internal names. + +################################################################################# + + +#Control Flow (Section 8) + +################################################################################# + + +#Undefined Evaluation Order (Section 8.2 ) + +evalorder=;SFP-1 +#Behavior of an expression is unspecified or implementationdependent because subexpressions contain interfering side effects that may be evaluated in any order. + +evalorderuncon +#An expression may be undefined because a subexpression contains a call to an unconstrained function (no modifies clause) that may modify something that may be modified or used by another subexpression. + +################################################################################# + + +#roblematic Control Structures (Section 8.3 ) + +infloops +#Likely infinite loop is detected (Section 8.3.1). + +infloopsuncon +#Likely infinite loop is detected. Loop test or body calls an unconstrained function that may produce an undetected modification. + +elseifcomplete +#There is no finals else following an else if construct (Section 8.3.5). + +casebreak=;SFP-4;CWE-484 +#There is a nonempty case in a switch not followed by a break(Section 8.3.2 ). + +firstcase +#The first statement after a switch is not a case. + +#Duplicatecase +#Duplicate cases in switch. + +misscase +#A switch on an enum type is missing a case for a member of the enumerator. +#+ +emptyreturn +#Empty return in function declared to return value. +#+ +alwaysexits +#Loop predicate always exits. + +loopexec +#Assume all loops execute at least once. This effects usebeforedefinition and memory checking. It should probably not be used globally, but may be used surrounding a particular loop that is known to always execute to prevent spurious messages. (sets forloopexec, whileloopexec and iterloopexec +# +forloopexec +#Assume all for loops execute at least once. This effects usebeforedefinition and memory checking. It should probably not be used globally, but may be used surrounding a particular loop that is known to always execute to prevent spurious messages. +# +whileloopexec +#Assume all while loops execute at least once. This effects usebeforedefinition and memory checking. It should probably not be used globally, but may be used surrounding a particular loop that is known to always execute to prevent spurious messages. +# +iterloopexec +#Assume all iter loops execute at least once. This effects usebeforedefinition and memory checking. It should probably not be used globally, but may be used surrounding a particular loop that is known to always execute to prevent spurious messages. +#+ +obviousloopexec +#Assume loop that can be determined to always execute always does. + +################################################################################# + + +#Deep Break (Section 8.3.3 ) + +deepbreak +#Report errors for break statements inside a nested while, for or switch. (Sets all nested break and continue flags.) + +looploopbreak +#There is a break inside a while, for or iterator loop that is inside a while, for or iterator loop. Mark with /*@innerbreak@*/ to suppress the message. + +switchloopbreak +#There is abreak inside a while, for or iterator loop that is inside a switch statement. Mark with /*@loopbreak@*/. + +loopswitchbreak +#There is abreak inside a switch statement that is inside a while, for or iterator loop. Mark with /*@switchbreak@*/. + +switchswitchbreak +#There is abreak inside a switch statement that is inside another switch statement. Mark with /*@innerbreak@*/. + +looploopcontinue +#There is a continue inside a while, for or iterator loop that is inside a while, for or iterator loop. Mark with /*@innercontinue@*/. + +################################################################################# + + +#Loop and if Bodies (Section 8.3.4) + +allempty +#An if, while or for statement has no body (sets ifempty, whileempty and forempty.) + +allblock +#The body of an if, while or for statement is not a block (sets ifblock, whileblock and forblock.) + +whileempty +#A while statement has no body. + +whileblock +#The body of a while statement is not a block + +forempty +#A for statement has no body. + +forblock +#The body of a for statement is not a block. + +ifempty=Other +#An if statement has no body. + +ifblock +#The body of an if statement is not a block. + +################################################################################# + + +#Suspicious Statements (Section 8.4) + +unreachable=;SFP-2;CWE-561 +#Code is not reached on any possible execution. + +noeffect=;SFP-1 +#Statement has no effect. + +noeffectuncon +#Statement involving call to unconstrained function may have no effect. + +noret=Other +#There is a path with no return in a function declared to return a nonvoid value. + +################################################################################# + + + +#Ignored Return Values (Section 8.4.2 ) +#These flags control when errors are reported for function calls that do not use the return value. Casting the function call to void or declaring the called function to return /*@alt void@*/. + + +retvalbool +#Return value of type bool ignored. + +retvalint=;SFP-4;CWE-252 +#Return value of type int ignored. + +retvalother=;SFP-4;CWE-252 +#Return value of type other than bool or int ignored. + +retval +#Return value ignored (Sets retvalbool, retvalint, retvalother.) + +################################################################################# + + +#Memory Bounds (Section 9) + +bounds +#Memory read or write may be out of bounds of allocated storage (sets boundsread and boundswrite + +boundsread +#A memory read references memory beyond the allocated storage (also sets likelyboundsread. + +boundswrite +#A memory write may write to an address beyond the allocated buffer (also sets likelyboundswrite. + +likelybounds +#Likely memory read or write is likely to be out of bounds of allocated storage (sets likelyboundsread and likelyboundswrite) + +likelyboundsread +#A likely memory read references memory beyond the allocated storage (also sets likelyboundsread. + +likelyboundswrite +#A memory write is likely to write to an address beyond the allocated buffer. + +fcnpost +#Display function post conditions. + +redundantconstraints +#Display seemingly redundant conditions. + +checkpost +#The functions implementation may not satidfy a post condition given in an ensures clause. +# +showconstraintparens +#Display parentheses around constraint terms. +#+ +showconstraintlocation +#Display location for every constraint generated. + +#The following flags are mainly of interest to Splint developers. The default values are adequate in normal use. They are included for completeness. + +debugfcnconstraint +#erform buffer overflow checking even if the errors would be inhibited. +# +implictconstraints +#Generate implicit constraints for functions. This is an experimental option. Currently this option reduces the number of bounds errors but causes real error to be missed. +# +orconstraint +#This flags affects the internal constraint resolution. If set, the internal constraint resolution is more accurate. The performance impact is minimal so there is little reason not to have this flag set. + +################################################################################# + + +#Extensible Checking (Section 13 ) + +mts +#Load meta state declaration and corresponding xh file. + +statetransfer +#Transfer violates userdefined state rules. + +statemerge +#Control path merge violates userdefined state merge rules. + +################################################################################# + +#Completeness (Section 13 ) + +################################################################################# +#Unused Declarations (Section 13.1 ) +#These flags control when errors are reported for declarations that are never used. The unused annotation can be used to prevent unused errors from being report for a particular declaration. + + +topuse=;SFP-2;CWE-563 +#An external declaration is not used in any file. + +constuse=;SFP-2;CWE-563 +#Constant never used. + +enummemuse=;SFP-2;CWE-563 +#Member of enumerator never used. + +varuse=;SFP-2;CWE-563 +#Variable never used. + +paramuse=SFP-2 +#Function parameter never used. + +fcnuse=;SFP-2;CWE-561 +#Function is never used. + +typeuse=;SFP-2;CWE-563 +#Defined type never used. + +fielduse=;SFP-2;CWE-563 +#Field of structure or union type is never used. + +unusedspecial +#Declaration in a special file (corresponding to .l or .y file) is unused. + +################################################################################# + +#Complete rograms (Section 13.2) + +declundef +#Function, variable, iterator or constant declared but never defined. + +partial +#Check as partial system (sets declundef, exportlocal and prevents checking of macros in headers without corresponding .c files.) + + +################################################################################# + + +#Exports + +exportlocal=;SFP-2;CWE-561 +#A declaration is exported but not used outside this module. (Declaration can use the static qualifier.) + +exportheader +#A declaration (other than a variable) is exported but does not appear in a header file. + +exportheadervar +#A variable declaration is exported but does not appear in a header file. + + +################################################################################# + +#Unrecognized Identifiers + +unrecog=;SFP-1;CWE-456 +#An unrecognized identifier is used. + +sysunrecog=;SFP-4;CWE-665 +#Report unrecognized identifiers that start with the system prefix, __ (two underscores). + +repeatunrecog=;SFP-4;CWE-665 +#Report multiple messages for unrecognized identifiers. If repeatunrecog is not set, an error is reported only the first time a particular unrecognized identifier appears in the file. + + +################################################################################# + +#Multiple Definition and Declarations + +redef=;SFP-4;CWE-665 +#A function or variable is defined more than once. + +redecl=;SFP-4;CWE-665 +#An identifier is declared more than once. + +nestedextern=;SFP-1;CWE-465 +#An extern declaration is used inside a function body. + + +################################################################################# + +#ISO Conformance + +noparams +#A function is declared without a parameter list prototype. + +oldstyle +#Function definition is in old style syntax. Standard prototype syntax is preferred. + +exitarg=Risky values +#Argument to exit has implementation defined behavior. The only valid arguments to exit are EXIT_SUCCESS, EXIT_FAILURE and 0. An error is reported if Splint can determine statically that the argument to exit is not one of these. + +usevarargs=Other +#Report if is used (should use stdarg.h). + +################################################################################# + +#Warn use + +bufferoverflow +#Use of function that may lead to buffer overflow. + +bufferoverflowhigh=;SFP-8;CWE-120 +#Use of function that may lead to buffer overflow. + +implementationoptional +#Use of a declarator that is implementation optional, not required by ISO99. + +multithreaded +#Nonreentrant function should not be used in multithreaded code. + +portability +#Use of function that may have implementationdependent behavior. + +superuser +#Call to function restricted to superusers. + +toctou +#Possible time of check, time of use vulnerability. + +unixstandard +#Use of function that need not be provided by UNIX implementations + +################################################################################# + +#Header Inclusion (Section 14.3 ) + +skipansiheaders +#Prevent inclusion of header files in a system directory with names that match standard ANSI headers. The symbolic information in the standard library is used instead. Flag in effect only if a library that includes the standard library is used. The ANSI headers are: assert, ctype, errno, float, limits, locale, math, setjmp, signal, stdarg, stddef, stdio, stdlib, strings, string, time, and wchar. + +skipisoheaders +#Prevent inclusion of header files in a system directory with names that match standard ISO C99 headers. The symbolic information in the standard library is used instead. In effect only if a library that includes the standard library is used. The ISO C99 headers are: assert, complex, ctype, errno, fenv, float, inttypes, iso646, limits, locale, math, setjmp, signal, stdarg, stdbool, stddef, stdio, stdlib, string, tgmath, time, wchar, and wctype. + +skipposixheaders +#Prevent inclusion of header files in a system directory with names that match standard POSIX headers. The symbolic information in the standard library is used instead. In effect only if a library that includes the POSIX library is used. The skipped POSIX headers are: dirent, fcntl, grp, pwd, termios, sys/stat, sys/times, sys/types, sys/utsname, sys/wait, unistd, and utime. + +warnposixheaders=Other +#Report use of a POSIX header when checking a program with a nonPOSIX library. + +warnunixheaders +#Warn the user that the unix library may not be compatible with all platforms. + +skipsysheaders +#Prevent inclusion of all header files in system directories. + +sysdirexpandmacros +#Expand macros in system directories regardless of other settings, except for macros corresponding to names defined in a load library. + +sysdirerrors +#Report errors in files in system directories (set by sysdirs). + +warnsysfiles +#Warn when a system file was listed as a command line file but Splint is not set to report errors for system files. This prevents accidentally missing warnings in system files when Splint is run in a system directory. + +singleinclude +#Optimize header inclusion to only include each header file once. + +neverinclude +#Use library information instead of including header files. + +caseinsensitivefilenames +#File names are case insensitive (file.h and FILE.H are the same file). + + + +#Comments +#These flags control how syntactic comments are interpreted. + +#commentchar +#Set the marker character for syntactic comments. Comments beginning with /* are interpreted by Splint. + +noaccess +#Ignore access comments. + +nocomments +#Ignore all stylized comments. + +supcounts +#Actual number of errors does not match number in /*@i@*/ + +lintcomments +#Interpret traditional lint comments (/*FALLTHROUGH*/, /*NOTREACHED*/, /*PRINTFLIKE*/). + +warnlintcomments=Other +#Print a warning and suggest an alternative when a traditional lint comment is used. + +unrecogcomments=Other +#Stylized comment is unrecognized. + +unrecogflagcomments +#Semantic comment attempts to set a flag that is not recognized. + +annotationerror +#A declaration uses an invalid annotation. + +commenterror +#A syntactic comment is used inconsistently. diff --git a/com.kdmanalytics.toif.splint/target/com.kdmanalytics.toif.splint-1.15.5.jar b/com.kdmanalytics.toif.splint/target/com.kdmanalytics.toif.splint-1.15.5.jar new file mode 100644 index 00000000..c6280b50 Binary files /dev/null and b/com.kdmanalytics.toif.splint/target/com.kdmanalytics.toif.splint-1.15.5.jar differ diff --git a/com.kdmanalytics.toif.splint/target/local-artifacts.properties b/com.kdmanalytics.toif.splint/target/local-artifacts.properties new file mode 100644 index 00000000..cc112c78 --- /dev/null +++ b/com.kdmanalytics.toif.splint/target/local-artifacts.properties @@ -0,0 +1,4 @@ +#Thu May 29 09:56:19 EDT 2014 +artifact.attached.p2metadata=/home/adam/git/toif/plugins/com.kdmanalytics.toif.splint/target/p2content.xml +artifact.main=/home/adam/git/toif/plugins/com.kdmanalytics.toif.splint/target/com.kdmanalytics.toif.splint-1.15.5.jar +artifact.attached.p2artifacts=/home/adam/git/toif/plugins/com.kdmanalytics.toif.splint/target/p2artifacts.xml diff --git a/com.kdmanalytics.toif.splint/target/maven-archiver/pom.properties b/com.kdmanalytics.toif.splint/target/maven-archiver/pom.properties new file mode 100644 index 00000000..c747d27e --- /dev/null +++ b/com.kdmanalytics.toif.splint/target/maven-archiver/pom.properties @@ -0,0 +1,5 @@ +#Generated by Maven +#Thu May 29 09:56:19 EDT 2014 +version=1.15.5 +groupId=com.kdmanalytics.toif.compile +artifactId=com.kdmanalytics.toif.splint diff --git a/com.kdmanalytics.toif.splint/target/p2artifacts.xml b/com.kdmanalytics.toif.splint/target/p2artifacts.xml new file mode 100644 index 00000000..cfa52dd0 --- /dev/null +++ b/com.kdmanalytics.toif.splint/target/p2artifacts.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/com.kdmanalytics.toif.splint/target/p2content.xml b/com.kdmanalytics.toif.splint/target/p2content.xml new file mode 100644 index 00000000..b6bff704 --- /dev/null +++ b/com.kdmanalytics.toif.splint/target/p2content.xml @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Bundle-SymbolicName: com.kdmanalytics.toif.splint;singleton:=true Bundle-Version: 1.15.5 + + + + + diff --git a/com.kdmanalytics.toif.updatesite/.gitignore b/com.kdmanalytics.toif.updatesite/.gitignore new file mode 100644 index 00000000..400720e4 --- /dev/null +++ b/com.kdmanalytics.toif.updatesite/.gitignore @@ -0,0 +1,4 @@ +/features +/plugins +/artifacts.jar +/content.jar diff --git a/com.kdmanalytics.toif.updatesite/.project b/com.kdmanalytics.toif.updatesite/.project new file mode 100644 index 00000000..62044f31 --- /dev/null +++ b/com.kdmanalytics.toif.updatesite/.project @@ -0,0 +1,17 @@ + + + com.kdmanalytics.toif.updatesite + + + + + + org.eclipse.pde.UpdateSiteBuilder + + + + + + org.eclipse.pde.UpdateSiteNature + + diff --git a/com.kdmanalytics.toif.updatesite/TOIF_View_Updatesite_1.8.7.zip b/com.kdmanalytics.toif.updatesite/TOIF_View_Updatesite_1.8.7.zip new file mode 100644 index 00000000..f1635c4c Binary files /dev/null and b/com.kdmanalytics.toif.updatesite/TOIF_View_Updatesite_1.8.7.zip differ diff --git a/com.kdmanalytics.toif.updatesite/TOIF_View_Updatesite_1.8.8.zip b/com.kdmanalytics.toif.updatesite/TOIF_View_Updatesite_1.8.8.zip new file mode 100644 index 00000000..727fbe10 Binary files /dev/null and b/com.kdmanalytics.toif.updatesite/TOIF_View_Updatesite_1.8.8.zip differ diff --git a/com.kdmanalytics.toif.updatesite/eclipse.log b/com.kdmanalytics.toif.updatesite/eclipse.log new file mode 100644 index 00000000..58f6a5b0 --- /dev/null +++ b/com.kdmanalytics.toif.updatesite/eclipse.log @@ -0,0 +1,236 @@ +!SESSION 2013-11-26 14:26:58.631 ----------------------------------------------- +eclipse.buildId=M20120208-0800 +java.version=1.7.0_45 +java.vendor=Oracle Corporation +BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_CA +Framework arguments: -product org.eclipse.epp.package.rcp.product +Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.rcp.product + +!ENTRY org.eclipse.update.configurator 4 0 2013-11-26 14:30:42.201 +!MESSAGE Unable to access file "plugins/org.eclipse.datatools.sqltools.parsers.sql.query.source_1.2.1.v201201250505.jar!META-INF/MANIFEST.MF". + +!ENTRY org.eclipse.jface 2 0 2013-11-26 14:30:46.251 +!MESSAGE Keybinding conflicts occurred. They may interfere with normal accelerator operation. +!SUBENTRY 1 org.eclipse.jface 2 0 2013-11-26 14:30:46.251 +!MESSAGE A conflict occurred for ALT+SHIFT+D R: +Binding(ALT+SHIFT+D R, + ParameterizedCommand(Command(org.eclipse.rap.ui.launch.RAPLaunchShortcut.debug,Debug RAP Application, + Debug RAP Application, + Category(org.eclipse.debug.ui.category.run,Run/Debug,Run/Debug command category,true), + , + ,,true),null), + org.eclipse.ui.defaultAcceleratorConfiguration, + org.eclipse.ui.contexts.window,,,system) +Binding(ALT+SHIFT+D R, + ParameterizedCommand(Command(org.eclipse.wst.server.launchShortcut.debug,Debug on Server, + Debug the current selection on a server, + Category(org.eclipse.debug.ui.category.run,Run/Debug,Run/Debug command category,true), + , + ,,true),null), + org.eclipse.ui.defaultAcceleratorConfiguration, + org.eclipse.ui.contexts.window,,,system) +!SUBENTRY 1 org.eclipse.jface 2 0 2013-11-26 14:30:46.251 +!MESSAGE A conflict occurred for ALT+SHIFT+X R: +Binding(ALT+SHIFT+X R, + ParameterizedCommand(Command(org.eclipse.rap.ui.launch.RAPLaunchShortcut.run,Run RAP Application, + Run RAP Application, + Category(org.eclipse.debug.ui.category.run,Run/Debug,Run/Debug command category,true), + , + ,,true),null), + org.eclipse.ui.defaultAcceleratorConfiguration, + org.eclipse.ui.contexts.window,,,system) +Binding(ALT+SHIFT+X R, + ParameterizedCommand(Command(org.eclipse.wst.server.launchShortcut.run,Run on Server, + Run the current selection on a server, + Category(org.eclipse.debug.ui.category.run,Run/Debug,Run/Debug command category,true), + , + ,,true),null), + org.eclipse.ui.defaultAcceleratorConfiguration, + org.eclipse.ui.contexts.window,,,system) +!SUBENTRY 1 org.eclipse.jface 2 0 2013-11-26 14:30:46.251 +!MESSAGE A conflict occurred for ALT+CTRL+R: +Binding(ALT+CTRL+R, + ParameterizedCommand(Command(org.eclipse.team.svn.ui.command.CompareWithRevisionCommand,URL..., + , + Category(org.eclipse.team.svn.ui.command.category,SVN,null,true), + , + ,,true),null), + org.eclipse.ui.defaultAcceleratorConfiguration, + org.eclipse.ui.contexts.window,,,system) +Binding(ALT+CTRL+R, + ParameterizedCommand(Command(org.python.pydev.debug.setnext,Set Next Statement, + , + Category(org.python.pydev.ui.category.run,PyDev - Run,Python run category,true), + , + ,,true),null), + org.eclipse.ui.defaultAcceleratorConfiguration, + org.eclipse.ui.contexts.window,,,system) +!SUBENTRY 1 org.eclipse.jface 2 0 2013-11-26 14:30:46.251 +!MESSAGE A conflict occurred for CTRL+DEL: +Binding(CTRL+DEL, + ParameterizedCommand(Command(org.eclipse.datatools.sqltools.result.removeInstance,Remove Result, + , + Category(org.eclipse.datatools.sqltools.result.category,SQL Results View,null,true), + , + ,,true),null), + org.eclipse.ui.defaultAcceleratorConfiguration, + org.eclipse.ui.contexts.window,,,system) +Binding(CTRL+DEL, + ParameterizedCommand(Command(org.eclipse.graphiti.ui.internal.action.RemoveAction,Remove, + Remove selected Pictogram Elements, + Category(org.eclipse.graphiti.ui.Graphiti_Category,Edit,Graphiti Diagram Editor,true), + , + ,,true),null), + org.eclipse.ui.defaultAcceleratorConfiguration, + org.eclipse.ui.contexts.window,,,system) + +!ENTRY org.eclipse.equinox.p2.publisher.eclipse 2 0 2013-11-26 14:31:19.262 +!MESSAGE An error occurred while loading the manifest S:\Robert\eclipse-rcp-indigo-SR2-win32-x86_64\eclipse\plugins\org.eclipse.datatools.sqltools.parsers.sql.query.source_1.2.1.v201201250505.jar. +!STACK 0 +java.util.zip.ZipException: error in opening zip file + at java.util.zip.ZipFile.open(Native Method) + at java.util.zip.ZipFile.(Unknown Source) + at java.util.zip.ZipFile.(Unknown Source) + at org.eclipse.equinox.p2.publisher.eclipse.BundlesAction.basicLoadManifest(BundlesAction.java:530) + at org.eclipse.equinox.p2.publisher.eclipse.BundlesAction.loadManifest(BundlesAction.java:516) + at org.eclipse.equinox.p2.publisher.eclipse.BundlesAction.createBundleDescription(BundlesAction.java:509) + at org.eclipse.equinox.internal.provisional.p2.directorywatcher.RepositoryListener.processBundle(RepositoryListener.java:141) + at org.eclipse.equinox.internal.provisional.p2.directorywatcher.RepositoryListener.process(RepositoryListener.java:136) + at org.eclipse.equinox.internal.provisional.p2.directorywatcher.RepositoryListener.added(RepositoryListener.java:117) + at org.eclipse.equinox.internal.p2.extensionlocation.BundlePoolFilteredListener.added(BundlePoolFilteredListener.java:42) + at org.eclipse.equinox.internal.p2.extensionlocation.SiteListener.added(SiteListener.java:336) + at org.eclipse.equinox.internal.provisional.p2.directorywatcher.DirectoryWatcher.processFile(DirectoryWatcher.java:197) + at org.eclipse.equinox.internal.provisional.p2.directorywatcher.DirectoryWatcher.scanDirectories(DirectoryWatcher.java:160) + at org.eclipse.equinox.internal.provisional.p2.directorywatcher.DirectoryWatcher.poll(DirectoryWatcher.java:108) + at org.eclipse.equinox.internal.p2.extensionlocation.SiteListener.synchronizeRepositories(SiteListener.java:111) + at org.eclipse.equinox.internal.p2.extensionlocation.ExtensionLocationMetadataRepository.ensureInitialized(ExtensionLocationMetadataRepository.java:66) + at org.eclipse.equinox.internal.p2.extensionlocation.ExtensionLocationMetadataRepository.getProperties(ExtensionLocationMetadataRepository.java:194) + at org.eclipse.equinox.internal.p2.repository.helpers.AbstractRepositoryManager.addRepository(AbstractRepositoryManager.java:127) + at org.eclipse.equinox.internal.p2.repository.helpers.AbstractRepositoryManager.loadRepository(AbstractRepositoryManager.java:657) + at org.eclipse.equinox.internal.p2.metadata.repository.MetadataRepositoryManager.loadRepository(MetadataRepositoryManager.java:96) + at org.eclipse.equinox.internal.p2.metadata.repository.MetadataRepositoryManager.loadRepository(MetadataRepositoryManager.java:92) + at org.eclipse.equinox.p2.engine.ProvisioningContext.loadMetadataRepository(ProvisioningContext.java:211) + at org.eclipse.equinox.p2.engine.ProvisioningContext.getLoadedMetadataRepositories(ProvisioningContext.java:194) + at org.eclipse.equinox.p2.engine.ProvisioningContext.getMetadata(ProvisioningContext.java:275) + at org.eclipse.equinox.internal.p2.director.SimplePlanner.gatherAvailableInstallableUnits(SimplePlanner.java:261) + at org.eclipse.equinox.internal.p2.director.SimplePlanner.getSolutionFor(SimplePlanner.java:321) + at org.eclipse.equinox.internal.p2.director.SimplePlanner.getProvisioningPlan(SimplePlanner.java:379) + at org.eclipse.equinox.internal.p2.operations.PlannerResolutionJob.runModal(PlannerResolutionJob.java:76) + at org.eclipse.equinox.p2.operations.ProfileChangeOperation.resolveModal(ProfileChangeOperation.java:115) + at org.eclipse.equinox.internal.p2.ui.dialogs.ProvisioningOperationWizard$1.run(ProvisioningOperationWizard.java:213) + at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121) + +!ENTRY org.eclipse.equinox.p2.publisher.eclipse 4 0 2013-11-26 14:31:20.362 +!MESSAGE Invalid site reference %primaryUpdateURL in feature org.eclipse.persistence.dbws.source. + +!ENTRY org.eclipse.equinox.p2.publisher.eclipse 4 0 2013-11-26 14:31:20.362 +!MESSAGE Invalid site reference %secondaryUpdateURL in feature org.eclipse.persistence.dbws.source. + +!ENTRY org.eclipse.equinox.p2.publisher.eclipse 4 0 2013-11-26 14:31:20.362 +!MESSAGE Invalid site reference %primaryUpdateURL in feature org.eclipse.persistence.dbwsbuilder.source. + +!ENTRY org.eclipse.equinox.p2.publisher.eclipse 4 0 2013-11-26 14:31:20.362 +!MESSAGE Invalid site reference %secondaryUpdateURL in feature org.eclipse.persistence.dbwsbuilder.source. + +!ENTRY org.eclipse.equinox.p2.publisher.eclipse 4 0 2013-11-26 14:31:20.372 +!MESSAGE Invalid site reference %primaryUpdateURL in feature org.eclipse.persistence.dbwsbuilder. + +!ENTRY org.eclipse.equinox.p2.publisher.eclipse 4 0 2013-11-26 14:31:20.372 +!MESSAGE Invalid site reference %secondaryUpdateURL in feature org.eclipse.persistence.dbwsbuilder. + +!ENTRY org.eclipse.equinox.p2.publisher.eclipse 4 0 2013-11-26 14:31:20.372 +!MESSAGE Invalid site reference %primaryUpdateURL in feature org.eclipse.persistence.dbws. + +!ENTRY org.eclipse.equinox.p2.publisher.eclipse 4 0 2013-11-26 14:31:20.372 +!MESSAGE Invalid site reference %secondaryUpdateURL in feature org.eclipse.persistence.dbws. + +!ENTRY org.eclipse.equinox.p2.publisher.eclipse 4 0 2013-11-26 14:31:20.382 +!MESSAGE Invalid site reference %primaryUpdateURL in feature org.eclipse.persistence.jpa.source. + +!ENTRY org.eclipse.equinox.p2.publisher.eclipse 4 0 2013-11-26 14:31:20.382 +!MESSAGE Invalid site reference %secondaryUpdateURL in feature org.eclipse.persistence.jpa.source. + +!ENTRY org.eclipse.equinox.p2.publisher.eclipse 4 0 2013-11-26 14:31:20.382 +!MESSAGE Invalid site reference %primaryUpdateURL in feature org.eclipse.persistence.jpa. + +!ENTRY org.eclipse.equinox.p2.publisher.eclipse 4 0 2013-11-26 14:31:20.382 +!MESSAGE Invalid site reference %secondaryUpdateURL in feature org.eclipse.persistence.jpa. + +!ENTRY org.eclipse.equinox.p2.publisher.eclipse 4 0 2013-11-26 14:31:20.392 +!MESSAGE Invalid site reference %primaryUpdateURL in feature org.eclipse.persistence.moxy.source. + +!ENTRY org.eclipse.equinox.p2.publisher.eclipse 4 0 2013-11-26 14:31:20.392 +!MESSAGE Invalid site reference %secondaryUpdateURL in feature org.eclipse.persistence.moxy.source. + +!ENTRY org.eclipse.equinox.p2.publisher.eclipse 4 0 2013-11-26 14:31:20.392 +!MESSAGE Invalid site reference %primaryUpdateURL in feature org.eclipse.persistence.moxy. + +!ENTRY org.eclipse.equinox.p2.publisher.eclipse 4 0 2013-11-26 14:31:20.392 +!MESSAGE Invalid site reference %secondaryUpdateURL in feature org.eclipse.persistence.moxy. + +!ENTRY org.eclipse.equinox.p2.publisher.eclipse 4 0 2013-11-26 14:31:20.392 +!MESSAGE Invalid site reference %primaryUpdateURL in feature org.eclipse.persistence.nosql.source. + +!ENTRY org.eclipse.equinox.p2.publisher.eclipse 4 0 2013-11-26 14:31:20.402 +!MESSAGE Invalid site reference %secondaryUpdateURL in feature org.eclipse.persistence.nosql.source. + +!ENTRY org.eclipse.equinox.p2.publisher.eclipse 4 0 2013-11-26 14:31:20.402 +!MESSAGE Invalid site reference %primaryUpdateURL in feature org.eclipse.persistence.nosql. + +!ENTRY org.eclipse.equinox.p2.publisher.eclipse 4 0 2013-11-26 14:31:20.402 +!MESSAGE Invalid site reference %secondaryUpdateURL in feature org.eclipse.persistence.nosql. + +!ENTRY org.eclipse.equinox.p2.publisher.eclipse 4 0 2013-11-26 14:31:20.402 +!MESSAGE Invalid site reference %primaryUpdateURL in feature org.eclipse.persistence.sdk. + +!ENTRY org.eclipse.equinox.p2.publisher.eclipse 4 0 2013-11-26 14:31:20.402 +!MESSAGE Invalid site reference %secondaryUpdateURL in feature org.eclipse.persistence.sdk. + +!ENTRY org.eclipse.equinox.p2.publisher.eclipse 4 0 2013-11-26 14:31:20.412 +!MESSAGE Invalid site reference %primaryUpdateURL in feature org.eclipse.persistence.sdo.source. + +!ENTRY org.eclipse.equinox.p2.publisher.eclipse 4 0 2013-11-26 14:31:20.412 +!MESSAGE Invalid site reference %secondaryUpdateURL in feature org.eclipse.persistence.sdo.source. + +!ENTRY org.eclipse.equinox.p2.publisher.eclipse 4 0 2013-11-26 14:31:20.412 +!MESSAGE Invalid site reference %primaryUpdateURL in feature org.eclipse.persistence.sdo. + +!ENTRY org.eclipse.equinox.p2.publisher.eclipse 4 0 2013-11-26 14:31:20.412 +!MESSAGE Invalid site reference %secondaryUpdateURL in feature org.eclipse.persistence.sdo. + +!ENTRY org.eclipse.equinox.p2.publisher.eclipse 2 0 2013-11-26 14:31:24.582 +!MESSAGE An error occurred while loading the manifest S:\Robert\eclipse-rcp-indigo-SR2-win32-x86_64\eclipse\plugins\org.eclipse.datatools.sqltools.parsers.sql.query.source_1.2.1.v201201250505.jar. +!STACK 0 +java.util.zip.ZipException: error in opening zip file + at java.util.zip.ZipFile.open(Native Method) + at java.util.zip.ZipFile.(Unknown Source) + at java.util.zip.ZipFile.(Unknown Source) + at org.eclipse.equinox.p2.publisher.eclipse.BundlesAction.basicLoadManifest(BundlesAction.java:530) + at org.eclipse.equinox.p2.publisher.eclipse.BundlesAction.loadManifest(BundlesAction.java:516) + at org.eclipse.equinox.p2.publisher.eclipse.BundlesAction.createBundleDescription(BundlesAction.java:509) + at org.eclipse.equinox.internal.provisional.p2.directorywatcher.RepositoryListener.processBundle(RepositoryListener.java:141) + at org.eclipse.equinox.internal.provisional.p2.directorywatcher.RepositoryListener.process(RepositoryListener.java:136) + at org.eclipse.equinox.internal.provisional.p2.directorywatcher.RepositoryListener.added(RepositoryListener.java:117) + at org.eclipse.equinox.internal.p2.extensionlocation.BundlePoolFilteredListener.added(BundlePoolFilteredListener.java:42) + at org.eclipse.equinox.internal.p2.extensionlocation.SiteListener.added(SiteListener.java:336) + at org.eclipse.equinox.internal.provisional.p2.directorywatcher.DirectoryWatcher.processFile(DirectoryWatcher.java:197) + at org.eclipse.equinox.internal.provisional.p2.directorywatcher.DirectoryWatcher.scanDirectories(DirectoryWatcher.java:160) + at org.eclipse.equinox.internal.provisional.p2.directorywatcher.DirectoryWatcher.poll(DirectoryWatcher.java:108) + at org.eclipse.equinox.internal.p2.extensionlocation.SiteListener.synchronizeRepositories(SiteListener.java:111) + at org.eclipse.equinox.internal.p2.extensionlocation.ExtensionLocationArtifactRepository.ensureInitialized(ExtensionLocationArtifactRepository.java:66) + at org.eclipse.equinox.internal.p2.extensionlocation.ExtensionLocationArtifactRepository.getProperties(ExtensionLocationArtifactRepository.java:259) + at org.eclipse.equinox.internal.p2.repository.helpers.AbstractRepositoryManager.addRepository(AbstractRepositoryManager.java:127) + at org.eclipse.equinox.internal.p2.repository.helpers.AbstractRepositoryManager.loadRepository(AbstractRepositoryManager.java:657) + at org.eclipse.equinox.internal.p2.artifact.repository.ArtifactRepositoryManager.loadRepository(ArtifactRepositoryManager.java:100) + at org.eclipse.equinox.internal.p2.artifact.repository.ArtifactRepositoryManager.loadRepository(ArtifactRepositoryManager.java:96) + at org.eclipse.equinox.p2.engine.ProvisioningContext.getLoadedArtifactRepositories(ProvisioningContext.java:160) + at org.eclipse.equinox.p2.engine.ProvisioningContext.getArtifactRepositories(ProvisioningContext.java:143) + at org.eclipse.equinox.internal.p2.engine.phases.Sizing.completePhase(Sizing.java:91) + at org.eclipse.equinox.internal.p2.engine.Phase.postPerform(Phase.java:216) + at org.eclipse.equinox.internal.p2.engine.Phase.perform(Phase.java:84) + at org.eclipse.equinox.internal.p2.engine.PhaseSet.perform(PhaseSet.java:44) + at org.eclipse.equinox.internal.p2.engine.Engine.perform(Engine.java:75) + at org.eclipse.equinox.internal.p2.engine.Engine.perform(Engine.java:44) + at org.eclipse.equinox.internal.p2.ui.ProvUI.getSize(ProvUI.java:230) + at org.eclipse.equinox.internal.p2.ui.dialogs.SizeComputingWizardPage$1.run(SizeComputingWizardPage.java:63) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) diff --git a/com.kdmanalytics.toif.updatesite/site.xml b/com.kdmanalytics.toif.updatesite/site.xml new file mode 100644 index 00000000..432b37b3 --- /dev/null +++ b/com.kdmanalytics.toif.updatesite/site.xml @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/doc/CWEs SFPs and Clusters.xls b/doc/CWEs SFPs and Clusters.xls new file mode 100644 index 00000000..16c85371 Binary files /dev/null and b/doc/CWEs SFPs and Clusters.xls differ diff --git a/doc/KDM_TOIF_1_15_5_UG_1.0.1.pdf b/doc/KDM_TOIF_1_15_5_UG_1.0.1.pdf new file mode 100644 index 00000000..09b77266 Binary files /dev/null and b/doc/KDM_TOIF_1_15_5_UG_1.0.1.pdf differ diff --git a/doc/RDFandTOIF.pdf b/doc/RDFandTOIF.pdf new file mode 100644 index 00000000..2be27b83 Binary files /dev/null and b/doc/RDFandTOIF.pdf differ diff --git a/doc/Specification of the TOIF XML schema_v2.pdf b/doc/Specification of the TOIF XML schema_v2.pdf new file mode 100644 index 00000000..b975d3dc Binary files /dev/null and b/doc/Specification of the TOIF XML schema_v2.pdf differ diff --git a/doc/TOIF XMI Conformance testing Report.pdf b/doc/TOIF XMI Conformance testing Report.pdf new file mode 100644 index 00000000..e49862bd Binary files /dev/null and b/doc/TOIF XMI Conformance testing Report.pdf differ diff --git a/doc/TOIF specification_v1.1_final.pdf b/doc/TOIF specification_v1.1_final.pdf new file mode 100644 index 00000000..64fa5916 Binary files /dev/null and b/doc/TOIF specification_v1.1_final.pdf differ diff --git a/doc/TOIF_Adaptor_Design_1.8.7.pdf b/doc/TOIF_Adaptor_Design_1.8.7.pdf new file mode 100644 index 00000000..f09b14ef Binary files /dev/null and b/doc/TOIF_Adaptor_Design_1.8.7.pdf differ diff --git a/doc/TOIF_readme_1.15.5.txt b/doc/TOIF_readme_1.15.5.txt new file mode 100644 index 00000000..0d434a83 --- /dev/null +++ b/doc/TOIF_readme_1.15.5.txt @@ -0,0 +1,73 @@ +Readme file for + + * Tool Output Integration Framework version 1.15.5 + +Contents +======== + +Tool Output Integration Framework version 1.15.5 + + 1. What is Tool Output Integration Framework (TOIF)? + 2. TOIF 1.15.5 New Features + 3. Supported Generator Versions + 4. Known Issues + 5. Getting help + +KDM Analytics customer support + + +---------------------------------------------------------------------------- +Tool Output Integration Framework version 1.15.5 +====================================== + +1. What is TOIF? + +The Tool Output Integration Framework (TOIF) is a powerful open source vulnerability detection platform that provides analysts information of system defects with the ability to: +* Integrate multiple vulnerability detection tools as “data feeds” into the repository +* Collate findings from several tools +* Put vulnerability findings into the context of other facts about the system (such as metrics, architecture, design patterns, etc.) + +TOIF takes the output of defect generator tools and displays the results in Eclipse. + +TOIF includes the following components: + +* TOIF Adaptor: TOIF Adaptor is used to collect the output from various vulnerability detection tools and convert their output into TOIF xml + +* TOIF Assimilator: After running the TOIF Adaptor you need to run the Assimilator to merge TOIF findings and/or KDM data into a common fact-orientated repository or filE. + +* TOIF Report View: Once you have your TOIF findings assimilated you view the TOIF Report View to display the results in Eclipse. + +2. TOIF 1.15.5 New Features: +* No new features - Bug fixes + +3. Supported Generator Versions + +TOIF 1.15.5 supports the following generator versions for windows and linux: +* cppcheck-1.40 +* findbugs-1.3.9 +* jlint-3.0 +* rats-2.3 +* splint-3.1.2 + +4. Known Issues + +* Traceback displays numbers as reported by TOIF Adaptors: The traceback currently shows numbers as reported by the TOIF Adaptors unlike the code locations in the view list (which are normalized to kdm locations). + +5. Getting help + +For TOIF source resources, please visit GitHub https://github.com/KdmAnalytics/toif/. + +For information about installing and using TOIF, consult the TOIF User's Guide. + +----------------------------------------------------------------------- +KDM Analytics customer support +==================================== + + If, after consulting the published information, you still have questions about using this KDM Analytics product, please contact KDM Analytics Customer Support using one of these methods: + + E-mail: support@kdmanalytics.com + + Copyright © 2006-2014 KDM Analytics Inc. All rights reserved. + + Information subject to change without notice. + \ No newline at end of file diff --git a/doc/examples/housekeepingExamples/bindsHousekeeping b/doc/examples/housekeepingExamples/bindsHousekeeping new file mode 100755 index 00000000..1670d27b --- /dev/null +++ b/doc/examples/housekeepingExamples/bindsHousekeeping @@ -0,0 +1,37 @@ +########################### +# Facts +########################### + +TOIFSegmentIsRelatedToProject=project1 +TOIFSegmentIsProducedByOrganization=org1 +TOIFSegmentIsOwnedByOrganization=org1 +TOIFSegmentIsGeneratedByPerson=person1 +TOIFSegmentIsSupervisedByPerson=person1 + +PersonIsInvolvedInProjectAsRole=person1;project1;role1 +OrganizationIsInvolvedInProjectAsRole=org1;project1;role2 +OrganizationIsPartOfOrganizationAsRole=org1;org2;role2 +PersonIsEmployedByOrganizationAsRole=person1;org1;role1 + +########################### +# Entities +########################### + +SegmentDescription=Segment relating to the findings of the cppcheck tool on the binds project. + +#projectId=name;description +project1=binds;Using binds to test the TOIF tool chain. + +#personId=name;email;phone +person1=Adam Nunn;adam@kdmanalytics.com;555-1234 +#person2=Joe Bloggs;blogs@kdmanalytics.com;555-1234 + +#organizationId=name;description;address;phone;email +org1=KDM;Kdm Analytics;Richmond Road;555-5555;kdm@kdmanalytics.com + +#organizationId=name;description;address;phone;email +org2=Acme Corporation;Acme Corporation;blah;555-5555;thingamy@thingamy.com + +#roleId=name;description +role1=Software Developer;Developer on the TOIF Adaptors project +role2=company;employer diff --git a/doc/examples/housekeepingExamples/kens b/doc/examples/housekeepingExamples/kens new file mode 100755 index 00000000..b4b1d9dc --- /dev/null +++ b/doc/examples/housekeepingExamples/kens @@ -0,0 +1,37 @@ +########################### +# Facts +########################### + +TOIFSegmentIsRelatedToProject=project1 +TOIFSegmentIsProducedByOrganization=org1 +TOIFSegmentIsOwnedByOrganization=org1 +TOIFSegmentIsGeneratedByPerson=person1 +TOIFSegmentIsSupervisedByPerson=person1 + +PersonIsInvolvedInProjectAsRole=person1;project1;role1 +OrganizationIsInvolvedInProjectAsRole=org1;project1;role2 +OrganizationIsPartOfOrganizationAsRole=org1;org2;role2 +PersonIsEmployedByOrganizationAsRole=person1;org1;role1 + +########################### +# Entities +########################### + +SegmentDescription=Segment relating to the findings of the Defect Counter Tool. + +#projectId=name;description +project1=binds;Defects in Wireshark. + +#personId=name;email;phone +person1=Ken Duck;ken@kdmanalytics.com;613-627-1011 +#person2=Joe Bloggs;blogs@kdmanalytics.com;555-1234 + +#organizationId=name;description;address;phone;email +org1=KDM;Kdm Analytics;Richmond Road;555-5555;kdm@kdmanalytics.com + +#organizationId=name;description;address;phone;email +org2=Acme Corporation;Acme Corporation;blah;555-5555;thingamy@thingamy.com + +#roleId=name;description +role1=Software Developer;Developer for KDM Analytics +role2=company;employer diff --git a/doc/examples/housekeepingExamples/sphinxHousekeeping b/doc/examples/housekeepingExamples/sphinxHousekeeping new file mode 100755 index 00000000..6af725e1 --- /dev/null +++ b/doc/examples/housekeepingExamples/sphinxHousekeeping @@ -0,0 +1,37 @@ +########################### +# Facts +########################### + +TOIFSegmentIsRelatedToProject=project1 +TOIFSegmentIsProducedByOrganization=org1 +TOIFSegmentIsOwnedByOrganization=org1 +TOIFSegmentIsGeneratedByPerson=person1 +TOIFSegmentIsSupervisedByPerson=person1 + +PersonIsInvolvedInProjectAsRole=person1;project1;role1 +OrganizationIsInvolvedInProjectAsRole=org1;project1;role2 +OrganizationIsPartOfOrganizationAsRole=org1;org2;role2 +PersonIsEmployedByOrganizationAsRole=person1;org1;role1 + +########################### +# Entities +########################### + +SegmentDescription=Segment relating to the sphinx-4 project. + +#projectId=name;description +project1=Sphinx-4;Using Sphinx-4 to test the TOIF tool chain. + +#personId=name;email;phone +person1=Adam Nunn;adam@kdmanalytics.com;555-1234 +#person2=Joe Bloggs;blogs@kdmanalytics.com;555-1234 + +#organizationId=name;description;address;phone;email +org1=KDM;Kdm Analytics;Richmond Road;555-5555;kdm@kdmanalytics.com + +#organizationId=name;description;address;phone;email +org2=Acme Corporation;Acme Corporation;blah;555-5555;thingamy@thingamy.com + +#roleId=name;description +role1=Software Developer;Developer on the TOIF Adaptors project +role2=company;employer diff --git a/doc/examples/housekeepingExamples/wiresharkHousekeeping b/doc/examples/housekeepingExamples/wiresharkHousekeeping new file mode 100755 index 00000000..e178bd4d --- /dev/null +++ b/doc/examples/housekeepingExamples/wiresharkHousekeeping @@ -0,0 +1,38 @@ +########################### +# Facts +########################### + +TOIFSegmentIsRelatedToProject=project1 +TOIFSegmentIsProducedByOrganization=org1 +TOIFSegmentIsOwnedByOrganization=org1 + +TOIFSegmentIsGeneratedByPerson=person1 +TOIFSegmentIsSupervisedByPerson=person1 + +PersonIsInvolvedInProjectAsRole=person1;project1;role1 +OrganizationIsInvolvedInProjectAsRole=org1;project1;role2 +OrganizationIsPartOfOrganizationAsRole=org1;org2;role2 +PersonIsEmployedByOrganizationAsRole=person1;org1;role1 + +########################### +# Entities +########################### + +SegmentDescription=Segment relating to the findings in the wireshark project. + +#projectId=name;description +project1=Wireshark;Using Wireshark to test the TOIF tool chain. + +#personId=name;email;phone +person1=Adam Nunn;adam@kdmanalytics.com;555-1234 +#person2=Joe Bloggs;blogs@kdmanalytics.com;555-1234 + +#organizationId=name;description;address;phone;email +org1=KDM;Kdm Analytics;Richmond Road;555-5555;kdm@kdmanalytics.com + +#organizationId=name;description;address;phone;email +org2=Acme Corporation;Acme Corporation;blah;555-5555;thingamy@thingamy.com + +#roleId=name;description +role1=Software Developer;Developer on the TOIF Adaptors project +role2=company;employer diff --git a/doc/examples/linux scripts/Ant build target.xml b/doc/examples/linux scripts/Ant build target.xml new file mode 100755 index 00000000..bec5a46c --- /dev/null +++ b/doc/examples/linux scripts/Ant build target.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/doc/examples/linux scripts/gcc-python-wrapper.py b/doc/examples/linux scripts/gcc-python-wrapper.py new file mode 100644 index 00000000..837dade2 --- /dev/null +++ b/doc/examples/linux scripts/gcc-python-wrapper.py @@ -0,0 +1,160 @@ +#!/usr/bin/env python + +################################################### +#An example of wrapping the gcc compiler to execute +# the adaptors. +#################################################### + +import subprocess +import os +import shlex +import sys + +################################################# +# User defined options +# +# HOUSE_KEEPING = TOIF HOUSE_KEEPING File +# OUTPUT_DIR = Location where TOIF result files +# will be created. Directory will be +# created if it does not exist +# COMPILER = process name of original compiler which +# will called after TOIF is done. +# if set to none compile step will be skipped +# +# DEBUG = simple flag for debugging +################################################# +HOUSE_KEEPING = "c:/kdm/lm/housekeeping.txt" +OUTPUT_DIR = "c:/kdm/lm/tmp" +COMPILER = "gcc" +DEBUG = True + +################################################# +# Define which tools we wish to run and any options that +# we wish to pass +# +# To disable a tool set name to None. For example: +# CPP_CHECK=None +################################################# +CPP_CHECK="cppcheck" # run cppcheck +CPP_CHECK_ARGS = ["--enable=all"] # cppcheck options +RATS="rats" # run rats +RATS_ARGS=[] # rats options +SPLINT="splint" # run splint +SPLINT_ARGS=["+posixlib", "-weak"] # splint options + +########################################### +# String arrays to track options to the +# compiler +########################################### +include = "" # -I options +options = "" # -D options + +# This is a list of files that we will assume are source +CList = [".c",".cpp",".C",".CPP"] +TOIF_INCLUDES = [] # Array of -I options +TOIF_DEFINES = [] # Array of -D options +TOIF_SOURCE = None # Do we have source file + +SUB_PROCESS = [] # Array of TOIF took jobs + +########################################################## +# Create output directory of it does not exist +########################################################## +if not os.path.exists( OUTPUT_DIR): + os.makedirs(OUTPUT_DIR) + +########################################################## +#for all the arguments passed to compiler, get the ones we need. +########################################################## +for arg in sys.argv: + # Handle -I options + if arg.startswith( "-I" ): + TOIF_INCLUDES.append( arg ) + continue + + # handle -D options + if arg.startswith( "-D" ): + TOIF_DEFINES.append( arg) + continue + + # handle source file (assume 1 source per compile) + for cType in CList: + if arg.endswith( cType ): + TOIF_SOURCE = arg + break + + +if DEBUG == True: + print "TOIF includes=", TOIF_INCLUDES + print "TOIF DEFINES", TOIF_DEFINES + print "TOIF_SOURCE", TOIF_SOURCE + +######################################################### +# Perform TOIF processing if we have detected source +######################################################### +if TOIF_SOURCE != None: + # Build common TOIF parameter block + commonArgs = [] + commonArgs.append( "--housekeeping="+HOUSE_KEEPING ) + commonArgs.append( "--outputdirectory="+OUTPUT_DIR ) + commonArgs.append( "--inputfile=" + TOIF_SOURCE ) + + commonArgs.append( "--" ) + #commonArgs.extend( TOIF_INCLUDES ) + #commonArgs.extend( TOIF_DEFINES ) + + if DEBUG == True: + print "common TOIF args=", commonArgs + + # Do cppcheck if enabled + if CPP_CHECK != None: + cppcheck_cmd = ["toif", "--adaptor=cppcheck"] + cppcheck_cmd.extend( commonArgs ) + cppcheck_cmd.extend( CPP_CHECK_ARGS ) + print cppcheck_cmd + + # Start cppcheck subprocess + p = subprocess.Popen( cppcheck_cmd, shell=False) + SUB_PROCESS.append( p ) + + # Do Rats if enabled + if RATS != None: + rats_cmd = ["toif", "--adaptor=rats"] + rats_cmd.extend( commonArgs ) + rats_cmd.extend( RATS_ARGS ) + print rats_cmd + + # start RATS subprocess + p = subprocess.Popen( rats_cmd, shell=False ) + SUB_PROCESS.append( p ) + + # Do splint if enabled + if SPLINT != None: + splint_cmd = ["toif", "--adaptor=splint"] + splint_cmd.extend( commonArgs ) + splint_cmd.extend( SPLINT_ARGS ) + splint_cmd.extend( TOIF_INCLUDES ) + print splint_cmd + + # Start splint subprocess + p = subprocess.Popen( splint_cmd, shell=False ) + SUB_PROCESS.append( p ) + + ###################################### + # Wait for each subprocess to complete + ###################################### + for p in SUB_PROCESS: + p.wait() + +#run the compiler with all the original arguments +# if None skip compiler step +if COMPILER != None: + subprocess.call([COMPILER]+sys.argv[1:]) + + + + + + + + diff --git a/doc/examples/linux scripts/gcc-wrapper.sh b/doc/examples/linux scripts/gcc-wrapper.sh new file mode 100644 index 00000000..f5ee3416 --- /dev/null +++ b/doc/examples/linux scripts/gcc-wrapper.sh @@ -0,0 +1,72 @@ +#! /usr/bin/bash + +echo wrapper $* +echo $PATH + +HOUSE_KEEPING="/c/kdm/housekeeping.txt" +OUT_DIR="/c/tmp/toif" +TOIF=toif +USER_GCC=/c/kdm/gcc/bin/gcc.exe +CPPCHECK_ARGS="--enable=all" +RATS_ARGS="" +SPLINT_ARGS="+posixlib -weak" + +TOIF_INCLUDES=() +TOIF_DEFINES=() +TOIF_SOURCE="NONE" + +for arg in $* +do + echo $arg + if [[ $arg == -I* ]] ; + then + #echo "include: $arg" + TOIF_INCLUDES=( "${TOIF_INCLUDES[@]} $arg") + fi + + if [[ $arg == -D* ]] ; + then + #echo "define: $arg" + TOIF_DEFINES=( "${TOIF_DEFINES[@]} $arg") + fi + + if [[ $arg == *.c ]] ; + then + #echo "source: $arg" + TOIF_SOURCE=$arg + + fi +done +echo ${TOIF_INCLUDES[@]} >> /tmp/robert.txt +echo "${TOIF_DEFINES[@]}" +echo "${TOIF_SOURCE}" + +################################################## +# Check if we will accept line for TOIF processing +################################################## +if [ ${TOIF_SOURCE} != "NONE" ] ; +then + #echo "found" >> /tmp/robert.txt + COMMON_ARGS=("--housekeeping=${HOUSE_KEEPING} --outputdirectory=${OUT_DIR} --inputfile=${TOIF_SOURCE} -- ") + + ################################# + # Start processing for each tool + ################################# + ${TOIF} --adaptor=cppcheck ${COMMON_ARGS[@]} ${CPPCHECK_ARGS} & + ${TOIF} --adaptor=rats ${COMMON_ARGS[@]} ${RATS_ARGS} & + ${TOIF} --adaptor=splint ${COMMON_ARGS[@]} ${SPLINT_ARGS} & + + wait +fi + +################################################## +# Perform users compile command now +################################################## +${USER_GCC} $* +exit $? + + + + + + diff --git a/doc/examples/linux scripts/gccPythonWrapper2 b/doc/examples/linux scripts/gccPythonWrapper2 new file mode 100644 index 00000000..18c6b688 --- /dev/null +++ b/doc/examples/linux scripts/gccPythonWrapper2 @@ -0,0 +1,83 @@ +#!/usr/bin/env python + +""" +An example of wrapping the gcc compiler to execute the adaptors. + +""" + +import subprocess +import os +import shlex +import sys + +include = "" +options = "" +inFile = "" + +CP = "\"/home/tony/Desktop/Adaptors-v1.8.6/*\"" +HOUSEKEEPING = "/tmp/housekeeping.txt" +OUTDIR = "/tmp/robert/toif/" + +CList = [".c",".cpp",".C",".CPP"] + +#for all the arguments passed to gcc, get the ones we need. +for opt in sys.argv: + + + #if the argument starts with "-I", then it is an includes. + if opt[:2] == "-I": + include = include + " " + opt + + #"-D" is a compiler option. + if opt[:2] == "-D": + options = options + " " + opt + + #if the argument ends with a possible C extension, use it as an input file. + if os.path.splitext(opt)[1] in CList: + + #need to construct a full path to the file based on current working directory. + inFile = os.getcwd()+os.sep+opt + + #if "packet-" in inFile: + # break + + +if inFile: + print("ACCEPTED TOIF: ",sys.argv) + #construct the rats command and run it. + cmd = "toif --adaptor=rats --housekeeping=" + HOUSEKEEPING + " --inputfile=" + inFile + " --outputdirectory=" + OUTDIR + ratsCommand = shlex.split(cmd) + rats = subprocess.Popen(ratsCommand,stdout=subprocess.PIPE) + + cmd = "toif --adaptor=splint --housekeeping=" + HOUSEKEEPING + " --inputfile=" + inFile + " --outputdirectory=" + OUTDIR + " -- "+include + cmd = cmd + " -- +posixlib -weak" + + print("TOIF: ",cmd) + + #construct the splint command and run it. + splintCommand = shlex.split(cmd) + splint = subprocess.Popen(splintCommand,stdout=subprocess.PIPE) + + #construct the cppcheck command and run it. + cppcheckCommand = shlex.split("toif --adaptor=cppcheck --housekeeping=" + HOUSEKEEPING + " --inputfile=" + inFile + " --outputdirectory=" + OUTDIR + " -- --enable=all" ) + cppcheck = subprocess.Popen(cppcheckCommand,stdout=subprocess.PIPE) + + #wait for the adaptors to return. + rats.wait() + splint.wait() + cppcheck.wait() + +else: + print("DECLINED TOIF: ",sys.argv) + +#run the gc compiler with all the original compilers. +subprocess.call(["gcc"]+sys.argv[1:]) +#gcc = subprocess.Popen(["gcc"]+sys.argv[1:], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) +#gcc.wait() + + + + + + + diff --git a/doc/examples/linux scripts/javaAdaptors b/doc/examples/linux scripts/javaAdaptors new file mode 100755 index 00000000..4c09b46e --- /dev/null +++ b/doc/examples/linux scripts/javaAdaptors @@ -0,0 +1,10 @@ +#!/bin/bash + +OUTPUT=/home/adam/Desktop/output/ +CLASSPATH="/home/adam/Desktop/adaptors/*" + +echo -e "\nRunning Findbugs Adaptor:\n" ${1} +java -cp "$CLASSPATH" ToifAdaptor --adaptor FindbugsAdaptor --outputDirectory $OUTPUT --houseKeeping /home/adam/Desktop/adaptors/housekeepingExamples/sphinxHouseKeeping --inputFile ${1} -auxclasspath ${2} 2>> "${OUTPUT}Summary" || echo "Findbugs failed on file:" $1>> "${OUTPUT}Summary"& + +echo -e "\nRunning Jlint Adaptor:\n" ${1} +java -cp "$CLASSPATH" ToifAdaptor --adaptor JlintAdaptor --outputDirectory $OUTPUT --houseKeeping /home/adam/Desktop/adaptors//housekeepingExamples/sphinxHouseKeeping --inputFile ${1} 2>> "${OUTPUT}Summary" || echo "jlint failed on file:" $1>> "${OUTPUT}Summary"& diff --git a/doc/examples/linux scripts/merge-wrapper.py b/doc/examples/linux scripts/merge-wrapper.py new file mode 100644 index 00000000..74ab6a10 --- /dev/null +++ b/doc/examples/linux scripts/merge-wrapper.py @@ -0,0 +1,17 @@ +#!/usr/bin/env python + +################################################### +#An example of wrapping the gcc compiler to execute +# the adaptors. +#################################################### + +import subprocess +import os +import shlex +import sys + +########################################################## +#for all the arguments passed to compiler, get the ones we need. +########################################################## +for arg in sys.argv: + print arg \ No newline at end of file diff --git a/doc/examples/windows scripts/Ant build target.xml b/doc/examples/windows scripts/Ant build target.xml new file mode 100755 index 00000000..bec5a46c --- /dev/null +++ b/doc/examples/windows scripts/Ant build target.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/doc/examples/windows scripts/javaAdaptors.py b/doc/examples/windows scripts/javaAdaptors.py new file mode 100755 index 00000000..116a4ec5 --- /dev/null +++ b/doc/examples/windows scripts/javaAdaptors.py @@ -0,0 +1,23 @@ +#javaAdaptors.py + +import subprocess +import os +import shlex +import sys + +CP = "\"C:/Users/adam/Desktop/adaptors/*\";" +HOUSEKEEPING = "C:/Users/adam/Desktop/adaptors/housekeepingExamples/sphinxHouseKeeping" +OUTDIR = "C:/Users/adam/Desktop/sph4" + +inFile = sys.argv[1] +auxclasspath = sys.argv[2] + +inFile = inFile.replace("\\","/") +auxclasspath = auxclasspath.replace("\\","/") + +print("file: "+inFile) +jlintCommand = shlex.split("java -cp " + CP + " ToifAdaptor --adaptor JlintAdaptor --houseKeeping " + HOUSEKEEPING + " --inputFile " + inFile + " --outputDirectory " + OUTDIR) +jlint = subprocess.Popen(jlintCommand,stdout=subprocess.PIPE) + +findbugsCommand = shlex.split("java -cp " + CP + " ToifAdaptor --adaptor FindbugsAdaptor --houseKeeping " + HOUSEKEEPING + " --inputFile " + inFile + " --outputDirectory " + OUTDIR + " -auxclasspath " + auxclasspath) +findbugs = subprocess.Popen(findbugsCommand,stdout=subprocess.PIPE) diff --git a/doc/toifXmiSchema.xsd b/doc/toifXmiSchema.xsd new file mode 100755 index 00000000..01890d0c --- /dev/null +++ b/doc/toifXmiSchema.xsd @@ -0,0 +1,703 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +