Skip to content

Commit 3c1c090

Browse files
committed
minor code-style changes
1 parent 37bcb16 commit 3c1c090

File tree

6 files changed

+12
-23
lines changed

6 files changed

+12
-23
lines changed

Hightail/src/org/hightail/SupportedSites.java

+6-7
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@
33
import java.io.IOException;
44
import java.net.HttpURLConnection;
55
import java.net.URL;
6-
import javax.net.ssl.HttpsURLConnection;
7-
import javax.xml.ws.ProtocolException;
8-
import static org.hightail.SupportedSites.values;
96
import org.hightail.parsers.contest.*;
107
import org.hightail.parsers.task.*;
118
import org.hightail.util.XTrustProvider;
@@ -23,8 +20,7 @@ public enum SupportedSites {
2320
Jutge (
2421
"jutge",
2522
new JutgeTaskParser(),
26-
new JutgeContestParser()
27-
)
23+
new JutgeContestParser())
2824
;
2925

3026
private TaskParser taskParser;
@@ -43,8 +39,11 @@ public String getDirectory() {
4339

4440
private static void verifyURL(String url) throws ParserException {
4541
try {
46-
if(url.contains("jutge."))
42+
if (url.contains("jutge.")) {
43+
// workaround to cope with the SSL cerificate problem on Jutge
44+
// this is needed also for the task parser itself to work (this method gets called before the task parser)
4745
XTrustProvider.install();
46+
}
4847
URL u = new URL(url);
4948
HttpURLConnection conn = (HttpURLConnection) u.openConnection();
5049
conn.setRequestMethod("GET");
@@ -53,7 +52,7 @@ private static void verifyURL(String url) throws ParserException {
5352
if (code != 200) {
5453
throw new ParserException("Incorrect URL.");
5554
}
56-
}catch (IOException ex) {
55+
} catch (IOException ex) {
5756
throw new ParserException("Malformed URL.");
5857
}
5958
}

Hightail/src/org/hightail/parsers/contest/JutgeContestParser.java

+1-11
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,8 @@
11
package org.hightail.parsers.contest;
22

33
import java.util.ArrayList;
4-
import java.util.Collections;
5-
import java.util.HashSet;
6-
import java.util.Set;
74
import org.hightail.Problem;
8-
import org.hightail.parsers.task.JutgeTaskParser;
9-
import org.hightail.parsers.task.TaskParser;
10-
import org.htmlparser.Node;
11-
import org.htmlparser.Parser;
12-
import org.htmlparser.filters.LinkRegexFilter;
13-
import org.htmlparser.tags.LinkTag;
145
import org.htmlparser.util.ParserException;
15-
import org.htmlparser.visitors.TagFindingVisitor;
166

177
/**
188
* Jutge (UPC local online judge) contest parser.
@@ -27,7 +17,7 @@ Problem lists (which can be interpreted as contests) are only available if you a
2717
Also, it doesn't make much sense here since most problems are public and they are usually solved
2818
one by one in pratice.
2919
*/
30-
throw new ParserException("Parsing failed.");
20+
throw new ParserException("Contest parser for Jutge is not implemented.");
3121
}
3222

3323
@Override

Hightail/src/org/hightail/parsers/task/JutgeTaskParser.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,9 @@ private ArrayList<String> extractInputsOrOutputs (FilterBean fb, boolean isInput
8787
as output. I hope that there is no problem which has "/pre" as output.
8888
*/
8989
for(int i=0; i<inputs.size(); ++i) {
90-
if(inputs.get(i).equals("/pre"))
90+
if(inputs.get(i).equals("/pre")) {
9191
inputs.set(i,"");
92+
}
9293
}
9394
return inputs;
9495
}

Hightail/src/org/hightail/ui/ProblemJPanel.form

+1-1
Original file line numberDiff line numberDiff line change
@@ -95,12 +95,12 @@
9595
<Component id="saveTestsButton" alignment="3" max="32767" attributes="0"/>
9696
<Component id="copyInputButton" alignment="3" max="32767" attributes="0"/>
9797
</Group>
98-
<Component id="deleteTestcaseButton" alignment="0" max="32767" attributes="0"/>
9998
<Component id="editTestcaseButton" alignment="0" max="32767" attributes="0"/>
10099
<Component id="newTestcaseButton" alignment="0" max="32767" attributes="0"/>
101100
<Component id="abortCurrentTestButton" alignment="0" max="32767" attributes="0"/>
102101
<Component id="runTestsButton" alignment="0" max="32767" attributes="0"/>
103102
<Component id="abortAllTestsButton" alignment="0" max="32767" attributes="0"/>
103+
<Component id="deleteTestcaseButton" alignment="1" max="32767" attributes="0"/>
104104
</Group>
105105
</Group>
106106
</Group>

Hightail/src/org/hightail/ui/ProblemJPanel.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -194,12 +194,12 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
194194
.addGroup(testcasePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
195195
.addComponent(saveTestsButton)
196196
.addComponent(copyInputButton))
197-
.addComponent(deleteTestcaseButton)
198197
.addComponent(editTestcaseButton, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
199198
.addComponent(newTestcaseButton)
200199
.addComponent(abortCurrentTestButton)
201200
.addComponent(runTestsButton)
202-
.addComponent(abortAllTestsButton)))
201+
.addComponent(abortAllTestsButton)
202+
.addComponent(deleteTestcaseButton, javax.swing.GroupLayout.Alignment.TRAILING)))
203203
);
204204

205205
openContainingDirectoryButton.setText("Browse...");

Hightail/src/org/hightail/util/XTrustProvider.java

-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@
3838
import java.security.PrivilegedAction;
3939
import java.security.Security;
4040
import java.security.cert.X509Certificate;
41-
4241
import javax.net.ssl.ManagerFactoryParameters;
4342
import javax.net.ssl.TrustManager;
4443
import javax.net.ssl.TrustManagerFactorySpi;

0 commit comments

Comments
 (0)