Makefile.fetch | 3 RepositoryExternal.mk | 50 - android/source/src/java/org/mozilla/gecko/gfx/JavaPanZoomController.java | 2 bean/qa/complex/bean/WriterFrame.java | 2 config_host.mk.in | 3 configure.ac | 91 -- connectivity/qa/connectivity/tools/HsqlColumnDescriptor.java | 4 dbaccess/qa/complex/dbaccess/SingleSelectQueryComposer.java | 4 download.lst | 9 external/apache-commons/ExternalProject_apache_commons_codec.mk | 37 - external/apache-commons/ExternalProject_apache_commons_httpclient.mk | 40 - external/apache-commons/ExternalProject_apache_commons_lang.mk | 37 - external/apache-commons/Module_apache-commons.mk | 6 external/apache-commons/README | 2 external/apache-commons/UnpackedTarball_apache_commons_codec.mk | 24 external/apache-commons/UnpackedTarball_apache_commons_httpclient.mk | 19 external/apache-commons/UnpackedTarball_apache_commons_lang.mk | 20 external/apache-commons/patches/codec.patch | 20 external/apache-commons/patches/httpclient.patch | 119 --- external/apache-commons/patches/httpclient_no_javadoc.patch | 11 external/apache-commons/patches/lang.patch | 11 jurt/com/sun/star/comp/bridgefactory/BridgeFactory.java | 2 odk/examples/DevelopersGuide/GUI/UnoDialogSample2.java | 14 odk/examples/DevelopersGuide/UCB/ChildrenRetriever.java | 2 odk/examples/DevelopersGuide/UCB/DataStreamRetriever.java | 2 qadevOOo/runner/lib/SimpleStatus.java | 10 qadevOOo/runner/util/DBTools.java | 32 - qadevOOo/testdocs/backend/org/openoffice/JavaSystemBackend.java | 6 qadevOOo/tests/java/complex/unoapi/CheckModuleAPI.java | 2 qadevOOo/tests/java/ifc/i18n/_XExtendedIndexEntrySupplier.java | 2 qadevOOo/tests/java/ifc/reflection/_XIdlReflection.java | 2 qadevOOo/tests/java/ifc/util/_XURLTransformer.java | 26 qadevOOo/tests/java/mod/_dbaccess/ORowSet.java | 2 qadevOOo/tests/java/mod/_dbaccess/OSingleSelectQueryComposer.java | 2 qadevOOo/tests/java/mod/_forms/GenericModelTest.java | 4 qadevOOo/tests/java/mod/_forms/ODatabaseForm.java | 2 reportbuilder/java/org/libreoffice/report/pentaho/parser/draw/ObjectOleReadHandler.java | 4 scripting/java/com/sun/star/script/framework/io/UCBStreamHandler.java | 2 scripting/java/com/sun/star/script/framework/provider/ScriptContext.java | 8 sw/qa/complex/accessibility/AccessibleRelationSet.java | 2 swext/Extension_wiki-publisher.mk | 15 swext/Jar_mediawiki.mk | 7 swext/mediawiki/src/com/sun/star/wiki/Helper.java | 312 +++++----- swext/mediawiki/src/com/sun/star/wiki/MainThreadDialogExecutor.java | 8 swext/mediawiki/src/com/sun/star/wiki/WikiArticle.java | 109 +-- swext/mediawiki/src/com/sun/star/wiki/WikiEditSettingDialog.java | 31 swext/mediawiki/src/com/sun/star/wiki/WikiProtocolSocketFactory.java | 216 ++++++ swext/mediawiki/src/description.xml | 2 toolkit/qa/complex/toolkit/awtgrid/TMutableGridDataModel.java | 4 vcl/qa/complex/memCheck/TestDocument.java | 2 wizards/com/sun/star/wizards/db/DBMetaData.java | 6 wizards/com/sun/star/wizards/document/FormHandler.java | 18 wizards/com/sun/star/wizards/form/FormDocument.java | 4 wizards/com/sun/star/wizards/form/StyleApplier.java | 8 wizards/com/sun/star/wizards/table/PrimaryKeyHandler.java | 2 wizards/com/sun/star/wizards/table/ScenarioSelector.java | 4 wizards/com/sun/star/wizards/ui/ButtonList.java | 2 wizards/com/sun/star/wizards/ui/FieldSelection.java | 16 wizards/com/sun/star/wizards/ui/FilterComponent.java | 6 xmerge/source/xmerge/java/org/openoffice/xmerge/converter/palm/PalmDB.java | 2 xmerge/source/xmerge/java/org/openoffice/xmerge/converter/palm/PdbEncoder.java | 2 xmerge/source/xmerge/java/org/openoffice/xmerge/converter/palm/PdbUtil.java | 6 xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/OfficeZip.java | 12 xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/xslt/PluginFactoryImpl.java | 2 xmerge/source/xmerge/java/org/openoffice/xmerge/util/Debug.java | 8 xmerge/source/xmerge/java/org/openoffice/xmerge/util/registry/ConverterInfoReader.java | 22 66 files changed, 572 insertions(+), 894 deletions(-)
New commits: commit 0b1726ee446cfdaae8a9ac6d7222f1b1eed66e30 Author: Rene Engelhard <r...@debian.org> Date: Fri Oct 9 20:58:55 2015 +0200 remove now unneeded apache-commons libs Change-Id: Ida7a5f5db5bba8d03bf31de760a908cee9a514e4 (cherry picked from commit a41a4a22f1a7e82ab64f28b71f5ce6acc1c04921) diff --git a/Makefile.fetch b/Makefile.fetch index db40845..659c808 100644 --- a/Makefile.fetch +++ b/Makefile.fetch @@ -104,9 +104,6 @@ $(WORKDIR)/download: $(BUILDDIR)/config_host.mk $(SRCDIR)/download.lst $(SRCDIR) @date >> $(fetch_LOGFILE) $(foreach item, \ $(call fetch_Optional,ABW,ABW_TARBALL) \ - $(call fetch_Optional,APACHE_COMMONS,APACHE_COMMONS_CODEC_TARBALL) \ - $(call fetch_Optional,APACHE_COMMONS,APACHE_COMMONS_HTTPCLIENT_TARBALL) \ - $(call fetch_Optional,APACHE_COMMONS,APACHE_COMMONS_LANG_TARBALL) \ $(call fetch_Optional,APACHE_COMMONS,APACHE_COMMONS_LOGGING_TARBALL) \ $(call fetch_Optional,APR,APR_TARBALL) \ $(call fetch_Optional,APR,APR_UTIL_TARBALL) \ diff --git a/RepositoryExternal.mk b/RepositoryExternal.mk index 8f988d7..eb12c36 100644 --- a/RepositoryExternal.mk +++ b/RepositoryExternal.mk @@ -3625,21 +3625,6 @@ endif ifneq ($(SYSTEM_APACHE_COMMONS),) -define gb_Jar__use_commons-codec -$(call gb_Jar_use_system_jar,$(1),$(COMMONS_CODEC_JAR)) -endef -gb_ExternalProject__use_commons-codec := - -define gb_Jar__use_commons-httpclient -$(call gb_Jar_use_system_jar,$(1),$(COMMONS_HTTPCLIENT_JAR)) -endef -gb_ExternalProject__use_commons-httpclient := - -define gb_Jar__use_commons-lang -$(call gb_Jar_usadd_linked_libse_system_jar,$(1),$(COMMONS_LANG_JAR)) -endef -gb_ExternalProject__use_commons-lang := - define gb_Jar__use_commons-logging $(call gb_Jar_use_system_jar,$(1),$(COMMONS_LOGGING_JAR)) endef @@ -3652,41 +3637,6 @@ $(eval $(call gb_Helper_register_jars_for_install,OOO,reportbuilder,\ commons-logging-$(COMMONS_LOGGING_VERSION) \ )) endif -$(eval $(call gb_Helper_register_jars,OXT,\ - $(if $(filter TRUE,$(HAVE_JAVA6)),commons-codec-1.9,commons-codec-1.6) \ - commons-httpclient-3.1 \ - $(if $(filter TRUE,$(HAVE_JAVA6)),commons-lang3-3.3.1.jar,commons-lang-2.4) \ -)) - -define gb_Jar__use_commons-codec -$(call gb_Jar_use_external_project,$(1),apache_commons_codec) -$(call gb_Jar_use_external_jar,$(1),$(call gb_UnpackedTarball_get_dir,apache_commons_codec)\ -$(if $(filter TRUE,$(HAVE_JAVA6)),/dist/commons-codec-1.9.jar,/dist/commons-codec-1.6.jar),\ -$(if $(filter TRUE,$(HAVE_JAVA6)),commons-codec-1.9.jar,commons-codec-1.6.jar)\ -) -endef -define gb_ExternalProject__use_commons-codec -$(call gb_ExternalProject_use_external_project,$(1),apache_commons_codec) -endef - -define gb_Jar__use_commons-httpclient -$(call gb_Jar_use_external_project,$(1),apache_commons_httpclient) -$(call gb_Jar_use_external_jar,$(1),$(call gb_UnpackedTarball_get_dir,apache_commons_httpclient)/dist/commons-httpclient.jar,commons-httpclient-3.1.jar) -endef -define gb_ExternalProject__use_commons-httpclient -$(call gb_ExternalProject_use_external_project,$(1),apache_commons_httpclient) -endef - -define gb_Jar__use_commons-lang -$(call gb_Jar_use_external_project,$(1),apache_commons_lang) -$(call gb_Jar_use_external_jar,$(1),$(call gb_UnpackedTarball_get_dir,apache_commons_lang)\ -$(if $(filter TRUE,$(HAVE_JAVA6)),/target/commons-lang3-3.3.1.jar,/dist/commons-lang-2.4.jar),\ -$(if $(filter TRUE,$(HAVE_JAVA6)),commons-lang3-3.3.1.jar,commons-lang-2.4.jar)\ -) -endef -define gb_ExternalProject__use_commons-lang -$(call gb_ExternalProject_use_external_project,$(1),apache_commons_lang) -endef define gb_Jar__use_commons-logging $(call gb_Jar_use_external_project,$(1),apache_commons_logging) diff --git a/config_host.mk.in b/config_host.mk.in index 5e5851e..698b5cd 100644 --- a/config_host.mk.in +++ b/config_host.mk.in @@ -62,9 +62,6 @@ export CMIS_LIBS=$(gb_SPACE)@CMIS_LIBS@ export COLLADA2GLTF_CFLAGS=$(gb_SPACE)@COLLADA2GLTF_CFLAGS@ export COLLADA2GLTF_LIBS=$(gb_SPACE)@COLLADA2GLTF_LIBS@ export COM=@COM@ -export COMMONS_CODEC_JAR=@COMMONS_CODEC_JAR@ -export COMMONS_HTTPCLIENT_JAR=@COMMONS_HTTPCLIENT_JAR@ -export COMMONS_LANG_JAR=@COMMONS_LANG_JAR@ export COMMONS_LOGGING_JAR=@COMMONS_LOGGING_JAR@ export COMMONS_LOGGING_VERSION=@COMMONS_LOGGING_VERSION@ export COMPATH=@COMPATH@ diff --git a/configure.ac b/configure.ac index 8423fb4..4c00d32 100644 --- a/configure.ac +++ b/configure.ac @@ -10694,84 +10694,24 @@ AC_SUBST(LIBSERIALIZER_JAR) # this has to be here because both the Wiki Publisher and the SRB use # commons-logging COMMONS_LOGGING_VERSION=1.2 -if test "$ENABLE_MEDIAWIKI" = "TRUE" -o "$ENABLE_REPORTBUILDER" = "TRUE"; then +if test "$ENABLE_REPORTBUILDER" = "TRUE"; then AC_MSG_CHECKING([which Apache commons-* libs to use]) if test "$with_system_apache_commons" = "yes"; then SYSTEM_APACHE_COMMONS=TRUE AC_MSG_RESULT([external]) - if test "$ENABLE_MEDIAWIKI" = "TRUE"; then - if test -z $COMMONS_CODEC_JAR; then - _commons_codec_path="" - if test "$HAVE_JAVA6" = "TRUE"; then - _commons_codec_path="/usr/share/java/commons-codec-1.9.jar" - else - _commons_codec_path="/usr/share/java/commons-codec-1.6.jar" - fi - AC_CHECK_FILE($_commons_codec_path, - [ COMMONS_CODEC_JAR=$_commons_codec_path ], - [ - AC_CHECK_FILE(/usr/share/java/commons-codec.jar, - [ COMMONS_CODEC_JAR=/usr/share/java/commons-codec.jar ], - [AC_MSG_ERROR(commons-codec.jar replacement not found.)] - ) - ] - ) - else - AC_CHECK_FILE($COMMONS_CODEC_JAR, [], - [AC_MSG_ERROR(commons-codec.jar not found.)], []) - fi - - if test -z $COMMONS_LANG_JAR; then - _commons_lang_path="" - if test "$HAVE_JAVA6" = "TRUE"; then - _commons_lang_path="/usr/share/java/commons-lang3-3.3.1-src.tar.gz" - else - _commons_lang_path="/usr/share/java/commons-lang-2.4.jar" - fi - AC_CHECK_FILE($_commons_lang_path, - [ COMMONS_LANG_JAR=$commons_lang_path ], - [ - AC_CHECK_FILE(/usr/share/java/commons-lang.jar, - [ COMMONS_LANG_JAR=/usr/share/java/commons-lang.jar ], - [AC_MSG_ERROR(commons-lang.jar replacement not found.)] - ) - ] - ) - else - AC_CHECK_FILE($COMMONS_LANG_JAR, [], - [AC_MSG_ERROR(commons-lang.jar not found.)], []) - fi - - if test -z $COMMONS_HTTPCLIENT_JAR; then - AC_CHECK_FILE(/usr/share/java/commons-httpclient-3.1.jar, - [ COMMONS_HTTPCLIENT_JAR=/usr/share/java/commons-httpclient-3.1.jar ], - [ - AC_CHECK_FILE(/usr/share/java/commons-httpclient.jar, - [ COMMONS_HTTPCLIENT_JAR=/usr/share/java/commons-httpclient.jar ], - [AC_MSG_ERROR(commons-httpclient.jar replacement not found.)] - ) - ] - ) - else - AC_CHECK_FILE($COMMONS_HTTPCLIENT_JAR, [], - [AC_MSG_ERROR(commons-httpclient.jar not found.)], []) - fi - fi - if test "$ENABLE_MEDIAWIKI" = "TRUE" -o "$ENABLE_REPORTBUILDER" = "TRUE"; then - if test -z $COMMONS_LOGGING_JAR; then - AC_CHECK_FILE(/usr/share/java/commons-logging-${COMMONS_LOGGING_VERSION}.jar, - [ COMMONS_LOGGING_JAR=/usr/share/java/commons-logging-${COMMONS_LOGGING_VERSION}.jar ], - [ - AC_CHECK_FILE(/usr/share/java/commons-logging.jar, - [ COMMONS_LOGGING_JAR=/usr/share/java/commons-logging.jar ], - [AC_MSG_ERROR(commons-logging.jar replacement not found.)] - ) - ] - ) - else - AC_CHECK_FILE($COMMONS_LOGGING_JAR, [], - [AC_MSG_ERROR(commons-logging.jar not found.)], []) - fi + if test -z $COMMONS_LOGGING_JAR; then + AC_CHECK_FILE(/usr/share/java/commons-logging-${COMMONS_LOGGING_VERSION}.jar, + [ COMMONS_LOGGING_JAR=/usr/share/java/commons-logging-${COMMONS_LOGGING_VERSION}.jar ], + [ + AC_CHECK_FILE(/usr/share/java/commons-logging.jar, + [ COMMONS_LOGGING_JAR=/usr/share/java/commons-logging.jar ], + [AC_MSG_ERROR(commons-logging.jar replacement not found.)] + ) + ] + ) + else + AC_CHECK_FILE($COMMONS_LOGGING_JAR, [], + [AC_MSG_ERROR(commons-logging.jar not found.)], []) fi else AC_MSG_RESULT([internal]) @@ -10780,9 +10720,6 @@ if test "$ENABLE_MEDIAWIKI" = "TRUE" -o "$ENABLE_REPORTBUILDER" = "TRUE"; then fi fi AC_SUBST(SYSTEM_APACHE_COMMONS) -AC_SUBST(COMMONS_CODEC_JAR) -AC_SUBST(COMMONS_LANG_JAR) -AC_SUBST(COMMONS_HTTPCLIENT_JAR) AC_SUBST(COMMONS_LOGGING_JAR) AC_SUBST(COMMONS_LOGGING_VERSION) diff --git a/download.lst b/download.lst index 784cf86..38e7740 100644 --- a/download.lst +++ b/download.lst @@ -1,14 +1,5 @@ export ABW_MD5SUM := 7a3815b506d064313ba309617b6f5a0b export ABW_TARBALL := libabw-0.1.1.tar.bz2 -export APACHE_COMMONS_CODEC_TARBALL := $(if $(filter TRUE,$(HAVE_JAVA6))\ - ,048751f3271906db5126ab76870444c4-commons-codec-1.9-src.zip\ - ,2e482c7567908d334785ce7d69ddfff7-commons-codec-1.6-src.tar.gz\ -) -export APACHE_COMMONS_HTTPCLIENT_TARBALL := 2c9b0f83ed5890af02c0df1c1776f39b-commons-httpclient-3.1-src.tar.gz -export APACHE_COMMONS_LANG_TARBALL := $(if $(filter TRUE,$(HAVE_JAVA6))\ - ,8ab049135b2d15313da5d9f0656894a1-commons-lang3-3.3.1-src.tar.gz\ - ,625ff5f2f968dd908bca43c9469d6e6b-commons-lang-2.4-src.tar.gz\ -) export APACHE_COMMONS_LOGGING_MD5SUM := ce977548f1cbf46918e93cd38ac35163 export APACHE_COMMONS_LOGGING_TARBALL := commons-logging-1.2-src.tar.gz export APR_MD5SUM := eff9d741b0999a9bbab96862dd2a2a3d diff --git a/external/apache-commons/ExternalProject_apache_commons_codec.mk b/external/apache-commons/ExternalProject_apache_commons_codec.mk deleted file mode 100644 index aedda04..0000000 --- a/external/apache-commons/ExternalProject_apache_commons_codec.mk +++ /dev/null @@ -1,37 +0,0 @@ -# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- -# -# This file is part of the LibreOffice project. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. -# - -$(eval $(call gb_ExternalProject_ExternalProject,apache_commons_codec)) - -$(eval $(call gb_ExternalProject_register_targets,apache_commons_codec,\ - build \ -)) - -$(call gb_ExternalProject_get_state_target,apache_commons_codec,build) : - $(call gb_ExternalProject_run,build,\ - ANT_OPTS="$$ANT_OPTS -Dfile.encoding=ISO-8859-1" \ - $(ICECREAM_RUN) "$(ANT)" \ - -q \ - -f build.xml \ - -Dbuild.label="build-$(LIBO_VERSION_MAJOR).$(LIBO_VERSION_MINOR).$(LIBO_VERSION_MICRO).$(LIBO_VERSION_PATCH)" \ - $(if $(filter yes,$(JAVACISGCJ))\ - ,-Dbuild.compiler=gcj \ - ,$(if $(filter TRUE,$(HAVE_JAVA6)) \ - ,-Dcompile.source=1.6 -Dcompile.target=1.6 \ - ,-Dant.build.javac.source=$(JAVA_SOURCE_VER) -Dant.build.javac.target=$(JAVA_TARGET_VER) \ - ) \ - ) \ - $(if $(filter TRUE,$(HAVE_JAVA6)) \ - ,$(if $(debug),-Dcompile.debug="true",-Dcompile.debug="false") \ - ,$(if $(debug),-Dbuild.debug="on") \ - ) \ - jar \ - ) - -# vim: set noet sw=4 ts=4: diff --git a/external/apache-commons/ExternalProject_apache_commons_httpclient.mk b/external/apache-commons/ExternalProject_apache_commons_httpclient.mk deleted file mode 100644 index c2cec42..0000000 --- a/external/apache-commons/ExternalProject_apache_commons_httpclient.mk +++ /dev/null @@ -1,40 +0,0 @@ -# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- -# -# This file is part of the LibreOffice project. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. -# - -$(eval $(call gb_ExternalProject_ExternalProject,apache_commons_httpclient)) - -$(eval $(call gb_ExternalProject_use_external,apache_commons_httpclient,commons-codec)) -$(eval $(call gb_ExternalProject_use_external,apache_commons_httpclient,commons-logging)) - -$(eval $(call gb_ExternalProject_register_targets,apache_commons_httpclient,\ - build \ -)) - -$(call gb_ExternalProject_get_state_target,apache_commons_httpclient,build) : - $(call gb_ExternalProject_run,build,\ - ANT_OPTS="$$ANT_OPTS -Dfile.encoding=ISO-8859-1" \ - $(ICECREAM_RUN) "$(ANT)" \ - -q \ - -f build.xml \ - -Dbuild.label="build-$(LIBO_VERSION_MAJOR).$(LIBO_VERSION_MINOR).$(LIBO_VERSION_MICRO).$(LIBO_VERSION_PATCH)" \ - -Dcommons-logging.jar="$(call gb_UnpackedTarball_get_dir,apache_commons_logging)/target/commons-logging-$(COMMONS_LOGGING_VERSION).jar" \ - $(if $(filter TRUE,$(HAVE_JAVA6))\ - ,-Dcommons-codec.jar="$(call gb_UnpackedTarball_get_dir,apache_commons_codec)/dist/commons-codec-1.9.jar" \ - ,-Dcommons-codec.jar="$(call gb_UnpackedTarball_get_dir,apache_commons_codec)/dist/commons-codec-1.6-SNAPSHOT.jar" \ - ) \ - $(if $(filter yes,$(JAVACISGCJ))\ - ,-Dbuild.compiler=gcj \ - ,-Dant.build.javac.source=$(JAVA_SOURCE_VER) \ - -Dant.build.javac.target=$(JAVA_TARGET_VER) \ - ) \ - $(if $(debug),-Dbuild.debug="on") \ - dist \ - ) - -# vim: set noet sw=4 ts=4: diff --git a/external/apache-commons/ExternalProject_apache_commons_lang.mk b/external/apache-commons/ExternalProject_apache_commons_lang.mk deleted file mode 100644 index c180a89..0000000 --- a/external/apache-commons/ExternalProject_apache_commons_lang.mk +++ /dev/null @@ -1,37 +0,0 @@ -# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- -# -# This file is part of the LibreOffice project. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. -# - -$(eval $(call gb_ExternalProject_ExternalProject,apache_commons_lang)) - -$(eval $(call gb_ExternalProject_register_targets,apache_commons_lang,\ - build \ -)) - -$(call gb_ExternalProject_get_state_target,apache_commons_lang,build) : - $(call gb_ExternalProject_run,build,\ - ANT_OPTS="$$ANT_OPTS -Dfile.encoding=ISO-8859-1" \ - $(ICECREAM_RUN) "$(ANT)" \ - -q \ - -f build.xml \ - -Dbuild.label="build-$(LIBO_VERSION_MAJOR).$(LIBO_VERSION_MINOR).$(LIBO_VERSION_MICRO).$(LIBO_VERSION_PATCH)" \ - $(if $(filter yes,$(JAVACISGCJ))\ - ,-Dbuild.compiler=gcj \ - ,$(if $(filter TRUE,$(HAVE_JAVA6)) \ - ,-Dcompile.source=1.6 -Dcompile.target=1.6 \ - ,-Dant.build.javac.source=$(JAVA_SOURCE_VER) -Dant.build.javac.target=$(JAVA_TARGET_VER) \ - ) \ - ) \ - $(if $(filter TRUE,$(HAVE_JAVA6)) \ - ,$(if $(debug),-Dcompile.debug="true") \ - ,$(if $(debug),-Dbuild.debug="on") \ - ) \ - jar \ - ) - -# vim: set noet sw=4 ts=4: diff --git a/external/apache-commons/Module_apache-commons.mk b/external/apache-commons/Module_apache-commons.mk index 1dcac4d..45aabe2 100644 --- a/external/apache-commons/Module_apache-commons.mk +++ b/external/apache-commons/Module_apache-commons.mk @@ -11,13 +11,7 @@ $(eval $(call gb_Module_Module,apache-commons)) $(eval $(call gb_Module_add_targets,apache-commons,\ ExternalPackage_apache_commons_logging \ - ExternalProject_apache_commons_codec \ - ExternalProject_apache_commons_httpclient \ - ExternalProject_apache_commons_lang \ ExternalProject_apache_commons_logging \ - UnpackedTarball_apache_commons_codec \ - UnpackedTarball_apache_commons_httpclient \ - UnpackedTarball_apache_commons_lang \ UnpackedTarball_apache_commons_logging \ )) diff --git a/external/apache-commons/README b/external/apache-commons/README index 0ab7b63..18944ac 100644 --- a/external/apache-commons/README +++ b/external/apache-commons/README @@ -1 +1 @@ -Java libraries; used for logging and http/https access in Extensions, from [http://commons.apache.org/] +Java library; used for logging in Extensions, from [http://commons.apache.org/] diff --git a/external/apache-commons/UnpackedTarball_apache_commons_codec.mk b/external/apache-commons/UnpackedTarball_apache_commons_codec.mk deleted file mode 100644 index 5e55c1f..0000000 --- a/external/apache-commons/UnpackedTarball_apache_commons_codec.mk +++ /dev/null @@ -1,24 +0,0 @@ -# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- -# -# This file is part of the LibreOffice project. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. -# - -$(eval $(call gb_UnpackedTarball_UnpackedTarball,apache_commons_codec)) - -$(eval $(call gb_UnpackedTarball_set_tarball,apache_commons_codec,$(APACHE_COMMONS_CODEC_TARBALL))) - -$(eval $(call gb_UnpackedTarball_set_patchlevel,apache_commons_codec,3)) - -$(eval $(call gb_UnpackedTarball_fix_end_of_line,apache_commons_codec,\ - build.xml \ -)) - -$(eval $(call gb_UnpackedTarball_add_patches,apache_commons_codec,\ - external/apache-commons/patches/codec.patch \ -)) - -# vim: set noet sw=4 ts=4: diff --git a/external/apache-commons/UnpackedTarball_apache_commons_httpclient.mk b/external/apache-commons/UnpackedTarball_apache_commons_httpclient.mk deleted file mode 100644 index 23d995f..0000000 --- a/external/apache-commons/UnpackedTarball_apache_commons_httpclient.mk +++ /dev/null @@ -1,19 +0,0 @@ -# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- -# -# This file is part of the LibreOffice project. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. -# - -$(eval $(call gb_UnpackedTarball_UnpackedTarball,apache_commons_httpclient)) - -$(eval $(call gb_UnpackedTarball_set_tarball,apache_commons_httpclient,$(APACHE_COMMONS_HTTPCLIENT_TARBALL),,apache-commons)) - -$(eval $(call gb_UnpackedTarball_add_patches,apache_commons_httpclient,\ - external/apache-commons/patches/httpclient.patch \ - external/apache-commons/patches/httpclient_no_javadoc.patch \ -)) - -# vim: set noet sw=4 ts=4: diff --git a/external/apache-commons/UnpackedTarball_apache_commons_lang.mk b/external/apache-commons/UnpackedTarball_apache_commons_lang.mk deleted file mode 100644 index 7d227ac..0000000 --- a/external/apache-commons/UnpackedTarball_apache_commons_lang.mk +++ /dev/null @@ -1,20 +0,0 @@ -# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- -# -# This file is part of the LibreOffice project. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. -# - -$(eval $(call gb_UnpackedTarball_UnpackedTarball,apache_commons_lang)) - -$(eval $(call gb_UnpackedTarball_set_tarball,apache_commons_lang,$(APACHE_COMMONS_LANG_TARBALL),,apache-commons)) - -$(eval $(call gb_UnpackedTarball_add_patches,apache_commons_lang,\ - $(if $(filter TRUE,$(HAVE_JAVA6)) \ - ,external/apache-commons/patches/lang.patch \ - ) \ -)) - -# vim: set noet sw=4 ts=4: diff --git a/external/apache-commons/patches/codec.patch b/external/apache-commons/patches/codec.patch deleted file mode 100644 index 7a9b489..0000000 --- a/external/apache-commons/patches/codec.patch +++ /dev/null @@ -1,20 +0,0 @@ ---- misc/build/commons-codec-1.6-src/build.xml-old 2012-05-05 22:12:32.000000000 -0500 -+++ misc/build/commons-codec-1.6-src/build.xml 2012-05-05 22:16:00.000000000 -0500 -@@ -96,7 +96,6 @@ - </target> - <target name="dist" depends="compile, javadoc" description="Create binary distribution"> - <mkdir dir="${dist.home}"/> -- <copy file="${basedir}/LICENSE.txt" todir="${dist.home}"/> - <copy file="${basedir}/NOTICE.txt" todir="${dist.home}"/> - <copy file="${basedir}/RELEASE-NOTES.txt" todir="${dist.home}"/> - <antcall target="jar"/> -@@ -104,8 +103,7 @@ - <target name="jar" depends="compile" description="Create jar"> - <mkdir dir="${dist.home}"/> - <mkdir dir="${build.home}/classes/META-INF"/> -- <copy file="${basedir}/LICENSE.txt" tofile="${build.home}/classes/META-INF/LICENSE.txt"/> -- <copy file="${basedir}/LICENSE.txt" tofile="${build.home}/classes/META-INF/NOTICE.txt"/> -+ <copy file="${basedir}/NOTICE.txt" tofile="${build.home}/classes/META-INF/NOTICE.txt"/> - <jar jarfile="${dist.home}/${final.name}.jar" basedir="${build.home}/classes"> - <manifest> - <attribute name="Specification-Title" value="Commons Codec"/> diff --git a/external/apache-commons/patches/httpclient.patch b/external/apache-commons/patches/httpclient.patch deleted file mode 100644 index a64384f..0000000 --- a/external/apache-commons/patches/httpclient.patch +++ /dev/null @@ -1,119 +0,0 @@ ---- misc/commons-httpclient-3.1/src/java/org/apache/commons/httpclient/ConnectMethod.java 2012-05-07 12:34:01.000000000 -0500 -+++ misc/build/commons-httpclient-3.1/src/java/org/apache/commons/httpclient/ConnectMethod.java 2012-05-07 12:37:50.000000000 -0500 -@@ -38,7 +38,7 @@ - /** - * Establishes a tunneled HTTP connection via the CONNECT method. - * -- * @author Ortwin Gl???ck -+ * @author Ortwin Glueck - * @author dIon Gillard - * @author <a href="mailto:mbow...@gargoylesoftware.com">Mike Bowler</a> - * @author <a href="mailto:o...@ural.ru">Oleg Kalnichevski</a> -diff -ru misc/commons-httpclient-3.1/src/java/org/apache/commons/httpclient/HttpClient.java misc/build/commons-httpclient-3.1/src/java/org/apache/commons/httpclient/HttpClient.java ---- misc/commons-httpclient-3.1/src/java/org/apache/commons/httpclient/HttpClient.java 2012-05-07 12:34:01.000000000 -0500 -+++ misc/build/commons-httpclient-3.1/src/java/org/apache/commons/httpclient/HttpClient.java 2012-05-07 12:37:50.000000000 -0500 -@@ -48,7 +48,7 @@ - * @author <a href="mailto:rwaldh...@apache.org">Rodney Waldhoff</a> - * @author Sean C. Sullivan - * @author <a href="mailto:d...@apache.org">dIon Gillard</a> -- * @author Ortwin Gl?ck -+ * @author Ortwin Glueck - * @author <a href="mailto:be...@u.washington.edu">Michael Becke</a> - * @author <a href="mailto:mbow...@gargoylesoftware.com">Mike Bowler</a> - * @author Sam Maloney -diff -ru misc/commons-httpclient-3.1/src/java/org/apache/commons/httpclient/HttpClientError.java misc/build/commons-httpclient-3.1/src/java/org/apache/commons/httpclient/HttpClientError.java ---- misc/commons-httpclient-3.1/src/java/org/apache/commons/httpclient/HttpClientError.java 2012-05-07 12:34:01.000000000 -0500 -+++ misc/build/commons-httpclient-3.1/src/java/org/apache/commons/httpclient/HttpClientError.java 2012-05-07 12:37:50.000000000 -0500 -@@ -33,7 +33,7 @@ - /** - * Signals that an error has occurred. - * -- * @author Ortwin Gl?ck -+ * @author Ortwin Glueck - * @version $Revision: 480424 $ $Date: 2006-11-29 06:56:49 +0100 (Wed, 29 Nov 2006) $ - * @since 3.0 - */ -diff -ru misc/commons-httpclient-3.1/src/java/org/apache/commons/httpclient/HttpContentTooLargeException.java misc/build/commons-httpclient-3.1/src/java/org/apache/commons/httpclient/HttpContentTooLargeException.java ---- misc/commons-httpclient-3.1/src/java/org/apache/commons/httpclient/HttpContentTooLargeException.java 2012-05-07 12:34:01.000000000 -0500 -+++ misc/build/commons-httpclient-3.1/src/java/org/apache/commons/httpclient/HttpContentTooLargeException.java 2012-05-07 12:37:50.000000000 -0500 -@@ -3,7 +3,7 @@ - /** - * Signals that the response content was larger than anticipated. - * -- * @author Ortwin Glück -+ * @author Ortwin Glueck - */ - public class HttpContentTooLargeException extends HttpException { - private int maxlen; -diff -ru misc/commons-httpclient-3.1/src/java/org/apache/commons/httpclient/WireLogInputStream.java misc/build/commons-httpclient-3.1/src/java/org/apache/commons/httpclient/WireLogInputStream.java ---- misc/commons-httpclient-3.1/src/java/org/apache/commons/httpclient/WireLogInputStream.java 2012-05-07 12:34:01.000000000 -0500 -+++ misc/build/commons-httpclient-3.1/src/java/org/apache/commons/httpclient/WireLogInputStream.java 2012-05-07 12:37:50.000000000 -0500 -@@ -37,7 +37,7 @@ - /** - * Logs all data read to the wire LOG. - * -- * @author Ortwin Gl�ck -+ * @author Ortwin Glueck - * @author <a href="mailto:mbow...@gargoylesoftware.com">Mike Bowler</a> - * @author <a href="mailto:o...@ural.ru">Oleg Kalnichevski</a> - * -diff -ru misc/commons-httpclient-3.1/src/java/org/apache/commons/httpclient/auth/BasicScheme.java misc/build/commons-httpclient-3.1/src/java/org/apache/commons/httpclient/auth/BasicScheme.java ---- misc/commons-httpclient-3.1/src/java/org/apache/commons/httpclient/auth/BasicScheme.java 2012-05-07 12:34:01.000000000 -0500 -+++ misc/build/commons-httpclient-3.1/src/java/org/apache/commons/httpclient/auth/BasicScheme.java 2012-05-07 12:37:50.000000000 -0500 -@@ -46,7 +46,7 @@ - * @author <a href="mailto:r...@apache.org">Remy Maucherat</a> - * @author Rodney Waldhoff - * @author <a href="mailto:jsde...@apache.org">Jeff Dever</a> -- * @author Ortwin Gl?ck -+ * @author Ortwin Glueck - * @author Sean C. Sullivan - * @author <a href="mailto:adr...@ephox.com">Adrian Sutton</a> - * @author <a href="mailto:mbow...@gargoylesoftware.com">Mike Bowler</a> -diff -ru misc/commons-httpclient-3.1/src/java/org/apache/commons/httpclient/auth/DigestScheme.java misc/build/commons-httpclient-3.1/src/java/org/apache/commons/httpclient/auth/DigestScheme.java ---- misc/commons-httpclient-3.1/src/java/org/apache/commons/httpclient/auth/DigestScheme.java 2012-05-07 12:34:01.000000000 -0500 -+++ misc/build/commons-httpclient-3.1/src/java/org/apache/commons/httpclient/auth/DigestScheme.java 2012-05-07 12:37:50.000000000 -0500 -@@ -67,7 +67,7 @@ - * @author <a href="mailto:r...@apache.org">Remy Maucherat</a> - * @author Rodney Waldhoff - * @author <a href="mailto:jsde...@apache.org">Jeff Dever</a> -- * @author Ortwin Gl?ck -+ * @author Ortwin Glueck - * @author Sean C. Sullivan - * @author <a href="mailto:adr...@ephox.com">Adrian Sutton</a> - * @author <a href="mailto:mbow...@gargoylesoftware.com">Mike Bowler</a> -diff -ru misc/commons-httpclient-3.1/src/java/org/apache/commons/httpclient/auth/HttpAuthenticator.java misc/build/commons-httpclient-3.1/src/java/org/apache/commons/httpclient/auth/HttpAuthenticator.java ---- misc/commons-httpclient-3.1/src/java/org/apache/commons/httpclient/auth/HttpAuthenticator.java 2012-05-07 12:34:01.000000000 -0500 -+++ misc/build/commons-httpclient-3.1/src/java/org/apache/commons/httpclient/auth/HttpAuthenticator.java 2012-05-07 12:37:50.000000000 -0500 -@@ -62,7 +62,7 @@ - * @author <a href="mailto:r...@apache.org">Remy Maucherat</a> - * @author Rodney Waldhoff - * @author <a href="mailto:jsde...@apache.org">Jeff Dever</a> -- * @author Ortwin Gl�ck -+ * @author Ortwin Glueck - * @author Sean C. Sullivan - * @author <a href="mailto:adr...@ephox.com">Adrian Sutton</a> - * @author <a href="mailto:mbow...@gargoylesoftware.com">Mike Bowler</a> -diff -ru misc/commons-httpclient-3.1/src/java/org/apache/commons/httpclient/auth/NTLMScheme.java misc/build/commons-httpclient-3.1/src/java/org/apache/commons/httpclient/auth/NTLMScheme.java ---- misc/commons-httpclient-3.1/src/java/org/apache/commons/httpclient/auth/NTLMScheme.java 2012-05-07 12:34:01.000000000 -0500 -+++ misc/build/commons-httpclient-3.1/src/java/org/apache/commons/httpclient/auth/NTLMScheme.java 2012-05-07 12:37:50.000000000 -0500 -@@ -43,7 +43,7 @@ - * @author <a href="mailto:r...@apache.org">Remy Maucherat</a> - * @author Rodney Waldhoff - * @author <a href="mailto:jsde...@apache.org">Jeff Dever</a> -- * @author Ortwin Gl???ck -+ * @author Ortwin Glueck - * @author Sean C. Sullivan - * @author <a href="mailto:adr...@ephox.com">Adrian Sutton</a> - * @author <a href="mailto:mbow...@gargoylesoftware.com">Mike Bowler</a> -diff -ru misc/commons-httpclient-3.1/src/java/org/apache/commons/httpclient/methods/PostMethod.java misc/build/commons-httpclient-3.1/src/java/org/apache/commons/httpclient/methods/PostMethod.java ---- misc/commons-httpclient-3.1/src/java/org/apache/commons/httpclient/methods/PostMethod.java 2012-05-07 12:34:01.000000000 -0500 -+++ misc/build/commons-httpclient-3.1/src/java/org/apache/commons/httpclient/methods/PostMethod.java 2012-05-07 12:37:50.000000000 -0500 -@@ -62,7 +62,7 @@ - * @author <a href="mailto:r...@apache.org">Remy Maucherat</a> - * @author <a href="mailto:ds...@us.britannica.com">Doug Sale</a> - * @author <a href="mailto:jsde...@apache.org">Jeff Dever</a> -- * @author Ortwin Gl???ck -+ * @author Ortwin Glueck - * @author <a href="mailto:mbow...@gargoylesoftware.com">Mike Bowler</a> - * @author <a href="mailto:o...@ural.ru">Oleg Kalnichevski</a> - * diff --git a/external/apache-commons/patches/httpclient_no_javadoc.patch b/external/apache-commons/patches/httpclient_no_javadoc.patch deleted file mode 100644 index a9bd95d..0000000 --- a/external/apache-commons/patches/httpclient_no_javadoc.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- misc/commons-httpclient-3.1/build.xml 2007-08-18 11:02:14.000000000 +0200 -+++ misc/build/commons-httpclient-3.1/build.xml 2012-07-09 09:59:21.364830700 +0200 -@@ -142,7 +142,7 @@ - - <!-- ========== Targets: "External" Targets =============================== --> - -- <target name="dist" depends="compile,doc" -+ <target name="dist" depends="compile" - description="Create binary distribution"> - <mkdir dir="${dist.home}"/> - <copy file="LICENSE.txt" todir="${dist.home}"/> diff --git a/external/apache-commons/patches/lang.patch b/external/apache-commons/patches/lang.patch deleted file mode 100644 index 3e5d442..0000000 --- a/external/apache-commons/patches/lang.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- misc/commons-lang3-src/default.properties 2014-03-15 13:47:48.000000000 +0100 -+++ misc/build/commons-lang3-src/default.properties 2014-10-30 17:57:53.000000000 +0100 -@@ -60,7 +60,7 @@ - test.home = src/test/java - - # Should Java compilations set the 'debug' compiler option? --compile.debug = true -+compile.debug = false - - # Should Java compilations set the 'deprecation' compiler option? - compile.deprecation = true commit 9d82731793602473c78ab5131156a266e875da98 Author: Andras Timar <andras.ti...@collabora.com> Date: Thu Oct 15 11:15:14 2015 +0200 swext: remove unused import Change-Id: I6d9296ef4dc01d6ea0fb591582831693200f0f7b diff --git a/swext/mediawiki/src/com/sun/star/wiki/WikiProtocolSocketFactory.java b/swext/mediawiki/src/com/sun/star/wiki/WikiProtocolSocketFactory.java index 3d2d22da..4ffd06c 100644 --- a/swext/mediawiki/src/com/sun/star/wiki/WikiProtocolSocketFactory.java +++ b/swext/mediawiki/src/com/sun/star/wiki/WikiProtocolSocketFactory.java @@ -20,7 +20,6 @@ package com.sun.star.wiki; import java.io.IOException; import java.net.InetAddress; -import java.net.InetSocketAddress; import java.net.Socket; import java.net.UnknownHostException; import java.security.KeyStore; commit 17d6c6fdebc098107e280d4a68d8bcfa91bd23e9 Author: Michael Stahl <mst...@redhat.com> Date: Thu Oct 8 23:26:39 2015 +0200 swext: increment the extension version number to 1.2.0 ... and also set the User-Agent header so the servers know who's messing with them. Change-Id: I0173db05868c5fcd0f85435adf78884ca562596d (cherry picked from commit 18b934af9979522c8cff1ff76504ce19c3e6916d) diff --git a/swext/mediawiki/src/com/sun/star/wiki/Helper.java b/swext/mediawiki/src/com/sun/star/wiki/Helper.java index b40b5f1..8a15621 100644 --- a/swext/mediawiki/src/com/sun/star/wiki/Helper.java +++ b/swext/mediawiki/src/com/sun/star/wiki/Helper.java @@ -643,6 +643,8 @@ public class Helper // ((HttpsURLConnection) conn).setSSLSocketFactory(new LoggingProtocolSocketFactory()); conn.setRequestMethod(method); + // TODO: is it possible to read the version from the extension metadata? + conn.setRequestProperty("User-Agent", "LibreOffice Wiki Publisher 1.2.0"); // note: don't connect yet so that the caller can do some further setup return conn; diff --git a/swext/mediawiki/src/description.xml b/swext/mediawiki/src/description.xml index 1e637bd..e83d4f3 100644 --- a/swext/mediawiki/src/description.xml +++ b/swext/mediawiki/src/description.xml @@ -17,7 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . --> <description xmlns="http://openoffice.org/extensions/description/2006" xmlns:d="http://openoffice.org/extensions/description/2006" xmlns:xlink="http://www.w3.org/1999/xlink"> - <version value="1.1.2"/> + <version value="1.2.0"/> <identifier value="com.sun.wiki-publisher"/> <display-name> <name lang="en-US">Wiki Publisher</name> commit 0de97240cf6dfcf31455a29841629192390fb058 Author: Michael Stahl <mst...@redhat.com> Date: Thu Oct 8 21:51:40 2015 +0200 swext: add a logging out stream to help debugging TLS connections Change-Id: Idbabae3edad5e95a37fa9834d24a72ebd13087ae (cherry picked from commit 2ccef1c93d4c1a478fbdd8a49caf0735f68ba141) diff --git a/swext/mediawiki/src/com/sun/star/wiki/Helper.java b/swext/mediawiki/src/com/sun/star/wiki/Helper.java index f5e5c48..b40b5f1 100644 --- a/swext/mediawiki/src/com/sun/star/wiki/Helper.java +++ b/swext/mediawiki/src/com/sun/star/wiki/Helper.java @@ -639,6 +639,9 @@ public class Helper ((HttpsURLConnection) conn).setSSLSocketFactory(new WikiProtocolSocketFactory()); } +// enable this to help debug connections where TLS gets in the way +// ((HttpsURLConnection) conn).setSSLSocketFactory(new LoggingProtocolSocketFactory()); + conn.setRequestMethod(method); // note: don't connect yet so that the caller can do some further setup diff --git a/swext/mediawiki/src/com/sun/star/wiki/WikiProtocolSocketFactory.java b/swext/mediawiki/src/com/sun/star/wiki/WikiProtocolSocketFactory.java index 5d7efe1..3d2d22da 100644 --- a/swext/mediawiki/src/com/sun/star/wiki/WikiProtocolSocketFactory.java +++ b/swext/mediawiki/src/com/sun/star/wiki/WikiProtocolSocketFactory.java @@ -25,6 +25,7 @@ import java.net.Socket; import java.net.UnknownHostException; import java.security.KeyStore; import javax.net.ssl.SSLContext; +import javax.net.ssl.SSLSocket; import javax.net.ssl.SSLSocketFactory; import javax.net.ssl.TrustManager; import javax.net.ssl.TrustManagerFactory; @@ -167,3 +168,166 @@ class WikiProtocolSocketFactory extends SSLSocketFactory } } +// A factory that creates streams that log everything that's written +// to stderr - useful for debugging encrypted TLS connections +class LoggingProtocolSocketFactory extends SSLSocketFactory +{ + private SSLContext m_aSSLContext; + + private static class LogSocket extends SSLSocket + { + private SSLSocket m_Socket; + + public LogSocket(Socket socket) + { + m_Socket = (SSLSocket) socket; + } + + private static class LogStream extends java.io.FilterOutputStream + { + public LogStream(java.io.OutputStream stream) + { + super(stream); + } + + @Override + public void write(byte[] buf, int offset, int len) + throws IOException + { + System.err.println("LogStream.write: \"" + new String(buf, offset, len, "UTF-8") + "\""); + out.write(buf, offset, len); + } + } + + @Override + public java.io.OutputStream getOutputStream() throws IOException + { + return new LogStream(m_Socket.getOutputStream()); + } + + @Override public void addHandshakeCompletedListener(javax.net.ssl.HandshakeCompletedListener listener) { m_Socket.addHandshakeCompletedListener(listener); } + @Override public String[] getEnabledCipherSuites() { return m_Socket.getEnabledCipherSuites(); } + @Override public String[] getEnabledProtocols() { return m_Socket.getEnabledProtocols(); } + @Override public boolean getEnableSessionCreation() { return m_Socket.getEnableSessionCreation(); } + @Override public boolean getNeedClientAuth() { return m_Socket.getNeedClientAuth(); } + @Override public javax.net.ssl.SSLSession getSession() { return m_Socket.getSession(); } + @Override public javax.net.ssl.SSLParameters getSSLParameters() { return m_Socket.getSSLParameters(); } + @Override public String[] getSupportedCipherSuites() { return m_Socket.getSupportedCipherSuites(); } + @Override public String[] getSupportedProtocols() { return m_Socket.getSupportedProtocols(); } + @Override public boolean getUseClientMode() { return m_Socket.getUseClientMode(); } + @Override public boolean getWantClientAuth() { return m_Socket.getWantClientAuth(); } + @Override public void removeHandshakeCompletedListener(javax.net.ssl.HandshakeCompletedListener listener) { m_Socket.removeHandshakeCompletedListener(listener); } + @Override public void setEnabledCipherSuites(String[] suites) { m_Socket.setEnabledCipherSuites(suites); } + @Override public void setEnabledProtocols(String[] protocols) { m_Socket.setEnabledProtocols(protocols); } + @Override public void setEnableSessionCreation(boolean flag) { m_Socket.setEnableSessionCreation(flag); } + @Override public void setNeedClientAuth(boolean need) { m_Socket.setNeedClientAuth(need); } + @Override public void setSSLParameters(javax.net.ssl.SSLParameters params) { m_Socket.setSSLParameters(params); } + @Override public void setUseClientMode(boolean mode) { m_Socket.setUseClientMode(mode); } + @Override public void setWantClientAuth(boolean want) { m_Socket.setWantClientAuth(want); } + @Override public void startHandshake() throws IOException { m_Socket.startHandshake(); } + + @Override public void bind(java.net.SocketAddress bindpoint) throws IOException { m_Socket.bind(bindpoint); } + @Override public void close() throws IOException { m_Socket.close(); } + @Override public void connect(java.net.SocketAddress endpoint) throws IOException { m_Socket.connect(endpoint); } + @Override public void connect(java.net.SocketAddress endpoint, int timeout) throws IOException { m_Socket.connect(endpoint, timeout); } + @Override public java.nio.channels.SocketChannel getChannel() { return m_Socket.getChannel(); } + @Override public InetAddress getInetAddress() { return m_Socket.getInetAddress(); } + @Override public java.io.InputStream getInputStream() throws IOException { return m_Socket.getInputStream(); } + @Override public boolean getKeepAlive() throws java.net.SocketException { return m_Socket.getKeepAlive(); } + @Override public InetAddress getLocalAddress() { return m_Socket.getLocalAddress(); } + @Override public int getLocalPort() { return m_Socket.getLocalPort(); } + @Override public java.net.SocketAddress getLocalSocketAddress() { return m_Socket.getLocalSocketAddress(); } + @Override public boolean getOOBInline() throws java.net.SocketException { return m_Socket.getOOBInline(); } + @Override public int getPort() { return m_Socket.getPort(); } + @Override public int getReceiveBufferSize() throws java.net.SocketException { return m_Socket.getReceiveBufferSize(); } + @Override public java.net.SocketAddress getRemoteSocketAddress() { return m_Socket.getRemoteSocketAddress(); } + @Override public boolean getReuseAddress() throws java.net.SocketException { return m_Socket.getReuseAddress(); } + @Override public int getSendBufferSize() throws java.net.SocketException { return m_Socket.getSendBufferSize(); } + @Override public int getSoLinger() throws java.net.SocketException { return m_Socket.getSoLinger(); } + @Override public int getSoTimeout() throws java.net.SocketException { return m_Socket.getSoTimeout(); } + @Override public boolean getTcpNoDelay() throws java.net.SocketException { return m_Socket.getTcpNoDelay(); } + @Override public int getTrafficClass() throws java.net.SocketException { return m_Socket.getTrafficClass(); } + @Override public boolean isBound() { return m_Socket.isBound(); } + @Override public boolean isClosed() { return m_Socket.isClosed(); } + @Override public boolean isConnected() { return m_Socket.isConnected(); } + @Override public boolean isInputShutdown() { return m_Socket.isInputShutdown(); } + @Override public boolean isOutputShutdown() { return m_Socket.isOutputShutdown(); } + @Override public void sendUrgentData(int data) throws IOException { m_Socket.sendUrgentData(data); } + @Override public void setKeepAlive(boolean on) throws java.net.SocketException { m_Socket.setKeepAlive(on); } + @Override public void setOOBInline(boolean on) throws java.net.SocketException { m_Socket.setOOBInline(on); } + @Override public void setPerformancePreferences(int connectionTime, int latency, int bandwidth) { m_Socket.setPerformancePreferences(connectionTime, latency, bandwidth); } + @Override public void setReceiveBufferSize(int size) throws java.net.SocketException { m_Socket.setReceiveBufferSize(size); } + @Override public void setReuseAddress(boolean on) throws java.net.SocketException { m_Socket.setReuseAddress(on); } + @Override public void setSendBufferSize(int size) throws java.net.SocketException { m_Socket.setSendBufferSize(size); } + @Override public void setSoLinger(boolean on, int linger) throws java.net.SocketException { m_Socket.setSoLinger(on, linger); } + @Override public void setSoTimeout(int timeout) throws java.net.SocketException{ m_Socket.setSoTimeout(timeout); } + @Override public void setTcpNoDelay(boolean on) throws java.net.SocketException{ m_Socket.setTcpNoDelay(on); } + @Override public void setTrafficClass(int tc) throws java.net.SocketException { m_Socket.setTrafficClass(tc); } + @Override public void shutdownInput() throws IOException { m_Socket.shutdownInput(); } + @Override public void shutdownOutput() throws IOException { m_Socket.shutdownOutput(); } + @Override public String toString() { return m_Socket.toString(); } + + } + + @Override + public Socket createSocket(InetAddress address, int port) + throws IOException + { + return new LogSocket(((SSLSocketFactory) SSLSocketFactory.getDefault()).createSocket(address, port)); + } + + @Override + public Socket createSocket(InetAddress address, int port, InetAddress localAddress, int localPort) + throws IOException + { + return new LogSocket(((SSLSocketFactory) SSLSocketFactory.getDefault()).createSocket(address, port, localAddress, localPort)); + } + + @Override + public Socket createSocket( String sHost, int nPort, InetAddress clientHost, int clientPort ) + throws IOException, UnknownHostException + { + return new LogSocket(((SSLSocketFactory) SSLSocketFactory.getDefault()).createSocket(sHost, nPort, clientHost, clientPort)); + } + + @Override + public Socket createSocket( String sHost, int nPort ) + throws IOException, UnknownHostException + { + return new LogSocket(((SSLSocketFactory) SSLSocketFactory.getDefault()).createSocket(sHost, nPort)); + } + + @Override + public Socket createSocket( Socket aSocket, String sHost, int nPort, boolean bAutoClose ) + throws IOException + { + return new LogSocket(((SSLSocketFactory) SSLSocketFactory.getDefault()).createSocket(aSocket, sHost, nPort, bAutoClose)); + } + + @Override + public String[] getDefaultCipherSuites() + { + // have to implement abstract method, just use the default + return ((SSLSocketFactory) SSLSocketFactory.getDefault()).getDefaultCipherSuites(); + } + + @Override + public String[] getSupportedCipherSuites() + { + // have to implement abstract method, just use the default + return ((SSLSocketFactory) SSLSocketFactory.getDefault()).getSupportedCipherSuites(); + } + + @Override + public boolean equals(Object obj) + { + return ((obj != null) && obj.getClass().equals(LoggingProtocolSocketFactory.class)); + } + + @Override + public int hashCode() + { + return LoggingProtocolSocketFactory.class.hashCode(); + } +} + commit 6d571956b71366b92fb37b1bd9b70dfb019991fb Author: Michael Stahl <mst...@redhat.com> Date: Wed Oct 7 18:25:57 2015 +0200 swext: Wiki Publisher does not use those apache-commons libraries ... itself, they were apparently just dependencies of commons-httpclient, so remove them. Change-Id: I8fd5c85db058c4aa14c4f5fea20fd17ba361b0b2 (cherry picked from commit 4b6ceed4a4a9b152905a8b1712ffb9bd61373c16) diff --git a/swext/Extension_wiki-publisher.mk b/swext/Extension_wiki-publisher.mk index 94ea40b..ec31c96 100644 --- a/swext/Extension_wiki-publisher.mk +++ b/swext/Extension_wiki-publisher.mk @@ -16,19 +16,6 @@ $(eval $(call gb_Extension_use_unpacked,wiki-publisher,xsltml)) $(eval $(call gb_Extension_use_default_description,wiki-publisher,swext/mediawiki/src/description-en-US.txt)) $(eval $(call gb_Extension_use_default_license,wiki-publisher)) -ifeq ($(SYSTEM_APACHE_COMMONS),) -$(eval $(call gb_Extension_use_external_project,wiki-publisher,apache_commons_logging)) -$(eval $(call gb_Extension_use_external_project,wiki-publisher,apache_commons_codec)) -$(eval $(call gb_Extension_use_external_project,wiki-publisher,apache_commons_lang)) - -$(eval $(call gb_Extension_add_file,wiki-publisher,$(if $(filter TRUE,$(HAVE_JAVA6)),commons-codec-1.9.jar,commons-codec-1.6.jar),\ -$(call gb_UnpackedTarball_get_dir,apache_commons_codec)$(if $(filter TRUE,$(HAVE_JAVA6)),/dist/commons-codec-1.9.jar,/dist/commons-codec-1.6-SNAPSHOT.jar)\ -)) -$(eval $(call gb_Extension_add_file,wiki-publisher,$(if $(filter TRUE,$(HAVE_JAVA6)),commons-lang3-3.3.1.jar,commons-lang-2.4.jar),\ -$(call gb_UnpackedTarball_get_dir,apache_commons_lang)$(if $(filter TRUE,$(HAVE_JAVA6)),/target/commons-lang3-3.3.1.jar,/dist/commons-lang-2.4.jar)\ -)) -$(eval $(call gb_Extension_add_file,wiki-publisher,commons-logging-$(COMMONS_LOGGING_VERSION).jar,$(call gb_UnpackedTarball_get_dir,apache_commons_logging)/target/commons-logging-$(COMMONS_LOGGING_VERSION).jar)) -endif $(eval $(call gb_Extension_add_file,wiki-publisher,Addons.xcu,$(call gb_XcuFile_for_extension,swext/mediawiki/src/registry/data/org/openoffice/Office/Addons.xcu))) $(eval $(call gb_Extension_add_file,wiki-publisher,Filter.xcu,$(SRCDIR)/swext/mediawiki/src/registry/data/org/openoffice/TypeDetection/Filter.xcu)) $(eval $(call gb_Extension_add_file,wiki-publisher,OptionsDialog.xcu,$(call gb_XcuFile_for_extension,swext/mediawiki/src/registry/data/org/openoffice/Office/OptionsDialog.xcu))) diff --git a/swext/Jar_mediawiki.mk b/swext/Jar_mediawiki.mk index 49f0a8b..2341580 100644 --- a/swext/Jar_mediawiki.mk +++ b/swext/Jar_mediawiki.mk @@ -14,12 +14,6 @@ $(eval $(call gb_Jar_set_packageroot,mediawiki,com)) $(eval $(call gb_Jar_set_manifest,mediawiki,$(SRCDIR)/swext/mediawiki/src/com/sun/star/wiki/MANIFEST.MF)) -$(eval $(call gb_Jar_use_externals,mediawiki,\ - commons-codec \ - commons-lang \ - commons-logging \ -)) - $(eval $(call gb_Jar_use_jars,mediawiki,\ juh \ jurt \ commit 81d31dc3e12d4a39ce4e78f1d6232619aafbc00e Author: Michael Stahl <mst...@redhat.com> Date: Wed Oct 7 17:40:29 2015 +0200 swext: remove commons-httpclient dependency from Wiki Publisher JRE 6 has sufficient HttpURLConnection etc. stuff to make this work without bundling external libraries. Change-Id: I6c71980c718169024006f02a96c442a71d798d55 (cherry picked from commit f7d149a731a0284d3d7b7b1c26c736654e0712fd) diff --git a/swext/Extension_wiki-publisher.mk b/swext/Extension_wiki-publisher.mk index ffee9ac..94ea40b 100644 --- a/swext/Extension_wiki-publisher.mk +++ b/swext/Extension_wiki-publisher.mk @@ -19,13 +19,11 @@ $(eval $(call gb_Extension_use_default_license,wiki-publisher)) ifeq ($(SYSTEM_APACHE_COMMONS),) $(eval $(call gb_Extension_use_external_project,wiki-publisher,apache_commons_logging)) $(eval $(call gb_Extension_use_external_project,wiki-publisher,apache_commons_codec)) -$(eval $(call gb_Extension_use_external_project,wiki-publisher,apache_commons_httpclient)) $(eval $(call gb_Extension_use_external_project,wiki-publisher,apache_commons_lang)) $(eval $(call gb_Extension_add_file,wiki-publisher,$(if $(filter TRUE,$(HAVE_JAVA6)),commons-codec-1.9.jar,commons-codec-1.6.jar),\ $(call gb_UnpackedTarball_get_dir,apache_commons_codec)$(if $(filter TRUE,$(HAVE_JAVA6)),/dist/commons-codec-1.9.jar,/dist/commons-codec-1.6-SNAPSHOT.jar)\ )) -$(eval $(call gb_Extension_add_file,wiki-publisher,commons-httpclient-3.1.jar,$(call gb_UnpackedTarball_get_dir,apache_commons_httpclient)/dist/commons-httpclient.jar)) $(eval $(call gb_Extension_add_file,wiki-publisher,$(if $(filter TRUE,$(HAVE_JAVA6)),commons-lang3-3.3.1.jar,commons-lang-2.4.jar),\ $(call gb_UnpackedTarball_get_dir,apache_commons_lang)$(if $(filter TRUE,$(HAVE_JAVA6)),/target/commons-lang3-3.3.1.jar,/dist/commons-lang-2.4.jar)\ )) diff --git a/swext/Jar_mediawiki.mk b/swext/Jar_mediawiki.mk index 2c6bc3f..49f0a8b 100644 --- a/swext/Jar_mediawiki.mk +++ b/swext/Jar_mediawiki.mk @@ -17,7 +17,6 @@ $(eval $(call gb_Jar_set_manifest,mediawiki,$(SRCDIR)/swext/mediawiki/src/com/su $(eval $(call gb_Jar_use_externals,mediawiki,\ commons-codec \ commons-lang \ - commons-httpclient \ commons-logging \ )) diff --git a/swext/mediawiki/src/com/sun/star/wiki/Helper.java b/swext/mediawiki/src/com/sun/star/wiki/Helper.java index 50750de..f5e5c48 100644 --- a/swext/mediawiki/src/com/sun/star/wiki/Helper.java +++ b/swext/mediawiki/src/com/sun/star/wiki/Helper.java @@ -53,18 +53,10 @@ import com.sun.star.uno.XComponentContext; import com.sun.star.util.XChangesBatch; import java.net.*; import java.io.*; +import javax.net.ssl.HttpsURLConnection; import javax.net.ssl.SSLException; import javax.swing.text.html.HTMLEditorKit; -import org.apache.commons.httpclient.HttpClient; -import org.apache.commons.httpclient.HostConfiguration; -import org.apache.commons.httpclient.HttpMethodBase; -import org.apache.commons.httpclient.cookie.CookiePolicy; -import org.apache.commons.httpclient.MultiThreadedHttpConnectionManager; -import org.apache.commons.httpclient.protocol.Protocol; -import org.apache.commons.httpclient.URI; -import org.apache.commons.httpclient.methods.GetMethod; -import org.apache.commons.httpclient.methods.PostMethod; public class Helper { @@ -142,8 +134,6 @@ public class Helper private static String[] m_pConfigStrings; - private static MultiThreadedHttpConnectionManager m_aConnectionManager; - private static HttpClient m_aClient; private static boolean m_bAllowConnection = true; private static Boolean m_bShowInBrowser = null; @@ -174,35 +164,11 @@ public class Helper return m_pConfigStrings[nID]; } - synchronized private static HttpClient GetHttpClient() - throws WikiCancelException - { - if ( !m_bAllowConnection ) - throw new WikiCancelException(); - - if ( m_aConnectionManager == null ) - m_aConnectionManager = new MultiThreadedHttpConnectionManager(); - - if ( m_aClient == null ) - { - m_aClient = new HttpClient( m_aConnectionManager ); - m_aClient.getParams().setParameter( "http.protocol.cookie-policy", CookiePolicy.BROWSER_COMPATIBILITY ); - m_aClient.getParams().setParameter( "http.protocol.single-cookie-header", Boolean.TRUE ); - m_aClient.getParams().setParameter( "http.protocol.content-charset", "UTF-8" ); - } - - return m_aClient; - } - synchronized protected static void AllowConnection( boolean bAllow ) { m_bAllowConnection = bAllow; - if ( !bAllow && m_aConnectionManager != null ) - { - m_aClient = null; - m_aConnectionManager.shutdown(); - m_aConnectionManager = null; - } + // TODO: how to shut down any pending connections? + // hope it doesn't matter? } synchronized protected static boolean IsConnectionAllowed() @@ -282,11 +248,6 @@ public class Helper return m_xInteractionHandler; } - private static Protocol GetOwnHttps( int nPort ) - { - return new Protocol( "https", new WikiProtocolSocketFactory(), ( ( nPort < 0 ) ? 443 : nPort ) ); - } - protected static String GetMainURL( String sWebPage, String sVURL ) { String sResultURL = ""; @@ -366,9 +327,6 @@ public class Helper } - - - protected static String CreateTempFile( XComponentContext xContext ) { String sURL = ""; @@ -579,30 +537,30 @@ public class Helper return xNameAccess; } - private static void SetConfigurationProxy( HostConfiguration aHostConfig, XComponentContext xContext ) + private static Proxy GetConfigurationProxy(URI uri, XComponentContext xContext) { - if ( aHostConfig == null || xContext == null ) - return; + assert(uri != null); + assert(xContext != null); try { XNameAccess xNameAccess = GetConfigNameAccess( xContext, "org.openoffice.Inet/Settings" ); int nProxyType = AnyConverter.toInt( xNameAccess.getByName( "ooInetProxyType" ) ); - if ( nProxyType == 0 ) - aHostConfig.setProxyHost( null ); - else - { + if ( nProxyType == 0 ) { + return Proxy.NO_PROXY; + } else { if ( nProxyType == 1 ) { // system proxy + return null; } else if ( nProxyType == 2 ) { String aProxyNameProp = "ooInetHTTPProxyName"; String aProxyPortProp = "ooInetHTTPProxyPort"; - if ( aHostConfig.getProtocol().getScheme().equals( "https" ) ) + if (uri.getScheme().equals("https")) { aProxyNameProp = "ooInetHTTPSProxyName"; aProxyPortProp = "ooInetHTTPSProxyPort"; @@ -620,7 +578,8 @@ public class Helper nProxyPort = 80; // TODO: check whether the URL is in the NoProxy list - aHostConfig.setProxy( aProxyName, nProxyPort ); + InetSocketAddress address = new InetSocketAddress(aProxyName, nProxyPort); + return new Proxy(Proxy.Type.HTTP, address); } } } @@ -628,6 +587,7 @@ public class Helper { e.printStackTrace(); } + return null; // invalid configuration value? } protected static void ShowURLInBrowser( XComponentContext xContext, String sURL ) @@ -648,33 +608,70 @@ public class Helper } } - protected static void ExecuteMethod( HttpMethodBase aMethod, HostConfiguration aHostConfig, URI aURI, XComponentContext xContext, boolean bSetHost ) + protected static HttpURLConnection PrepareMethod(String method, URI uri, XComponentContext xContext) throws WikiCancelException, IOException, SSLException { - if ( aMethod != null && aHostConfig != null && aURI != null && xContext != null ) + assert(method != null); + assert(uri != null); + assert(xContext != null); + + if (!IsConnectionAllowed()) { + throw new WikiCancelException(); + } + + if (java.net.CookieHandler.getDefault() == null) { + // set a cookie manager so cookies don't get lost + // apparently it's not possible to do that on a per-connection + // basis but only globally? + java.net.CookieHandler.setDefault(new java.net.CookieManager()); + } + + Proxy proxy = GetConfigurationProxy(uri, xContext); + HttpURLConnection conn = null; + if (proxy != null) { + conn = (HttpURLConnection) uri.toURL().openConnection(proxy); + } else { + conn = (HttpURLConnection) uri.toURL().openConnection(); + } + if (uri.getScheme().equals("https") && AllowUnknownCert(xContext, uri.getHost())) { - if ( bSetHost ) - { - aHostConfig.setHost( aURI ); - SetConfigurationProxy( aHostConfig, xContext ); - } + // let unknown certificates be accepted + ((HttpsURLConnection) conn).setSSLSocketFactory(new WikiProtocolSocketFactory()); + } - if ( aHostConfig.getProtocol().getScheme().equals( "https" ) - && AllowUnknownCert( xContext, aURI.getHost() ) ) - { - // let unknown certificates be accepted - { - { - aHostConfig.setHost( aHostConfig.getHost(), ( aURI.getPort() < 0 ? 443 : aURI.getPort() ), Helper.GetOwnHttps( aURI.getPort() ) ); - Helper.GetHttpClient().executeMethod( aHostConfig, aMethod ); - } + conn.setRequestMethod(method); + // note: don't connect yet so that the caller can do some further setup + + return conn; + } + + protected static String ReadResponseBody(HttpURLConnection conn) + throws IOException + { + String ret = null; + InputStream stream = conn.getInputStream(); + try { + // there doesn't seem to be an easier way get the content encoding + String type = conn.getContentType(); + String charset = "ISO-8859-1"; // default in RFC2616 + for (String param : type.split(";")) { + if (param.trim().toLowerCase().startsWith("charset=")) { + charset = param.trim().substring("charset=".length()); + break; } } - else - { - Helper.GetHttpClient().executeMethod( aHostConfig, aMethod ); + BufferedReader br = + new BufferedReader(new InputStreamReader(stream, charset)); + StringBuilder buf = new StringBuilder(); + String line; + while ((line = br.readLine()) != null) { + buf.append(line); } + ret = buf.toString(); + } finally { + stream.close(); } + return ret; } private static class HTMLParse extends HTMLEditorKit @@ -738,76 +735,74 @@ public class Helper return sResult; } - protected static HostConfiguration Login( URI aMainURL, String sWikiUser, String sWikiPass, XComponentContext xContext ) - throws java.io.IOException, WikiCancelException + protected static boolean Login(URI aMainURL, String sWikiUser, String sWikiPass, XComponentContext xContext) + throws java.io.IOException, WikiCancelException, URISyntaxException { - HostConfiguration aHostConfig = null; + boolean success = false; if ( sWikiUser != null && sWikiPass != null && xContext != null ) { - HostConfiguration aNewHostConfig = new HostConfiguration(); - - URI aURI = new URI( aMainURL.toString() + "index.php?title=Special:Userlogin", false ); - GetMethod aGetCookie = new GetMethod( aURI.getEscapedPathQuery() ); - - ExecuteMethod( aGetCookie, aNewHostConfig, aURI, xContext, true ); - - int nResultCode = aGetCookie.getStatusCode(); String sLoginPage = null; - if ( nResultCode == 200 ) - sLoginPage = aGetCookie.getResponseBodyAsString(); - - aGetCookie.releaseConnection(); + URI aURI = new URI(aMainURL.toString() + "index.php?title=Special:Userlogin"); + HttpURLConnection connGet = PrepareMethod("GET", aURI, xContext); + connGet.setInstanceFollowRedirects(true); + + connGet.connect(); + int nResultCode = connGet.getResponseCode(); + if (nResultCode == 200) { + sLoginPage = ReadResponseBody(connGet); + } if ( sLoginPage != null ) { String sLoginToken = GetLoginToken( sLoginPage ); - PostMethod aPost = new PostMethod(); - URI aPostURI = new URI( aMainURL.getPath() + "index.php?title=Special:Userlogin&action=submitlogin", false ); - aPost.setPath( aPostURI.getEscapedPathQuery() ); + URI aPostURI = new URI(aMainURL.toString() + "index.php?title=Special:Userlogin&action=submitlogin"); - aPost.addParameter( "wpName", sWikiUser ); - aPost.addParameter( "wpRemember", "1" ); - aPost.addParameter( "wpPassword", sWikiPass ); - if ( sLoginToken.length() > 0 ) - aPost.addParameter( "wpLoginToken", sLoginToken ); + HttpURLConnection connPost = PrepareMethod("POST", aPostURI, xContext); + connPost.setInstanceFollowRedirects(true); + connPost.setDoInput(true); + connPost.setDoOutput(true); + connPost.connect(); + + OutputStreamWriter post = new OutputStreamWriter(connPost.getOutputStream()); + post.write("wpName="); + post.write(URLEncoder.encode(sWikiUser, "UTF-8")); + post.write("&wpRemember=1"); + post.write("&wpPassword="); + post.write(URLEncoder.encode(sWikiPass, "UTF-8")); + + if (sLoginToken.length() > 0) { + post.write("&wpLoginToken="); + post.write(URLEncoder.encode(sLoginToken, "UTF-8")); + } String[][] pArgs = GetSpecialArgs( xContext, aMainURL.getHost() ); if ( pArgs != null ) for ( int nArgInd = 0; nArgInd < pArgs.length; nArgInd++ ) if ( pArgs[nArgInd].length == 2 && pArgs[nArgInd][0] != null && pArgs[nArgInd][1] != null ) - aPost.addParameter( pArgs[nArgInd][0], pArgs[nArgInd][1] ); - - ExecuteMethod( aPost, aNewHostConfig, aPostURI, xContext, false ); - - nResultCode = aPost.getStatusCode(); - - while( nResultCode >= 301 && nResultCode <= 303 || nResultCode == 307 ) - { - String sRedirectURL = aPost.getResponseHeader( "Location" ).getValue(); - aPost.releaseConnection(); + { + post.write("&"); + post.write(URLEncoder.encode(pArgs[nArgInd][0], "UTF-8")); + post.write("="); + post.write(URLEncoder.encode(pArgs[nArgInd][0], "UTF-8")); + } - aURI = new URI( sRedirectURL ); - aPost = new PostMethod(); - aPost.setPath( aURI.getEscapedPathQuery() ); - ExecuteMethod( aPost, aNewHostConfig, aURI, xContext, false ); + post.flush(); + post.close(); - nResultCode = aPost.getStatusCode(); - } + nResultCode = connPost.getResponseCode(); if ( nResultCode == 200 ) { - String sResult = aPost.getResponseBodyAsString(); + String sResult = ReadResponseBody(connPost); if ( !LoginReportsError( sResult ) ) - aHostConfig = aNewHostConfig; + success = true; } - - aPost.releaseConnection(); } } - return aHostConfig; + return success; } protected static String[] GetPasswordsForURLAndUser( XComponentContext xContext, String sURL, String sUserName ) diff --git a/swext/mediawiki/src/com/sun/star/wiki/WikiArticle.java b/swext/mediawiki/src/com/sun/star/wiki/WikiArticle.java index e16db71..58638b5 100644 --- a/swext/mediawiki/src/com/sun/star/wiki/WikiArticle.java +++ b/swext/mediawiki/src/com/sun/star/wiki/WikiArticle.java @@ -19,15 +19,14 @@ package com.sun.star.wiki; import java.io.StringReader; +import java.io.OutputStreamWriter; import java.util.Map; +import java.net.URLEncoder; +import java.net.URI; +import java.net.HttpURLConnection; import javax.swing.text.html.HTMLEditorKit; -import org.apache.commons.httpclient.HostConfiguration; -import org.apache.commons.httpclient.URI; -import org.apache.commons.httpclient.methods.GetMethod; -import org.apache.commons.httpclient.methods.PostMethod; - import com.sun.star.uno.XComponentContext; @@ -47,12 +46,11 @@ public class WikiArticle private final String m_sTitle; private final URI m_aMainURI; - private HostConfiguration m_aHostConfig; - + private boolean m_isLoggedIn = false; /** Creates a new instance of WikiArticle */ public WikiArticle( XComponentContext xContext, String sTitle, Map<String,String> wikiSettings, boolean bLogin, WikiPropDialog aPropDialog ) - throws java.net.MalformedURLException, java.io.IOException, WikiCancelException + throws java.net.URISyntaxException, java.io.IOException, WikiCancelException { m_xContext = xContext; @@ -61,7 +59,7 @@ public class WikiArticle m_sWikiPass = wikiSettings.get("Password"); m_sTitle = sTitle; - m_aMainURI = new URI( sMainUrl, false ); + m_aMainURI = new URI(sMainUrl); if ( bLogin ) { @@ -112,23 +110,21 @@ public class WikiArticle private String getArticleWiki() - throws java.io.IOException, WikiCancelException + throws java.net.URISyntaxException, java.io.IOException, WikiCancelException { String sWikiCode = null; - if ( m_aHostConfig != null ) + if (m_isLoggedIn) { - URI aURI = new URI( m_aMainURI.toString() + "index.php?title=" + m_sTitle + "&action=edit", false ); - GetMethod aRequest = new GetMethod( aURI.getEscapedPathQuery() ); + URI aURI = new URI(m_aMainURI.toString() + "index.php?title=" + m_sTitle + "&action=edit"); + HttpURLConnection connGet = Helper.PrepareMethod("GET", aURI, m_xContext); + connGet.connect(); - Helper.ExecuteMethod( aRequest, m_aHostConfig, aURI, m_xContext, false ); - - int nResultCode = aRequest.getStatusCode(); + int nResultCode = connGet.getResponseCode(); String sWebPage = null; - if ( nResultCode == 200 ) - sWebPage = aRequest.getResponseBodyAsString(); - - aRequest.releaseConnection(); + if (nResultCode == 200) { + sWebPage = Helper.ReadResponseBody(connGet); + } if ( sWebPage != null ) { @@ -156,19 +152,19 @@ public class WikiArticle } private void InitArticleHTML() - throws java.io.IOException, WikiCancelException + throws java.net.URISyntaxException, java.io.IOException, WikiCancelException { - if ( m_aHostConfig != null ) + if (m_isLoggedIn) { - URI aURI = new URI( m_aMainURI.toString() + "index.php?title=" + m_sTitle, false ); - GetMethod aRequest = new GetMethod( aURI.getEscapedPathQuery() ); - - Helper.ExecuteMethod( aRequest, m_aHostConfig, aURI, m_xContext, false ); + URI uri = new URI(m_aMainURI.toString() + "index.php?title=" + m_sTitle); + HttpURLConnection connGet = Helper.PrepareMethod("GET", uri, m_xContext); + connGet.connect(); - int nResultCode = aRequest.getStatusCode(); + int nResultCode = connGet.getResponseCode(); String sWebPage = null; - if ( nResultCode == 200 ) - sWebPage = aRequest.getResponseBodyAsString(); + if (nResultCode == 200) { + sWebPage = Helper.ReadResponseBody(connGet); + } if ( sWebPage != null ) { @@ -192,36 +188,46 @@ public class WikiArticle } protected boolean setArticle( String sWikiCode, String sWikiComment, boolean bMinorEdit ) - throws java.io.IOException, WikiCancelException + throws java.net.URISyntaxException, java.io.IOException, WikiCancelException { boolean bResult = false; - if ( m_aHostConfig != null && sWikiCode != null && sWikiComment != null ) + if (m_isLoggedIn && sWikiCode != null && sWikiComment != null) { // get the edit time and token getArticleWiki(); - URI aURI = new URI( m_aMainURI.getPath() + "index.php?title=" + m_sTitle + "&action=submit", false ); - PostMethod aPost = new PostMethod(); - aPost.setPath( aURI.getEscapedPathQuery() ); - - aPost.addParameter( "wpTextbox1", sWikiCode ); - aPost.addParameter( "wpSummary", sWikiComment ); - aPost.addParameter( "wpSection", "" ); - aPost.addParameter( "wpEdittime", m_sEditTime ); - aPost.addParameter( "wpSave", "Save page" ); - aPost.addParameter( "wpEditToken", m_sEditToken ); - - if ( bMinorEdit ) - aPost.addParameter( "wpMinoredit", "1" ); + URI uri = new URI(m_aMainURI.toString() + "index.php?title=" + m_sTitle + "&action=submit"); + + HttpURLConnection connPost = Helper.PrepareMethod("POST", uri, m_xContext); + connPost.setDoInput(true); + connPost.setDoOutput(true); + connPost.connect(); + + OutputStreamWriter post = new OutputStreamWriter(connPost.getOutputStream()); + post.write("wpTextbox1="); + post.write(URLEncoder.encode(sWikiCode, "UTF-8")); + post.write("&wpSummary="); + post.write(URLEncoder.encode(sWikiComment, "UTF-8")); + post.write("&wpSection="); + post.write("&wpEdittime="); + post.write(URLEncoder.encode(m_sEditTime, "UTF-8")); + post.write("&wpSave=Save%20page"); + post.write("&wpEditToken="); + post.write(URLEncoder.encode(m_sEditToken, "UTF-8")); + + if (bMinorEdit) { + post.write("&wpMinoredit=1"); + } - Helper.ExecuteMethod( aPost, m_aHostConfig, aURI, m_xContext, false ); + post.flush(); + post.close(); - int nResultCode = aPost.getStatusCode(); + int nResultCode = connPost.getResponseCode(); if ( nResultCode < 400 ) bResult = true; - String aResult = aPost.getResponseBodyAsString(); + String aResult = Helper.ReadResponseBody(connPost); // TODO: remove the debug printing, try to detect the error System.out.print( "nSubmitCode = " + nResultCode + "\n===\n" + aResult ); @@ -231,15 +237,12 @@ public class WikiArticle } private boolean Login() - throws java.io.IOException, WikiCancelException + throws java.net.URISyntaxException, java.io.IOException, WikiCancelException { - m_aHostConfig = Helper.Login( m_aMainURI, m_sWikiUser, m_sWikiPass, m_xContext ); - return ( m_aHostConfig != null ); + m_isLoggedIn = Helper.Login( m_aMainURI, m_sWikiUser, m_sWikiPass, m_xContext ); + return m_isLoggedIn; } - - - protected boolean NotExist() { boolean bResult = true; diff --git a/swext/mediawiki/src/com/sun/star/wiki/WikiEditSettingDialog.java b/swext/mediawiki/src/com/sun/star/wiki/WikiEditSettingDialog.java index aef6cb6..ad9e2ca 100644 --- a/swext/mediawiki/src/com/sun/star/wiki/WikiEditSettingDialog.java +++ b/swext/mediawiki/src/com/sun/star/wiki/WikiEditSettingDialog.java @@ -21,12 +21,10 @@ package com.sun.star.wiki; import java.util.HashMap; import java.util.Map; +import java.net.URI; +import java.net.HttpURLConnection; import javax.net.ssl.SSLException; -import org.apache.commons.httpclient.HostConfiguration; -import org.apache.commons.httpclient.URI; -import org.apache.commons.httpclient.methods.GetMethod; - import com.sun.star.awt.XDialog; import com.sun.star.beans.XPropertySet; import com.sun.star.lang.EventObject; @@ -199,8 +197,6 @@ public class WikiEditSettingDialog extends WikiDialog String sUserName = ( String ) GetPropSet( "UsernameField" ).getPropertyValue( "Text" ); String sPassword = ( String ) GetPropSet( "PasswordField" ).getPropertyValue( "Text" ); - HostConfiguration aHostConfig = new HostConfiguration(); - boolean bInitHost = true; boolean bAllowIndex = true; do @@ -213,20 +209,17 @@ public class WikiEditSettingDialog extends WikiDialog if ( sURL.length() > 0 ) { - URI aURI = new URI( sURL, false ); - GetMethod aRequest = new GetMethod( aURI.getEscapedPathQuery() ); - aRequest.setFollowRedirects( false ); - Helper.ExecuteMethod( aRequest, aHostConfig, aURI, m_xContext, bInitHost ); - bInitHost = false; + URI aURI = new URI(sURL); + HttpURLConnection connGet = Helper.PrepareMethod("GET", aURI, m_xContext); + connGet.setInstanceFollowRedirects(false); + connGet.connect(); - int nResultCode = aRequest.getStatusCode(); + int nResultCode = connGet.getResponseCode(); String sWebPage = null; if ( nResultCode == 200 ) - sWebPage = aRequest.getResponseBodyAsString(); + sWebPage = Helper.ReadResponseBody(connGet); else if ( nResultCode >= 301 && nResultCode <= 303 || nResultCode == 307 ) - sRedirectURL = aRequest.getResponseHeader( "Location" ).getValue(); - - aRequest.releaseConnection(); + sRedirectURL = connGet.getHeaderField("Location"); if ( sWebPage != null && sWebPage.length() > 0 ) { @@ -252,10 +245,10 @@ public class WikiEditSettingDialog extends WikiDialog } else { - URI aMainURI = new URI( sMainURL, true ); // it must be an escaped URL, otherwise an exception should be thrown + URI aMainURI = new URI(sMainURL); if ( ( sUserName.length() > 0 || sPassword.length() > 0 ) - && Helper.Login( aMainURI, sUserName, sPassword, m_xContext ) == null ) + && !Helper.Login(aMainURI, sUserName, sPassword, m_xContext)) { // a wrong login information is provided // show error @@ -268,7 +261,7 @@ public class WikiEditSettingDialog extends WikiDialog } else { - setting.put( "Url", aMainURI.getEscapedURI() ); + setting.put( "Url", aMainURI.toASCIIString() ); setting.put( "Username", sUserName ); setting.put( "Password", sPassword ); if ( addMode ) diff --git a/swext/mediawiki/src/com/sun/star/wiki/WikiProtocolSocketFactory.java b/swext/mediawiki/src/com/sun/star/wiki/WikiProtocolSocketFactory.java index b6da4a5..5d7efe1 100644 --- a/swext/mediawiki/src/com/sun/star/wiki/WikiProtocolSocketFactory.java +++ b/swext/mediawiki/src/com/sun/star/wiki/WikiProtocolSocketFactory.java @@ -25,17 +25,14 @@ import java.net.Socket; import java.net.UnknownHostException; import java.security.KeyStore; import javax.net.ssl.SSLContext; +import javax.net.ssl.SSLSocketFactory; import javax.net.ssl.TrustManager; import javax.net.ssl.TrustManagerFactory; import javax.net.ssl.X509TrustManager; import java.security.cert.CertificateException; import java.security.cert.X509Certificate; -import org.apache.commons.httpclient.ConnectTimeoutException; -import org.apache.commons.httpclient.HttpClientError; -import org.apache.commons.httpclient.params.HttpConnectionParams; -import org.apache.commons.httpclient.protocol.SecureProtocolSocketFactory; -class WikiProtocolSocketFactory implements SecureProtocolSocketFactory +class WikiProtocolSocketFactory extends SSLSocketFactory { private SSLContext m_aSSLContext; @@ -105,43 +102,59 @@ class WikiProtocolSocketFactory implements SecureProtocolSocketFactory } if ( m_aSSLContext == null ) - throw new HttpClientError(); + throw new RuntimeException("failed to create SSLContext"); return m_aSSLContext; } - public Socket createSocket( String sHost, int nPort, InetAddress clientHost, int clientPort ) - throws IOException, UnknownHostException + @Override + public Socket createSocket(InetAddress address, int port) + throws IOException { - return GetNotSoSecureSSLContext().getSocketFactory().createSocket( sHost, nPort, clientHost, clientPort ); + return GetNotSoSecureSSLContext().getSocketFactory().createSocket(address, port); + } + + @Override + public Socket createSocket(InetAddress address, int port, InetAddress localAddress, int localPort) + throws IOException + { + return GetNotSoSecureSSLContext().getSocketFactory().createSocket(address, port, localAddress, localPort); } - public Socket createSocket( final String sHost, final int nPort, final InetAddress aLocalAddress, final int nLocalPort, final HttpConnectionParams params ) - throws IOException, UnknownHostException, ConnectTimeoutException + @Override + public Socket createSocket( String sHost, int nPort, InetAddress clientHost, int clientPort ) + throws IOException, UnknownHostException { - if ( params == null ) - return createSocket( sHost, nPort, aLocalAddress, nLocalPort ); - - int nTimeout = params.getConnectionTimeout(); - Socket aSocket = GetNotSoSecureSSLContext().getSocketFactory().createSocket(); - aSocket.bind( new InetSocketAddress( aLocalAddress, nLocalPort ) ); - aSocket.connect( new InetSocketAddress( sHost, nPort ), nTimeout ); - return aSocket; + return GetNotSoSecureSSLContext().getSocketFactory().createSocket( sHost, nPort, clientHost, clientPort ); } + @Override public Socket createSocket( String sHost, int nPort ) throws IOException, UnknownHostException { return GetNotSoSecureSSLContext().getSocketFactory().createSocket( sHost, nPort ); } + @Override public Socket createSocket( Socket aSocket, String sHost, int nPort, boolean bAutoClose ) - throws IOException, UnknownHostException + throws IOException { return GetNotSoSecureSSLContext().getSocketFactory().createSocket( aSocket, sHost, nPort, bAutoClose ); } @Override + public String[] getDefaultCipherSuites() + { + return GetNotSoSecureSSLContext().getSocketFactory().getDefaultCipherSuites(); + } + + @Override + public String[] getSupportedCipherSuites() + { + return GetNotSoSecureSSLContext().getSocketFactory().getSupportedCipherSuites(); + } + + @Override public boolean equals(Object obj) { return ((obj != null) && obj.getClass().equals(WikiProtocolSocketFactory.class)); commit c45c2c8fceee2b302266bf7491e0886ae6464397 Author: Noel Grandin <n...@peralex.com> Date: Fri Jun 12 09:30:14 2015 +0200 java: 'final static' to 'static final' this is the canonical order, and it makes the code easier to read Reviewed-on: https://gerrit.libreoffice.org/16242 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: David Ostrovsky <da...@ostrovsky.org> (cherry picked from commit 0c18bedb7328493040c1a20822b345e624d6041f) Change-Id: I272e7f1e140296e582702b6dbf77a03eefb65470 diff --git a/android/source/src/java/org/mozilla/gecko/gfx/JavaPanZoomController.java b/android/source/src/java/org/mozilla/gecko/gfx/JavaPanZoomController.java index b4c321f..5a0f446 100644 --- a/android/source/src/java/org/mozilla/gecko/gfx/JavaPanZoomController.java +++ b/android/source/src/java/org/mozilla/gecko/gfx/JavaPanZoomController.java @@ -110,7 +110,7 @@ public class JavaPanZoomController mTouchEventHandler.destroy(); } - private final static float easeOut(float t) { + private static final float easeOut(float t) { // ease-out approx. // -(t-1)^2+1 t = t-1; diff --git a/bean/qa/complex/bean/WriterFrame.java b/bean/qa/complex/bean/WriterFrame.java index 77f1959..eb7e477 100644 --- a/bean/qa/complex/bean/WriterFrame.java +++ b/bean/qa/complex/bean/WriterFrame.java @@ -30,7 +30,7 @@ import com.sun.star.uno.UnoRuntime; class WriterFrame extends java.awt.Frame { private com.sun.star.comp.beans.OOoBean m_bean; - private final static String m_sDocURL = "private:factory/swriter"; + private static final String m_sDocURL = "private:factory/swriter"; /** @param loadBeforeVisible diff --git a/connectivity/qa/connectivity/tools/HsqlColumnDescriptor.java b/connectivity/qa/connectivity/tools/HsqlColumnDescriptor.java index 5d93118..12330ff 100644 --- a/connectivity/qa/connectivity/tools/HsqlColumnDescriptor.java +++ b/connectivity/qa/connectivity/tools/HsqlColumnDescriptor.java @@ -39,9 +39,9 @@ public class HsqlColumnDescriptor public final String getForeignColumn() { return ForeignColumn; } /// determines that a column is required, i.e. not nullable - public final static int REQUIRED = 1; + public static final int REQUIRED = 1; /// determines that a column is part of the primary key of its table - public final static int PRIMARY = 2; + public static final int PRIMARY = 2; public HsqlColumnDescriptor( String _Name, String _TypeName ) { diff --git a/dbaccess/qa/complex/dbaccess/SingleSelectQueryComposer.java b/dbaccess/qa/complex/dbaccess/SingleSelectQueryComposer.java index 08eea00..07088a0 100644 --- a/dbaccess/qa/complex/dbaccess/SingleSelectQueryComposer.java +++ b/dbaccess/qa/complex/dbaccess/SingleSelectQueryComposer.java @@ -46,13 +46,13 @@ public class SingleSelectQueryComposer extends CRMBasedTestCase { private XSingleSelectQueryComposer m_composer = null; - private final static String COMPLEXFILTER = "( \"ID\" = 1 AND \"Postal\" = '4' )" + private static final String COMPLEXFILTER = "( \"ID\" = 1 AND \"Postal\" = '4' )" + " OR ( \"ID\" = 2 AND \"Postal\" = '5' )" + " OR ( \"ID\" = 3 AND \"Postal\" = '6' AND \"Address\" = '7' )" + " OR ( \"Address\" = '8' )" + " OR ( \"Postal\" = '9' )" + " OR ( NOW( ) = {d '2010-01-01' } )"; - private final static String INNERPRODUCTSQUERY = "products (inner)"; + private static final String INNERPRODUCTSQUERY = "products (inner)"; private void createQueries() throws Exception diff --git a/jurt/com/sun/star/comp/bridgefactory/BridgeFactory.java b/jurt/com/sun/star/comp/bridgefactory/BridgeFactory.java index d84b739..59a8c00 100644 --- a/jurt/com/sun/star/comp/bridgefactory/BridgeFactory.java +++ b/jurt/com/sun/star/comp/bridgefactory/BridgeFactory.java @@ -52,7 +52,7 @@ public class BridgeFactory implements XBridgeFactory/*, XEventListener*/ { * The name of the service, the <code>JavaLoader</code> accesses this through * reflection. */ - public final static String __serviceName = "com.sun.star.bridge.BridgeFactory"; + public static final String __serviceName = "com.sun.star.bridge.BridgeFactory"; /** * Gives a factory for creating the service. diff --git a/odk/examples/DevelopersGuide/GUI/UnoDialogSample2.java b/odk/examples/DevelopersGuide/GUI/UnoDialogSample2.java index 27c578b..90ce8a4 100644 --- a/odk/examples/DevelopersGuide/GUI/UnoDialogSample2.java +++ b/odk/examples/DevelopersGuide/GUI/UnoDialogSample2.java @@ -55,14 +55,14 @@ public class UnoDialogSample2 extends UnoDialogSample { // define some constants used to set positions and sizes // of controls. For further information see // http://ui.openoffice.org/knowledge/DialogSpecificationandGuidelines.odt - final static int nFixedTextHeight = 8; - final static int nControlMargin = 6; - final static int nDialogWidth = 250; - final static int nDialogHeight = 140; + static final int nFixedTextHeight = 8; + static final int nControlMargin = 6; + static final int nDialogWidth = 250; + static final int nDialogHeight = 140; // the default roadmap width == 80 MAPs - final static int nRoadmapWidth = 80; - final static int nButtonHeight = 14; - final static int nButtonWidth = 50; + static final int nRoadmapWidth = 80; + static final int nButtonHeight = 14; + static final int nButtonWidth = 50; public UnoDialogSample2(XComponentContext _xContext, XMultiComponentFactory _xMCF, Object _oUnoObject) { diff --git a/odk/examples/DevelopersGuide/UCB/ChildrenRetriever.java b/odk/examples/DevelopersGuide/UCB/ChildrenRetriever.java index 9764718..42f0689 100644 --- a/odk/examples/DevelopersGuide/UCB/ChildrenRetriever.java +++ b/odk/examples/DevelopersGuide/UCB/ChildrenRetriever.java @@ -123,7 +123,7 @@ public class ChildrenRetriever { // Fill argument structure... OpenCommandArgument2 arg = new OpenCommandArgument2(); arg.Mode = OpenMode.ALL; // FOLDER, DOCUMENTS -> simple filter - arg.Priority = 32768; // Final static for 32768 + arg.Priority = 32768; // static final for 32768 arg.Properties = props; XDynamicResultSet set; diff --git a/odk/examples/DevelopersGuide/UCB/DataStreamRetriever.java b/odk/examples/DevelopersGuide/UCB/DataStreamRetriever.java index 95fb3e9..f25e6cd 100644 --- a/odk/examples/DevelopersGuide/UCB/DataStreamRetriever.java +++ b/odk/examples/DevelopersGuide/UCB/DataStreamRetriever.java @@ -87,7 +87,7 @@ public class DataStreamRetriever { // Fill argument structure... OpenCommandArgument2 arg = new OpenCommandArgument2(); arg.Mode = OpenMode.DOCUMENT; - arg.Priority = 32768; // Final static for 32768 + arg.Priority = 32768; // static final for 32768 // Create data sink implementation object. XActiveDataSink dataSink = new MyActiveDataSink(); diff --git a/qadevOOo/runner/lib/SimpleStatus.java b/qadevOOo/runner/lib/SimpleStatus.java index 6866d7e..9526646 100644 --- a/qadevOOo/runner/lib/SimpleStatus.java +++ b/qadevOOo/runner/lib/SimpleStatus.java @@ -29,29 +29,29 @@ class SimpleStatus { /** * The constatnt represents PASSED runtime state. */ - public final static int PASSED = 0; + public static final int PASSED = 0; /** * The constant represents EXCEPTION runtime state. */ - public final static int EXCEPTION = 3; + public static final int EXCEPTION = 3; /** * The constant represents SKIPPED runtime state. */ - public final static int SKIPPED = 1; + public static final int SKIPPED = 1; /** * This is a private indicator for a user defined runtime state */ - private final static int USER_DEFINED = 4; + private static final int USER_DEFINED = 4; /* Test states */ /** * The constant represents FAILED state. */ - public final static boolean FAILED = false; + public static final boolean FAILED = false; diff --git a/qadevOOo/runner/util/DBTools.java b/qadevOOo/runner/util/DBTools.java index e10a896..46af25a 100644 --- a/qadevOOo/runner/util/DBTools.java +++ b/qadevOOo/runner/util/DBTools.java @@ -44,30 +44,30 @@ public class DBTools { private final XMultiServiceFactory xMSF; private XNamingService dbContext; //JDBC driver - public final static String TST_JDBC_DRIVER = "org.gjt.mm.mysql.Driver"; + public static final String TST_JDBC_DRIVER = "org.gjt.mm.mysql.Driver"; // constants for TestDB table column indexes - public final static int TST_STRING = 1 ; - public final static int TST_INT = 2 ; - private final static int TST_DOUBLE = 5 ; - private final static int TST_DATE = 6 ; - private final static int TST_BOOLEAN = 10 ; - private final static int TST_CHARACTER_STREAM = 11 ; - private final static int TST_BINARY_STREAM = 12 ; + public static final int TST_STRING = 1 ; + public static final int TST_INT = 2 ; + private static final int TST_DOUBLE = 5 ; + private static final int TST_DATE = 6 ; + private static final int TST_BOOLEAN = 10 ; + private static final int TST_CHARACTER_STREAM = 11 ; + private static final int TST_BINARY_STREAM = 12 ; // constants for TestDB columns names - public final static String TST_STRING_F = "_TEXT" ; - public final static String TST_INT_F = "_INT" ; - public final static String TST_DOUBLE_F = "_DOUBLE" ; - public final static String TST_DATE_F = "_DATE" ; - private final static String TST_BOOLEAN_F = "_BOOL" ; - private final static String TST_CHARACTER_STREAM_F = "_MEMO1" ; - public final static String TST_BINARY_STREAM_F = "_MEMO2" ; + public static final String TST_STRING_F = "_TEXT" ; + public static final String TST_INT_F = "_INT" ; + public static final String TST_DOUBLE_F = "_DOUBLE" ; + public static final String TST_DATE_F = "_DATE" ; + private static final String TST_BOOLEAN_F = "_BOOL" ; + private static final String TST_CHARACTER_STREAM_F = "_MEMO1" ; + public static final String TST_BINARY_STREAM_F = "_MEMO2" ; /** * Values for filling test table. */ - public final static Object[][] TST_TABLE_VALUES = new Object[][] { + public static final Object[][] TST_TABLE_VALUES = new Object[][] { {"String1", Integer.valueOf(1), null, null, new Double(1.1), new Date((short) 1,(short) 1, (short) 2001), null, null, null, Boolean.TRUE, null, null}, diff --git a/qadevOOo/testdocs/backend/org/openoffice/JavaSystemBackend.java b/qadevOOo/testdocs/backend/org/openoffice/JavaSystemBackend.java index ab739aeb..734e47c 100644 --- a/qadevOOo/testdocs/backend/org/openoffice/JavaSystemBackend.java +++ b/qadevOOo/testdocs/backend/org/openoffice/JavaSystemBackend.java @@ -36,9 +36,9 @@ import com.sun.star.util.XTimeStamped; public class JavaSystemBackend implements XSingleLayerStratum, XTypeProvider, XServiceInfo, XTimeStamped, XComponent { - public final static String __serviceName = "com.sun.star.configuration.backend.PlatformBackend"; - public final static String __implName = "org.openoffice.JavaSystemBackend"; - public final static String testComponent = "org.openoffice.Office.Common"; + public static final String __serviceName = "com.sun.star.configuration.backend.PlatformBackend"; + public static final String __implName = "org.openoffice.JavaSystemBackend"; + public static final String testComponent = "org.openoffice.Office.Common"; protected static XMultiServiceFactory msf = null; protected XLayer aLayer = null; diff --git a/qadevOOo/tests/java/complex/unoapi/CheckModuleAPI.java b/qadevOOo/tests/java/complex/unoapi/CheckModuleAPI.java index 40e75d4..3662a58 100644 --- a/qadevOOo/tests/java/complex/unoapi/CheckModuleAPI.java +++ b/qadevOOo/tests/java/complex/unoapi/CheckModuleAPI.java @@ -60,7 +60,7 @@ public class CheckModuleAPI extends ComplexTestCase private static String mSRC_ROOT = null; private static boolean mIsInitialized = false; - private final static boolean mContinue = true; + private static final boolean mContinue = true; private static BuildEnvTools bet = null; /** diff --git a/qadevOOo/tests/java/ifc/i18n/_XExtendedIndexEntrySupplier.java b/qadevOOo/tests/java/ifc/i18n/_XExtendedIndexEntrySupplier.java index afb317e..004b014 100644 --- a/qadevOOo/tests/java/ifc/i18n/_XExtendedIndexEntrySupplier.java +++ b/qadevOOo/tests/java/ifc/i18n/_XExtendedIndexEntrySupplier.java @@ -206,7 +206,7 @@ public class _XExtendedIndexEntrySupplier extends MultiMethodTest { * for the "getPhoneticCandidate" test. Euivalents are only usable for zh,CN locale. */ public static class UnicodeStringPair { - final static int valCount = 78; + static final int valCount = 78; static final String[] sStringEquivalence = new String[valCount]; static final char[] iUnicodeEquivalence = new char[valCount]; diff --git a/qadevOOo/tests/java/ifc/reflection/_XIdlReflection.java b/qadevOOo/tests/java/ifc/reflection/_XIdlReflection.java index 09ebb1f..a3c42cc 100644 --- a/qadevOOo/tests/java/ifc/reflection/_XIdlReflection.java +++ b/qadevOOo/tests/java/ifc/reflection/_XIdlReflection.java @@ -34,7 +34,7 @@ import lib.MultiMethodTest; */ public class _XIdlReflection extends MultiMethodTest{ public XIdlReflection oObj = null; - protected final static String typeName = "com.sun.star.container.XNameAccess"; + protected static final String typeName = "com.sun.star.container.XNameAccess"; /** * Test calls the method and checks returned interface diff --git a/qadevOOo/tests/java/ifc/util/_XURLTransformer.java b/qadevOOo/tests/java/ifc/util/_XURLTransformer.java index 3955cb9..2f541d3 100644 --- a/qadevOOo/tests/java/ifc/util/_XURLTransformer.java +++ b/qadevOOo/tests/java/ifc/util/_XURLTransformer.java @@ -40,21 +40,21 @@ public class _XURLTransformer extends MultiMethodTest { URL url; - final static String user = "user"; - final static String invalidUserPrefix = "1"; - final static String password = "password"; - final static String server = "server"; - final static String invalidServerPrefix = "1"; - final static String port = "8080"; - final static String path = "/pub/path"; - final static String name = "file.txt"; - final static String arguments = "a=b"; - final static String mark = "mark"; - - final static String expectedCompleteHTTP = "http://" + static final String user = "user"; + static final String invalidUserPrefix = "1"; + static final String password = "password"; + static final String server = "server"; + static final String invalidServerPrefix = "1"; + static final String port = "8080"; + static final String path = "/pub/path"; + static final String name = "file.txt"; + static final String arguments = "a=b"; + static final String mark = "mark"; + + static final String expectedCompleteHTTP = "http://" + server + ":" + port + path + "/" + name + "?" + arguments + "#" + mark; - final static String expectedCompleteFTP = "ftp://" + static final String expectedCompleteFTP = "ftp://" + user + ":" + password + "@" + server + ":" + port + path + "/" + name; diff --git a/qadevOOo/tests/java/mod/_dbaccess/ORowSet.java b/qadevOOo/tests/java/mod/_dbaccess/ORowSet.java index fe3b94b..95b16e5 100644 --- a/qadevOOo/tests/java/mod/_dbaccess/ORowSet.java +++ b/qadevOOo/tests/java/mod/_dbaccess/ORowSet.java @@ -129,7 +129,7 @@ public class ORowSet extends TestCase { String tableName = null; DataSourceDescriptor srcInf = null; boolean isMySQLDB = false; - protected final static String dbSourceName = "ORowSetDataSource"; + protected static final String dbSourceName = "ORowSetDataSource"; public XConnection m_connection = null; private Object m_rowSet = null; private DataSource m_dataSource; diff --git a/qadevOOo/tests/java/mod/_dbaccess/OSingleSelectQueryComposer.java b/qadevOOo/tests/java/mod/_dbaccess/OSingleSelectQueryComposer.java index 1e3e3f4..4ef5db8 100644 --- a/qadevOOo/tests/java/mod/_dbaccess/OSingleSelectQueryComposer.java +++ b/qadevOOo/tests/java/mod/_dbaccess/OSingleSelectQueryComposer.java @@ -136,7 +136,7 @@ public class OSingleSelectQueryComposer extends TestCase { String tableName = null; DBTools.DataSourceInfo srcInf = null; boolean isMySQLDB = false; - protected final static String dbSourceName = "OSingleSelectQueryComposerDataSource"; + protected static final String dbSourceName = "OSingleSelectQueryComposerDataSource"; public XConnection conn = null; diff --git a/qadevOOo/tests/java/mod/_forms/GenericModelTest.java b/qadevOOo/tests/java/mod/_forms/GenericModelTest.java index 0a0f7b3..71cd60a 100644 --- a/qadevOOo/tests/java/mod/_forms/GenericModelTest.java +++ b/qadevOOo/tests/java/mod/_forms/GenericModelTest.java @@ -129,8 +129,8 @@ public class GenericModelTest extends TestCase { /** * This is the name of the Data Base which the test uses: "APITestDatabase" */ - private final static String m_dbSourceName = "APITestDatabase"; - private final static String m_TestDB = "TestDB"; + private static final String m_dbSourceName = "APITestDatabase"; + private static final String m_TestDB = "TestDB"; private DBTools m_dbTools = null; private boolean m_ConnectionColsed = false; diff --git a/qadevOOo/tests/java/mod/_forms/ODatabaseForm.java b/qadevOOo/tests/java/mod/_forms/ODatabaseForm.java index 72755f0..57dec6c 100644 --- a/qadevOOo/tests/java/mod/_forms/ODatabaseForm.java +++ b/qadevOOo/tests/java/mod/_forms/ODatabaseForm.java @@ -216,7 +216,7 @@ import com.sun.star.view.XControlAccess; * @see ifc.sdbc._RowSet */ public class ODatabaseForm extends TestCase { - protected final static String dbSourceName = "ODatabaseFormDataSource"; + protected static final String dbSourceName = "ODatabaseFormDataSource"; private static int uniqueSuffix = 0; private static String origDB = null; private static String tmpDir = null; ... etc. - the rest is truncated
_______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits