test_class.declarator: client
test_class.modifier: @Mock
  	@Bind
  	private
test_class.original_string: @Mock
  	@Bind
  	private Client client;
test_class.type: Client
test_class.var_name: client
test_class.declarator: chatMessageManager
test_class.modifier: @Mock
  	@Bind
  	private
test_class.original_string: @Mock
  	@Bind
  	private ChatMessageManager chatMessageManager;
test_class.type: ChatMessageManager
test_class.var_name: chatMessageManager
test_class.declarator: emojiPlugin
test_class.modifier: @Inject
  	private
test_class.original_string: @Inject
  	private EmojiPlugin emojiPlugin;
test_class.type: EmojiPlugin
test_class.var_name: emojiPlugin
test_class.file: runelite-client/src/test/java/net/runelite/client/plugins/emojis/EmojiPluginTest.java
test_class.identifier: EmojiPluginTest
test_case.body: @Test
  	public void testEmojiUpdateMessage()
  	{
  		String PARTY_POPPER = "<img=" + (-1 + Emoji.getEmoji("@@@").ordinal()) + '>';
  		String OPEN_MOUTH = "<img=" + (-1 + Emoji.getEmoji(":O").ordinal()) + '>';
  		assertNull(emojiPlugin.updateMessage("@@@@@"));
  		assertEquals(PARTY_POPPER, emojiPlugin.updateMessage("@@@"));
  		assertEquals(PARTY_POPPER + ' ' + PARTY_POPPER, emojiPlugin.updateMessage("@@@ @@@"));
  		assertEquals(PARTY_POPPER + ' ' + OPEN_MOUTH, emojiPlugin.updateMessage("@@@\u00A0:O"));
  		assertEquals(PARTY_POPPER + ' ' + OPEN_MOUTH + ' ' + PARTY_POPPER, emojiPlugin.updateMessage("@@@\u00A0:O @@@"));
  		assertEquals(PARTY_POPPER + " Hello World " + PARTY_POPPER, emojiPlugin.updateMessage("@@@\u00A0Hello World\u00A0@@@"));
  	}
test_case.class_method_signature: EmojiPluginTest.testEmojiUpdateMessage()
test_case.full_signature: @Test public void testEmojiUpdateMessage()
test_case.identifier: testEmojiUpdateMessage
test_case.invocations: ordinal getEmoji ordinal getEmoji assertNull updateMessage assertEquals updateMessage assertEquals updateMessage assertEquals updateMessage assertEquals updateMessage assertEquals updateMessage
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testEmojiUpdateMessage()
focal_class.declarator: WHITESPACE_REGEXP = Pattern.compile("[\\s\\u00A0]")
focal_class.modifier: private static final
focal_class.original_string: private static final Pattern WHITESPACE_REGEXP = Pattern.compile("[\\s\\u00A0]");
focal_class.type: Pattern
focal_class.var_name: WHITESPACE_REGEXP
focal_class.declarator: client
focal_class.modifier: @Inject
  	private
focal_class.original_string: @Inject
  	private Client client;
focal_class.type: Client
focal_class.var_name: client
focal_class.declarator: clientThread
focal_class.modifier: @Inject
  	private
focal_class.original_string: @Inject
  	private ClientThread clientThread;
focal_class.type: ClientThread
focal_class.var_name: clientThread
focal_class.declarator: chatMessageManager
focal_class.modifier: @Inject
  	private
focal_class.original_string: @Inject
  	private ChatMessageManager chatMessageManager;
focal_class.type: ChatMessageManager
focal_class.var_name: chatMessageManager
focal_class.declarator: modIconsStart = -1
focal_class.modifier: private
focal_class.original_string: private int modIconsStart = -1;
focal_class.type: int
focal_class.var_name: modIconsStart
focal_class.file: runelite-client/src/main/java/net/runelite/client/plugins/emojis/EmojiPlugin.java
focal_class.identifier: EmojiPlugin
focal_class.class_method_signature: EmojiPlugin.startUp()
focal_class.full_signature: @Override protected void startUp()
focal_class.identifier: startUp
focal_class.modifiers: @Override protected
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void startUp()
focal_class.class_method_signature: EmojiPlugin.onGameStateChanged(GameStateChanged gameStateChanged)
focal_class.full_signature: @Subscribe public void onGameStateChanged(GameStateChanged gameStateChanged)
focal_class.identifier: onGameStateChanged
focal_class.modifiers: @Subscribe public
focal_class.parameters: (GameStateChanged gameStateChanged)
focal_class.return: void
focal_class.signature: void onGameStateChanged(GameStateChanged gameStateChanged)
focal_class.class_method_signature: EmojiPlugin.loadEmojiIcons()
focal_class.full_signature: private void loadEmojiIcons()
focal_class.identifier: loadEmojiIcons
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void loadEmojiIcons()
focal_class.class_method_signature: EmojiPlugin.onChatMessage(ChatMessage chatMessage)
focal_class.full_signature: @Subscribe public void onChatMessage(ChatMessage chatMessage)
focal_class.identifier: onChatMessage
focal_class.modifiers: @Subscribe public
focal_class.parameters: (ChatMessage chatMessage)
focal_class.return: void
focal_class.signature: void onChatMessage(ChatMessage chatMessage)
focal_class.class_method_signature: EmojiPlugin.onOverheadTextChanged(final OverheadTextChanged event)
focal_class.full_signature: @Subscribe public void onOverheadTextChanged(final OverheadTextChanged event)
focal_class.identifier: onOverheadTextChanged
focal_class.modifiers: @Subscribe public
focal_class.parameters: (final OverheadTextChanged event)
focal_class.return: void
focal_class.signature: void onOverheadTextChanged(final OverheadTextChanged event)
focal_class.class_method_signature: EmojiPlugin.updateMessage(final String message)
focal_class.full_signature: @Nullable String updateMessage(final String message)
focal_class.identifier: updateMessage
focal_class.modifiers: @Nullable
focal_class.parameters: (final String message)
focal_class.return: String
focal_class.signature: String updateMessage(final String message)
focal_class.superclass: extends Plugin
focal_method.body: @Nullable
  	String updateMessage(final String message)
  	{
  		final String[] messageWords = WHITESPACE_REGEXP.split(message);
  
  		boolean editedMessage = false;
  		for (int i = 0; i < messageWords.length; i++)
  		{
  			// Remove tags except for <lt> and <gt>
  			final String trigger = Text.removeFormattingTags(messageWords[i]);
  			final Emoji emoji = Emoji.getEmoji(trigger);
  
  			if (emoji == null)
  			{
  				continue;
  			}
  
  			final int emojiId = modIconsStart + emoji.ordinal();
  
  			messageWords[i] = messageWords[i].replace(trigger, "<img=" + emojiId + ">");
  			editedMessage = true;
  		}
  
  		// If we haven't edited the message any, don't update it.
  		if (!editedMessage)
  		{
  			return null;
  		}
  
  		return Strings.join(messageWords, " ");
  	}
focal_method.class_method_signature: EmojiPlugin.updateMessage(final String message)
focal_method.full_signature: @Nullable String updateMessage(final String message)
focal_method.identifier: updateMessage
focal_method.invocations: split removeFormattingTags getEmoji ordinal replace join
focal_method.modifiers: @Nullable
focal_method.parameters: (final String message)
focal_method.return: String
focal_method.signature: String updateMessage(final String message)