Commit Graph

336 Commits

Author SHA1 Message Date
1101ae6772 Typo: deleteing->deleting
Change-Id: I2bdde7524a97039c94a8da5ac5d2eba38c91d71a
2015-02-21 10:56:21 +01:00
f1f6edaae1 Make LogUtils.getTrace actually work
Change-Id: I59e2b93ed1142bac22ead08cc101e27cfa3e02df
2015-02-16 11:27:14 +01:00
3336a5071b rhbz#1192732: Revert "From the context of the code, this field should...
...not be static."  This reverts commit
6d4c1f0d4a623bf7f3b3a0af2ece5c969d5aec77.  Whatever made the author of that
commit think rhinoWindow shouldn't be static, it clearly needs to be, as in
edit()'s Runnable.run(), the usage of rhinoWindow at the end relies on
rhinoWindow being set via the

  new ScriptEditorForJavaScript(context, url)

call to initUI() (or else rhinoWindow already being set from a previous such
call if already editor != null).
2015-02-16 10:45:50 +01:00
b55ef81671 typo: langugage -> language
Change-Id: Ifabd5a7851946b3e4109e22e6e9a1ff34575c1e5
2015-01-23 15:01:37 +01:00
3ab2d3a2c5 fdo#88256 fix crash when running javascript macro
caused by my commit 8583da1e934a49791ef8d86668f3d5c3c5dae1d7
"java: remove unused fields"

Change-Id: Ibcd6462e8229a0a6cb98ebfd16ce5d2ea45ca931
2015-01-13 10:38:48 +02:00
e92d3e9007 java: scripting: fix bug in removing model from map
found by PMD

Change-Id: I4bd35dd30f6c77aad96932216d8459b812004a88
2014-12-19 10:41:54 +02:00
08ece8d873 java: revert part of commit, scripting/ is public API
revert part of my commit
7557f23b31dcfb4d86c122bb34d9675c0db9a694
"java: reduce visibility of fields and methods"

Change-Id: I2049a154b60b165d4d2217495935442d6da66e97
2014-12-11 15:20:09 +02:00
7557f23b31 java: reduce visibility of fields and methods
found by PMD

Change-Id: Id6737916b68ccbdbdeec5d314747a38410923ac6
Reviewed-on: https://gerrit.libreoffice.org/13409
Tested-by: LibreOffice gerrit bot <gerrit@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2014-12-11 06:09:03 +00:00
7d812b09b5 java: unused imports
Change-Id: I05824a6f19a5f3048a52101b96f6bf3d3099df08
Reviewed-on: https://gerrit.libreoffice.org/13403
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
2014-12-10 08:03:50 +00:00
c199b76d88 java: remove some unused local variables
Change-Id: Ia01528460e2f4b610d123e29cad66520abc6a965
2014-12-05 11:15:57 +02:00
db203e59d6 java: remove some unused fields
Change-Id: I1b6fb6b47439c448ac31983702772e2115c70d56
2014-12-05 11:15:56 +02:00
58eab57648 java: final fields that can be static
found by PMD

Change-Id: I2b48f35d252d6e914c2a18a2c175b075a9d3ac0f
Reviewed-on: https://gerrit.libreoffice.org/13099
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
2014-11-25 06:06:48 +00:00
0063cf2856 java: make fields final where possible
found by PMD

Change-Id: I87780366119c141cd2dafe6ca1bf2d9798b10aec
2014-11-18 12:44:28 +02:00
bb437029c1 java: convert fields to local variables where possible
found by PMD

Change-Id: I05b45382b8fb1b734657ce9421a20e6ef6fbe542
Reviewed-on: https://gerrit.libreoffice.org/12376
Tested-by: LibreOffice gerrit bot <gerrit@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2014-11-12 11:03:29 +00:00
36ff1527c9 java: reduce excessive code indentation levels
by using early return in some methods

Change-Id: I3611c8c89b3a94ef7e1772d178acf065fd7fcdc7
Reviewed-on: https://gerrit.libreoffice.org/12374
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
2014-11-12 08:01:55 +00:00
2a0569b53d scripting: redundant cast to String
Change-Id: I5e048964cc7885a32c59ff8a9eb1fc5b9523e843
Reviewed-on: https://gerrit.libreoffice.org/11859
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
2014-10-19 10:12:55 +00:00
93056481e8 java: when rethrowing exceptions, store the original
Change-Id: I8a2a264597d0b1ae06b08136fea36003682380b5
2014-10-17 08:26:22 +02:00
03c7c26cbe java: final fields that can be static
Change-Id: I8c06be7bc0b8a38c662209f0de72a00550e25447
2014-10-17 08:26:21 +02:00
12b01b920f java: no need to call String.valueOf to append to a String
Change-Id: I5ef45b971d24dde814ab8cbb2e9503d9da4f0d73
2014-10-17 08:26:19 +02:00
b2f69f6264 java: when rethrowing, store the original exception
Change-Id: I14666493e72da177fcfff1895ef3206f0e13cc01
2014-10-16 12:27:14 +02:00
fa22664be2 java: always use braces for while loops
Change-Id: Iff896b0cace8b8305528b3b0140004ea856169ce
2014-10-16 08:15:52 +02:00
0fdba36ab6 scripting: replace '.size() == 0' with '.isEmpty()' (collections)
http://docs.oracle.com/javase/1.5.0/docs/api/java/util/Map.html#isEmpty()
http://docs.oracle.com/javase/1.5.0/docs/api/java/util/ArrayList.html#isEmpty()

Change-Id: I76d8d8be2794655cb27ab121759494d7084b4744
Reviewed-on: https://gerrit.libreoffice.org/11967
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
2014-10-14 12:29:02 +00:00
791ed2c654 scripting: use new exception constructors
Change-Id: I7eeece85d4e462bf2df010ee29c062941a677759
Reviewed-on: https://gerrit.libreoffice.org/11966
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
2014-10-14 12:28:37 +00:00
b862f6e923 scripting: Null pointer dereference
Change-Id: I0d72ef34945065f68e9af8b0957dc440a74c14ce
Reviewed-on: https://gerrit.libreoffice.org/11923
Reviewed-by: Matthew Francis <mjay.francis@gmail.com>
Tested-by: Matthew Francis <mjay.francis@gmail.com>
2014-10-13 17:18:54 +00:00
68fa141097 java: use isEmpty() instead of "size() == 0"
Change-Id: I23e1038246999b0744d8e9ae83b66fa1f7dafa99
2014-10-07 13:20:03 +02:00
dc53e3027b java: simplify conditions involving logical negation
Change-Id: Ib45e58273e650ef9a31dbdb5f71e995a5976f50e
2014-10-07 13:20:02 +02:00
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
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
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
77650bcc64 fix more Java1.5 incompatibility
Change-Id: I9d750f525fe73d59c150b322401418dfbd0822dd
2014-09-29 12:01:11 +02:00
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
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
31c379041c ScriptProvider implementations need to be accessible
...from com.sun.star.comp.loader.FactoryHelper.  Regression introduced with
70f56bc22fe952c75ec714e05e1bb5296491a36a "java: reduce scope, make member
classes private."

Change-Id: Iabf41a5eca2df25408e90428c60736b4a73db4c3
2014-09-16 12:57:50 +02:00
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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