Skip to content

Commit 9e593c5

Browse files
Manager rewrite (discord-jda#608)
* Remove author tags for myself (since I'm in the copyright anyway) * Replace existing manager locks with ReentrantLock, this will serve as helpful if somehow threads become deadlocked * Fixed incorrect timestamp calculation * Add ability to disable permission checks on all managers * Fixed field in GuildManager (the correct key is default_message_notifications) * Fixed wrong key in AuditLogKey#ROLE_HOISTED * Allow unicode for channel names * Added more references and examples for use of Permission enum in some places of the API
1 parent 52bf802 commit 9e593c5

File tree

66 files changed

+2226
-960
lines changed

Some content is hidden

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

66 files changed

+2226
-960
lines changed

src/main/java/net/dv8tion/jda/client/entities/Application.java

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@
2323
import net.dv8tion.jda.core.entities.ISnowflake;
2424
import net.dv8tion.jda.core.requests.RestAction;
2525

26+
import javax.annotation.CheckReturnValue;
2627
import java.util.Collection;
2728
import java.util.List;
28-
import javax.annotation.CheckReturnValue;
2929

3030
/**
3131
* Represents a Discord Application from its owning client point of view
@@ -136,11 +136,10 @@ public interface Application extends ISnowflake
136136

137137
/**
138138
* Returns the {@link net.dv8tion.jda.client.managers.ApplicationManager ApplicationManager} for this Application.
139-
* In the ApplicationManager, you can modify things like the name and icon of this Application.
139+
* <br>In the ApplicationManager, you can modify things like the name and icon of this Application.
140+
* You modify multiple fields in one request by chaining setters before calling {@link net.dv8tion.jda.core.requests.RestAction#queue() RestAction.queue()}.
140141
*
141142
* @return The ApplicationManager of this Channel
142-
*
143-
* @see #getManagerUpdatable()
144143
*/
145144
ApplicationManager getManager();
146145

@@ -152,7 +151,11 @@ public interface Application extends ISnowflake
152151
* @return The ApplicationManagerUpdatable of this Application
153152
*
154153
* @see #getManager()
154+
*
155+
* @deprecated
156+
* Use {@link #getManager()} instead
155157
*/
158+
@Deprecated
156159
ApplicationManagerUpdatable getManagerUpdatable();
157160

158161
/**

src/main/java/net/dv8tion/jda/client/entities/impl/ApplicationImpl.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818

1919
import net.dv8tion.jda.client.entities.Application;
2020
import net.dv8tion.jda.client.managers.ApplicationManager;
21-
import net.dv8tion.jda.client.managers.ApplicationManagerUpdatable;
2221
import net.dv8tion.jda.core.JDA;
2322
import net.dv8tion.jda.core.Permission;
2423
import net.dv8tion.jda.core.requests.Request;
@@ -32,11 +31,11 @@
3231

3332
public class ApplicationImpl implements Application
3433
{
35-
3634
private final JDA api;
3735
private final Object mngLock = new Object();
3836
private ApplicationManager manager;
39-
private ApplicationManagerUpdatable managerUpdatable;
37+
@Deprecated
38+
private net.dv8tion.jda.client.managers.ApplicationManagerUpdatable managerUpdatable;
4039

4140
private BotImpl bot;
4241
private String description;
@@ -164,16 +163,17 @@ public ApplicationManager getManager()
164163
}
165164

166165
@Override
167-
public ApplicationManagerUpdatable getManagerUpdatable()
166+
@Deprecated
167+
public net.dv8tion.jda.client.managers.ApplicationManagerUpdatable getManagerUpdatable()
168168
{
169-
ApplicationManagerUpdatable mng = managerUpdatable;
169+
net.dv8tion.jda.client.managers.ApplicationManagerUpdatable mng = managerUpdatable;
170170
if (mng == null)
171171
{
172172
synchronized (mngLock)
173173
{
174174
mng = managerUpdatable;
175175
if (mng == null)
176-
mng = managerUpdatable = new ApplicationManagerUpdatable(this);
176+
mng = managerUpdatable = new net.dv8tion.jda.client.managers.ApplicationManagerUpdatable(this);
177177
}
178178
}
179179
return mng;

0 commit comments

Comments
 (0)