<commit_before>package com.irccloud.android;

import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.Iterator;

public class BuffersDataSource {
	public class Buffer {
		int bid;
		int cid;
		long min_eid;
		long last_seen_eid;
		String name;
		String type;
		int archived;
		int deferred;
		String away_msg;
	}

	public class comparator implements Comparator<Buffer> {
	    public int compare(Buffer b1, Buffer b2) {
	    	return b1.name.compareToIgnoreCase(b2.name);
	    }
	}
	
	private ArrayList<Buffer> buffers;
	
	private static BuffersDataSource instance = null;
	
	public static BuffersDataSource getInstance() {<commit_msg>Sort unjoined channels below channels, and conversations below unjoined channels<commit_after>package com.irccloud.android;

import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.Iterator;

public class BuffersDataSource {
	public class Buffer {
		int bid;
		int cid;
		long min_eid;
		long last_seen_eid;
		String name;
		String type;
		int archived;
		int deferred;
		String away_msg;
	}

	public class comparator implements Comparator<Buffer> {
	    public int compare(Buffer b1, Buffer b2) {
	    	int joined1 = 1, joined2 = 1;
	    	ChannelsDataSource.Channel c = ChannelsDataSource.getInstance().getChannelForBuffer(b1.bid);
			if(c == null)
				joined1 = 0;
	    	c = ChannelsDataSource.getInstance().getChannelForBuffer(b2.bid);
			if(c == null)
				joined2 = 0;
	    	if(b1.type.equals("conversation") && b2.type.equals("channel"))
	    		return 1;
	    	else if(b1.type.equals("channel") && b2.type.equals("conversation"))
	    		return -1;
	    	else if(joined1 != joined2)
	    		return joined2 - joined1;
	    	else
	    		return b1.name.compareToIgnoreCase(b2.name);
	    }
	}
	
	private ArrayList<Buffer> buffers;
	
	private static BuffersDataSource instance = null;
	
	public static BuffersDataSource getInstance() {
{'fraction_non_alphanumeric': 0.09322465613856343, 'fraction_numerical': 0.014263881813550688, 'mean_word_length': 3.778588807785888, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1683731', 'n_tokens_mistral': 684, 'n_tokens_neox': 616, 'n_words': 161}