Skip to content

Commit 9b8f589

Browse files
committed
lint fix
1 parent 4bb145c commit 9b8f589

File tree

1,457 files changed

+318838
-255445
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,457 files changed

+318838
-255445
lines changed

.gitignore

+28-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,34 @@
1+
# Compiled class file
2+
*.class
3+
4+
# Log file
5+
*.log
6+
7+
# BlueJ files
8+
*.ctxt
9+
10+
# Mobile Tools for Java (J2ME)
11+
.mtj.tmp/
12+
13+
# Package Files #
14+
*.jar
15+
*.war
16+
*.nar
17+
*.ear
18+
*.zip
19+
*.tar.gz
20+
*.rar
21+
22+
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
23+
hs_err_pid*
24+
replay_pid*
25+
26+
# project files
127
/Sample/nbproject/private/
228
/Sample/build/
329
/LoginForm/nbproject/private/
430
/LoginForm/build/
531
/LoginLogout/LoginLogoutDB/nbproject/private/
632
/LoginLogout/WebApplication1/nbproject/private/
7-
/LoginLogout/LoginLogoutDB/build/
33+
/LoginLogout/LoginLogoutDB/build/
34+
.vscode

Applets/src/myApplet.java

+24-17
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,55 @@
11
import java.applet.Applet;
22
import java.awt.Color;
33
import java.awt.Graphics;
4+
45
class Ball {
5-
int x,y,radius,dx,dy;
6+
int x, y, radius, dx, dy;
67
Color BallColor;
7-
public Ball(int x,int y,int radius,int dx,int dy,Color bColor) {
8-
this.x=x;
9-
this.y=y;
10-
this.radius=radius;
11-
this.dx=dx;
12-
this.dy=dy;
13-
BallColor=bColor;
8+
9+
public Ball(int x, int y, int radius, int dx, int dy, Color bColor) {
10+
this.x = x;
11+
this.y = y;
12+
this.radius = radius;
13+
this.dx = dx;
14+
this.dy = dy;
15+
BallColor = bColor;
1416
}
1517
}
16-
public class myApplet extends Applet implements Runnable{
18+
19+
public class myApplet extends Applet implements Runnable {
1720
Ball redBall;
21+
1822
public void init() {
19-
redBall=new Ball(150,0,20,2,5,Color.red);
23+
redBall = new Ball(150, 0, 20, 2, 5, Color.red);
2024
Thread t = new Thread(this);
2125
t.start();
2226
}
27+
2328
public void paint(Graphics g) {
2429
g.setColor(redBall.BallColor);
2530
g.fillOval(redBall.x, redBall.y, redBall.radius, redBall.radius);
2631
}
32+
2733
public void run() {
2834
try {
2935
Color c = redBall.BallColor;
30-
redBall.BallColor = new Color(c.getRed(), c.getBlue()+20, c.getGreen());
31-
redBall.y=redBall.y+redBall.dy;
36+
redBall.BallColor = new Color(c.getRed(), c.getBlue() + 20, c.getGreen());
37+
redBall.y = redBall.y + redBall.dy;
38+
} catch (Exception e) {
3239
}
33-
catch(Exception e){}
34-
while(redBall.BallColor.getBlue()!=255) {
40+
while (redBall.BallColor.getBlue() != 255) {
3541
try {
3642
displacementOperation(redBall);
3743
Thread.sleep(1000);
3844
repaint();
45+
} catch (Exception e) {
3946
}
40-
catch(Exception e){}
4147
}
4248
}
49+
4350
public void displacementOperation(Ball ball) {
4451
Color c = ball.BallColor;
45-
ball.BallColor = new Color(c.getRed(), c.getBlue()+20, c.getGreen());
46-
ball.y=ball.y+ball.dy;
52+
ball.BallColor = new Color(c.getRed(), c.getBlue() + 20, c.getGreen());
53+
ball.y = ball.y + ball.dy;
4754
}
4855
}

BeginnersBookDemo/src/HelloForm.java

+19-20
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,39 @@
1+
12
// Import required java libraries
23
import java.io.*;
34
import javax.servlet.*;
45
import javax.servlet.http.*;
56

67
// Extend HttpServlet class
78
public class HelloForm extends HttpServlet {
8-
9+
910
/**
10-
*
11-
*/
12-
private static final long serialVersionUID = 1L;
11+
*
12+
*/
13+
private static final long serialVersionUID = 1L;
14+
15+
public void doGet(HttpServletRequest request, HttpServletResponse response)
16+
throws ServletException, IOException {
1317

14-
public void doGet(HttpServletRequest request, HttpServletResponse response)
15-
throws ServletException, IOException {
16-
1718
// Set response content type
1819
response.setContentType("text/html");
1920

2021
PrintWriter out = response.getWriter();
2122
String title = "Using GET Method to Read Form Data";
22-
String docType =
23-
"<!doctype html public \"-//w3c//dtd html 4.0 " + "transitional//en\">\n";
24-
23+
String docType = "<!doctype html public \"-//w3c//dtd html 4.0 " + "transitional//en\">\n";
24+
2525
out.println(docType +
26-
"<html>\n" +
26+
"<html>\n" +
2727
"<head><title>" + title + "</title></head>\n" +
2828
"<body bgcolor = \"#f0f0f0\">\n" +
29-
"<h1 align = \"center\">" + title + "</h1>\n" +
30-
"<ul>\n" +
31-
" <li><b>First Name</b>: "
32-
+ request.getParameter("first_name") + "\n" +
33-
" <li><b>Last Name</b>: "
34-
+ request.getParameter("last_name") + "\n" +
35-
"</ul>\n" +
29+
"<h1 align = \"center\">" + title + "</h1>\n" +
30+
"<ul>\n" +
31+
" <li><b>First Name</b>: "
32+
+ request.getParameter("first_name") + "\n" +
33+
" <li><b>Last Name</b>: "
34+
+ request.getParameter("last_name") + "\n" +
35+
"</ul>\n" +
3636
"</body>" +
37-
"</html>"
38-
);
37+
"</html>");
3938
}
4039
}

BeginnersBookDemo/src/HelloFormPost.java

+20-21
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
// Import required java libraries
23
import java.io.*;
34
import javax.servlet.*;
@@ -7,42 +8,40 @@
78
public class HelloFormPost extends HttpServlet {
89

910
/**
10-
*
11-
*/
12-
private static final long serialVersionUID = 7201972957655188417L;
11+
*
12+
*/
13+
private static final long serialVersionUID = 7201972957655188417L;
1314

14-
// Method to handle GET method request.
15+
// Method to handle GET method request.
1516
public void doGet(HttpServletRequest request, HttpServletResponse response)
16-
throws ServletException, IOException {
17-
17+
throws ServletException, IOException {
18+
1819
// Set response content type
1920
response.setContentType("text/html");
2021

2122
PrintWriter out = response.getWriter();
2223
String title = "Using GET Method to Read Form Data";
23-
String docType =
24-
"<!doctype html public \"-//w3c//dtd html 4.0 " +
25-
"transitional//en\">\n";
26-
24+
String docType = "<!doctype html public \"-//w3c//dtd html 4.0 " +
25+
"transitional//en\">\n";
26+
2727
out.println(docType +
28-
"<html>\n" +
28+
"<html>\n" +
2929
"<head><title>" + title + "</title></head>\n" +
3030
"<body bgcolor = \"#f0f0f0\">\n" +
31-
"<h1 align = \"center\">" + title + "</h1>\n" +
32-
"<ul>\n" +
33-
" <li><b>First Name</b>: "
34-
+ request.getParameter("first_name") + "\n" +
35-
" <li><b>Last Name</b>: "
36-
+ request.getParameter("last_name") + "\n" +
37-
"</ul>\n" +
31+
"<h1 align = \"center\">" + title + "</h1>\n" +
32+
"<ul>\n" +
33+
" <li><b>First Name</b>: "
34+
+ request.getParameter("first_name") + "\n" +
35+
" <li><b>Last Name</b>: "
36+
+ request.getParameter("last_name") + "\n" +
37+
"</ul>\n" +
3838
"</body>" +
39-
"</html>"
40-
);
39+
"</html>");
4140
}
4241

4342
// Method to handle POST method request.
4443
public void doPost(HttpServletRequest request, HttpServletResponse response)
45-
throws ServletException, IOException {
44+
throws ServletException, IOException {
4645

4746
doGet(request, response);
4847
}

BeginnersBookDemo/src/MyServletDemo.java

+9-9
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,18 @@
66
public class MyServletDemo extends HttpServlet {
77

88
/**
9-
*
10-
*/
11-
private static final long serialVersionUID = 1L;
12-
private String mymsg;
9+
*
10+
*/
11+
private static final long serialVersionUID = 1L;
12+
private String mymsg;
1313

1414
public void init() throws ServletException {
1515
mymsg = "Hello World!";
1616
}
1717

18-
public void doGet(HttpServletRequest request,
19-
HttpServletResponse response)
20-
throws ServletException, IOException
21-
{
18+
public void doGet(HttpServletRequest request,
19+
HttpServletResponse response)
20+
throws ServletException, IOException {
2221

2322
// Setting up the content type of webpage
2423
response.setContentType("text/html");
@@ -29,7 +28,8 @@ public void doGet(HttpServletRequest request,
2928
}
3029

3130
public void destroy() {
32-
/* leaving empty for now this can be
31+
/*
32+
* leaving empty for now this can be
3333
* used when we want to do something at the end
3434
* of Servlet life cycle
3535
*/

BeginnersBookDemo/src/ReadParams.java

+24-25
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
// Import required java libraries
23
import java.io.*;
34
import javax.servlet.*;
@@ -6,40 +7,38 @@
67

78
// Extend HttpServlet class
89
public class ReadParams extends HttpServlet {
9-
10+
1011
/**
11-
*
12-
*/
13-
private static final long serialVersionUID = 1L;
12+
*
13+
*/
14+
private static final long serialVersionUID = 1L;
1415

15-
// Method to handle GET method request.
16+
// Method to handle GET method request.
1617
public void doGet(HttpServletRequest request, HttpServletResponse response)
17-
throws ServletException, IOException {
18-
18+
throws ServletException, IOException {
19+
1920
// Set response content type
2021
response.setContentType("text/html");
2122

2223
PrintWriter out = response.getWriter();
2324
String title = "Reading All Form Parameters";
24-
String docType =
25-
"<!doctype html public \"-//w3c//dtd html 4.0 " + "transitional//en\">\n";
25+
String docType = "<!doctype html public \"-//w3c//dtd html 4.0 " + "transitional//en\">\n";
2626

2727
out.println(docType +
28-
"<html>\n" +
29-
"<head><title>" + title + "</title></head>\n" +
30-
"<body bgcolor = \"#f0f0f0\">\n" +
31-
"<h1 align = \"center\">" + title + "</h1>\n" +
32-
"<table width = \"100%\" border = \"1\" align = \"center\">\n" +
33-
"<tr bgcolor = \"#949494\">\n" +
28+
"<html>\n" +
29+
"<head><title>" + title + "</title></head>\n" +
30+
"<body bgcolor = \"#f0f0f0\">\n" +
31+
"<h1 align = \"center\">" + title + "</h1>\n" +
32+
"<table width = \"100%\" border = \"1\" align = \"center\">\n" +
33+
"<tr bgcolor = \"#949494\">\n" +
3434
"<th>Param Name</th>" +
35-
"<th>Param Value(s)</th>\n"+
36-
"</tr>\n"
37-
);
35+
"<th>Param Value(s)</th>\n" +
36+
"</tr>\n");
3837

3938
Enumeration paramNames = request.getParameterNames();
4039

41-
while(paramNames.hasMoreElements()) {
42-
String paramName = (String)paramNames.nextElement();
40+
while (paramNames.hasMoreElements()) {
41+
String paramName = (String) paramNames.nextElement();
4342
out.print("<tr><td>" + paramName + "</td>\n<td>");
4443
String[] paramValues = request.getParameterValues(paramName);
4544

@@ -48,25 +47,25 @@ public void doGet(HttpServletRequest request, HttpServletResponse response)
4847
String paramValue = paramValues[0];
4948
if (paramValue.length() == 0)
5049
out.println("<i>No Value</i>");
51-
else
50+
else
5251
out.println(paramValue);
5352
} else {
5453
// Read multiple valued data
5554
out.println("<ul>");
5655

57-
for(int i = 0; i < paramValues.length; i++) {
56+
for (int i = 0; i < paramValues.length; i++) {
5857
out.println("<li>" + paramValues[i]);
5958
}
6059
out.println("</ul>");
6160
}
6261
}
6362
out.println("</tr>\n</table>\n</body></html>");
6463
}
65-
64+
6665
// Method to handle POST method request.
6766
public void doPost(HttpServletRequest request, HttpServletResponse response)
68-
throws ServletException, IOException {
69-
67+
throws ServletException, IOException {
68+
7069
doGet(request, response);
7170
}
7271
}

0 commit comments

Comments
 (0)