Added missing final modifiers.
This commit is contained in:
@@ -122,7 +122,7 @@ public final class Forum
|
||||
{
|
||||
while (rs.next())
|
||||
{
|
||||
Topic t = new Topic(Topic.ConstructorType.RESTORE, rs.getInt("topic_id"), rs.getInt("topic_forum_id"), rs.getString("topic_name"), rs.getLong("topic_date"), rs.getString("topic_ownername"), rs.getInt("topic_ownerid"), rs.getInt("topic_type"), rs.getInt("topic_reply"));
|
||||
final Topic t = new Topic(Topic.ConstructorType.RESTORE, rs.getInt("topic_id"), rs.getInt("topic_forum_id"), rs.getString("topic_name"), rs.getLong("topic_date"), rs.getString("topic_ownername"), rs.getInt("topic_ownerid"), rs.getInt("topic_type"), rs.getInt("topic_reply"));
|
||||
_topic.put(t.getID(), t);
|
||||
if (t.getID() > TopicBBSManager.getInstance().getMaxID(this))
|
||||
{
|
||||
|
||||
@@ -155,7 +155,7 @@ public class Post
|
||||
*/
|
||||
public void updatetxt(int i)
|
||||
{
|
||||
CPost cp = getCPost(i);
|
||||
final CPost cp = getCPost(i);
|
||||
try (Connection con = ConnectionFactory.getInstance().getConnection();
|
||||
PreparedStatement ps = con.prepareStatement("UPDATE posts SET post_txt=? WHERE post_id=? AND post_topic_id=? AND post_forum_id=?"))
|
||||
{
|
||||
|
||||
@@ -58,7 +58,7 @@ public abstract class BaseBBSManager
|
||||
*/
|
||||
protected void send1002(L2PcInstance activeChar, String string, String string2, String string3)
|
||||
{
|
||||
List<String> _arg = new ArrayList<>();
|
||||
final List<String> _arg = new ArrayList<>();
|
||||
_arg.add("0");
|
||||
_arg.add("0");
|
||||
_arg.add("0");
|
||||
|
||||
@@ -47,8 +47,8 @@ public class ForumsBBSManager extends BaseBBSManager
|
||||
{
|
||||
while (rs.next())
|
||||
{
|
||||
int forumId = rs.getInt("forum_id");
|
||||
Forum f = new Forum(forumId, null);
|
||||
final int forumId = rs.getInt("forum_id");
|
||||
final Forum f = new Forum(forumId, null);
|
||||
addForum(f);
|
||||
}
|
||||
}
|
||||
@@ -112,7 +112,7 @@ public class ForumsBBSManager extends BaseBBSManager
|
||||
*/
|
||||
public Forum createNewForum(String name, Forum parent, int type, int perm, int oid)
|
||||
{
|
||||
Forum forum = new Forum(name, parent, type, perm, oid);
|
||||
final Forum forum = new Forum(name, parent, type, perm, oid);
|
||||
forum.insertIntoDb();
|
||||
return forum;
|
||||
}
|
||||
|
||||
@@ -66,11 +66,11 @@ public class PostBBSManager extends BaseBBSManager
|
||||
{
|
||||
if (command.startsWith("_bbsposts;read;"))
|
||||
{
|
||||
StringTokenizer st = new StringTokenizer(command, ";");
|
||||
final StringTokenizer st = new StringTokenizer(command, ";");
|
||||
st.nextToken();
|
||||
st.nextToken();
|
||||
int idf = Integer.parseInt(st.nextToken());
|
||||
int idp = Integer.parseInt(st.nextToken());
|
||||
final int idf = Integer.parseInt(st.nextToken());
|
||||
final int idp = Integer.parseInt(st.nextToken());
|
||||
String index = null;
|
||||
if (st.hasMoreTokens())
|
||||
{
|
||||
@@ -90,12 +90,12 @@ public class PostBBSManager extends BaseBBSManager
|
||||
}
|
||||
else if (command.startsWith("_bbsposts;edit;"))
|
||||
{
|
||||
StringTokenizer st = new StringTokenizer(command, ";");
|
||||
final StringTokenizer st = new StringTokenizer(command, ";");
|
||||
st.nextToken();
|
||||
st.nextToken();
|
||||
int idf = Integer.parseInt(st.nextToken());
|
||||
int idt = Integer.parseInt(st.nextToken());
|
||||
int idp = Integer.parseInt(st.nextToken());
|
||||
final int idf = Integer.parseInt(st.nextToken());
|
||||
final int idt = Integer.parseInt(st.nextToken());
|
||||
final int idp = Integer.parseInt(st.nextToken());
|
||||
showEditPost((TopicBBSManager.getInstance().getTopicByID(idt)), ForumsBBSManager.getInstance().getForumByID(idf), activeChar, idp);
|
||||
}
|
||||
else
|
||||
@@ -149,9 +149,9 @@ public class PostBBSManager extends BaseBBSManager
|
||||
|
||||
private void showMemoPost(Topic topic, L2PcInstance activeChar, Forum forum)
|
||||
{
|
||||
Post p = getGPosttByTopic(topic);
|
||||
Locale locale = Locale.getDefault();
|
||||
DateFormat dateFormat = DateFormat.getDateInstance(DateFormat.FULL, locale);
|
||||
final Post p = getGPosttByTopic(topic);
|
||||
final Locale locale = Locale.getDefault();
|
||||
final DateFormat dateFormat = DateFormat.getDateInstance(DateFormat.FULL, locale);
|
||||
|
||||
String mes = p.getCPost(0).postTxt.replace(">", ">");
|
||||
mes = mes.replace("<", "<");
|
||||
@@ -163,19 +163,19 @@ public class PostBBSManager extends BaseBBSManager
|
||||
@Override
|
||||
public void parsewrite(String ar1, String ar2, String ar3, String ar4, String ar5, L2PcInstance activeChar)
|
||||
{
|
||||
StringTokenizer st = new StringTokenizer(ar1, ";");
|
||||
int idf = Integer.parseInt(st.nextToken());
|
||||
int idt = Integer.parseInt(st.nextToken());
|
||||
int idp = Integer.parseInt(st.nextToken());
|
||||
final StringTokenizer st = new StringTokenizer(ar1, ";");
|
||||
final int idf = Integer.parseInt(st.nextToken());
|
||||
final int idt = Integer.parseInt(st.nextToken());
|
||||
final int idp = Integer.parseInt(st.nextToken());
|
||||
|
||||
Forum f = ForumsBBSManager.getInstance().getForumByID(idf);
|
||||
final Forum f = ForumsBBSManager.getInstance().getForumByID(idf);
|
||||
if (f == null)
|
||||
{
|
||||
CommunityBoardHandler.separateAndSend("<html><body><br><br><center>the forum: " + idf + " does not exist !</center><br><br></body></html>", activeChar);
|
||||
}
|
||||
else
|
||||
{
|
||||
Topic t = f.getTopic(idt);
|
||||
final Topic t = f.getTopic(idt);
|
||||
if (t == null)
|
||||
{
|
||||
CommunityBoardHandler.separateAndSend("<html><body><br><br><center>the topic: " + idt + " does not exist !</center><br><br></body></html>", activeChar);
|
||||
|
||||
@@ -62,7 +62,7 @@ public class TopicBBSManager extends BaseBBSManager
|
||||
|
||||
public int getMaxID(Forum f)
|
||||
{
|
||||
Integer i = _maxId.get(f);
|
||||
final Integer i = _maxId.get(f);
|
||||
if (i == null)
|
||||
{
|
||||
return 0;
|
||||
@@ -87,7 +87,7 @@ public class TopicBBSManager extends BaseBBSManager
|
||||
{
|
||||
if (ar1.equals("crea"))
|
||||
{
|
||||
Forum f = ForumsBBSManager.getInstance().getForumByID(Integer.parseInt(ar2));
|
||||
final Forum f = ForumsBBSManager.getInstance().getForumByID(Integer.parseInt(ar2));
|
||||
if (f == null)
|
||||
{
|
||||
CommunityBoardHandler.separateAndSend("<html><body><br><br><center>the forum: " + ar2 + " is not implemented yet</center><br><br></body></html>", activeChar);
|
||||
@@ -95,10 +95,10 @@ public class TopicBBSManager extends BaseBBSManager
|
||||
else
|
||||
{
|
||||
f.vload();
|
||||
Topic t = new Topic(Topic.ConstructorType.CREATE, TopicBBSManager.getInstance().getMaxID(f) + 1, Integer.parseInt(ar2), ar5, Calendar.getInstance().getTimeInMillis(), activeChar.getName(), activeChar.getObjectId(), Topic.MEMO, 0);
|
||||
final Topic t = new Topic(Topic.ConstructorType.CREATE, TopicBBSManager.getInstance().getMaxID(f) + 1, Integer.parseInt(ar2), ar5, Calendar.getInstance().getTimeInMillis(), activeChar.getName(), activeChar.getObjectId(), Topic.MEMO, 0);
|
||||
f.addTopic(t);
|
||||
TopicBBSManager.getInstance().setMaxID(t.getID(), f);
|
||||
Post p = new Post(activeChar.getName(), activeChar.getObjectId(), Calendar.getInstance().getTimeInMillis(), t.getID(), f.getID(), ar4);
|
||||
final Post p = new Post(activeChar.getName(), activeChar.getObjectId(), Calendar.getInstance().getTimeInMillis(), t.getID(), f.getID(), ar4);
|
||||
PostBBSManager.getInstance().addPostByTopic(p, t);
|
||||
parsecmd("_bbsmemo", activeChar);
|
||||
}
|
||||
@@ -106,14 +106,14 @@ public class TopicBBSManager extends BaseBBSManager
|
||||
}
|
||||
else if (ar1.equals("del"))
|
||||
{
|
||||
Forum f = ForumsBBSManager.getInstance().getForumByID(Integer.parseInt(ar2));
|
||||
final Forum f = ForumsBBSManager.getInstance().getForumByID(Integer.parseInt(ar2));
|
||||
if (f == null)
|
||||
{
|
||||
CommunityBoardHandler.separateAndSend("<html><body><br><br><center>the forum: " + ar2 + " does not exist !</center><br><br></body></html>", activeChar);
|
||||
}
|
||||
else
|
||||
{
|
||||
Topic t = f.getTopic(Integer.parseInt(ar3));
|
||||
final Topic t = f.getTopic(Integer.parseInt(ar3));
|
||||
if (t == null)
|
||||
{
|
||||
CommunityBoardHandler.separateAndSend("<html><body><br><br><center>the topic: " + ar3 + " does not exist !</center><br><br></body></html>", activeChar);
|
||||
@@ -121,7 +121,7 @@ public class TopicBBSManager extends BaseBBSManager
|
||||
else
|
||||
{
|
||||
// CPost cp = null;
|
||||
Post p = PostBBSManager.getInstance().getGPosttByTopic(t);
|
||||
final Post p = PostBBSManager.getInstance().getGPosttByTopic(t);
|
||||
if (p != null)
|
||||
{
|
||||
p.deleteme(t);
|
||||
@@ -146,10 +146,10 @@ public class TopicBBSManager extends BaseBBSManager
|
||||
}
|
||||
else if (command.startsWith("_bbstopics;read"))
|
||||
{
|
||||
StringTokenizer st = new StringTokenizer(command, ";");
|
||||
final StringTokenizer st = new StringTokenizer(command, ";");
|
||||
st.nextToken();
|
||||
st.nextToken();
|
||||
int idf = Integer.parseInt(st.nextToken());
|
||||
final int idf = Integer.parseInt(st.nextToken());
|
||||
String index = null;
|
||||
if (st.hasMoreTokens())
|
||||
{
|
||||
@@ -168,27 +168,27 @@ public class TopicBBSManager extends BaseBBSManager
|
||||
}
|
||||
else if (command.startsWith("_bbstopics;crea"))
|
||||
{
|
||||
StringTokenizer st = new StringTokenizer(command, ";");
|
||||
final StringTokenizer st = new StringTokenizer(command, ";");
|
||||
st.nextToken();
|
||||
st.nextToken();
|
||||
int idf = Integer.parseInt(st.nextToken());
|
||||
final int idf = Integer.parseInt(st.nextToken());
|
||||
showNewTopic(ForumsBBSManager.getInstance().getForumByID(idf), activeChar, idf);
|
||||
}
|
||||
else if (command.startsWith("_bbstopics;del"))
|
||||
{
|
||||
StringTokenizer st = new StringTokenizer(command, ";");
|
||||
final StringTokenizer st = new StringTokenizer(command, ";");
|
||||
st.nextToken();
|
||||
st.nextToken();
|
||||
int idf = Integer.parseInt(st.nextToken());
|
||||
int idt = Integer.parseInt(st.nextToken());
|
||||
Forum f = ForumsBBSManager.getInstance().getForumByID(idf);
|
||||
final int idf = Integer.parseInt(st.nextToken());
|
||||
final int idt = Integer.parseInt(st.nextToken());
|
||||
final Forum f = ForumsBBSManager.getInstance().getForumByID(idf);
|
||||
if (f == null)
|
||||
{
|
||||
CommunityBoardHandler.separateAndSend("<html><body><br><br><center>the forum: " + idf + " does not exist !</center><br><br></body></html>", activeChar);
|
||||
}
|
||||
else
|
||||
{
|
||||
Topic t = f.getTopic(idt);
|
||||
final Topic t = f.getTopic(idt);
|
||||
if (t == null)
|
||||
{
|
||||
CommunityBoardHandler.separateAndSend("<html><body><br><br><center>the topic: " + idt + " does not exist !</center><br><br></body></html>", activeChar);
|
||||
@@ -196,7 +196,7 @@ public class TopicBBSManager extends BaseBBSManager
|
||||
else
|
||||
{
|
||||
// CPost cp = null;
|
||||
Post p = PostBBSManager.getInstance().getGPosttByTopic(t);
|
||||
final Post p = PostBBSManager.getInstance().getGPosttByTopic(t);
|
||||
if (p != null)
|
||||
{
|
||||
p.deleteme(t);
|
||||
@@ -263,7 +263,7 @@ public class TopicBBSManager extends BaseBBSManager
|
||||
{
|
||||
break;
|
||||
}
|
||||
Topic t = forum.getTopic(j);
|
||||
final Topic t = forum.getTopic(j);
|
||||
if (t != null)
|
||||
{
|
||||
if (i++ >= (12 * (index - 1)))
|
||||
|
||||
Reference in New Issue
Block a user