Input:
    public static String parseMessage(String pName, String world, String msg, String format) {
        Object prefix = Reader.getRawPrefix(pName, InfoType.USER, world);
        Object suffix = Reader.getRawSuffix(pName, InfoType.USER, world);
        Object group = Reader.getRawGroup(pName, InfoType.USER, world);
        String vI = ConfigType.MCHAT_VAR_INDICATOR.getString();
        if (msg == null)
            msg = "";
        if (prefix == null)
            prefix = "";
        if (suffix == null)
            suffix = "";
        if (group == null)
            group = "";
        String hSClass = "";
        String hClass = "";
        String hHealth = "";
        String hHBar = "";
        String hMana = "";
        String hMBar = "";
        String hParty = "";
        String hMastered = "";
        String hLevel = "";
        String hSLevel = "";
        String hExp = "";
        String hSExp = "";
        String hEBar = "";
        String hSEBar = "";
        String tTown = "";
        String tTownName = "";
        String tTitle = "";
        String tSurname = "";
        String tResidentName = "";
        String tPrefix = "";
        String tNamePrefix = "";
        String tPostfix = "";
        String tNamePostfix = "";
        String tNation = "";
        String tNationName = "";
        String tNationTag = "";
        Double locX = (double) randomNumber(-100, 100);
        Double locY = (double) randomNumber(-100, 100);
        Double locZ = (double) randomNumber(-100, 100);
        String loc = ("X: " + locX + ", " + "Y: " + locY + ", " + "Z: " + locZ);
        String healthbar = "";
        String health = String.valueOf(randomNumber(1, 20));
        String pWorld = "";
        String hungerLevel = String.valueOf(randomNumber(0, 20));
        String hungerBar = API.createBasicBar(randomNumber(0, 20), 20, 10);
        String level = String.valueOf(randomNumber(1, 2));
        String exp = String.valueOf(randomNumber(0, 200))+ "/" + ((randomNumber(1, 2) + 1) * 10);
        String expBar = API.createBasicBar(randomNumber(0, 200), ((randomNumber(1, 2) + 1) * 10), 10);
        String tExp = String.valueOf(randomNumber(0, 300));
        String gMode = String.valueOf(randomNumber(0, 1));
        Date now = new Date();
        SimpleDateFormat dateFormat = new SimpleDateFormat(LocaleType.FORMAT_DATE.getRaw());
        String time = dateFormat.format(now);
        String dName = pName;
        String dType = "";
        if (ConfigType.MCHAT_CHAT_DISTANCE.getDouble() > 0) {
            dType = LocaleType.FORMAT_LOCAL.getVal();
        }
        String sType = "";
        if (MChat.isSpying.get(pName) != null
                && MChat.isSpying.get(pName))
            sType = LocaleType.FORMAT_SPY.getVal();
        if (Bukkit.getServer().getPlayer(pName) != null)  {
            Player player = Bukkit.getServer().getPlayer(pName);
            locX = player.getLocation().getX();
            locY = player.getLocation().getY();
            locZ = player.getLocation().getZ();
            loc = ("X: " + locX + ", " + "Y: " + locY + ", " + "Z: " + locZ);
            healthbar = API.createHealthBar(player);
            health = String.valueOf(player.getHealth());
            pWorld = player.getWorld().getName();
            hungerLevel = String.valueOf(player.getFoodLevel());
            hungerBar = API.createBasicBar(player.getFoodLevel(), 20, 10);
            level = String.valueOf(player.getLevel());
            exp = String.valueOf(player.getExp()) + "/" + ((player.getLevel() + 1) * 10);
            expBar = API.createBasicBar(player.getExp(), ((player.getLevel() + 1) * 10), 10);
            tExp = String.valueOf(player.getTotalExperience());
            gMode = "";
            if (player.getGameMode() != null && player.getGameMode().name() != null)
                gMode = player.getGameMode().name();
            dName = player.getDisplayName();
            if (heroesB)             {
                Hero hero = heroes.getCharacterManager().getHero(player);
                HeroClass heroClass = hero.getHeroClass();
                HeroClass heroSClass = hero.getSecondClass();
                int hL = hero.getLevel();
                int hSL = hero.getLevel(heroSClass);
                double hE = hero.getExperience(heroClass);
                double hSE = hero.getExperience(heroSClass);
                hClass = hero.getHeroClass().getName();
                hHealth = String.valueOf(hero.getHealth());
                hHBar = Messaging.createHealthBar(hero.getHealth(), hero.getMaxHealth());
                hMana = String.valueOf(hero.getMana());
                hLevel = String.valueOf(hL);
                hExp = String.valueOf(hE);
                hEBar = Messaging.createExperienceBar(hero, heroClass);
                Integer hMMana = hero.getMaxMana();
                if (hMMana != null)
                    hMBar = Messaging.createManaBar(hero.getMana(), hero.getMaxMana());
                if (hero.getParty() != null)
                    hParty = hero.getParty().toString();
                if (heroSClass != null) {
                    hSClass = heroSClass.getName();
                    hSLevel = String.valueOf(hSL);
                    hSExp = String.valueOf(hSE);
                    hSEBar = Messaging.createExperienceBar(hero, heroSClass);
                }
                if ((hero.isMaster(heroClass))
                        && (heroSClass == null || hero.isMaster(heroSClass)))
                    hMastered = LocaleType.MESSAGE_HEROES_TRUE.getVal();
                else
                    hMastered = LocaleType.MESSAGE_HEROES_FALSE.getVal();
            }
            if (townyB) {
                try {
                    Resident resident = TownyUniverse.getDataSource().getResident(pName);
                    if (resident.hasTown()) {
                        Town town = resident.getTown();
                        tTown = town.getName();
                        tTownName = TownyFormatter.getFormattedTownName(town);
                        tTitle = resident.getTitle();
                        tSurname = resident.getSurname();
                        tResidentName = resident.getFormattedName();
                        tPrefix = resident.hasTitle() ? resident.getTitle() : TownyFormatter.getNamePrefix(resident);
                        tNamePrefix = TownyFormatter.getNamePrefix(resident);
                        tPostfix = resident.hasSurname() ? resident.getSurname() : TownyFormatter.getNamePostfix(resident);
                        tNamePostfix = TownyFormatter.getNamePostfix(resident);
                        if (resident.hasNation()) {
                            Nation nation = town.getNation();
                            tNation = nation.getName();
                            tNationName = nation.getFormattedName();
                            tNationTag = nation.getTag();
                        }
                    }
                } catch (Exception ignored) {}
            }
        }
        String formatAll = parseVars(format, pName, world);
        msg = msg.replaceAll("%", "%%");
        formatAll = formatAll.replaceAll("%", "%%");
        formatAll = MessageUtil.addColour(formatAll);
        if (ConfigType.MCHAT_CAPS_LOCK_RANGE.getInteger() > 0)
            msg = fixCaps(msg, ConfigType.MCHAT_CAPS_LOCK_RANGE.getInteger());
        if (formatAll == null)
            return msg;
        if (API.checkPermissions(pName, world, "mchat.coloredchat"))
            msg = MessageUtil.addColour(msg);
        if (!API.checkPermissions(pName, world, "mchat.censorbypass"))
            msg = replaceCensoredWords(msg);
        TreeMap<String, Object> fVarMap = new TreeMap<String, Object>();
        TreeMap<String, Object> rVarMap = new TreeMap<String, Object>();
        TreeMap<String, Object> lVarMap = new TreeMap<String, Object>();
        addVar(fVarMap, vI + "mnameformat," + vI + "mnf", LocaleType.FORMAT_NAME.getVal());
        addVar(fVarMap, vI + "healthbar," + vI + "hb", healthbar);
        addVar(rVarMap, vI + "distancetype," + vI + "dtype", dType);
        addVar(rVarMap, vI + "displayname," + vI + "dname," + vI + "dn", dName);
        addVar(rVarMap, vI + "experiencebar," + vI + "expb," + vI + "ebar," + vI + "eb", expBar);
        addVar(rVarMap, vI + "experience," + vI + "exp", exp);
        addVar(rVarMap, vI + "gamemode," + vI + "gm", gMode);
        addVar(rVarMap, vI + "group," + vI + "g", group);
        addVar(rVarMap, vI + "hungerbar," + vI + "hub", hungerBar);
        addVar(rVarMap, vI + "hunger", hungerLevel);
        addVar(rVarMap, vI + "health," + vI + "h", health);
        addVar(rVarMap, vI + "location," + vI + "loc", loc);
        addVar(rVarMap, vI + "level," + vI + "l", level);
        addVar(rVarMap, vI + "mname," + vI + "mn", Reader.getMName(pName));
        addVar(rVarMap, vI + "pname," + vI + "n", pName);
        addVar(rVarMap, vI + "prefix," + vI + "p", prefix);
        addVar(rVarMap, vI + "spying," + vI + "spy", sType);
        addVar(rVarMap, vI + "suffix," + vI + "s", suffix);
        addVar(rVarMap, vI + "totalexp," + vI + "texp," + vI + "te", tExp);
        addVar(rVarMap, vI + "time," + vI + "t", time);
        addVar(rVarMap, vI + "world," + vI + "w", pWorld);
        addVar(rVarMap, vI + "Groupname," + vI + "Gname," + vI + "G", Reader.getGroupName(group.toString()));
        addVar(rVarMap, vI + "HClass," + vI + "HC", hClass);
        addVar(rVarMap, vI + "HExp," + vI + "HEx", hExp);
        addVar(rVarMap, vI + "HEBar," + vI + "HEb", hEBar);
        addVar(rVarMap, vI + "HHBar," + vI + "HHB", hHBar);
        addVar(rVarMap, vI + "HHealth," + vI + "HH", hHealth);
        addVar(rVarMap, vI + "HLevel," + vI + "HL", hLevel);
        addVar(rVarMap, vI + "HMastered," + vI + "HMa", hMastered);
        addVar(rVarMap, vI + "HMana," + vI + "HMn", hMana);
        addVar(rVarMap, vI + "HMBar," + vI + "HMb", hMBar);
        addVar(rVarMap, vI + "HParty," + vI + "HPa", hParty);
        addVar(rVarMap, vI + "HSecClass," + vI + "HSC", hSClass);
        addVar(rVarMap, vI + "HSecExp," + vI + "HSEx", hSExp);
        addVar(rVarMap, vI + "HSecEBar," + vI + "HSEb", hSEBar);
        addVar(rVarMap, vI + "HSecLevel," + vI + "HSL", hSLevel);
        addVar(rVarMap, vI + "town", tTown);
        addVar(rVarMap, vI + "townname", tTownName);
        addVar(rVarMap, vI + "townysurname", tSurname);
        addVar(rVarMap, vI + "townytitle", tTitle);
        addVar(rVarMap, vI + "townyresidentname", tResidentName);
        addVar(rVarMap, vI + "townyprefix", tPrefix);
        addVar(rVarMap, vI + "townynameprefix", tNamePrefix);
        addVar(rVarMap, vI + "townypostfix", tPostfix);
        addVar(rVarMap, vI + "townynamepostfix", tNamePostfix);
        addVar(rVarMap, vI + "townynation", tNation);
        addVar(rVarMap, vI + "townynationname", tNationName);
        addVar(rVarMap, vI + "townynationtag", tNationTag);
        addVar(rVarMap, vI + "Worldname," + vI + "Wname," + vI + "W", Reader.getWorldName(pWorld));
        addVar(lVarMap, vI + "message," + vI + "msg," + vI + "m", msg);
        formatAll = replaceCustVars(pName, formatAll);
        formatAll = replaceVars(formatAll, fVarMap.descendingMap(), true);
        formatAll = replaceVars(formatAll, rVarMap.descendingMap(), true);
        formatAll = replaceVars(formatAll, lVarMap.descendingMap(), false);
        return formatAll;
    }

Output:
    public static String parseMessage(String pName, String world, String msg, String format) {
        Object prefix = Reader.getRawPrefix(pName, InfoType.USER, world);
        Object suffix = Reader.getRawSuffix(pName, InfoType.USER, world);
        Object group = Reader.getRawGroup(pName, InfoType.USER, world);
        String vI = ConfigType.MCHAT_VAR_INDICATOR.getString();
        if (msg == null)
            msg = "";
        if (prefix == null)
            prefix = "";
        if (suffix == null)
            suffix = "";
        if (group == null)
            group = "";
        String hSClass = "";
        String hClass = "";
        String hHealth = "";
        String hHBar = "";
        String hMana = "";
        String hMBar = "";
        String hParty = "";
        String hMastered = "";
        String hLevel = "";
        String hSLevel = "";
        String hExp = "";
        String hSExp = "";
        String hEBar = "";
        String hSEBar = "";
        String tTown = "";
        String tTownName = "";
        String tTitle = "";
        String tSurname = "";
        String tResidentName = "";
        String tPrefix = "";
        String tNamePrefix = "";
        String tPostfix = "";
        String tNamePostfix = "";
        String tNation = "";
        String tNationName = "";
        String tNationTag = "";
        Double locX = (double) randomNumber(-100, 100);
        Double locY = (double) randomNumber(-100, 100);
        Double locZ = (double) randomNumber(-100, 100);
        String loc = ("X: " + locX + ", " + "Y: " + locY + ", " + "Z: " + locZ);
        String healthbar = "";
        String health = String.valueOf(randomNumber(1, 20));
        String pWorld = "";
        String hungerLevel = String.valueOf(randomNumber(0, 20));
        String hungerBar = API.createBasicBar(randomNumber(0, 20), 20, 10);
        String level = String.valueOf(randomNumber(1, 2));
        String exp = String.valueOf(randomNumber(0, 200))+ "/" + ((randomNumber(1, 2) + 1) * 10);
        String expBar = API.createBasicBar(randomNumber(0, 200), ((randomNumber(1, 2) + 1) * 10), 10);
        String tExp = String.valueOf(randomNumber(0, 300));
        String gMode = String.valueOf(randomNumber(0, 1));
        Date now = new Date();
        SimpleDateFormat dateFormat = new SimpleDateFormat(LocaleType.FORMAT_DATE.getRaw());
        String time = dateFormat.format(now);
        String dName = pName;
        String dType = "";
        if (MChat.isShouting.get(pName) != null
                && MChat.isShouting.get(pName)) {
            dType = LocaleType.FORMAT_SHOUT.getVal();
        } else if (ConfigType.MCHAT_CHAT_DISTANCE.getDouble() > 0) {
            dType = LocaleType.FORMAT_LOCAL.getVal();
        }
        String sType = "";
        if (MChat.isSpying.get(pName) != null
                && MChat.isSpying.get(pName))
            sType = LocaleType.FORMAT_SPY.getVal();
        if (Bukkit.getServer().getPlayer(pName) != null)  {
            Player player = Bukkit.getServer().getPlayer(pName);
            locX = player.getLocation().getX();
            locY = player.getLocation().getY();
            locZ = player.getLocation().getZ();
            loc = ("X: " + locX + ", " + "Y: " + locY + ", " + "Z: " + locZ);
            healthbar = API.createHealthBar(player);
            health = String.valueOf(player.getHealth());
            pWorld = player.getWorld().getName();
            hungerLevel = String.valueOf(player.getFoodLevel());
            hungerBar = API.createBasicBar(player.getFoodLevel(), 20, 10);
            level = String.valueOf(player.getLevel());
            exp = String.valueOf(player.getExp()) + "/" + ((player.getLevel() + 1) * 10);
            expBar = API.createBasicBar(player.getExp(), ((player.getLevel() + 1) * 10), 10);
            tExp = String.valueOf(player.getTotalExperience());
            gMode = "";
            if (player.getGameMode() != null && player.getGameMode().name() != null)
                gMode = player.getGameMode().name();
            dName = player.getDisplayName();
            if (heroesB)             {
                Hero hero = heroes.getCharacterManager().getHero(player);
                HeroClass heroClass = hero.getHeroClass();
                HeroClass heroSClass = hero.getSecondClass();
                int hL = hero.getLevel();
                int hSL = hero.getLevel(heroSClass);
                double hE = hero.getExperience(heroClass);
                double hSE = hero.getExperience(heroSClass);
                hClass = hero.getHeroClass().getName();
                hHealth = String.valueOf(hero.getHealth());
                hHBar = Messaging.createHealthBar(hero.getHealth(), hero.getMaxHealth());
                hMana = String.valueOf(hero.getMana());
                hLevel = String.valueOf(hL);
                hExp = String.valueOf(hE);
                hEBar = Messaging.createExperienceBar(hero, heroClass);
                Integer hMMana = hero.getMaxMana();
                if (hMMana != null)
                    hMBar = Messaging.createManaBar(hero.getMana(), hero.getMaxMana());
                if (hero.getParty() != null)
                    hParty = hero.getParty().toString();
                if (heroSClass != null) {
                    hSClass = heroSClass.getName();
                    hSLevel = String.valueOf(hSL);
                    hSExp = String.valueOf(hSE);
                    hSEBar = Messaging.createExperienceBar(hero, heroSClass);
                }
                if ((hero.isMaster(heroClass))
                        && (heroSClass == null || hero.isMaster(heroSClass)))
                    hMastered = LocaleType.MESSAGE_HEROES_TRUE.getVal();
                else
                    hMastered = LocaleType.MESSAGE_HEROES_FALSE.getVal();
            }
            if (townyB) {
                try {
                    Resident resident = TownyUniverse.getDataSource().getResident(pName);
                    if (resident.hasTown()) {
                        Town town = resident.getTown();
                        tTown = town.getName();
                        tTownName = TownyFormatter.getFormattedTownName(town);
                        tTitle = resident.getTitle();
                        tSurname = resident.getSurname();
                        tResidentName = resident.getFormattedName();
                        tPrefix = resident.hasTitle() ? resident.getTitle() : TownyFormatter.getNamePrefix(resident);
                        tNamePrefix = TownyFormatter.getNamePrefix(resident);
                        tPostfix = resident.hasSurname() ? resident.getSurname() : TownyFormatter.getNamePostfix(resident);
                        tNamePostfix = TownyFormatter.getNamePostfix(resident);
                        if (resident.hasNation()) {
                            Nation nation = town.getNation();
                            tNation = nation.getName();
                            tNationName = nation.getFormattedName();
                            tNationTag = nation.getTag();
                        }
                    }
                } catch (Exception ignored) {}
            }
        }
        String formatAll = parseVars(format, pName, world);
        msg = msg.replaceAll("%", "%%");
        formatAll = formatAll.replaceAll("%", "%%");
        formatAll = MessageUtil.addColour(formatAll);
        if (ConfigType.MCHAT_CAPS_LOCK_RANGE.getInteger() > 0)
            msg = fixCaps(msg, ConfigType.MCHAT_CAPS_LOCK_RANGE.getInteger());
        if (formatAll == null)
            return msg;
        if (API.checkPermissions(pName, world, "mchat.coloredchat"))
            msg = MessageUtil.addColour(msg);
        if (!API.checkPermissions(pName, world, "mchat.censorbypass"))
            msg = replaceCensoredWords(msg);
        TreeMap<String, Object> fVarMap = new TreeMap<String, Object>();
        TreeMap<String, Object> rVarMap = new TreeMap<String, Object>();
        TreeMap<String, Object> lVarMap = new TreeMap<String, Object>();
        addVar(fVarMap, vI + "mnameformat," + vI + "mnf", LocaleType.FORMAT_NAME.getVal());
        addVar(fVarMap, vI + "healthbar," + vI + "hb", healthbar);
        addVar(rVarMap, vI + "distancetype," + vI + "dtype", dType);
        addVar(rVarMap, vI + "displayname," + vI + "dname," + vI + "dn", dName);
        addVar(rVarMap, vI + "experiencebar," + vI + "expb," + vI + "ebar," + vI + "eb", expBar);
        addVar(rVarMap, vI + "experience," + vI + "exp", exp);
        addVar(rVarMap, vI + "gamemode," + vI + "gm", gMode);
        addVar(rVarMap, vI + "group," + vI + "g", group);
        addVar(rVarMap, vI + "hungerbar," + vI + "hub", hungerBar);
        addVar(rVarMap, vI + "hunger", hungerLevel);
        addVar(rVarMap, vI + "health," + vI + "h", health);
        addVar(rVarMap, vI + "location," + vI + "loc", loc);
        addVar(rVarMap, vI + "level," + vI + "l", level);
        addVar(rVarMap, vI + "mname," + vI + "mn", Reader.getMName(pName));
        addVar(rVarMap, vI + "pname," + vI + "n", pName);
        addVar(rVarMap, vI + "prefix," + vI + "p", prefix);
        addVar(rVarMap, vI + "spying," + vI + "spy", sType);
        addVar(rVarMap, vI + "suffix," + vI + "s", suffix);
        addVar(rVarMap, vI + "totalexp," + vI + "texp," + vI + "te", tExp);
        addVar(rVarMap, vI + "time," + vI + "t", time);
        addVar(rVarMap, vI + "world," + vI + "w", pWorld);
        addVar(rVarMap, vI + "Groupname," + vI + "Gname," + vI + "G", Reader.getGroupName(group.toString()));
        addVar(rVarMap, vI + "HClass," + vI + "HC", hClass);
        addVar(rVarMap, vI + "HExp," + vI + "HEx", hExp);
        addVar(rVarMap, vI + "HEBar," + vI + "HEb", hEBar);
        addVar(rVarMap, vI + "HHBar," + vI + "HHB", hHBar);
        addVar(rVarMap, vI + "HHealth," + vI + "HH", hHealth);
        addVar(rVarMap, vI + "HLevel," + vI + "HL", hLevel);
        addVar(rVarMap, vI + "HMastered," + vI + "HMa", hMastered);
        addVar(rVarMap, vI + "HMana," + vI + "HMn", hMana);
        addVar(rVarMap, vI + "HMBar," + vI + "HMb", hMBar);
        addVar(rVarMap, vI + "HParty," + vI + "HPa", hParty);
        addVar(rVarMap, vI + "HSecClass," + vI + "HSC", hSClass);
        addVar(rVarMap, vI + "HSecExp," + vI + "HSEx", hSExp);
        addVar(rVarMap, vI + "HSecEBar," + vI + "HSEb", hSEBar);
        addVar(rVarMap, vI + "HSecLevel," + vI + "HSL", hSLevel);
        addVar(rVarMap, vI + "town", tTown);
        addVar(rVarMap, vI + "townname", tTownName);
        addVar(rVarMap, vI + "townysurname", tSurname);
        addVar(rVarMap, vI + "townytitle", tTitle);
        addVar(rVarMap, vI + "townyresidentname", tResidentName);
        addVar(rVarMap, vI + "townyprefix", tPrefix);
        addVar(rVarMap, vI + "townynameprefix", tNamePrefix);
        addVar(rVarMap, vI + "townypostfix", tPostfix);
        addVar(rVarMap, vI + "townynamepostfix", tNamePostfix);
        addVar(rVarMap, vI + "townynation", tNation);
        addVar(rVarMap, vI + "townynationname", tNationName);
        addVar(rVarMap, vI + "townynationtag", tNationTag);
        addVar(rVarMap, vI + "Worldname," + vI + "Wname," + vI + "W", Reader.getWorldName(pWorld));
        addVar(lVarMap, vI + "message," + vI + "msg," + vI + "m", msg);
        formatAll = replaceCustVars(pName, formatAll);
        formatAll = replaceVars(formatAll, fVarMap.descendingMap(), true);
        formatAll = replaceVars(formatAll, rVarMap.descendingMap(), true);
        formatAll = replaceVars(formatAll, lVarMap.descendingMap(), false);
        return formatAll;
    }


Input:
	public void testAttachToExistingReport() throws Exception {
		TaskData taskData = BugzillaFixture.current().createTask(PrivilegeLevel.USER, null, null);
		assertNotNull(taskData);
		int numAttached = taskData.getAttributeMapper()
				.getAttributesByType(taskData, TaskAttribute.TYPE_ATTACHMENT)
				.size();
		assertNotNull(repository.getCredentials(AuthenticationType.REPOSITORY));
		assertNotNull(repository.getCredentials(AuthenticationType.REPOSITORY).getUserName());
		assertNotNull(repository.getCredentials(AuthenticationType.REPOSITORY).getPassword());
		BugzillaClient client = connector.getClientManager().getClient(repository, new NullProgressMonitor());
		TaskAttribute attrAttachment = taskData.getAttributeMapper().createTaskAttachment(taskData);
		TaskAttachmentMapper attachmentMapper = TaskAttachmentMapper.createFrom(attrAttachment);
		attachmentMapper.setDescription("Test attachment " + new Date());
		attachmentMapper.setContentType("text/plain");
		attachmentMapper.setPatch(false);
		attachmentMapper.setComment("Automated JUnit attachment test");
		attachmentMapper.applyTo(attrAttachment);
		String filePath = "/this/is/not/a/real-file";
		FileTaskAttachmentSource attachment = new FileTaskAttachmentSource(new File(filePath));
		attachment.setContentType(FileTaskAttachmentSource.APPLICATION_OCTET_STREAM);
		attachment.setDescription(AttachmentUtil.CONTEXT_DESCRIPTION);
		attachment.setName("mylyn-context.zip");
		try {
			client.postAttachment(taskData.getTaskId(), attachmentMapper.getComment(), attachment, attrAttachment,
					new NullProgressMonitor());
			fail("never reach this!");
		} catch (Exception e) {
			assertEquals("A repository error has occurred.", e.getMessage());
		}
		taskData = BugzillaFixture.current().getTask(taskData.getTaskId(), client);
		assertNotNull(taskData);
		assertEquals(numAttached, taskData.getAttributeMapper().getAttributesByType(taskData,
				TaskAttribute.TYPE_ATTACHMENT).size());
		String fileName = "test-attach-" + System.currentTimeMillis() + ".txt";
		File attachFile = new File(fileName);
		attachFile.createNewFile();
		BufferedWriter write = new BufferedWriter(new FileWriter(attachFile));
		attachment = new FileTaskAttachmentSource(attachFile);
		attachment.setContentType(FileTaskAttachmentSource.APPLICATION_OCTET_STREAM);
		attachment.setDescription(AttachmentUtil.CONTEXT_DESCRIPTION);
		attachment.setName("mylyn-context.zip");
		try {
			client.postAttachment(taskData.getTaskId(), attachmentMapper.getComment(), attachment, attrAttachment,
					new NullProgressMonitor());
			fail("never reach this!");
		} catch (Exception e) {
			assertEquals("A repository error has occurred.", e.getMessage());
		}
		taskData = BugzillaFixture.current().getTask(taskData.getTaskId(), client);
		assertNotNull(taskData);
		assertEquals(numAttached, taskData.getAttributeMapper().getAttributesByType(taskData,
				TaskAttribute.TYPE_ATTACHMENT).size());
		write.write("test file");
		write.close();
		try {
			client.postAttachment(taskData.getTaskId(), attachmentMapper.getComment(), attachment, attrAttachment,
					new NullProgressMonitor());
		} catch (Exception e) {
			fail("never reach this!");
		}
		taskData = BugzillaFixture.current().getTask(taskData.getTaskId(), client);
		assertNotNull(taskData);
		assertEquals(numAttached + 1, taskData.getAttributeMapper().getAttributesByType(taskData,
				TaskAttribute.TYPE_ATTACHMENT).size());
		assertTrue(attachFile.delete());
	}

Output:
	public void testAttachToExistingReport() throws Exception {
		TaskData taskData = BugzillaFixture.current().createTask(PrivilegeLevel.USER, null, null);
		assertNotNull(taskData);
		int numAttached = taskData.getAttributeMapper()
				.getAttributesByType(taskData, TaskAttribute.TYPE_ATTACHMENT)
				.size();
		assertNotNull(repository.getCredentials(AuthenticationType.REPOSITORY));
		assertNotNull(repository.getCredentials(AuthenticationType.REPOSITORY).getUserName());
		assertNotNull(repository.getCredentials(AuthenticationType.REPOSITORY).getPassword());
		BugzillaClient client = connector.getClientManager().getClient(repository, new NullProgressMonitor());
		TaskAttribute attrAttachment = taskData.getAttributeMapper().createTaskAttachment(taskData);
		TaskAttachmentMapper attachmentMapper = TaskAttachmentMapper.createFrom(attrAttachment);
		attachmentMapper.setDescription("Test attachment " + new Date());
		attachmentMapper.setContentType("text/plain");
		attachmentMapper.setPatch(false);
		attachmentMapper.setComment("Automated JUnit attachment test");
		attachmentMapper.applyTo(attrAttachment);
		String filePath = "/this/is/not/a/real-file";
		FileTaskAttachmentSource attachment = new FileTaskAttachmentSource(new File(filePath));
		attachment.setContentType(FileTaskAttachmentSource.APPLICATION_OCTET_STREAM);
		attachment.setDescription(AttachmentUtil.CONTEXT_DESCRIPTION);
		attachment.setName("mylyn-context.zip");
		try {
			client.postAttachment(taskData.getTaskId(), attachmentMapper.getComment(), attachment, attrAttachment,
					new NullProgressMonitor());
			fail("never reach this!");
		} catch (Exception e) {
			assertEquals("An unknown repository error has occurred: ", e.getMessage());
		}
		taskData = BugzillaFixture.current().getTask(taskData.getTaskId(), client);
		assertNotNull(taskData);
		assertEquals(numAttached, taskData.getAttributeMapper().getAttributesByType(taskData,
				TaskAttribute.TYPE_ATTACHMENT).size());
		String fileName = "test-attach-" + System.currentTimeMillis() + ".txt";
		File attachFile = new File(fileName);
		attachFile.createNewFile();
		BufferedWriter write = new BufferedWriter(new FileWriter(attachFile));
		attachment = new FileTaskAttachmentSource(attachFile);
		attachment.setContentType(FileTaskAttachmentSource.APPLICATION_OCTET_STREAM);
		attachment.setDescription(AttachmentUtil.CONTEXT_DESCRIPTION);
		attachment.setName("mylyn-context.zip");
		try {
			client.postAttachment(taskData.getTaskId(), attachmentMapper.getComment(), attachment, attrAttachment,
					new NullProgressMonitor());
			fail("never reach this!");
		} catch (Exception e) {
			assertEquals("A repository error has occurred.", e.getMessage());
		}
		taskData = BugzillaFixture.current().getTask(taskData.getTaskId(), client);
		assertNotNull(taskData);
		assertEquals(numAttached, taskData.getAttributeMapper().getAttributesByType(taskData,
				TaskAttribute.TYPE_ATTACHMENT).size());
		write.write("test file");
		write.close();
		try {
			client.postAttachment(taskData.getTaskId(), attachmentMapper.getComment(), attachment, attrAttachment,
					new NullProgressMonitor());
		} catch (Exception e) {
			fail("never reach this!");
		}
		taskData = BugzillaFixture.current().getTask(taskData.getTaskId(), client);
		assertNotNull(taskData);
		assertEquals(numAttached + 1, taskData.getAttributeMapper().getAttributesByType(taskData,
				TaskAttribute.TYPE_ATTACHMENT).size());
		assertTrue(attachFile.delete());
	}


Input:
    public Brand fetch(String uri) {
        LOG.info("Retrieving Hulu brand: " + uri + " with " + httpClient.getClass() + " : " + httpClient.toString());
        String content = getContent(uri);
        if (content != null) {
            HtmlNavigator navigator = new HtmlNavigator(content);
            Brand brand = extractor.extract(navigator);
            List<Item> episodes = Lists.newArrayList();
            if (episodeAdapter != null) {
                for (Item item : brand.getItems()) {
                    try {
                        Episode episode = episodeAdapter.fetch(item.getCanonicalUri());
                        episode.setBrand(brand);
                        episodes.add(episode);
                    } catch (FetchException fe) {
                        LOG.warn("Failed to retrieve episode: " + item.getCanonicalUri() + " with message: " + fe.getMessage() + " with cause: " + fe.getCause().getMessage());
                    }
                }
                brand.setItems(episodes);
            }
            LOG.info("Retrieved Hulu brand: " + uri + " with " + brand.getItems().size() + " episodes");
            return brand;
        } else {
            throw new FetchException("Unable to retrieve brand from Hulu: " + uri + " after a number of attempts");
        }
    }

Output:
    public Brand fetch(String uri) {
        LOG.info("Retrieving Hulu brand: " + uri + " with " + httpClient.getClass() + " : " + httpClient.toString());
        String content = getContent(uri);
        if (content != null) {
            HtmlNavigator navigator = new HtmlNavigator(content);
            Brand brand = extractor.extract(navigator);
            List<Item> episodes = Lists.newArrayList();
            if (episodeAdapter != null) {
                for (Item item : brand.getItems()) {
                    try {
                        Episode episode = episodeAdapter.fetch(item.getCanonicalUri());
                        episode.setBrand(brand);
                        episodes.add(episode);
                    } catch (FetchException fe) {
                        LOG.warn("Failed to retrieve episode: " + item.getCanonicalUri() + " with message: " + fe.getMessage());
                    }
                }
                brand.setItems(episodes);
            }
            LOG.info("Retrieved Hulu brand: " + uri + " with " + brand.getItems().size() + " episodes");
            return brand;
        } else {
            throw new FetchException("Unable to retrieve brand from Hulu: " + uri + " after a number of attempts");
        }
    }


Input:
    public final int getToken() throws IOException
    {
        int c;
    retry:
        for (;;) {
            for (;;) {
                c = getChar();
                if (c == EOF_CHAR) {
                    tokenBeg = cursor - 1;
                    tokenEnd = cursor;
                    return Token.EOF;
                } else if (c == '\n') {
                    dirtyLine = false;
                    tokenBeg = cursor - 1;
                    tokenEnd = cursor;
                    return Token.EOL;
                } else if (!isJSSpace(c)) {
                    if (c != '-') {
                        dirtyLine = true;
                    }
                    break;
                }
            }
            tokenBeg = cursor - 1;
            tokenEnd = cursor;
            boolean identifierStart;
            boolean isUnicodeEscapeStart = false;
            if (c == '\\') {
                c = getChar();
                if (c == 'u') {
                    identifierStart = true;
                    stringBufferTop = 0;
                } else {
                    identifierStart = false;
                    ungetChar(c);
                    c = '\\';
                }
            } else {
                identifierStart = Character.isJavaIdentifierStart((char)c);
                if (identifierStart) {
                    stringBufferTop = 0;
                    addToString(c);
                }
            }
            if (identifierStart) {
                boolean containsEscape = isUnicodeEscapeStart;
                for (;;) {
                    if (isUnicodeEscapeStart) {
                        int escapeVal = 0;
                        for (int i = 0; i != 4; ++i) {
                            c = getChar();
                            escapeVal = Kit.xDigitToInt(c, escapeVal);
                            if (escapeVal < 0) { break; }
                        }
                        if (escapeVal < 0) {
                            return Token.ERROR;
                        }
                        addToString(escapeVal);
                        isUnicodeEscapeStart = false;
                    } else {
                        c = getChar();
                        if (c == '\\') {
                            c = getChar();
                            if (c == 'u') {
                                isUnicodeEscapeStart = true;
                                containsEscape = true;
                            } else {
                                return Token.ERROR;
                            }
                        } else {
                            if (c == EOF_CHAR || c == BYTE_ORDER_MARK
                                || !Character.isJavaIdentifierPart((char)c))
                            {
                                break;
                            }
                            addToString(c);
                        }
                    }
                }
                ungetChar(c);
                String str = getStringFromBuffer();
                this.string = (String)allStrings.intern(str);
                return Token.NAME;
            }
            if (isDigit(c) || (c == '.' && isDigit(peekChar()))) {
                isOctal = false;
                stringBufferTop = 0;
                int base = 10;
                while ('0' <= c && c <= '9') {
                    addToString(c);
                    c = getChar();
                }
                boolean isInteger = true;
                ungetChar(c);
                String numString = getStringFromBuffer();
                this.string = numString;
                double dval;
                if (!isInteger) {
                    try {
                        dval = Double.valueOf(numString).doubleValue();
                    }
                    catch (NumberFormatException ex) {
                        return Token.ERROR;
                    }
                } else {
                    dval = stringToNumber(numString, 0, base);
                }
                this.number = dval;
                return Token.NUMBER;
            }
            switch (c) {
            case ';': return Token.SEMI;
            case '[': return Token.LB;
            case ']': return Token.RB;
            case '{': return Token.LC;
            case '}': return Token.RC;
            case '(': return Token.LP;
            case ')': return Token.RP;
            case ',': return Token.COMMA;
            case '?': return Token.HOOK;
            case ':':
                if (matchChar(':')) {
                    return Token.COLONCOLON;
                } else {
                    return Token.COLON;
                }
            case '.':
                if (matchChar('.')) {
                    return Token.DOTDOT;
                } else if (matchChar('(')) {
                    return Token.DOTQUERY;
                } else {
                    return Token.DOT;
                }
            case '|':
                if (matchChar('|')) {
                    return Token.OR;
                } else if (matchChar('=')) {
                    return Token.ASSIGN_BITOR;
                } else {
                    return Token.BITOR;
                }
            case '^':
                if (matchChar('=')) {
                    return Token.ASSIGN_BITXOR;
                } else {
                    return Token.BITXOR;
                }
            case '&':
                if (matchChar('&')) {
                    return Token.AND;
                } else if (matchChar('=')) {
                    return Token.ASSIGN_BITAND;
                } else {
                    return Token.BITAND;
                }
            case '=':
                if (matchChar('=')) {
                    if (matchChar('=')) {
                        return Token.SHEQ;
                    } else {
                        return Token.EQ;
                    }
                } else {
                    return Token.ASSIGN;
                }
            case '!':
                if (matchChar('=')) {
                    if (matchChar('=')) {
                        return Token.SHNE;
                    } else {
                        return Token.NE;
                    }
                } else {
                    return Token.NOT;
                }
            case '<':
                if (matchChar('<')) {
                    if (matchChar('=')) {
                        return Token.ASSIGN_LSH;
                    } else {
                        return Token.LSH;
                    }
                } else {
                    if (matchChar('=')) {
                        return Token.LE;
                    } else {
                        return Token.LT;
                    }
                }
            case '>':
                if (matchChar('>')) {
                    if (matchChar('>')) {
                        if (matchChar('=')) {
                            return Token.ASSIGN_URSH;
                        } else {
                            return Token.URSH;
                        }
                    } else {
                        if (matchChar('=')) {
                            return Token.ASSIGN_RSH;
                        } else {
                            return Token.RSH;
                        }
                    }
                } else {
                    if (matchChar('=')) {
                        return Token.GE;
                    } else {
                        return Token.GT;
                    }
                }
            case '*':
                if (matchChar('=')) {
                    return Token.ASSIGN_MUL;
                } else {
                    return Token.MUL;
                }
            case '/':
                if (matchChar('=')) {
                    return Token.ASSIGN_DIV;
                } else {
                    return Token.DIV;
                }
            case '%':
                if (matchChar('=')) {
                    return Token.ASSIGN_MOD;
                } else {
                    return Token.MOD;
                }
            case '~':
                return Token.BITNOT;
            case '+':
                if (matchChar('=')) {
                    return Token.ASSIGN_ADD;
                } else if (matchChar('+')) {
                    return Token.INC;
                } else {
                    return Token.ADD;
                }
            case '-':
                if (matchChar('=')) {
                    c = Token.ASSIGN_SUB;
                } else if (matchChar('-')) {
                    c = Token.DEC;
                } else {
                    c = Token.SUB;
                }
                return c;
            default:
                System.out.println("Illegal character");
                return Token.ERROR;
            }
        }
    }

Output:
    public final int getToken() throws IOException
    {
        int c;
    retry:
        for (;;) {
            for (;;) {
                c = getChar();
                if (c == EOF_CHAR) {
                    tokenBeg = cursor - 1;
                    tokenEnd = cursor;
                    return Token.EOF;
                } else if (c == '\n') {
                    dirtyLine = false;
                    tokenBeg = cursor - 1;
                    tokenEnd = cursor;
                    return Token.EOL;
                } else if (!isJSSpace(c)) {
                    if (c != '-') {
                        dirtyLine = true;
                    }
                    break;
                }
            }
            tokenBeg = cursor - 1;
            tokenEnd = cursor;
            boolean identifierStart;
            boolean isUnicodeEscapeStart = false;
            boolean isUnicode = false;
            if (c == '\\') {
                c = getChar();
                if (c == 'u') {
                    identifierStart = true;
                    stringBufferTop = 0;
                    isUnicode = true;
                } else {
                    identifierStart = false;
                    ungetChar(c);
                    c = '\\';
                }
            } else {
                identifierStart = Character.isJavaIdentifierStart((char)c);
                if (identifierStart) {
                    stringBufferTop = 0;
                    addToString(c);
                }
            }
            if (identifierStart) {
                boolean containsEscape = isUnicodeEscapeStart;
                for (;;) {
                    if (isUnicodeEscapeStart) {
                        int escapeVal = 0;
                        for (int i = 0; i != 4; ++i) {
                            c = getChar();
                            escapeVal = Kit.xDigitToInt(c, escapeVal);
                            if (escapeVal < 0) { break; }
                        }
                        if (escapeVal < 0) {
                            return Token.ERROR;
                        }
                        addToString(escapeVal);
                        isUnicodeEscapeStart = false;
                    } else {
                        c = getChar();
                        if (c == '\\') {
                            c = getChar();
                            if (c == 'u') {
                                isUnicodeEscapeStart = true;
                                containsEscape = true;
                            } else {
                                return Token.ERROR;
                            }
                        } else {
                            if (c == EOF_CHAR || c == BYTE_ORDER_MARK
                                || !Character.isJavaIdentifierPart((char)c))
                            {
                                break;
                            }
                            addToString(c);
                        }
                    }
                }
                ungetChar(c);
                String str = getStringFromBuffer();
                if (isUnicode) {
                    str = "\\u"+str;
                    char ch = (char) Integer.parseInt( str.substring(2), 16 );
                    str = String.valueOf(ch);
                }
                this.string = (String)allStrings.intern(str);
                return Token.NAME;
            }
            if (isDigit(c) || (c == '.' && isDigit(peekChar()))) {
                isOctal = false;
                stringBufferTop = 0;
                int base = 10;
                while ('0' <= c && c <= '9') {
                    addToString(c);
                    c = getChar();
                }
                boolean isInteger = true;
                ungetChar(c);
                String numString = getStringFromBuffer();
                this.string = numString;
                double dval;
                if (!isInteger) {
                    try {
                        dval = Double.valueOf(numString).doubleValue();
                    }
                    catch (NumberFormatException ex) {
                        return Token.ERROR;
                    }
                } else {
                    dval = stringToNumber(numString, 0, base);
                }
                this.number = dval;
                return Token.NUMBER;
            }
            switch (c) {
            case ';': return Token.SEMI;
            case '[': return Token.LB;
            case ']': return Token.RB;
            case '{': return Token.LC;
            case '}': return Token.RC;
            case '(': return Token.LP;
            case ')': return Token.RP;
            case ',': return Token.COMMA;
            case '?': return Token.HOOK;
            case ':':
                if (matchChar(':')) {
                    return Token.COLONCOLON;
                } else {
                    return Token.COLON;
                }
            case '.':
                if (matchChar('.')) {
                    return Token.DOTDOT;
                } else if (matchChar('(')) {
                    return Token.DOTQUERY;
                } else {
                    return Token.DOT;
                }
            case '|':
                if (matchChar('|')) {
                    return Token.OR;
                } else if (matchChar('=')) {
                    return Token.ASSIGN_BITOR;
                } else {
                    return Token.BITOR;
                }
            case '^':
                if (matchChar('=')) {
                    return Token.ASSIGN_BITXOR;
                } else {
                    return Token.BITXOR;
                }
            case '&':
                if (matchChar('&')) {
                    return Token.AND;
                } else if (matchChar('=')) {
                    return Token.ASSIGN_BITAND;
                } else {
                    return Token.BITAND;
                }
            case '=':
                if (matchChar('=')) {
                    if (matchChar('=')) {
                        return Token.SHEQ;
                    } else {
                        return Token.EQ;
                    }
                } else {
                    return Token.ASSIGN;
                }
            case '!':
                if (matchChar('=')) {
                    if (matchChar('=')) {
                        return Token.SHNE;
                    } else {
                        return Token.NE;
                    }
                } else {
                    return Token.NOT;
                }
            case '<':
                if (matchChar('<')) {
                    if (matchChar('=')) {
                        return Token.ASSIGN_LSH;
                    } else {
                        return Token.LSH;
                    }
                } else {
                    if (matchChar('=')) {
                        return Token.LE;
                    } else {
                        return Token.LT;
                    }
                }
            case '>':
                if (matchChar('>')) {
                    if (matchChar('>')) {
                        if (matchChar('=')) {
                            return Token.ASSIGN_URSH;
                        } else {
                            return Token.URSH;
                        }
                    } else {
                        if (matchChar('=')) {
                            return Token.ASSIGN_RSH;
                        } else {
                            return Token.RSH;
                        }
                    }
                } else {
                    if (matchChar('=')) {
                        return Token.GE;
                    } else {
                        return Token.GT;
                    }
                }
            case '*':
                if (matchChar('=')) {
                    return Token.ASSIGN_MUL;
                } else {
                    return Token.MUL;
                }
            case '/':
                if (matchChar('=')) {
                    return Token.ASSIGN_DIV;
                } else {
                    return Token.DIV;
                }
            case '%':
                if (matchChar('=')) {
                    return Token.ASSIGN_MOD;
                } else {
                    return Token.MOD;
                }
            case '~':
                return Token.BITNOT;
            case '+':
                if (matchChar('=')) {
                    return Token.ASSIGN_ADD;
                } else if (matchChar('+')) {
                    return Token.INC;
                } else {
                    return Token.ADD;
                }
            case '-':
                if (matchChar('=')) {
                    c = Token.ASSIGN_SUB;
                } else if (matchChar('-')) {
                    c = Token.DEC;
                } else {
                    c = Token.SUB;
                }
                return c;
            default:
                System.out.println("Illegal character");
                return Token.ERROR;
            }
        }
    }


Input:
  public void initialize() {
    if (entityManagerFactory != null) {
      return;
    }
    if (persistenceOptions != null) {
      if (!persistenceOptions.containsKey(ECLIPSELINK_CLASSLOADER_OPTION)) {
        persistenceOptions.put(ECLIPSELINK_CLASSLOADER_OPTION, EntityManagerProvider.class.getClassLoader());
      }
      persistenceOptions.put(MULTITENANT_PROPERTY_DEFAULT, "texo");
      entityManagerFactory = Persistence.createEntityManagerFactory(persistenceUnitName, persistenceOptions);
    } else {
      entityManagerFactory = Persistence.createEntityManagerFactory(persistenceUnitName);
    }
  }

Output:
  public void initialize() {
    if (entityManagerFactory != null) {
      return;
    }
    if (persistenceOptions != null) {
      if (!persistenceOptions.containsKey(ECLIPSELINK_CLASSLOADER_OPTION)) {
        persistenceOptions.put(ECLIPSELINK_CLASSLOADER_OPTION, EntityManagerProvider.class.getClassLoader());
      }
      persistenceOptions.put(MULTITENANT_PROPERTY_DEFAULT, "texo");
      entityManagerFactory = Persistence.createEntityManagerFactory(persistenceUnitName, persistenceOptions);
    } else {
      entityManagerFactory = Persistence.createEntityManagerFactory(persistenceUnitName);
    }
  }


Input:
    public Datenmodell()
    {
        g1=new Gleisstueck("Gleisstueck 1", 640);
        g2=new Gleisstueck("Gleisstueck 2", 320);
        g3=new Gleisstueck("Gleisstueck 3", 590);
        g4=new Gleisstueck("Gleisstueck 4", 190);
        g5=new Gleisstueck("Gleisstueck 5", 210);
        g6=new Gleisstueck("Gleisstueck 6", 260);
        g7=new Gleisstueck("Gleisstueck 7", 730);
        g8=new Gleisstueck("Gleisstueck 8", 200);
        g9=new Gleisstueck("Gleisstueck 9", 190);
        g10=new Gleisstueck("Gleisstueck 10", 570);
        g11=new Gleisstueck("Gleisstueck 11", 700);
        g12=new Gleisstueck("Gleisstueck 12", 220);
        g13=new Gleisstueck("Gleisstueck 13", 260);
        g14=new Gleisstueck("Gleisstueck 14", 60);
        g15=new Gleisstueck("Gleisstueck 15", 690);
        g16=new Gleisstueck("Gleisstueck 16", 330);
        g17=new Gleisstueck("Gleisstueck 17", 250);
        g18=new Gleisstueck("Gleisstueck 18", 80);
        g19=new Gleisstueck("Gleisstueck 19", 690);
        g20=new Gleisstueck("Gleisstueck 20", 60);
        g21=new Gleisstueck("Gleisstueck 21", 51);
        g22=new Gleisstueck("Gleisstueck 22", 50);
        g23=new Gleisstueck("Gleisstueck 23", 690);
        g24=new Gleisstueck("Gleisstueck 24", 120);
        g25=new Gleisstueck("Gleisstueck 25", 1220);
        g26=new Gleisstueck("Gleisstueck 26", 60);
        g27=new Gleisstueck("Gleisstueck 27", 50);
        g28=new Gleisstueck("Gleisstueck 28", 50);
        g29=new Gleisstueck("Gleisstueck 29", 60);
        w1=new Weiche("Weiche 1",g5,g9,g27);
        w2=new Weiche("Weiche 2",g10,g27,g9);
        w3=new Weiche("Weiche 3",g6,g1,g27);
        w5=new Weiche("Weiche 5",g28,g1,g2);
        w6=new Weiche("Weiche 6",g3,g4,g28);
        w7=new Weiche("Weiche 7",g7,g11,g6);
        w8=new Weiche("Weiche 8",g10,g6,g11);
        w10=new Weiche("Weiche 10",g11,g25,g26);
        w11=new Weiche("Weiche 11",g7,g26,g8);
        w12=new Weiche("Weiche 12",g8,g12,g26);
        w13=new Weiche("Weiche 13",g13,g17,g14);
        w14=new Weiche("Weiche 14",g18,g14,g17);
        w15=new Weiche("Weiche 15",g15,g19,g14);
        w16=new Weiche("Weiche 16",g18,g14,g29);
        w40=new Weiche("Weiche 40",g16,g20,g15);
        w39=new Weiche("Weiche 39",g15,g19,g20);
        w44=new Weiche("Weiche 44",g22,g16,g3);
        w43=new Weiche("Weiche 43",g4,g3,g22);
        w38=new Weiche("Weiche 38",g21,g24,g20);
        w37=new Weiche("Weiche 37",g23,g20,g24);
        w42=new Weiche("Weiche 42",g21,g24,g22);
        w41=new Weiche("Weiche 41",g25,g22,g24);
        w17=new Weiche("Weiche 17",g19,g23,g29);
        g1.setWeichen(w3, w5);
        g2.setWeichen(w5, null);
        g3.setWeichen(w44, w6);
        g4.setWeichen(w43, w6);
        g5.setWeichen(null, w1);
        g6.setWeichen(w3, w7);
        g7.setWeichen(w7, w11);
        g8.setWeichen(w11, null);
        g9.setWeichen(null, w2);
        g10.setWeichen(w2, w8);
        g11.setWeichen(w8, w10);
        g12.setWeichen(w12, null);
        g13.setWeichen(null, w13);
        g14.setWeichen(w13, w15);
        g15.setWeichen(w15, w40);
        g16.setWeichen(w40, w44);
        g17.setWeichen(null, w14);
        g18.setWeichen(w14, w16);
        g19.setWeichen(w17, w39);
        g20.setWeichen(w39, w38);
        g21.setWeichen(w38, w42);
        g22.setWeichen(w42, w43);
        g23.setWeichen(w17, w37);
        g24.setWeichen(w37, w41);
        g25.setWeichen(w41, w10);
        g26.setWeichen(w10, w12);
        g27.setWeichen(w1, w3);
        g28.setWeichen(w6, w5);
        g29.setWeichen(w16, w17);
        s1=new Signal("Signal 1", g6, false);
        s2=new Signal("Signal 2", g7, false);
        s3=new Signal("Signal 3", g8, false);
        s4=new Signal("Signal 4", g9, true);
        s5=new Signal("Signal 5", g10, false);
        s6=new Signal("Signal 6", g6, true);
        s7=new Signal("Signal 7", g11, false);
        s8=new Signal("Signal 8", g12, false);
        s9=new Signal("Signal 9", g10, true);
        s10=new Signal("Signal 10", g11, true);
        s11=new Signal("Signal 11", g1, false);
        s12=new Signal("Signal 12", g1, true);
        s13=new Signal("Signal 13", g3, true);
        s14=new Signal("Signal 14", g4, true);
        s15=new Signal("Signal 15", g2, false);
        s16=new Signal("Signal 16", g13, true);
        s17=new Signal("Signal 17", g15, false);
        s18=new Signal("Signal 18", g15, true);
        s20=new Signal("Signal 20", g17, true);
        s21=new Signal("Signal 21", g19, false);
        s22=new Signal("Signal 22", g19, true);
        s25=new Signal("Signal 25", g23, false);
        s26=new Signal("Signal 26", g25, false);
        s30=new Signal("Signal 30", g23, true);
        s31=new Signal("Signal 31", g25, true);
        g1.setSignal(s11);
        g1.setSignal(s12);
        g2.setSignal(s15);
        g3.setSignal(s13);
        g4.setSignal(s14);
        g5.setSignal(null);
        g6.setSignal(s1);
        g6.setSignal(s6);
        g7.setSignal(s2);
        g8.setSignal(s3);
        g9.setSignal(s4);
        g10.setSignal(s5);
        g10.setSignal(s9);
        g11.setSignal(s7);
        g11.setSignal(s10);
        g12.setSignal(s8);
        g13.setSignal(s16);
        g14.setSignal(null);
        g15.setSignal(s17);
        g15.setSignal(s18);
        g16.setSignal(null);
        g17.setSignal(s20);
        g18.setSignal(null);
        g19.setSignal(s21);
        g19.setSignal(s22);
        g20.setSignal(null);
        g21.setSignal(null);
        g22.setSignal(null);
        g23.setSignal(s25);
        g23.setSignal(s30);
        g24.setSignal(null);
        g25.setSignal(s31);
        g25.setSignal(s26);
        g26.setSignal(null);
        g27.setSignal(null);
        g28.setSignal(null);
        g29.setSignal(null);
        s= new Signal[25];
        s[0]=s1;
        s[1]=s2;
        s[2]=s3;
        s[3]=s4;
        s[4]=s5;
        s[5]=s6;
        s[6]=s7;
        s[7]=s8;
        s[8]=s9;
        s[9]=s10;
        s[10]=s11;
        s[11]=s12;
        s[12]=s13;
        s[13]=s14;
        s[14]=s15;
        s[15]=s16;
        s[16]=s17;
        s[17]=s18;
        s[18]=s20;
        s[19]=s21;
        s[20]=s22;
        s[21]=s25;
        s[22]=s26;
        s[23]=s30;
        s[24]=s31;
        w= new Weiche[23];
        w[0]=w1;
        w[1]=w2;
        w[2]=w3;
        w[3]=w5;
        w[4]=w6;
        w[5]=w7;
        w[6]=w8;
        w[7]=w10;
        w[8]=w11;
        w[9]=w12;
        w[10]=w13;
        w[11]=w14;
        w[12]=w15;
        w[13]=w16;
        w[14]=w17;
        w[15]=w37;
        w[16]=w38;
        w[17]=w39;
        w[18]=w40;
        w[19]=w41;
        w[20]=w42;
        w[21]=w43;
        w[22]=w44;
        g= new Gleisstueck[30];
        g[1]=g1;
        g[2]=g2;
        g[3]=g3;
        g[4]=g4;
        g[5]=g5;
        g[6]=g6;
        g[7]=g7;
        g[8]=g8;
        g[9]=g9;
        g[10]=g10;
        g[11]=g11;
        g[12]=g12;
        g[13]=g13;
        g[14]=g14;
        g[15]=g15;
        g[16]=g16;
        g[17]=g17;
        g[18]=g18;
        g[19]=g19;
        g[20]=g20;
        g[21]=g21;
        g[22]=g22;
        g[23]=g23;
        g[24]=g24;
        g[25]=g25;
        g[26]=g26;
        g[27]=g27;
        g[28]=g28;
        g[29]=g29;
    }

Output:
    public Datenmodell()
    {
        g1=new Gleisstueck("Gleisstueck 1", 640);
        g2=new Gleisstueck("Gleisstueck 2", 320);
        g3=new Gleisstueck("Gleisstueck 3", 590);
        g4=new Gleisstueck("Gleisstueck 4", 190);
        g5=new Gleisstueck("Gleisstueck 5", 210);
        g6=new Gleisstueck("Gleisstueck 6", 260);
        g7=new Gleisstueck("Gleisstueck 7", 730);
        g8=new Gleisstueck("Gleisstueck 8", 200);
        g9=new Gleisstueck("Gleisstueck 9", 190);
        g10=new Gleisstueck("Gleisstueck 10", 570);
        g11=new Gleisstueck("Gleisstueck 11", 700);
        g12=new Gleisstueck("Gleisstueck 12", 220);
        g13=new Gleisstueck("Gleisstueck 13", 260);
        g14=new Gleisstueck("Gleisstueck 14", 60);
        g15=new Gleisstueck("Gleisstueck 15", 690);
        g16=new Gleisstueck("Gleisstueck 16", 330);
        g17=new Gleisstueck("Gleisstueck 17", 250);
        g18=new Gleisstueck("Gleisstueck 18", 80);
        g19=new Gleisstueck("Gleisstueck 19", 690);
        g20=new Gleisstueck("Gleisstueck 20", 60);
        g21=new Gleisstueck("Gleisstueck 21", 51);
        g22=new Gleisstueck("Gleisstueck 22", 50);
        g23=new Gleisstueck("Gleisstueck 23", 690);
        g24=new Gleisstueck("Gleisstueck 24", 120);
        g25=new Gleisstueck("Gleisstueck 25", 1220);
        g26=new Gleisstueck("Gleisstueck 26", 60);
        g27=new Gleisstueck("Gleisstueck 27", 50);
        g28=new Gleisstueck("Gleisstueck 28", 50);
        g29=new Gleisstueck("Gleisstueck 29", 60);
        w1=new Weiche("Weiche 1",g5,g9,g27);
        w2=new Weiche("Weiche 2",g10,g27,g9);
        w3=new Weiche("Weiche 3",g6,g1,g27);
        w5=new Weiche("Weiche 5",g28,g1,g2);
        w6=new Weiche("Weiche 6",g3,g4,g28);
        w7=new Weiche("Weiche 7",g7,g11,g6);
        w8=new Weiche("Weiche 8",g10,g6,g11);
        w10=new Weiche("Weiche 10",g11,g25,g26);
        w11=new Weiche("Weiche 11",g7,g26,g8);
        w12=new Weiche("Weiche 12",g8,g12,g26);
        w13=new Weiche("Weiche 13",g13,g17,g14);
        w14=new Weiche("Weiche 14",g18,g14,g17);
        w15=new Weiche("Weiche 15",g15,g19,g14);
        w16=new Weiche("Weiche 16",g18,g14,g29);
        w40=new Weiche("Weiche 40",g16,g20,g15);
        w39=new Weiche("Weiche 39",g15,g19,g20);
        w44=new Weiche("Weiche 44",g22,g16,g3);
        w43=new Weiche("Weiche 43",g4,g3,g22);
        w38=new Weiche("Weiche 38",g21,g24,g20);
        w37=new Weiche("Weiche 37",g23,g20,g24);
        w42=new Weiche("Weiche 42",g21,g24,g22);
        w41=new Weiche("Weiche 41",g25,g22,g24);
        w17=new Weiche("Weiche 17",g19,g23,g29);
        g1.setWeichen(w3, w5);
        g2.setWeichen(w5, null);
        g3.setWeichen(w44, w6);
        g4.setWeichen(w43, w6);
        g5.setWeichen(null, w1);
        g6.setWeichen(w3, w7);
        g7.setWeichen(w7, w11);
        g8.setWeichen(w11, null);
        g9.setWeichen(null, w2);
        g10.setWeichen(w2, w8);
        g11.setWeichen(w8, w10);
        g12.setWeichen(w12, null);
        g13.setWeichen(null, w13);
        g14.setWeichen(w13, w15);
        g15.setWeichen(w15, w40);
        g16.setWeichen(w40, w44);
        g17.setWeichen(null, w14);
        g18.setWeichen(w14, w16);
        g19.setWeichen(w17, w39);
        g20.setWeichen(w39, w38);
        g21.setWeichen(w38, w42);
        g22.setWeichen(w42, w43);
        g23.setWeichen(w17, w37);
        g24.setWeichen(w37, w41);
        g25.setWeichen(w41, w10);
        g26.setWeichen(w10, w12);
        g27.setWeichen(w1, w3);
        g28.setWeichen(w6, w5);
        g29.setWeichen(w16, w17);
        s1=new Signal("Signal 1", g6, false);
        s2=new Signal("Signal 2", g7, false);
        s3=new Signal("Signal 3", g8, false);
        s4=new Signal("Signal 4", g9, true);
        s5=new Signal("Signal 5", g10, false);
        s6=new Signal("Signal 6", g6, true);
        s7=new Signal("Signal 7", g11, false);
        s8=new Signal("Signal 8", g12, false);
        s9=new Signal("Signal 9", g10, true);
        s10=new Signal("Signal 10", g11, true);
        s11=new Signal("Signal 11", g1, false);
        s12=new Signal("Signal 12", g1, true);
        s13=new Signal("Signal 13", g3, true);
        s14=new Signal("Signal 14", g4, true);
        s15=new Signal("Signal 15", g2, false);
        s16=new Signal("Signal 16", g13, true);
        s17=new Signal("Signal 17", g15, false);
        s18=new Signal("Signal 18", g15, true);
        s20=new Signal("Signal 20", g17, true);
        s21=new Signal("Signal 21", g19, false);
        s22=new Signal("Signal 22", g19, true);
        s25=new Signal("Signal 25", g23, false);
        s26=new Signal("Signal 26", g25, false);
        s30=new Signal("Signal 30", g23, true);
        s31=new Signal("Signal 31", g25, true);
        g1.setSignal(s11);
        g1.setSignal(s12);
        g2.setSignal(s15);
        g3.setSignal(s13);
        g4.setSignal(s14);
        g6.setSignal(s1);
        g6.setSignal(s6);
        g7.setSignal(s2);
        g8.setSignal(s3);
        g9.setSignal(s4);
        g10.setSignal(s5);
        g10.setSignal(s9);
        g11.setSignal(s7);
        g11.setSignal(s10);
        g12.setSignal(s8);
        g13.setSignal(s16);
        g15.setSignal(s17);
        g15.setSignal(s18);
        g17.setSignal(s20);
        g19.setSignal(s21);
        g19.setSignal(s22);
        g23.setSignal(s25);
        g23.setSignal(s30);
        g25.setSignal(s31);
        g25.setSignal(s26);
        s= new Signal[25];
        s[0]=s1;
        s[1]=s2;
        s[2]=s3;
        s[3]=s4;
        s[4]=s5;
        s[5]=s6;
        s[6]=s7;
        s[7]=s8;
        s[8]=s9;
        s[9]=s10;
        s[10]=s11;
        s[11]=s12;
        s[12]=s13;
        s[13]=s14;
        s[14]=s15;
        s[15]=s16;
        s[16]=s17;
        s[17]=s18;
        s[18]=s20;
        s[19]=s21;
        s[20]=s22;
        s[21]=s25;
        s[22]=s26;
        s[23]=s30;
        s[24]=s31;
        w= new Weiche[23];
        w[0]=w1;
        w[1]=w2;
        w[2]=w3;
        w[3]=w5;
        w[4]=w6;
        w[5]=w7;
        w[6]=w8;
        w[7]=w10;
        w[8]=w11;
        w[9]=w12;
        w[10]=w13;
        w[11]=w14;
        w[12]=w15;
        w[13]=w16;
        w[14]=w17;
        w[15]=w37;
        w[16]=w38;
        w[17]=w39;
        w[18]=w40;
        w[19]=w41;
        w[20]=w42;
        w[21]=w43;
        w[22]=w44;
        g= new Gleisstueck[30];
        g[1]=g1;
        g[2]=g2;
        g[3]=g3;
        g[4]=g4;
        g[5]=g5;
        g[6]=g6;
        g[7]=g7;
        g[8]=g8;
        g[9]=g9;
        g[10]=g10;
        g[11]=g11;
        g[12]=g12;
        g[13]=g13;
        g[14]=g14;
        g[15]=g15;
        g[16]=g16;
        g[17]=g17;
        g[18]=g18;
        g[19]=g19;
        g[20]=g20;
        g[21]=g21;
        g[22]=g22;
        g[23]=g23;
        g[24]=g24;
        g[25]=g25;
        g[26]=g26;
        g[27]=g27;
        g[28]=g28;
        g[29]=g29;
    }


Input:
	public void click_btn_finish(View view)
	{
		printErr(false, "");
		double solution = 0;
		boolean error_occurred = false;
		String leftOpStr = lOperand.getText().toString();
		String rightOpStr = rOperand.getText().toString();
		char operator = ((String) txt_signPlaceholder.getText()).charAt(0);
		double leftOperand = 0, rightOperand = 0;
		try
		{
			leftOperand = Double.parseDouble(leftOpStr);
		} catch (NumberFormatException e)
		{
			error_occurred = true;
			printErr(true, "Enter a valid number as the left operand.\n");
		}
		try
		{
			rightOperand = Double.parseDouble(rightOpStr);
		} catch (NumberFormatException e)
		{
			error_occurred = true;
			printErr(true, "Enter a valid number as the right operand.\n");
		}
		if (!error_occurred)
		{
			try
			{
				solution = Calculator.calculate(leftOperand, operator,
						rightOperand);
			} catch (ArithmeticException a)
			{
				printErr(true,
						"Cannot Divide by Zero! Some men just want to watch the world burn!\n");
			} catch (IllegalArgumentException i)
			{
				printErr(true, "Please select an operator.\n");
			}
		}
		if (!error_occurred)
			outputBox.setText("Answer: " + solution);
		else
			outputBox.setText("Answer: ");
	}

Output:
	public void click_btn_finish(View view)
	{
		printErr(false, "");
		double solution = 0;
		boolean error_occurred = false;
		String leftOpStr = lOperand.getText().toString();
		String rightOpStr = rOperand.getText().toString();
		char operator = ((String) txt_signPlaceholder.getText()).charAt(0);
		double leftOperand = 0, rightOperand = 0;
		try
		{
			leftOperand = Double.parseDouble(leftOpStr);
		} catch (NumberFormatException e)
		{
			error_occurred = true;
			printErr(true, "Enter a valid number as the left operand.\n");
		}
		try
		{
			rightOperand = Double.parseDouble(rightOpStr);
		} catch (NumberFormatException e)
		{
			error_occurred = true;
			printErr(true, "Enter a valid number as the right operand.\n");
		}
		if (!error_occurred)
		{
			try
			{
				solution = Calculator.calculate(leftOperand, operator,
						rightOperand);
			} catch (ArithmeticException a)
			{
				printErr(true,
						"Cannot Divide by Zero! Some men just want to watch the world burn!\n");
				error_occurred=true;
			} catch (IllegalArgumentException i)
			{
				printErr(true, "Please select an operator.\n");
				error_occurred=true;
			}
		}
		if (!error_occurred)
			outputBox.setText("Answer: " + solution);
		else
			outputBox.setText("Answer: ");
	}


Input:
		public void CreateAdRequest(Activity activity,
				LinearLayout view) {
			adview = new AdView(activity, AdSize.BANNER,
					myAdID);
			view.addView(adview);
			AdRequest adRequest = new AdRequest();
			adRequest.addTestDevice(AdRequest.TEST_EMULATOR);
			adRequest.addTestDevice(myTestDevice);
			adview.loadAd(adRequest);
		}

Output:
		public void CreateAdRequest(Activity activity,
				LinearLayout view) {
			adview = new AdView(activity, AdSize.BANNER,
					myAdID);
			view.addView(adview);
			AdRequest adRequest = new AdRequest();
			if(BuildConfig.DEBUG){
				adRequest.addTestDevice(AdRequest.TEST_EMULATOR);
				adRequest.addTestDevice(myTestDevice);
			}
			adview.loadAd(adRequest);
		}


Input:
    public void registerDataTableAndParseAPI(ASMDataTable dataTable)
    {
        this.dataTable = dataTable;
        Set<ASMData> apiList = dataTable.getAll("cpw.mods.fml.common.API");
        apiContainers = Maps.newHashMap();
        for (ASMData data : apiList)
        {
            Map<String, Object> annotationInfo = data.getAnnotationInfo();
            String apiPackage = data.getClassName().substring(0,data.getClassName().indexOf(".package-info"));
            String providedAPI = (String) annotationInfo.get("provides");
            String apiOwner = (String) annotationInfo.get("owner");
            String apiVersion = (String) annotationInfo.get("apiVersion");
            APIContainer container = apiContainers.get(providedAPI);
            if (container == null)
            {
                container = new APIContainer(providedAPI, apiVersion, data.getCandidate().getModContainer(), VersionParser.parseVersionReference(apiOwner));
                apiContainers.put(providedAPI, container);
            }
            else
            {
                container.validate(providedAPI, apiOwner, apiVersion);
            }
            container.addOwnedPackage(apiPackage);
            for (ModContainer mc : data.getCandidate().getContainedMods())
            {
                String embeddedIn = mc.getModId();
                if (container.currentReferents.contains(embeddedIn))
                {
                    continue;
                }
                FMLLog.fine("Found API %s (owned by %s providing %s) embedded in %s",apiPackage, apiOwner, providedAPI, embeddedIn);
                if (!embeddedIn.equals(apiOwner))
                {
                    container.addAPIReference(embeddedIn);
                }
            }
        }
        for (APIContainer container : apiContainers.values())
        {
            for (String pkg : container.packages)
            {
                Set<ModCandidate> candidates = dataTable.getCandidatesFor(pkg);
                for (ModCandidate candidate : candidates)
                {
                    List<String> candidateIds = Lists.transform(candidate.getContainedMods(), new ModIdFunction());
                    if (!candidateIds.contains(container.ownerMod.getLabel()) && !container.currentReferents.containsAll(candidateIds))
                    {
                        FMLLog.info("Found mod(s) %s containing declared API package %s (owned by %s) without associated API reference",candidateIds, pkg, container.ownerMod);
                        container.addAPIReferences(candidateIds);
                    }
                }
            }
            FMLLog.fine("Creating API container dummy for API %s: owner: %s, dependents: %s", container.providedAPI, container.ownerMod, container.referredMods);
        }
    }

Output:
    public void registerDataTableAndParseAPI(ASMDataTable dataTable)
    {
        this.dataTable = dataTable;
        Set<ASMData> apiList = dataTable.getAll("cpw.mods.fml.common.API");
        apiContainers = Maps.newHashMap();
        for (ASMData data : apiList)
        {
            Map<String, Object> annotationInfo = data.getAnnotationInfo();
            String apiPackage = data.getClassName().substring(0,data.getClassName().indexOf(".package-info"));
            String providedAPI = (String) annotationInfo.get("provides");
            String apiOwner = (String) annotationInfo.get("owner");
            String apiVersion = (String) annotationInfo.get("apiVersion");
            APIContainer container = apiContainers.get(providedAPI);
            if (container == null)
            {
                container = new APIContainer(providedAPI, apiVersion, data.getCandidate().getModContainer(), VersionParser.parseVersionReference(apiOwner));
                apiContainers.put(providedAPI, container);
            }
            else
            {
                container.validate(providedAPI, apiOwner, apiVersion);
            }
            container.addOwnedPackage(apiPackage);
            for (ModContainer mc : data.getCandidate().getContainedMods())
            {
                String embeddedIn = mc.getModId();
                if (container.currentReferents.contains(embeddedIn))
                {
                    continue;
                }
                FMLLog.fine("Found API %s (owned by %s providing %s) embedded in %s",apiPackage, apiOwner, providedAPI, embeddedIn);
                if (!embeddedIn.equals(apiOwner))
                {
                    container.addAPIReference(embeddedIn);
                }
            }
        }
        for (APIContainer container : apiContainers.values())
        {
            for (String pkg : container.packages)
            {
                Set<ModCandidate> candidates = dataTable.getCandidatesFor(pkg);
                for (ModCandidate candidate : candidates)
                {
                    List<String> candidateIds = Lists.transform(candidate.getContainedMods(), new ModIdFunction());
                    if (!candidateIds.contains(container.ownerMod.getLabel()) && !container.currentReferents.containsAll(candidateIds))
                    {
                        FMLLog.info("Found mod(s) %s containing declared API package %s (owned by %s) without associated API reference",candidateIds, pkg, container.ownerMod);
                        container.addAPIReferences(candidateIds);
                    }
                }
            }
            if (apiContainers.containsKey(container.ownerMod.getLabel()))
            {
                ArtifactVersion owner = container.ownerMod;
                do
                {
                    APIContainer parent = apiContainers.get(owner.getLabel());
                    FMLLog.finest("Removing upstream parent %s from %s", parent.ownerMod.getLabel(), container);
                    container.currentReferents.remove(parent.ownerMod.getLabel());
                    container.referredMods.remove(parent.ownerMod);
                    owner = parent.ownerMod;
                }
                while (apiContainers.containsKey(owner.getLabel()));
            }
            FMLLog.fine("Creating API container dummy for API %s: owner: %s, dependents: %s", container.providedAPI, container.ownerMod, container.referredMods);
        }
    }


Input:
	public static void shuffle(int[] array) {
		if (array == null) {
			return;
		}
		Random rand = new Random();
		for (int index = array.length - 1; index >= 1; index--) {
			ArrayUtils.swap(array, index, rand.nextInt(index));
		}
	}

Output:
	public static void shuffle(int[] array) {
		if (array == null) {
			return;
		}
		Random rand = new Random();
		for (int index = array.length - 1; index >= 1; index--) {
			ArrayUtils.swap(array, index, rand.nextInt(index + 1));
		}
	}


Input:
private void playMyEnglish(int initProgress){
		currentPrefValue = sharedPref.getString("prefix","AD");
        String prefix=currentPrefValue;
        sdDir = Environment.getExternalStorageDirectory();
        path = sdDir.getPath()+MP3_folder+"/";
        fileName = prefix + date + ".MP3";
        File f=new File(path + fileName);
        String today = String.format("%d年%d月%d日", cYear, cMonth+1,cDay);;
        textViewInfo.setText("今天是：" + today);
        textViewInfo.append("\n目标文件：" + fileName);
        if(f.exists()){
        	try {
        			mediaPlayer = new MediaPlayer();
        		mediaPlayer.setDataSource(path + fileName);
				mediaPlayer.prepare();
				int duration_milisecond = mediaPlayer.getDuration();
				seekBar.setMax(duration_milisecond);
                mTimer = new Timer();
                mTimerTask = new TimerTask() {
                    @Override
                    public void run() {
                        if(isChanging==true) {
                            return;
                        }
                        int current_position_milisecond = mediaPlayer.getCurrentPosition();
                        Message msg = new Message();
                        msg.what = 1;
                        Bundle bundle = new Bundle();
                        bundle.putInt("current_position_milisecond", current_position_milisecond);
                        msg.setData(bundle);
                        mHandler.sendMessage(msg);
                    }
                };
                mTimer.schedule(mTimerTask, 0, 100);
    			if(initProgress>0 && initProgress<duration_milisecond){
    				mediaPlayer.seekTo(initProgress);
    				seekBar.setProgress(initProgress);
    			}
				mediaPlayer.start();
				String html = "
正在播放文件：" + fileName + "";
				textViewInfo.append(Html.fromHtml(html));
				int duration_minute = duration_milisecond/1000/60;
				int duration_second = duration_milisecond/1000%60;
				textViewInfo.append("\n文件总时长：" + duration_minute + "分" + duration_second + "秒");
				buttonControl.setText(getResources().getString(R.string.pause));
				buttonControl.setEnabled(true);
		        mediaPlayer.setOnCompletionListener(new OnCompletionListener(){
		            @Override
		            public void onCompletion(MediaPlayer mp) {
		            	buttonControl.setText(getResources().getString(R.string.restart));
		            	mTimerTask.cancel();
		                mp.release();
		            }
		         });
			} catch (IOException e) {
				e.printStackTrace();
			}
        }
        else{
        	textViewInfo.append("\n找不到文件!");
        	textViewTimeRemaining.setText("剩余时间/已经播放时间：0");
        	buttonControl.setEnabled(false);
        }
     }

Output:
	private void playMyEnglish(int initProgress){
		currentPrefValue = sharedPref.getString("prefix","AD");
        String prefix=currentPrefValue;
        sdDir = Environment.getExternalStorageDirectory();
        path = sdDir.getPath()+MP3_folder+"/";
        fileName = prefix + date + ".MP3";
        File f=new File(path + fileName);
        String today = String.format("%d年%d月%d日", cYear, cMonth+1,cDay);;
        textViewInfo.setText("今天是：" + today);
        textViewInfo.append("\n目标文件：" + fileName);
        if(f.exists()){
        	try {
        			mediaPlayer = new MediaPlayer();
        		mediaPlayer.setDataSource(path + fileName);
				mediaPlayer.prepare();
				int duration_milisecond = mediaPlayer.getDuration();
				seekBar.setMax(duration_milisecond);
                mTimer = new Timer();
                mTimerTask = new TimerTask() {
                    @Override
                    public void run() {
                        if(isChanging==true) {
                            return;
                        }
                        int current_position_milisecond = mediaPlayer.getCurrentPosition();
                        Message msg = new Message();
                        msg.what = 1;
                        Bundle bundle = new Bundle();
                        bundle.putInt("current_position_milisecond", current_position_milisecond);
                        msg.setData(bundle);
                        mHandler.sendMessage(msg);
                    }
                };
                mTimer.schedule(mTimerTask, 0, 100);
    			if(initProgress>0 && initProgress<duration_milisecond){
    				mediaPlayer.seekTo(initProgress);
    				seekBar.setProgress(initProgress);
    			}
				mediaPlayer.start();
				String html = "<br><font color=\"#00bbaa\">正在播放文件：" + fileName + "</font>";
				textViewInfo.append(Html.fromHtml(html));
				int duration_minute = duration_milisecond/1000/60;
				int duration_second = duration_milisecond/1000%60;
				textViewInfo.append("\n文件总时长：" + duration_minute + "分" + duration_second + "秒");
				buttonControl.setText(getResources().getString(R.string.pause));
				buttonControl.setEnabled(true);
		        mediaPlayer.setOnCompletionListener(new OnCompletionListener(){
		            @Override
		            public void onCompletion(MediaPlayer mp) {
		            	buttonControl.setText(getResources().getString(R.string.restart));
		            	mTimerTask.cancel();
		                mp.release();
		            }
		         });
			} catch (IOException e) {
				e.printStackTrace();
			}
        }
        else{
        	String fileNotFound = "<br><font color=\"red\">找不到文件！请查看帮助、更改设置、或联系作者。</font>";
			textViewInfo.append(Html.fromHtml(fileNotFound));
        	textViewTimeRemaining.setText("剩余时间/已经播放时间：0");
        	buttonControl.setEnabled(false);
        }
     }


Input:
	protected void prepare(Environment env)
	{
		throwsDefinitions.add(env.analysisException);
		IClassDefinition c = classDefinition;
		StringBuilder sb = new StringBuilder();
		sb.append("\t/**\n");
		sb.append("\t* Called by the {@link "
				+ AnalysisUtil.getClass(env, c).getName().getName()
				+ "} node from {@link "
				+ AnalysisUtil.getClass(env, c).getName().getName() + "#apply("
				+ env.getTaggedDef(env.TAG_IAnalysis).getName().getName()
				+ ")}.\n");
		sb.append("\t* @param node the calling {@link "
				+ AnalysisUtil.getClass(env, c).getName().getName()
				+ "} node\n");
		sb.append("\t*/");
		this.javaDoc = sb.toString();
		String thisNodeMethodName = NameUtil.getClassName(AnalysisUtil.getCaseClass(env, c).getName().getName());
		this.name = "case" + thisNodeMethodName;
		this.setupArguments(env);
		this.requiredImports.add("java.util.ArrayList");
		this.requiredImports.add("java.util.List");
		this.requiredImports.add(env.analysisException.getName().getCanonicalName());
		StringBuffer bodySb = new StringBuffer();
		if (!(c instanceof ExternalJavaClassDefinition && ((ExternalJavaClassDefinition) c).extendsNode))
		{
			bodySb.append("\t\t_visitedNodes.add(node);\n");
		}
		if (addReturnToBody)
		{
			bodySb.append("\t\tA retVal = createNewReturnValue("
					+ getAdditionalBodyCallArguments() + ");\n");
		}
		bodySb.append("\t\t"
				+ wrapForMerge("in" + thisNodeMethodName + "("
						+ getAdditionalBodyCallArguments()) + ");\n\n");
		List<Field> allFields = new Vector<Field>();
		allFields.addAll(c.getInheritedFields());
		allFields.addAll(c.getFields());
		for (Field f : allFields)
		{
			boolean externalNode = false;
			if (f.isTokenField)
			{
				if (f.isTypeExternalNode())
				{
					externalNode = true;
				} else
				{
					continue;
				}
			}
			Method getMethod = new GetMethod(c, f);
			getMethod.getJavaSourceCode(env);
			String getMethodName = getMethod.name;
			String getter = "node." + getMethodName + "()";
			requiredImports.addAll(getMethod.getRequiredImports(env));
			if (!f.isList)
			{
				bodySb.append("\t\tif("
						+ getter
						+ " != null "
						+ (!externalNode ? "&& !_" + visitedNodesField.name
								+ ".contains(" + getter + ")" : "") + ") \n");
				bodySb.append("\t\t{\n");
				bodySb.append("\t\t\t"
						+ wrapForMerge(getter + ".apply(" + getCallArguments())
						+ ");\n");
				bodySb.append("\t\t}\n");
			} else if (f.isList && !f.isDoubleList)
			{
				bodySb.append("\t\t{\n");
				bodySb.append("\t\t\tList<" + f.getInnerTypeForList(env)
						+ "> copy = new ArrayList<"
						+ f.getInnerTypeForList(env) + ">(" + getter + ");\n");
				bodySb.append("\t\t\tfor( " + f.getInnerTypeForList(env)
						+ " e : copy) \n");
				bodySb.append("\t\t\t{\n");
				if (!externalNode)
				{
					bodySb.append("\t\t\t\tif(!_" + visitedNodesField.name
							+ ".contains(e))\n");
					bodySb.append("\t\t\t\t{\n");
					bodySb.append("\t\t\t\t\t"
							+ wrapForMerge("e.apply(" + getCallArguments())
							+ ");\n");
					bodySb.append("\t\t\t\t}\n");
				} else
				{
					bodySb.append("\t\t\t\t"
							+ wrapForMerge("e.apply(" + getCallArguments())
							+ ");\n");
				}
				bodySb.append("\t\t\t}\n");
				bodySb.append("\t\t}\n");
			} else if (f.isDoubleList)
			{
				bodySb.append("\t\t{\n");
				bodySb.append("\t\t\tList<List<" + f.getInnerTypeForList(env)
						+ ">> copy = new ArrayList<List<"
						+ f.getInnerTypeForList(env) + ">>(" + getter + ");\n");
				bodySb.append("\t\t\tfor( List<" + f.getInnerTypeForList(env)
						+ "> list : copy) {\n");
				bodySb.append("\t\t\t\tfor( " + f.getInnerTypeForList(env)
						+ " e : list) \n");
				bodySb.append("\t\t\t{\n");
				if (!externalNode)
				{
					bodySb.append("\t\t\t\t\tif(!_" + visitedNodesField.name
							+ ".contains(e))\n");
					bodySb.append("\t\t\t\t\t{\n");
					bodySb.append("\t\t\t\t\t\t"
							+ wrapForMerge("e.apply(" + getCallArguments())
							+ ");\n");
					bodySb.append("\t\t\t\t\t}\n");
				} else
				{
					bodySb.append("\t\t\t\t\t"
							+ wrapForMerge("e.apply(" + getCallArguments())
							+ ");\n");
				}
				bodySb.append("\t\t\t\t}\n");
				bodySb.append("\t\t\t}\n");
				bodySb.append("\t\t}\n");
			}
		}
		bodySb.append("\n\t\t"
				+ wrapForMerge("out" + thisNodeMethodName + "("
						+ getAdditionalBodyCallArguments()) + ");\n");
		if (addReturnToBody)
		{
			bodySb.append("\t\treturn retVal;");
		}
		this.body = bodySb.toString();
	}

Output:
	protected void prepare(Environment env)
	{
		throwsDefinitions.add(env.analysisException);
		IClassDefinition c = classDefinition;
		StringBuilder sb = new StringBuilder();
		sb.append("\t/**\n");
		sb.append("\t* Called by the {@link "
				+ AnalysisUtil.getClass(env, c).getName().getName()
				+ "} node from {@link "
				+ AnalysisUtil.getClass(env, c).getName().getName() + "#apply("
				+ env.getTaggedDef(env.TAG_IAnalysis).getName().getName()
				+ ")}.\n");
		sb.append("\t* @param node the calling {@link "
				+ AnalysisUtil.getClass(env, c).getName().getName()
				+ "} node\n");
		sb.append("\t*/");
		this.javaDoc = sb.toString();
		String thisNodeMethodName = NameUtil.getClassName(AnalysisUtil.getCaseClass(env, c).getName().getName());
		this.name = "case" + thisNodeMethodName;
		this.setupArguments(env);
		this.requiredImports.add("java.util.ArrayList");
		this.requiredImports.add("java.util.List");
		this.requiredImports.add(env.analysisException.getName().getCanonicalName());
		StringBuffer bodySb = new StringBuffer();
		if (!(c instanceof ExternalJavaClassDefinition) ||(c instanceof ExternalJavaClassDefinition && ((ExternalJavaClassDefinition) c).extendsNode))
		{
			bodySb.append("\t\t_visitedNodes.add(node);\n");
		}
		if (addReturnToBody)
		{
			bodySb.append("\t\tA retVal = createNewReturnValue("
					+ getAdditionalBodyCallArguments() + ");\n");
		}
		bodySb.append("\t\t"
				+ wrapForMerge("in" + thisNodeMethodName + "("
						+ getAdditionalBodyCallArguments()) + ");\n\n");
		List<Field> allFields = new Vector<Field>();
		allFields.addAll(c.getInheritedFields());
		allFields.addAll(c.getFields());
		for (Field f : allFields)
		{
			boolean externalNode = false;
			if (f.isTokenField)
			{
				if (f.isTypeExternalNode())
				{
					externalNode = true;
				} else
				{
					continue;
				}
			}
			Method getMethod = new GetMethod(c, f);
			getMethod.getJavaSourceCode(env);
			String getMethodName = getMethod.name;
			String getter = "node." + getMethodName + "()";
			requiredImports.addAll(getMethod.getRequiredImports(env));
			if (!f.isList)
			{
				bodySb.append("\t\tif("
						+ getter
						+ " != null "
						+ (!externalNode ? "&& !_" + visitedNodesField.name
								+ ".contains(" + getter + ")" : "") + ") \n");
				bodySb.append("\t\t{\n");
				bodySb.append("\t\t\t"
						+ wrapForMerge(getter + ".apply(" + getCallArguments())
						+ ");\n");
				bodySb.append("\t\t}\n");
			} else if (f.isList && !f.isDoubleList)
			{
				bodySb.append("\t\t{\n");
				bodySb.append("\t\t\tList<" + f.getInnerTypeForList(env)
						+ "> copy = new ArrayList<"
						+ f.getInnerTypeForList(env) + ">(" + getter + ");\n");
				bodySb.append("\t\t\tfor( " + f.getInnerTypeForList(env)
						+ " e : copy) \n");
				bodySb.append("\t\t\t{\n");
				if (!externalNode)
				{
					bodySb.append("\t\t\t\tif(!_" + visitedNodesField.name
							+ ".contains(e))\n");
					bodySb.append("\t\t\t\t{\n");
					bodySb.append("\t\t\t\t\t"
							+ wrapForMerge("e.apply(" + getCallArguments())
							+ ");\n");
					bodySb.append("\t\t\t\t}\n");
				} else
				{
					bodySb.append("\t\t\t\t"
							+ wrapForMerge("e.apply(" + getCallArguments())
							+ ");\n");
				}
				bodySb.append("\t\t\t}\n");
				bodySb.append("\t\t}\n");
			} else if (f.isDoubleList)
			{
				bodySb.append("\t\t{\n");
				bodySb.append("\t\t\tList<List<" + f.getInnerTypeForList(env)
						+ ">> copy = new ArrayList<List<"
						+ f.getInnerTypeForList(env) + ">>(" + getter + ");\n");
				bodySb.append("\t\t\tfor( List<" + f.getInnerTypeForList(env)
						+ "> list : copy) {\n");
				bodySb.append("\t\t\t\tfor( " + f.getInnerTypeForList(env)
						+ " e : list) \n");
				bodySb.append("\t\t\t{\n");
				if (!externalNode)
				{
					bodySb.append("\t\t\t\t\tif(!_" + visitedNodesField.name
							+ ".contains(e))\n");
					bodySb.append("\t\t\t\t\t{\n");
					bodySb.append("\t\t\t\t\t\t"
							+ wrapForMerge("e.apply(" + getCallArguments())
							+ ");\n");
					bodySb.append("\t\t\t\t\t}\n");
				} else
				{
					bodySb.append("\t\t\t\t\t"
							+ wrapForMerge("e.apply(" + getCallArguments())
							+ ");\n");
				}
				bodySb.append("\t\t\t\t}\n");
				bodySb.append("\t\t\t}\n");
				bodySb.append("\t\t}\n");
			}
		}
		bodySb.append("\n\t\t"
				+ wrapForMerge("out" + thisNodeMethodName + "("
						+ getAdditionalBodyCallArguments()) + ");\n");
		if (addReturnToBody)
		{
			bodySb.append("\t\treturn retVal;");
		}
		this.body = bodySb.toString();
	}


Input:
    public static int getBufferSize() {
        int result = BUFFER_SIZE;
        try {
            result = Integer.parseInt(System.getProperties().getProperty(
                    "org.restlet.engine.io.buffer.size"));
        } catch (NumberFormatException nfe) {
            result = BUFFER_SIZE;
        }
        return result;
    }

Output:
    public static int getBufferSize() {
        int result = BUFFER_SIZE;
        try {
            result = Integer.parseInt(System
                    .getProperty("org.restlet.engine.io.buffer.size"));
        } catch (NumberFormatException nfe) {
            result = BUFFER_SIZE;
        }
        return result;
    }


Input:
void show(Contact contact) {
		if (contact != null) {
			if (contact.hasBirthday()) {
				bdayIcon.setVisible(true);
			} else {
				bdayIcon.setVisible(false);
			}
			if (contact.hasNameDay()) {
				namedayIcon.setVisible(true);
			} else {
				namedayIcon.setVisible(false);
			}
			if (contact.hasCelebration()) {
				celebrationIcon.setVisible(true);
			} else {
				celebrationIcon.setVisible(false);
			}
			photo.setContact(contact);
			photo.setVisible(true);
			name.setText(String.format("
" + contact.getFullName() + "
"));
			if (contact.getNickName() != null && !contact.getNickName().isEmpty()) {
				nicknameLabel.setVisible(true);
				nickname.setVisible(true);
				nickname.setText(contact.getNickName());
			} else {
				nicknameLabel.setVisible(false);
				nickname.setVisible(false);
			}
			address.removeAll();
			addressLabel.setVisible(false);
			for (Address a : contact.getAdresses()) {
				if (!a.getAddress().isEmpty()) {
					addressLabel.setVisible(true);
					JLabelButton l = new JLabelButton();
					l.setVerticalTextPosition(JLabel.TOP);
					l.setHorizontalTextPosition(JLabel.CENTER);
					l.setAlignmentX(Component.LEFT_ALIGNMENT);
					l.setCursor(new Cursor(Cursor.HAND_CURSOR));
					l.setText(a.getAddress());
					try {
						l.setIcon(new ImageIcon(new URL("http://maps.google.com/maps/api/staticmap?size=128x128&sensor=false&markers=" + URLEncoder.encode(l.getText(), "utf8"))));
					} catch (IOException e) {
						System.err.println(e);
					}
					l.addActionListener(new MapListener());
					address.add(l);
				}
			}
			emails.removeAll();
			emailLabel.setVisible(false);
			for (Email e : contact.getEmails()) {
				if (!e.getEmail().isEmpty()) {
					emailLabel.setVisible(true);
					JLabelButton lb = new JLabelButton(e.getEmail());
					lb.setCursor(new Cursor(Cursor.HAND_CURSOR));
					lb.addActionListener(new EmailListener());
					emails.add(lb);
				}
			}
			webs.removeAll();
			websLabel.setVisible(false);
			for (Url u : contact.getUrls()) {
				if (u.getValue() != null) {
					websLabel.setVisible(true);
					JLabelButton lb = new JLabelButton(u.getValue().toString());
					lb.setCursor(new Cursor(Cursor.HAND_CURSOR));
					lb.addActionListener(new WebListener());
					emails.add(lb);
				}
			}
			if (!contact.getPhoneNumbers().isEmpty()) {
				phoneLabel.setVisible(true);
				phones.setVisible(true);
				phones.setText("" + contact.getAllPhones().replaceAll(", ", "
") + "");
			} else {
				phoneLabel.setVisible(false);
				phones.setVisible(false);
			}
			if (contact.getBirthday() != null && contact.getBirthday().getDate() != null) {
				birthday.setVisible(true);
				birthdayLabel.setVisible(true);
				birthday.setText(DateFormat.getDateInstance().format(contact.getBirthday().getDate()));
			} else {
				birthday.setVisible(false);
				birthdayLabel.setVisible(false);
			}
			if (contact.getNameDay() != null && contact.getNameDay().getDate() != null) {
				nameday.setVisible(true);
				namedayLabel.setVisible(true);
				nameday.setText(DateFormat.getDateInstance().format(contact.getNameDay().getDate()));
			} else {
				nameday.setVisible(false);
				namedayLabel.setVisible(false);
			}
			if (contact.getCelebration() != null && contact.getCelebration().getDate() != null) {
				celebration.setVisible(true);
				celebrationLabel.setVisible(true);
				celebration.setText(DateFormat.getDateInstance().format(contact.getCelebration().getDate()));
			} else {
				celebration.setVisible(false);
				celebrationLabel.setVisible(false);
			}
			if (contact.getNote() != null && !contact.getNote().isEmpty()) {
				note.setVisible(true);
				noteLabel.setVisible(true);
				note.setText("" + contact.getNote().replaceAll("\n", "
") + "");
			} else {
				note.setVisible(false);
				noteLabel.setVisible(false);
			}
			String separator = "";
			final StringBuilder groupstring = new StringBuilder();
			groups.setVisible(false);
			groupsLabel.setVisible(false);
			for (Group g : db.getAllGroupsForContact(contact)) {
				groups.setVisible(true);
				groupsLabel.setVisible(true);
				groupstring.append(separator);
				groupstring.append(g.getName());
				separator = ", ";
			}
			groups.setText(groupstring.toString());
			detailScrollPane.setVisible(true);
		}
	}

Output:
	void show(Contact contact) {
		if (contact != null) {
			if (contact.hasBirthday()) {
				bdayIcon.setVisible(true);
			} else {
				bdayIcon.setVisible(false);
			}
			if (contact.hasNameDay()) {
				namedayIcon.setVisible(true);
			} else {
				namedayIcon.setVisible(false);
			}
			if (contact.hasCelebration()) {
				celebrationIcon.setVisible(true);
			} else {
				celebrationIcon.setVisible(false);
			}
			photo.setContact(contact);
			photo.setVisible(true);
			name.setText(String.format("<html><h1>" + contact.getFullName() + "</h1></html>"));
			if (contact.getNickName() != null && !contact.getNickName().isEmpty()) {
				nicknameLabel.setVisible(true);
				nickname.setVisible(true);
				nickname.setText(contact.getNickName());
			} else {
				nicknameLabel.setVisible(false);
				nickname.setVisible(false);
			}
			address.removeAll();
			addressLabel.setVisible(false);
			for (Address a : contact.getAdresses()) {
				if (!a.getAddress().isEmpty()) {
					addressLabel.setVisible(true);
					JLabelButton l = new JLabelButton();
					l.setVerticalTextPosition(JLabel.TOP);
					l.setHorizontalTextPosition(JLabel.CENTER);
					l.setAlignmentX(Component.LEFT_ALIGNMENT);
					l.setCursor(new Cursor(Cursor.HAND_CURSOR));
					l.setText(a.getAddress());
					try {
						l.setIcon(new ImageIcon(new URL("http://maps.google.com/maps/api/staticmap?size=128x128&sensor=false&markers=" + URLEncoder.encode(l.getText(), "utf8"))));
					} catch (IOException e) {
						System.err.println(e);
					}
					l.addActionListener(new MapListener());
					address.add(l);
				}
			}
			emails.removeAll();
			emailLabel.setVisible(false);
			for (Email e : contact.getEmails()) {
				if (!e.getEmail().isEmpty()) {
					emailLabel.setVisible(true);
					JLabelButton lb = new JLabelButton(e.getEmail());
					lb.setCursor(new Cursor(Cursor.HAND_CURSOR));
					lb.addActionListener(new EmailListener());
					emails.add(lb);
				}
			}
			webs.removeAll();
			websLabel.setVisible(false);
			for (Url u : contact.getUrls()) {
				if (u.getValue() != null) {
					websLabel.setVisible(true);
					JLabelButton lb = new JLabelButton(u.getValue().toString());
					lb.setCursor(new Cursor(Cursor.HAND_CURSOR));
					lb.addActionListener(new WebListener());
					webs.add(lb);
				}
			}
			if (!contact.getPhoneNumbers().isEmpty()) {
				phoneLabel.setVisible(true);
				phones.setVisible(true);
				phones.setText("<html>" + contact.getAllPhones().replaceAll(", ", "<br>") + "</html>");
			} else {
				phoneLabel.setVisible(false);
				phones.setVisible(false);
			}
			if (contact.getBirthday() != null && contact.getBirthday().getDate() != null) {
				birthday.setVisible(true);
				birthdayLabel.setVisible(true);
				birthday.setText(DateFormat.getDateInstance().format(contact.getBirthday().getDate()));
			} else {
				birthday.setVisible(false);
				birthdayLabel.setVisible(false);
			}
			if (contact.getNameDay() != null && contact.getNameDay().getDate() != null) {
				nameday.setVisible(true);
				namedayLabel.setVisible(true);
				nameday.setText(DateFormat.getDateInstance().format(contact.getNameDay().getDate()));
			} else {
				nameday.setVisible(false);
				namedayLabel.setVisible(false);
			}
			if (contact.getCelebration() != null && contact.getCelebration().getDate() != null) {
				celebration.setVisible(true);
				celebrationLabel.setVisible(true);
				celebration.setText(DateFormat.getDateInstance().format(contact.getCelebration().getDate()));
			} else {
				celebration.setVisible(false);
				celebrationLabel.setVisible(false);
			}
			if (contact.getNote() != null && !contact.getNote().isEmpty()) {
				note.setVisible(true);
				noteLabel.setVisible(true);
				note.setText("<html>" + contact.getNote().replaceAll("\n", "<br>") + "</html>");
			} else {
				note.setVisible(false);
				noteLabel.setVisible(false);
			}
			String separator = "";
			final StringBuilder groupstring = new StringBuilder();
			groups.setVisible(false);
			groupsLabel.setVisible(false);
			for (Group g : db.getAllGroupsForContact(contact)) {
				groups.setVisible(true);
				groupsLabel.setVisible(true);
				groupstring.append(separator);
				groupstring.append(g.getName());
				separator = ", ";
			}
			groups.setText(groupstring.toString());
			detailScrollPane.setVisible(true);
		}
	}