Commit Graph

724 Commits

Author SHA1 Message Date
Daniel Gredler 1f2c736564 Unsafe public fields in UpdateInterface class: make public fields final
This commit makes the UpdateInterface class immutable. The Config -> UpdateInterface initialization is moved to the UpdateInterface constructor. Default values for the fields are moved to the constructor as well. Instances of String[] are changed to List<String> and made immutable. Instances of java.awt.Rectangle (which is mutable) are replaced with a new immutable com.threerings.getdown.util.Rectangle class.

Although java.awt.Color is (sort of) immutable, it was also removed and replaced with a new immutable com.threerings.getdown.util.Color class, since it was the last dependency from the getdown core module to anything in the java.awt package, which means that when we migrate to Java 9+ the core module should no longer require a dependency on the java.desktop module.

The assertions and expected values in ColorTest have been verified against the corresponding java.awt.Color values.

(Triggered by internal security audit and Fortify analysis.)
2018-09-05 17:07:58 -04:00
Michael Bayne 31c8315c1f Ignore target dirs in submodules. 2018-09-05 13:26:13 -07:00
Michael Bayne be5490dce7 Merged the tools module into core.
It wasn't actually providing any value. Neither tools nor core have any special
dependencies. The code in tools operates on the same files, formats and data
structures that core/runtime code operates on. It is simpler to have them in
the same module.
2018-09-04 16:06:37 -07:00
Michael Bayne 97ec8632ae Eliminate samskivert dependency in core.
I've long wanted to do this, but the launcher's use of all the samskivert UI
stuff made it onerous. Now that the launcher is a separate module, we can
remove the samskivert dependency in core (and tools), which simplifies things
and makes it easier to depend on core in a (future) self-updating app (when we
add support for that).
2018-09-04 13:54:40 -07:00
Michael Bayne 852d15a033 Change groupId to com.threerings.getdown.
I don't want to pollute the com.threerings top-level namespace with a bunch of
getdown-foo artifacts, and grouping everything under the top-level project
name, even when that name is repeated for all the artifacts is fairly standard
practice.
2018-09-04 12:36:48 -07:00
Michael Bayne a21657d6d0 Target 1.8-SNAPSHOT.
The new multi-module Getdown will be 1.8.
2018-09-04 12:33:38 -07:00
Michael Bayne 2cb99ed04d Use existing utility method.
This also avoids the weird old structure that closed an auto-closed input
stream inside the try-with-resources block.
2018-09-04 12:31:46 -07:00
Michael Bayne 8195460ee2 Remove obsolete Applet code. 2018-09-04 12:31:46 -07:00
Michael Bayne 4c383f99c7 Split Getdown into multiple (Maven) modules.
- core: the main Getdown logic code
- tools: code to create digest.txt & patch files
- launcher: the standalone launcher/updater app
- ant: the Ant task for creating digest.txt files

This paves the way for a proper Jigsaw-ification of the Getdown code.

I may further factor code out of getdown-launcher and into getdown-core to
enable the use-case where an app embeds Getdown completely and does not use the
launcher app/UI. That will also make it easier to create a JavaFX UI and retire
the old Swing UI.

This also moves the obsolete applet code into a separate applet module, which
is merely a temporary holding area. It will be deleted in the next commit.
2018-09-04 12:31:46 -07:00
Michael Bayne 8ff9bf4d68 Merge pull request #127 from sdgx/readme-version-info
Fix version info in README file
2018-09-04 08:44:54 -07:00
Michael Bayne 9b2f2364ca Merge pull request #128 from sdgx/locale-dependent-comparison
Use ROOT locale when lowercasing strings
2018-09-04 08:44:31 -07:00
Michael Bayne 1a7976281e Merge pull request #129 from sdgx/final-constants
Constants should be final
2018-09-04 08:43:05 -07:00
Michael Bayne e93ae413ca Merge pull request #130 from sdgx/file-delete-unchecked-return-value
Eliminate unchecked file.delete() return values
2018-09-04 08:41:37 -07:00
Daniel Gredler 15ea50dc55 Eliminate unchecked file.delete() return values, standardize the way files are deleted.
Ignoring a method's return value can cause the program to overlook unexpected states and conditions.
2018-08-31 14:04:00 -04:00
Daniel Gredler 9cd0c893ad Use ROOT locale when lowercasing strings, for consist results regardless of system locale 2018-08-30 18:07:39 -04:00
Daniel Gredler 010b9395c3 Constants should be final 2018-08-30 17:52:14 -04:00
Daniel Gredler 6b656869e7 Fix version info in README file 2018-08-30 17:49:30 -04:00
Michael Bayne d1d3102a97 Merge pull request #121 from sdgx/reliance-on-default-encoding
Reliance on default encoding
2018-08-30 14:13:11 -07:00
Michael Bayne 831a5e8b21 Merge pull request #122 from sdgx/weak-security-manager-check
Make security check method final
2018-08-30 14:10:43 -07:00
Michael Bayne 8988aa82b4 Some alternatives to/for null checking. 2018-08-30 14:09:24 -07:00
Michael Bayne 038b8351ac Merge pull request #124 from sdgx/missing-check-against-null
Add missing checks against null
2018-08-30 14:03:01 -07:00
Michael Bayne a2655c741a Formatting tweaks. 2018-08-30 13:55:21 -07:00
Michael Bayne 8f24ce4cc4 Merge pull request #125 from sdgx/missing-environment-variable
Missing environment variable handled incorrectly
2018-08-30 13:54:24 -07:00
Michael Bayne f33527284f Merge pull request #126 from sdgx/incompatible-bit-masks
Bitmasks using wrong operator? ("anything | 1 != 0" is always true)
2018-08-30 13:51:07 -07:00
Daniel Gredler ad6a08cdd3 Bitmasks seem to be using wrong operator ("anything | 1 != 0" is always true)
Note return value check was changed from != to == based on JavaDoc for return value and logic in overridden method in superclass.
2018-08-30 15:52:11 -04:00
Daniel Gredler 46f6814952 Missing environment variable handled incorrectly (mixup between varName and varValue) 2018-08-30 15:34:18 -04:00
Daniel Gredler d4050793b4 Add missing checks against null.
The program can dereference a null pointer because it does not check the return value of a function that might return
null.
2018-08-30 15:24:41 -04:00
Daniel Gredler 418fda3c8f Add missing checks against null.
The program can dereference a null pointer because it does not check the return value of a function that might return
null.
2018-08-30 15:10:39 -04:00
Daniel Gredler de1106e690 Make security check method final.
Non-final methods that perform security checks may be overridden in ways that bypass security checks.
2018-08-29 14:33:41 -04:00
Daniel Gredler 868144a630 Don't rely on platform default encoding, which can lead to inconsistent results on different platforms 2018-08-28 15:27:38 -04:00
Daniel Gredler cd76ed6be9 Use correct IO resource to read signature file 2018-08-28 15:24:44 -04:00
Daniel Gredler 2bef709cfd Be explicit about charset when calling String.getBytes() 2018-08-28 15:07:02 -04:00
Daniel Gredler 0a89e31cde Use standard charset constants whenever possible 2018-08-27 15:10:53 -04:00
Michael Bayne cdde1c773c Reel in the verbosity a bit.
Other than to disambiguate for the compiler, I don't think clarity is enhanced
with twenty plus individual imports from the most commonly used packages in the
JDK (java.io + java.util). We all know where HashMap and InputStream are
defined.

Also some of the try-with-resources expanded multiple stream wrappers into
individual declarations. This doesn't make things any safer, close one and
you've closed them all. I reverted them to their more compact form.
2018-08-27 10:56:26 -07:00
Michael Bayne 1c11ddf7f3 Merge pull request #119 from sdgx/close-resources
Use try-with-resources
2018-08-27 10:38:39 -07:00
Daniel Gredler a083f32ce0 Add a few more try-with-resources 2018-08-24 12:11:06 -04:00
Daniel Gredler 44ae6d99d0 Use try-with-resources: in some cases, resources were not always being released; in others, behavior was correct and we are just simplifying code 2018-08-24 11:28:26 -04:00
Michael Bayne 07412a792a Remove depend on commons-codec.
We'll use the Base64 class from Classpath/Android instead. One less moving
part.
2018-08-22 13:36:39 -07:00
Michael Bayne 83b316ab58 Fall back to main class if no app-specific class. 2018-08-22 08:21:04 -07:00
Michael Bayne 4e14def623 Truthier doc comment. 2018-08-09 12:27:23 -07:00
Michael Bayne 852bba52b1 Made ConfigUtil into a Config object that wraps the data.
This allows all of the config parsing helpers to live with Config.
2018-08-09 12:21:13 -07:00
Michael Bayne 45dc04c5a7 Added ui.min_show_seconds config.
This defines the minimum amount of time for which the UI will be shown before
automatically hiding itself. It defaults to 5 seconds (the old hard coded
value), which was chosen to ensure that users did not see a random window flash
up on the screen and then immediately disappear before they could see what it
was or meant, thereby confusing them.
2018-08-09 11:26:35 -07:00
Michael Bayne d1992a5b9d Added support for marking resources as executable. 2018-08-08 11:21:17 -07:00
Michael Bayne 4c7fa5c87b Merge pull request #111 from kac-/kac-antscript0
fix dead maven-ant-tasks binaries url
2018-08-07 09:55:04 -07:00
kac- a910c5b88f fix dead maven-ant-tasks binaries url 2018-08-06 21:16:48 +02:00
Michael Bayne 2b18ac283c Merge pull request #106 from ThomasGAI/patch-1
change "game" occurrences to "app" in messages_de
2018-07-26 08:52:33 -07:00
Michael Bayne a886bcac14 Don't encode the tracking URL, only the event & args. 2018-07-26 08:45:35 -07:00
ThomasGAI f72c937842 change "game" occurrences to "app" in messages_de
Changed "Spiel" to "Anwendung" in messages_de.properties for more common usage
2018-07-25 10:45:18 +02:00
Michael Bayne fa696c8999 Avoid calling the launched app a game. 2018-07-06 06:15:49 -07:00
Michael Bayne 3e9de69e73 [maven-release-plugin] prepare for next development iteration 2018-06-06 14:41:03 -07:00