Commit Graph

311 Commits

Author SHA1 Message Date
Noel Grandin
dc53e3027b java: simplify conditions involving logical negation
Change-Id: Ib45e58273e650ef9a31dbdb5f71e995a5976f50e
2014-10-07 13:20:02 +02:00
Robert Antoni Buj i Gelonch
e41597eade scripting: line break (code formatting)
Change-Id: Ib1a8d7e4bdaad2f4eae822d9af280fd5b6f9dd7b
Reviewed-on: https://gerrit.libreoffice.org/11794
Reviewed-by: David Tardon <dtardon@redhat.com>
Tested-by: David Tardon <dtardon@redhat.com>
2014-10-06 14:10:27 +00:00
Robert Antoni Buj i Gelonch
4a0fc2fb02 scripting: organize imports
Change-Id: I26a1164d44f464a44ed7deb93ac39465feb0541c
Reviewed-on: https://gerrit.libreoffice.org/11768
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
2014-10-03 05:25:06 +00:00
Robert Antoni Buj i Gelonch
6f42a71439 scripting: Format_java_code.sh initial run
Conflicts:
	scripting/java/com/sun/star/script/framework/io/UCBStreamHandler.java

Change-Id: I09b94d8c96dfbaf498bd93a0088feb80a9e4afb6
2014-10-02 15:25:29 +02:00
Noel Grandin
77650bcc64 fix more Java1.5 incompatibility
Change-Id: I9d750f525fe73d59c150b322401418dfbd0822dd
2014-09-29 12:01:11 +02:00
Noel Grandin
83636d2c09 java: when rethrowing exceptions, store the original cause
so that we get a nice complete stacktrace when it hits the final
handler

Change-Id: Iec4fcc15a2a25c55f591b5e069dce3d010197a90
2014-09-25 13:47:25 +02:00
Stephan Bergmann
27d5b5c6dd BRAND_BIN_SUBDIR -> BRAND_INI_DIR, to cater for new Mac OS X layout
Change-Id: Ic367545895a25a4cf6e95fc1be2f5db9f36a221b
2014-09-17 11:45:14 +02:00
Stephan Bergmann
31c379041c ScriptProvider implementations need to be accessible
...from com.sun.star.comp.loader.FactoryHelper.  Regression introduced with
70f56bc22f "java: reduce scope, make member
classes private."

Change-Id: Iabf41a5eca2df25408e90428c60736b4a73db4c3
2014-09-16 12:57:50 +02:00
rbuj
f93ce4f7eb scripting: decode(String) in URLDecoder has been deprecated
http://docs.oracle.com/javase/1.5.0/docs/api/java/net/URLDecoder.html#decode(java.lang.String)

Change-Id: I71ecb498c93d5e8d6959bdc3ab263a5ff48c1c21
Reviewed-on: https://gerrit.libreoffice.org/11453
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
2014-09-16 06:16:49 +00:00
rbuj
1ebbb8bceb scripting: Uncaught Exception
Change-Id: I949aa58416dbd80d87c9455009258f7bd2fd8520
Reviewed-on: https://gerrit.libreoffice.org/11439
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
2014-09-14 06:45:26 +00:00
rbuj
44304a8147 scripting: replace StringBuffer with StringBuilder method
In JDK 1.3, StringBuffer makes the String concatenations faster.

public String concat(String s1, String s2) {
  StringBuffer sb = new StringBuffer();
  sb.append(s1);
  sb.append(s2);
  return sb.toString();
}

JDK 1.5 comes with StringBuilder (which is faster than StringBuffer) and the method:

public String concat(String s1, String s2) {
  return s1 + s2;
}

is translated to:

public String concat(String s1, String s2) {
  return new StringBuilder().append(s1).append(s2).toString();
}

Change-Id: I2924fcdf23d7ffbb567d9e924d02edcab4d21be6
NOTE: StringBuffer is synchronized, StringBuilder is not.
Reviewed-on: https://gerrit.libreoffice.org/11436
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
2014-09-14 06:33:05 +00:00
rbuj
40f1849e0f scripting: encode(String) in URLEncoder has been deprecated
http://docs.oracle.com/javase/1.5.0/docs/api/java/net/URLEncoder.html

Change-Id: I9d9b40ecf0d76618376975c52e5d9f27ec4bae8e
Reviewed-on: https://gerrit.libreoffice.org/11438
Reviewed-by: Thomas Arnhold <thomas@arnhold.org>
Tested-by: Thomas Arnhold <thomas@arnhold.org>
2014-09-13 23:18:14 +00:00
rbuj
a28ad55a30 scripting: [deprecation] show() in Window has been deprecated
Change-Id: I1c157ebbfa0c307fd92c0a2d26e7d530be8ea9da
Reviewed-on: https://gerrit.libreoffice.org/11437
Reviewed-by: Thomas Arnhold <thomas@arnhold.org>
Tested-by: Thomas Arnhold <thomas@arnhold.org>
2014-09-13 23:04:57 +00:00
rbuj
fafb0db5d2 scripting: use String.length()==0 instead of String.equals(empty string)
Change-Id: Icff6a5d19aaf7ac7ebb0cd54140bd388cba0f24d
Reviewed-on: https://gerrit.libreoffice.org/11431
Reviewed-by: David Tardon <dtardon@redhat.com>
Tested-by: David Tardon <dtardon@redhat.com>
2014-09-13 15:09:44 +00:00
rbuj
8171113420 scripting: use a character literal
Change-Id: Iabd3514f3c64ff851463cb9b2c1c425164285eb5
Reviewed-on: https://gerrit.libreoffice.org/11430
Reviewed-by: David Tardon <dtardon@redhat.com>
Tested-by: David Tardon <dtardon@redhat.com>
2014-09-13 15:05:45 +00:00
rbuj
e41cc6898a scripting: Enhanced For-Loops
Change-Id: Ib5e59a8c153e7d788c14153fa3b94c8b2d0a068c
Reviewed-on: https://gerrit.libreoffice.org/11292
Reviewed-by: David Tardon <dtardon@redhat.com>
Tested-by: David Tardon <dtardon@redhat.com>
2014-09-13 15:03:32 +00:00
rbuj
b50fedfc34 scripting: avoid a possible NullPointerException
Change-Id: I90589bc042f4b88b700e9f3c167c460c3cff043c
Reviewed-on: https://gerrit.libreoffice.org/11311
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
2014-09-11 06:13:40 +00:00
rbuj
0876cc15fc scripting: fix array copy and, use System.arraycopy
Change-Id: If8addcc5d95f610ade404e62e4a2a775319e9ff3
Reviewed-on: https://gerrit.libreoffice.org/11354
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
2014-09-10 08:10:03 +00:00
rbuj
3bb05281cb scripting: if...else if...else Statement
Change-Id: Ia60b352b4cb52d2712b2499550859ece699341d1
Reviewed-on: https://gerrit.libreoffice.org/11322
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
2014-09-08 03:30:06 -05:00
rbuj
1fba1feac4 scripting: the assigned value is never used
Change-Id: I61dcf285ecc6d0affdb949ca03d686f96601d884
Reviewed-on: https://gerrit.libreoffice.org/11319
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
2014-09-08 03:29:11 -05:00
rbuj
4d6bd06c33 scripting: there isn't any benefit by reducing the scope here.
Change-Id: I73ebfac7b44d3fba7da70788784492fa3c53c572
Reviewed-on: https://gerrit.libreoffice.org/11312
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
2014-09-07 13:01:56 -05:00
rbuj
4464ada02f scripting: fix javadoc error: reference not found
Change-Id: Ife7bbd704211dd289b6066d541bd4ae0a1788ebf
Reviewed-on: https://gerrit.libreoffice.org/11307
Reviewed-by: Norbert Thiebaud <nthiebaud@gmail.com>
Tested-by: Norbert Thiebaud <nthiebaud@gmail.com>
2014-09-06 15:49:09 -05:00
rbuj
c562a0b58d scripting: remove import from the same package
Change-Id: If3a07e81f5d738395d6718302512c0172b90d977
Reviewed-on: https://gerrit.libreoffice.org/11285
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
2014-09-05 02:30:53 -05:00
rbuj
015d65c7ea scripting: use contains to check if a string contains a substring
Change-Id: I7cbd32310e362f43f0a456e45b58930eb5453f0c
Reviewed-on: https://gerrit.libreoffice.org/11289
Reviewed-by: Thomas Arnhold <thomas@arnhold.org>
Tested-by: Thomas Arnhold <thomas@arnhold.org>
2014-09-04 20:36:09 -05:00
rbuj
a795c3660b scripting: the if statement is redundant
Change-Id: I7e61d740d6f58afbcdad630deb0de0ef548efcfb
Reviewed-on: https://gerrit.libreoffice.org/11288
Reviewed-by: Thomas Arnhold <thomas@arnhold.org>
Tested-by: Thomas Arnhold <thomas@arnhold.org>
2014-09-04 20:34:16 -05:00
rbuj
652b807658 scripting: the assigned value is never used
Change-Id: I430da93e985291300ac5fdaccc7f907535771a07
Reviewed-on: https://gerrit.libreoffice.org/11287
Reviewed-by: Thomas Arnhold <thomas@arnhold.org>
Tested-by: Thomas Arnhold <thomas@arnhold.org>
2014-09-04 20:31:50 -05:00
rbuj
908ccc22d8 scripting: fix javadoc error: unknown tag: null
Change-Id: I7d9ec1759a1689943d51636926024278cec0dc3b
Reviewed-on: https://gerrit.libreoffice.org/11234
Reviewed-by: David Tardon <dtardon@redhat.com>
Tested-by: David Tardon <dtardon@redhat.com>
2014-09-02 06:11:11 -05:00
rbuj
b1492e6af1 scripting: fix javadoc error: unknown tag: returns
Change-Id: Ib257ad76b2571755bdb744ad128ba1e558207eee
Reviewed-on: https://gerrit.libreoffice.org/11233
Reviewed-by: Thomas Arnhold <thomas@arnhold.org>
Tested-by: Thomas Arnhold <thomas@arnhold.org>
2014-09-02 02:05:52 -05:00
Noel Grandin
609f7b8503 remove do-nothing code
Change-Id: I101cc3be44f029f7353e8d40823c0d6b2bd761b3
2014-08-20 12:12:27 +02:00
Noel Grandin
8c9fdc4a96 java: remove modifiers implied by the context
found by PMD

Change-Id: I04cbf986ddbcffff987784f381b8a9f52f1b3f31
2014-08-20 11:45:28 +02:00
Noel Grandin
60f152caee java: avoid unnecessary comparisons in boolean expressions
i.e. stuff like "x == true"

Change-Id: Ib82a4a30e736df392405332fa197b588482cffcf
2014-08-20 10:35:53 +02:00
Noel Grandin
252ed1708a double-checked locking is not thread-safe in Java
found by PMD

Change-Id: Ibd4a9139c626932bec56c0b1dd32b4d59c8440b1
2014-08-20 10:35:51 +02:00
Noel Grandin
4b4bff3402 java: no need to instantiate String objects directly
Change-Id: I7610774c94bf673ed3b574ffce04c4ee6ca93c03
2014-08-19 14:57:18 +02:00
Noel Grandin
ff0ad0493e java: use 'Integer.valueOf' instead of 'new Integer'
Change-Id: Ia8befb8d69914ce971174fc5f2ffc0e2f506a940
2014-08-19 14:57:17 +02:00
Noel Grandin
3a8d351988 java: remove unused methods
Change-Id: Ibb905e6f3e7d92a0e558f1f6562e5b472cd2717b
2014-08-19 14:57:13 +02:00
Noel Grandin
0c8c3a536b fix java1.5 build compatibility
accidentally introduced by me in commit 0477e6c3 "java: add
@Override annotation to overriding methods"

Change-Id: Ieccd78f57282778a5e8f805f7a40f5e6a24e9498
2014-08-19 10:21:22 +02:00
Noel Grandin
0d916bb240 java: remove unused imports
Change-Id: Ic60b30141fd1dc61acfb97b811aec680a2ab9c22
2014-08-14 10:59:49 +02:00
Noel Grandin
ac5954d7c5 java: remove commented out code
Change-Id: I05c907a38b562231e968c17f14e09ef80e0a6ed1
2014-08-14 10:59:48 +02:00
Noel Grandin
34bcf9b498 java: remove dead methods
found by UCDetector

Change-Id: I219caa8e680dba5a395541a778df6144841c4dde
2014-08-13 10:24:10 +02:00
Noel Grandin
8583da1e93 java: remove unused fields
found by UCDetector

Change-Id: I4a7c56a9918054c23469de5680658e7b501f0165
2014-08-13 08:49:24 +02:00
Noel Grandin
68cd011c90 java: reduce scope, make some methods private
found by UCDetector

Change-Id: Ib1425edde146193a65c242dc159b7e3fbf0e4a2e
2014-08-13 08:49:23 +02:00
Noel Grandin
70f56bc22f java: reduce scope, make member classes private
found by UCDetector

Change-Id: Ief32d078090102b14b60b35fc36542f8d4fb252b
2014-08-13 08:49:23 +02:00
Noel Grandin
da677dfd59 java: reduce scope, make fields private
found by UCDetector

Change-Id: I7f97e15667159cf8ee776e8f32fdcdec8ec00ed6
2014-08-13 08:49:22 +02:00
Noel Grandin
14d1a11ec4 java: reduce scope, make constructors private
found by UCDetector

Change-Id: If05277fd2fe77ceabb4c7c87aeb8569e3406102d
2014-08-13 08:49:22 +02:00
Noel Grandin
e701b3f732 java: reduce scope, make constants private
found by UCDetector

Change-Id: Ide9975e361ed17ac8cdcbe67ba74c563a9392d57
2014-08-12 12:16:37 +02:00
Noel Grandin
5656fe58a0 java: fix broken javadoc tags
Change-Id: I43d25ba49b758739ee8dc891b0db3e527004ec8b
2014-08-12 09:41:31 +02:00
Noel Grandin
1c496506bc java: remove useless javadoc tags
that are not conveying any useful information

Change-Id: Ic37934b8cc376fcdcb3d295232452f411dfd43b1
2014-08-12 09:41:31 +02:00
Noel Grandin
0477e6c39b java: add @Override annotation to overriding methods
Change-Id: I086964c6f6ce52c60c52b6dbc445d3c21d22c80a
2014-08-12 09:41:28 +02:00
Noel Grandin
d5a31b2215 java: remove unused parameters
Change-Id: Ifc44c51ddbd21fabaad686bc3d38e2dab54d97aa
2014-08-11 12:33:02 +02:00
Noel Grandin
41709cc268 java: remove unused parameters
Change-Id: I47c618117e079bb2ef90d92c449c8166ea957fa5
2014-08-11 12:33:02 +02:00