Skip to content
This repository was archived by the owner on Apr 15, 2023. It is now read-only.

Commit 20c7cb7

Browse files
Java 1.8
Install dependencies for travis
1 parent 0c6c748 commit 20c7cb7

File tree

4 files changed

+21
-10
lines changed

4 files changed

+21
-10
lines changed

.travis.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
language: java
22

33
before_install:
4+
- ./install_dependencies.sh
45
- "export DISPLAY=:99.0"
56
- "sh -e /etc/init.d/xvfb start"
67

@@ -14,6 +15,7 @@ notifications:
1415
branches:
1516
only:
1617
- master
18+
- develop
1719

1820
after_success:
1921
- mvn clean cobertura:cobertura coveralls:report

example/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323
<artifactId>maven-compiler-plugin</artifactId>
2424
<version>3.1</version>
2525
<configuration>
26-
<source>1.7</source>
27-
<target>1.7</target>
26+
<source>1.8</source>
27+
<target>1.8</target>
2828
</configuration>
2929
</plugin>
3030
</plugins>

install_dependencies.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/usr/bin/env bash
2+
set -e
3+
4+
sdk_project="tagmycode-java-sdk"
5+
branch=$(git branch | grep \* | cut -d ' ' -f2)
6+
7+
rm -fr ${sdk_project}
8+
9+
echo "Installing ${sdk_project}, branch ${branch}"
10+
11+
git clone https://github.com/massimozappino/${sdk_project}.git
12+
cd ${sdk_project}
13+
git checkout ${branch}
14+
mvn install -DskipTests

src/main/java/com/tagmycode/plugin/gui/form/PropertiesForm.java

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import com.tagmycode.sdk.model.Snippet;
88

99
import javax.swing.*;
10-
import java.io.UnsupportedEncodingException;
10+
import java.nio.charset.StandardCharsets;
1111
import java.text.DateFormat;
1212
import java.util.Date;
1313
import java.util.Locale;
@@ -25,7 +25,7 @@ public class PropertiesForm extends Windowable {
2525
private JCheckBox synchronizedCheckBox;
2626
private Snippet snippet;
2727

28-
public PropertiesForm(Framework framework, Snippet snippet) {
28+
PropertiesForm(Framework framework, Snippet snippet) {
2929
super(framework, framework.getParentFrame());
3030
this.snippet = snippet;
3131
defaultInitWindow();
@@ -40,15 +40,10 @@ private void populateFields() {
4040
createdAtTextField.setText(dateAndTime(snippet.getCreationDate()));
4141
modifiedAtTextField.setText(dateAndTime(snippet.getUpdateDate()));
4242
snippetUrlTextField.setText(snippet.getUrl());
43-
int bytes = 0;
44-
try {
45-
bytes = snippet.getCode().getBytes("UTF-8").length;
46-
} catch (UnsupportedEncodingException ignored) {
47-
}
43+
int bytes = snippet.getCode().getBytes(StandardCharsets.UTF_8).length;
4844
codeSizeTextField.setText(FileSize.toHumanReadable(bytes));
4945
privateCheckBox.setSelected(snippet.isPrivate());
5046
synchronizedCheckBox.setSelected(!snippet.isDirty());
51-
5247
}
5348

5449
private String dateAndTime(Date date) {

0 commit comments

Comments
 (0)