Closed Zarthus closed 6 years ago
Prior consensus from other Java projects:
http://docs.oracle.com/javase/6/docs/api/java/lang/Thread.html#getId()
http://www.gwtproject.org/makinggwtbetter.html#codestyle (scroll down to acronyms in names)
Googe's official Java style guide: https://google.github.io/styleguide/javaguide.html#s5.3-camel-case
Consensus in the .NET world:
https://msdn.microsoft.com/en-us/library/ms229043(v=vs.100).aspx#Anchor_2
Impacted classes:
STSClientState STSMachine STSPolicy STSPropertiesStorageManager STSStorageManager STSUtil PrivateCTCPQueryEvent PrivateCTCPReplyEvent SaslECDSANIST256PChallenge SaslECDSANIST256PChallenge.ECKeyPair KittehSTSException ClientReceiveMOTDEvent CIKeyMap CISet ChannelTargetedCTCPEvent ChannelCTCPEvent
Margin of failure is obviously present. (like method public void rainbowNotAColor()
)
kittehircclientlib $ grep -P '(class|interface|enum) [^ ]*[A-Z][A-Z][^ ]*' --recursive src/* --no-filename
public interface ISupportParameter extends ClientLinked {
interface WHOX extends ISupportParameter {
public class ChannelCTCPEvent extends ActorChannelMessageEventBase<User> implements ActorMessageEvent<User> {
public class ChannelTargetedCTCPEvent extends TargetedUserChannelMessageEventBase implements ActorMessageEvent<User> {
public class ClientReceiveMOTDEvent extends ServerMessageEventBase {
public class PrivateCTCPQueryEvent extends ActorPrivateMessageEventBase<User> implements ActorMessageEvent<User> {
public class PrivateCTCPReplyEvent extends ActorPrivateMessageEventBase<User> implements ActorMessageEvent<User> {
public class KittehServerISupportException extends RuntimeException {
public class KittehSTSException extends RuntimeException {
public class SaslECDSANIST256PChallenge extends AbstractSaslProtocol<ECPrivateKey> {
public static final class ECKeyPair {
public interface ISupportManager {
public enum STSClientState {
public interface STSMachine {
public class STSPolicy {
public class STSPropertiesStorageManager implements STSStorageManager {
public interface STSStorageManager {
class IRCActor {
class IRCActorSnapshot implements Actor {
private class IRCStaleable<T extends Staleable> extends IRCActor {
class IRCChannel extends IRCStaleable<IRCChannelSnapshot> {
class IRCChannelTopicSnapshot implements Channel.Topic {
class IRCChannelSnapshot extends IRCActorSnapshot implements Channel {
class IRCChannelCommands implements Channel.Commands {
class IRCUser extends IRCStaleable<IRCUserSnapshot> {
class IRCUserSnapshot extends IRCActorSnapshot implements User {
class IRCServer extends IRCActor {
class IRCServerSnapshot extends IRCActorSnapshot implements Server {
final class CTCPUtil {
final class IRCClient extends InternalClient {
class IRCServerInfo implements Resettable, ServerInfo {
class IRCServerMessage implements ServerMessage {
static class IRCNumericCommandServerMessage extends IRCServerMessage implements NumericCommandServerMessage {
static class IRCStringCommandServerMessage extends IRCServerMessage implements StringCommandServerMessage {
static class IRCCapabilityState implements CapabilityState {
final class ManagerISupport extends AbstractNameValueProcessor<ISupportParameter> implements ISupportManager {
private static class IRCISupportParameter implements ISupportParameter {
private abstract static class IRCISupportParameterValueRequired extends IRCISupportParameter {
private abstract static class IRCISupportParameterInteger extends IRCISupportParameterValueRequired implements ISupportParameter.IntegerParameter {
private static final class ISupportCaseMapping extends IRCISupportParameterValueRequired implements ISupportParameter.CaseMapping {
private static final class ISupportChannelLen extends IRCISupportParameterInteger implements ISupportParameter.ChannelLen {
private static final class ISupportChanLimit extends IRCISupportParameterValueRequired implements ISupportParameter.ChanLimit {
private static final class ISupportChanModes extends IRCISupportParameterValueRequired implements ISupportParameter.ChanModes {
private static final class ISupportChanTypes extends IRCISupportParameterValueRequired implements ISupportParameter.ChanTypes {
private static final class ISupportModes extends IRCISupportParameterInteger implements ISupportParameter.Modes {
private static final class ISupportNetwork extends IRCISupportParameterValueRequired implements ISupportParameter.Network {
private static final class ISupportNickLen extends IRCISupportParameterInteger implements ISupportParameter.NickLen {
private static final class ISupportPrefix extends IRCISupportParameterValueRequired implements ISupportParameter.Prefix {
private static final class ISupportWHOX extends IRCISupportParameter implements ISupportParameter.WHOX {
private static final class ISupportTopicLen extends IRCISupportParameterInteger implements ISupportParameter.TopicLen {
private static class IRCMessageTag implements MessageTag {
private static class IRCMessageTagTime extends IRCMessageTag implements MessageTag.Time {
class MemorySTSMachine implements STSMachine {
abstract static class IRCModeBase {
static class IRCChannelUserMode extends IRCModeBase implements ChannelUserMode {
static class IRCChannelMode extends IRCModeBase implements ChannelMode {
static class IRCUserMode extends IRCModeBase implements UserMode {
static class IRCModeInfo implements ModeInfo {
class STSHandler {
public class CIKeyMap<Value> implements Map<String, Value> {
public class CISet implements Set<String> {
public final class STSUtil {
public class SaslECDSANIST256PChallengeTest {
public class CHGHOSTTest {
public class CTCPUtilTest {
public class ISupportManagerTest {
public class STSHandlerTest {
public class STSPropertiesStorageManagerTest {
public class CIKeyMapTest {
public class CISetTest {
public class STSUtilTest {
kittehircclientlib $ grep -P '(public|private|protected) (?!class|interface)[
^ ]+ [^ ]*[A-Z][A-Z][^ ]*' --recursive src/* --no-filename
public Optional<List<String>> getMOTD() {
private final ECPrivateKey privateKey;
private final ECPublicKey publicKey;
private ECKeyPair(@Nonnull ECPrivateKey privateKey, @Nonnull ECPublicKey publicKey) {
public static ECPrivateKey getPrivateKey(@Nonnull String base64Encoded) throws NoSuchAlgorithmException, InvalidKeySpecException {
public static ECPublicKey getPublicKey(@Nonnull String base64Encoded) throws NoSuchAlgorithmException, InvalidKeySpecException {
public static ECKeyPair getNewKey() throws NoSuchAlgorithmException {
public void dispatch(IMessagePublication publication, Object message, Iterable listeners) {
public enum STSClientState {
private String reserializeData(STSPolicy policy) {
private IRCActorSnapshot(@Nonnull IRCActor actor) {
private final IRCChannelCommands commands;
private final IRCChannelCommands commands;
private IRCChannelSnapshot(@Nonnull IRCChannel channel, @Nonnull Topic topic) {
private IRCUserSnapshot(@Nonnull IRCUser user) {
private IRCServerSnapshot(@Nonnull IRCServer actor) {
private final ActorProvider.IRCChannel channel;
private final ActorProvider.IRCChannel channel;
public abstract ManagerISupport getISupportManager();
public abstract IRCServerInfo getServerInfo();
private final ManagerISupport iSupportManager = new ManagerISupport(this);
public ManagerISupport getISupportManager() {
public Optional<STSMachine> getSTSMachine() {
public void sendCTCPMessage(@Nonnull String target, @Nonnull String message) {
public Optional<ISupportParameter> getISupportParameter(@Nonnull String name) {
public Map<String, ISupportParameter> getISupportParameters() {
public Optional<List<String>> getMOTD() {
private final MBassador<Object> bus;
private final STSStorageManager manager;
public void setSTSPolicy(@Nonnull STSPolicy policy) {
private final STSMachine machine;
private void handleSTSCapability(CapabilityState sts, List<ServerMessage> originalMessages) {
public static STSStorageManager getDefaultStorageManager() {
public static STSStorageManager getDefaultStorageManager(@Nonnull Path stsFile) {
public static STSPolicy getSTSPolicyFromString(@Nonnull String delimiter, @Nonnull String str) {
public void fromCTCP() {
public void toCTCP() {
public void isCTCPTrue() {
public void isCTCPFalse() {
public void noEscapeToCTCP() {
public void noEscapeFromCTCP() {
public void test5ISUPPORT() {
public void testMOTD() {
public void testWALLOPS() {
public void testWALLOPSFail() {
private final IRCServerInfo serverInfo = new IRCServerInfo(this);
public ManagerISupport getISupportManager() {
public Optional<STSMachine> getSTSMachine() {
public void sendCTCPMessage(@Nonnull String target, @Nonnull String message) {
public void sendCTCPMessage(@Nonnull MessageReceiver target, @Nonnull String message) {
public void setSTSPolicy(@Nonnull STSPolicy policy) {
public Optional<ISupportParameter> getISupportParameter(@Nonnull String name) {
public Map<String, ISupportParameter> getISupportParameters() {
public Optional<List<String>> getMOTD() {
public boolean hasWhoXSupport() {
public Optional<ISupportParameter> getISupportParameter(@Nonnull String name) {
public Map<String, ISupportParameter> getISupportParameters() {
public Optional<List<String>> getMOTD() {
public boolean hasWhoXSupport() {
public void safeMessageFailLF() {
public void safeMessageFailCR() {
public void rainbowNotAColor() {
IDEA can probably handle this better.
kittehircclientlib$ grep -P '[a-z][^ ]+[A-Z][A-Z][^ ]+(;$| = )' --recursive src/* --no-filename | grep -P -v "[A-Z0-9_]{3,} = " | grep -P -v '^ {4,}[A-Z][^ ]+' | grep -v 'import' | grep -v 'return' | grep -v -P '^ {4,}\w+\.\w+'
byte finalYByte = yBytes[yBytes.length - 1];
type = ChannelMode.Type.A_MASK;
type = ChannelMode.Type.B_PARAMETER_ALWAYS;
type = ChannelMode.Type.C_PARAMETER_ON_SET;
type = ChannelMode.Type.D_PARAMETER_NEVER;
final ActorProvider.IRCUserSnapshot snapshotMock = Mockito.mock(ActorProvider.IRCUserSnapshot.class);
Personally I prefer all uppercase 2-letter acronyms, but I always use lowercase for acronyms 3+ characters.
https://github.com/KittehOrg/KittehIRCClientLib/commit/6bf9d9ded907c8bdf4541396658cbc6bd3421323
I left things like ISupport
as-is. But got pretty much everything else.
:frowning_woman:
Some classes, like DCC, IRC, CTCP, STS all have uppercase acronyms.
This issue is to see interest in renaming them from DCC to Dcc, and friends.
Feel free to give it a THUMBS UP if you agree, or a THUMBS DOWN if you think this idea sucks!
I promise no ambassadors or prime ministers will quit while voting is in progress.
UppercaseAcronymExit