auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testLedgerHandleAdvOutOfOrderWriteAndFrocedEnsembleChange() throws Exception { long ledgerId = 0xABCDEF; SyncObj syncObj1 = new SyncObj(); ByteBuffer entry; lh = bkc.createLedgerAdv(ledgerId, 3, 3, 3, digestType, ledgerPassword, null); entry = ByteBuffer.allocate(4); for (int i = 0; i < 5; i++) { entry.rewind(); entry.putInt(rng.nextInt(maxInt)); lh.addEntry(i, entry.array()); } ByteBuffer entry1 = ByteBuffer.allocate(4); entry1.putInt(rng.nextInt(maxInt)); lh.asyncAddEntry(10, entry1.array(), 0, entry1.capacity(), this, syncObj1); Thread.sleep(5000); CountDownLatch sleepLatch1 = new CountDownLatch(1); ArrayList<BookieSocketAddress> ensemble; ensemble = lh.getLedgerMetadata().getEnsembles().entrySet().iterator().next().getValue(); sleepBookie(ensemble.get(0), sleepLatch1); sleepBookie(ensemble.get(1), sleepLatch1); sleepBookie(ensemble.get(2), sleepLatch1); startNewBookie(); startNewBookie(); startNewBookie(); for (int i = 5; i < 10; i++) { entry.rewind(); entry.putInt(rng.nextInt(maxInt)); lh.addEntry(i, entry.array()); } sleepLatch1.countDown(); synchronized (syncObj1) { while (syncObj1.counter < 1) { syncObj1.wait(); } assertEquals(BKException.Code.OK, syncObj1.rc); } lh.close(); lh = bkc.openLedger(ledgerId, digestType, ledgerPassword); for (int i = 0; i < 11; i++) { lh.readEntries(i, i); } lh.close(); bkc.deleteLedger(ledgerId); }

Target:
public void testLedgerHandleAdvOutOfOrderWriteAndFrocedEnsembleChange() throws Exception { long ledgerId = 0xABCDEF; SyncObj syncObj1 = new SyncObj(); ByteBuffer entry; lh = bkc.createLedgerAdv(ledgerId, 3, 3, 3, digestType, ledgerPassword, null); entry = ByteBuffer.allocate(4); for (int i = 0; i < 5; i++) { entry.rewind(); entry.putInt(rng.nextInt(maxInt)); lh.addEntry(i, entry.array()); } ByteBuffer entry1 = ByteBuffer.allocate(4); entry1.putInt(rng.nextInt(maxInt)); lh.asyncAddEntry(10, entry1.array(), 0, entry1.capacity(), this, syncObj1); java.util.Queue<PendingAddOp> myPendingAddOps = Whitebox.getInternalState(lh, "pendingAddOps"); PendingAddOp addOp = null; boolean pendingAddOpReceived = false; while (!pendingAddOpReceived) { addOp = myPendingAddOps.peek(); if (addOp.entryId == 10 && addOp.completed) { pendingAddOpReceived = true; } else { Thread.sleep(1000); } } CountDownLatch sleepLatch1 = new CountDownLatch(1); ArrayList<BookieSocketAddress> ensemble; ensemble = lh.getLedgerMetadata().getEnsembles().entrySet().iterator().next().getValue(); sleepBookie(ensemble.get(0), sleepLatch1); sleepBookie(ensemble.get(1), sleepLatch1); sleepBookie(ensemble.get(2), sleepLatch1); startNewBookie(); startNewBookie(); startNewBookie(); for (int i = 5; i < 10; i++) { entry.rewind(); entry.putInt(rng.nextInt(maxInt)); lh.addEntry(i, entry.array()); } sleepLatch1.countDown(); synchronized (syncObj1) { while (syncObj1.counter < 1) { syncObj1.wait(); } assertEquals(BKException.Code.OK, syncObj1.rc); } lh.close(); lh = bkc.openLedger(ledgerId, digestType, ledgerPassword); for (int i = 0; i < 11; i++) { lh.readEntries(i, i); } lh.close(); bkc.deleteLedger(ledgerId); }
Source:
private static Graphics2D createGraphics2d(String fmt, OutputStream out, Dimension dim) throws IOException { switch (fmt) { case Depiction.SVG_FMT: SVGGraphics2D svg = new SVGGraphics2D(out, dim); svg.setCreator("Chemistry Development Kit (CDK)"); svg.writeHeader(); return svg; case Depiction.PDF_FMT: PDFGraphics2D pdf = new PDFGraphics2D(out, dim); pdf.setCreator("Chemistry Development Kit (CDK)"); Properties props = new Properties(); props.setProperty(PDFGraphics2D.FIT_TO_PAGE, "false"); props.setProperty(PDFGraphics2D.PAGE_SIZE, PDFGraphics2D.CUSTOM_PAGE_SIZE); props.setProperty(PDFGraphics2D.CUSTOM_PAGE_SIZE, dim.width + ", " + dim.height); props.setProperty(PDFGraphics2D.PAGE_MARGINS, "0, 0, 0, 0"); pdf.setProperties(props); pdf.writeHeader(); return pdf; case Depiction.PS_FMT: default: throw new IOException("Unsupported vector format, " + fmt); } }

Target:
private static Graphics2D createGraphics2d(String fmt, OutputStream out, Dimension dim) throws IOException { switch (fmt) { case Depiction.SVG_FMT: SVGGraphics2D svg = new SVGGraphics2D(out, dim); svg.setCreator("Chemistry Development Kit (<LINK_1>"); svg.writeHeader(); return svg; case Depiction.PDF_FMT: PDFGraphics2D pdf = new PDFGraphics2D(out, dim); pdf.setCreator("Chemistry Development Kit (<LINK_1>"); Properties props = new Properties(); props.setProperty(PDFGraphics2D.FIT_TO_PAGE, "false"); props.setProperty(PDFGraphics2D.PAGE_SIZE, PDFGraphics2D.CUSTOM_PAGE_SIZE); props.setProperty(PDFGraphics2D.CUSTOM_PAGE_SIZE, dim.width + ", " + dim.height); props.setProperty(PDFGraphics2D.PAGE_MARGINS, "0, 0, 0, 0"); pdf.setProperties(props); pdf.writeHeader(); return pdf; case Depiction.PS_FMT: default: throw new IOException("Unsupported vector format, " + fmt); } }
Source:
public void run() { try { while (RedisQueueInboundGateway.this.active) { RedisQueueInboundGateway.this.listening = true; RedisQueueInboundGateway.this.popMessageWithHeaderAndSend(); } } finally { if (RedisQueueInboundGateway.this.active) { RedisQueueInboundGateway.this.restart(); } else { RedisQueueInboundGateway.this.lifecycleLock.lock(); try { RedisQueueInboundGateway.this.lifecycleCondition.signalAll(); } finally { RedisQueueInboundGateway.this.lifecycleLock.unlock(); } } } }

Target:
public void run() { try { while (RedisQueueInboundGateway.this.active) { RedisQueueInboundGateway.this.listening = true; RedisQueueInboundGateway.this.receiveAndReply(); } } finally { if (RedisQueueInboundGateway.this.active) { RedisQueueInboundGateway.this.restart(); } else { RedisQueueInboundGateway.this.lifecycleLock.lock(); try { RedisQueueInboundGateway.this.lifecycleCondition.signalAll(); } finally { RedisQueueInboundGateway.this.lifecycleLock.unlock(); } } } }
Source:
public Future<String> runTransformationAsync(List<ITransformation> transformations, List<String> networkIdList) throws QuadrigaGeneratorException { List<List<TransformNode>> results = matchGraphs.matchGraphs(transformations, networkIdList); logger.info("Check results for transformations: " + results); String graphString = generator.generateText(results, null, true); return new AsyncResult<>(graphString); }

Target:
public Future<String> runTransformationAsync(List<ITransformation> transformations, List<String> networkIdList) throws QuadrigaGeneratorException { List<List<TransformNode>> results = matchGraphs.matchGraphs(transformations, networkIdList); String graphString = generator.generateText(results, null, true); return new AsyncResult<>(graphString); }
Source:
protected void doPost(final HttpServletRequest request, final HttpServletResponse response) throws ServletException, IOException { SQLSource.interact(new SQLInteractionInterface<Integer>() { @Override public Integer run(Connection connection) throws ServiceException, SQLException { uniID = Integer.parseInt(request.getParameter("university")); University university = UniversityUtil.getUniversityID(uniID); deptName = request.getParameter("deptName"); acronym = request.getParameter("acronym"); Department department = Department.create(connection, university, deptName, acronym); ID = department.getID(); return 0; } } ); response.sendRedirect("/department/index.jsp?did=" + ID); }

Target:
protected void doPost(final HttpServletRequest request, final HttpServletResponse response) throws ServletException, IOException { SQLSource.interact(new SQLInteractionInterface<Integer>() { @Override public Integer run(Connection connection) throws ServiceException, SQLException { int uniID = Integer.parseInt(request.getParameter("university")); University university = UniversityUtil.getUniversityID(uniID); String deptName = request.getParameter("deptName"); String acronym = request.getParameter("acronym"); if (university == null || deptName == null || acronym == null) { throw new ServiceException(ServiceStatus.MALFORMED_REQUEST); } Department department = Department.create(connection, university, deptName, acronym); ID = department.getID(); return 0; } } ); response.sendRedirect("/department/index.jsp?did=" + ID); }
Source:
public List<PermissionSubject> getPermissionCheckSubjects() { List<PermissionSubject> permissionList = new ArrayList<PermissionSubject>(); permissionList.add(new PermissionSubject(getVdsGroupId(), VdcObjectType.VdsGroups, getActionType().getActionGroup())); permissionList.add(new PermissionSubject(getVmTemplateId(), VdcObjectType.VmTemplate, getActionType().getActionGroup())); if (getVmTemplate() != null && !getVmTemplate().getDiskList().isEmpty()) { for (DiskImage disk : getParameters().getDiskInfoDestinationMap().values()) { addStoragePermissionByQuotaMode(permissionList, GuidUtils.getGuidValue(getStoragePoolId()), GuidUtils.getGuidValue(disk.getStorageIds().get(0))); } } addPermissionSubjectForAdminLevelProperties(permissionList); return permissionList; }

Target:
public List<PermissionSubject> getPermissionCheckSubjects() { List<PermissionSubject> permissionList = new ArrayList<PermissionSubject>(); permissionList.add(new PermissionSubject(getVdsGroupId(), VdcObjectType.VdsGroups, getActionType().getActionGroup())); permissionList.add(new PermissionSubject(getVmTemplateId(), VdcObjectType.VmTemplate, getActionType().getActionGroup())); if (getVmTemplate() != null && !getVmTemplate().getDiskList().isEmpty()) { for (DiskImage disk : getParameters().getDiskInfoDestinationMap().values()) { if (disk.getStorageIds() != null && !disk.getStorageIds().isEmpty()) { addStoragePermissionByQuotaMode(permissionList, GuidUtils.getGuidValue(getStoragePoolId()), GuidUtils.getGuidValue(disk.getStorageIds().get(0))); } } } addPermissionSubjectForAdminLevelProperties(permissionList); return permissionList; }
Source:
public static String toString(EnumSet<NtfsFileAttributes> ntfsAttributes) { if (ntfsAttributes == null) { return Constants.EMPTY_STRING; } final StringBuilder builder = new StringBuilder(); if (ntfsAttributes.contains(NtfsFileAttributes.READ_ONLY)) { builder.append("ReadOnly|"); } if (ntfsAttributes.contains(NtfsFileAttributes.HIDDEN)) { builder.append("Hidden|"); } if (ntfsAttributes.contains(NtfsFileAttributes.SYSTEM)) { builder.append("System|"); } if (ntfsAttributes.contains(NtfsFileAttributes.NORMAL)) { builder.append("None|"); } if (ntfsAttributes.contains(NtfsFileAttributes.DIRECTORY)) { builder.append("Directory|"); } if (ntfsAttributes.contains(NtfsFileAttributes.ARCHIVE)) { builder.append("Archive|"); } if (ntfsAttributes.contains(NtfsFileAttributes.TEMPORARY)) { builder.append("Temporary|"); } if (ntfsAttributes.contains(NtfsFileAttributes.OFFLINE)) { builder.append("Offline|"); } if (ntfsAttributes.contains(NtfsFileAttributes.NOT_CONTENT_INDEXED)) { builder.append("NotContentIndexed|"); } if (ntfsAttributes.contains(NtfsFileAttributes.NO_SCRUB_DATA)) { builder.append("NoScrubData|"); } builder.deleteCharAt(builder.lastIndexOf("|")); return builder.toString(); }

Target:
public static String toString(EnumSet<NtfsFileAttributes> ntfsAttributes) { if (ntfsAttributes == null) { return Constants.EMPTY_STRING; } final StringBuilder builder = new StringBuilder(); toStringHelper(builder, ntfsAttributes, NtfsFileAttributes.READ_ONLY, "ReadOnly|"); toStringHelper(builder, ntfsAttributes, NtfsFileAttributes.HIDDEN, "ReadOnly|"); toStringHelper(builder, ntfsAttributes, NtfsFileAttributes.READ_ONLY, "Hidden|"); toStringHelper(builder, ntfsAttributes, NtfsFileAttributes.SYSTEM, "System|"); toStringHelper(builder, ntfsAttributes, NtfsFileAttributes.NORMAL, "None|"); toStringHelper(builder, ntfsAttributes, NtfsFileAttributes.DIRECTORY, "Directory|"); toStringHelper(builder, ntfsAttributes, NtfsFileAttributes.ARCHIVE, "Archive|"); toStringHelper(builder, ntfsAttributes, NtfsFileAttributes.TEMPORARY, "Temporary|"); toStringHelper(builder, ntfsAttributes, NtfsFileAttributes.OFFLINE, "Offline|"); toStringHelper(builder, ntfsAttributes, NtfsFileAttributes.NOT_CONTENT_INDEXED, "NotContentIndexed|"); toStringHelper(builder, ntfsAttributes, NtfsFileAttributes.NO_SCRUB_DATA, "NoScrubData|"); builder.deleteCharAt(builder.lastIndexOf("|")); return builder.toString(); }
Source:
private String localizeKey(Context context, String key, String value) { if (key.equals(TITLE) || key.equals(MESSAGE) || key.equals(SUMMARY_TEXT)) { try { JSONObject localeObject = new JSONObject(value); String localeKey = localeObject.getString("locKey"); ArrayList<String> localeFormatData = new ArrayList<String>(); if (!localeObject.isNull("locData")) { String localeData = localeObject.getString("locData"); JSONArray localeDataArray = new JSONArray(localeData); for (int i = 0 ; i < localeDataArray.length(); i++) { localeFormatData.add(localeDataArray.getString(i)); } } String packageName = context.getPackageName(); Resources resources = context.getResources(); int resourceId = resources.getIdentifier(localeKey, "string", packageName); if (resourceId != 0) { return resources.getString(resourceId, localeFormatData.toArray()); } else { Log.d(LOG_TAG, "can't find resource for locale key = " + localeKey); return value; } } catch(JSONException e) { Log.d(LOG_TAG, "no locale found for key = " + key + ", error " + e.getMessage()); return value; } } return value; }

Target:
private String localizeKey(Context context, String key, String value) { if (key.equals(TITLE) || key.equals(MESSAGE) || key.equals(SUMMARY_TEXT)) { try { JSONObject localeObject = new JSONObject(value); String localeKey = localeObject.getString(LOC_KEY); ArrayList<String> localeFormatData = new ArrayList<String>(); if (!localeObject.isNull(LOC_DATA)) { String localeData = localeObject.getString(LOC_DATA); JSONArray localeDataArray = new JSONArray(localeData); for (int i = 0 ; i < localeDataArray.length(); i++) { localeFormatData.add(localeDataArray.getString(i)); } } String packageName = context.getPackageName(); Resources resources = context.getResources(); int resourceId = resources.getIdentifier(localeKey, "string", packageName); if (resourceId != 0) { return resources.getString(resourceId, localeFormatData.toArray()); } else { Log.d(LOG_TAG, "can't find resource for locale key = " + localeKey); return value; } } catch(JSONException e) { Log.d(LOG_TAG, "no locale found for key = " + key + ", error " + e.getMessage()); return value; } } return value; }
Source:
String recite() { if (words.length < 1) return ""; String initWord = "", result = ""; for(int i = 0; i < words.length; i++) { String word = words[i]; if (initWord.isEmpty()) { initWord = word; } else { result += "the " + word + " was lost.\n"; } if (i + 1 != words.length) result += "For want of a " + word + " "; } return result += "And all for the want of a " + initWord + "."; }

Target:
String recite() { if (words.length < 1) { return ""; } final StringBuilder result = new StringBuilder(); for(int i = 1; i < words.length; i++) { result.append("For want of a " + words[i - 1] + " the " + words[i] + " was lost.\n"); } result.append("And all for the want of a " + words[0] + "."); return result.toString(); }
Source:
private List<HomeFeedbackSessionRow> createSessionRows(List<FeedbackSessionAttributes> sessions, InstructorAttributes instructor) { List<HomeFeedbackSessionRow> rows = new ArrayList<>(); for (FeedbackSessionAttributes session : sessions) { InstructorHomeFeedbackSessionRow row = new InstructorHomeFeedbackSessionRow( sanitizeForHtml(session.getFeedbackSessionName()), getInstructorSubmissionsTooltipForFeedbackSession(session), getInstructorPublishedTooltipForFeedbackSession(session), getInstructorSubmissionStatusForFeedbackSession(session), getInstructorPublishedStatusForFeedbackSession(session), TimeHelper.formatDateTimeForInstructorHomePage(session.getStartTimeLocal()), session.getStartTimeInIso8601UtcFormat(), TimeHelper.formatDateTimeForSessionsFixedOffset(session.getStartTime(), session.getTimeZone()), TimeHelper.formatDateTimeForInstructorHomePage(session.getEndTimeLocal()), session.getEndTimeInIso8601UtcFormat(), TimeHelper.formatDateTimeForSessionsFixedOffset(session.getEndTime(), session.getTimeZone()), getInstructorFeedbackStatsLink(session.getCourseId(), session.getFeedbackSessionName()), getInstructorFeedbackSessionActions( session, Const.ActionURIs.INSTRUCTOR_HOME_PAGE, instructor)); rows.add(row); } return rows; }

Target:
private List<HomeFeedbackSessionRow> createSessionRows(List<FeedbackSessionAttributes> sessions, InstructorAttributes instructor) { List<HomeFeedbackSessionRow> rows = new ArrayList<>(); for (FeedbackSessionAttributes session : sessions) { InstructorHomeFeedbackSessionRow row = new InstructorHomeFeedbackSessionRow( sanitizeForHtml(session.getFeedbackSessionName()), getInstructorSubmissionsTooltipForFeedbackSession(session), getInstructorPublishedTooltipForFeedbackSession(session), getInstructorSubmissionStatusForFeedbackSession(session), getInstructorPublishedStatusForFeedbackSession(session), TimeHelper.formatDateTimeForInstructorHomePage(session.getStartTimeLocal()), session.getStartTimeInIso8601UtcFormat(), TimeHelper.formatDateTimeForSessions(session.getStartTime(), session.getTimeZone()), TimeHelper.formatDateTimeForInstructorHomePage(session.getEndTimeLocal()), session.getEndTimeInIso8601UtcFormat(), TimeHelper.formatDateTimeForSessions(session.getEndTime(), session.getTimeZone()), getInstructorFeedbackStatsLink(session.getCourseId(), session.getFeedbackSessionName()), getInstructorFeedbackSessionActions( session, Const.ActionURIs.INSTRUCTOR_HOME_PAGE, instructor)); rows.add(row); } return rows; }
Source:
public void visitToken(DetailAST ast) { final String line = getLine(ast.getLineNo() - 1); final int before = ast.getColumnNo() - 1; if (isColonOfCaseOrDefault(ast) && (before == -1 || Character.isWhitespace(line.charAt(before)))) { log(ast, MSG_KEY, ast.getText()); } }

Target:
public void visitToken(DetailAST ast) { final DetailAST parent = ast.getParent(); final boolean isColonOfCase = parent.getType() == TokenTypes.LITERAL_CASE; final boolean isColonOfDefault = parent.getType() == TokenTypes.LITERAL_DEFAULT; if (isColonOfCase || isColonOfDefault) { final boolean violation = isColonOfCase && checkWhitespaceBeforeColonOfCase(ast) || isColonOfDefault && checkWhitespaceBeforeColonOfDefault(ast); if (violation) { log(ast, MSG_KEY, ast.getText()); } } }
Source:
private void markExpiredCommandAsFailure(Guid cmdId) { CommandEntity cmdEntity = coco.getCommandEntity(cmdId); if (cmdEntity != null && cmdEntity.getCommandStatus() == CommandStatus.ACTIVE) { Calendar cal = Calendar.getInstance(); Integer cmdLifeTimeInMin = cmdEntity.getCommandParameters().getLifeInMinutes(); cal.add(Calendar.MINUTE, (-1) * (cmdLifeTimeInMin == null ? Config.<Integer>getValue(ConfigValues.CoCoLifeInMinutes) : cmdLifeTimeInMin)); if (cmdEntity.getCreatedAt().getTime() < cal.getTime().getTime()) { log.info("Marking expired command as Failed: command '{} ({})' that started at '{}' has been marked as Failed.", cmdEntity.getCommandType(), cmdEntity.getId(), cmdEntity.getCreatedAt()); coco.updateCommandStatus(cmdId, CommandStatus.FAILED); } } }

Target:
private void markExpiredCommandAsFailure(Guid cmdId) { CommandEntity cmdEntity = coco.getCommandEntity(cmdId); if (cmdEntity != null && cmdEntity.getCommandStatus() == CommandStatus.ACTIVE) { Calendar cal = Calendar.getInstance(); Integer cmdLifeTimeInMin = cmdEntity.getCommandParameters().getLifeInMinutes(); cal.add(Calendar.MINUTE, (-1) * (cmdLifeTimeInMin == null ? Config.<Integer>getValue(ConfigValues.CoCoLifeInMinutes) : cmdLifeTimeInMin)); if (cmdEntity.getCreatedAt().getTime() < cal.getTime().getTime()) { log.warn("Marking expired command as Failed: command '{} ({})' that started at '{}' has been marked as Failed.", cmdEntity.getCommandType(), cmdEntity.getId(), cmdEntity.getCreatedAt()); coco.updateCommandStatus(cmdId, CommandStatus.FAILED); } } }
Source:
private String newNamesQuery(final Set<Locale> locales, final String name, final boolean keywords) { final String phrase; if (keywords) { phrase = "(" + newRequirePartialWordsSearchPhrase(name) + " \"" + name + "\"^10)"; } else { phrase = "\"" + LuceneQuery.escapeQuery(name) + "\""; } StringBuilder query = new StringBuilder(); query.append(" +name:").append(phrase); query.append(" +locale:("); for (Locale locale : locales) { query.append(locale.getLanguage()).append("* "); if (!StringUtils.isBlank(locale.getCountry())) { query.append(locale).append("^2"); } } query.append(")"); query.append(" +voided:false"); return query.toString(); }

Target:
private String newNamesQuery(final Set<Locale> locales, final String name, final boolean keywords) { final String phrase; if (keywords) { phrase = "(" + newRequirePartialWordsSearchPhrase(name) + " \"" + name + "\"^1000)"; } else { phrase = "\"" + LuceneQuery.escapeQuery(name) + "\""; } StringBuilder query = new StringBuilder(); query.append(" +name:").append(phrase); query.append(" +locale:("); for (Locale locale : locales) { query.append(locale.getLanguage()).append("* "); if (!StringUtils.isBlank(locale.getCountry())) { query.append(locale).append("^2"); } } query.append(")"); query.append(" +voided:false"); return query.toString(); }
Source:
private static Content getPathIdFile(BlackboardArtifact artifact) throws ExecutionException { try { for (BlackboardAttribute attribute : artifact.getAttributes()) { if (attribute.getAttributeType().getTypeID() == BlackboardAttribute.ATTRIBUTE_TYPE.TSK_PATH_ID.getTypeID()) { return contentCache.get(attribute.getValueLong(), () -> artifact.getSleuthkitCase().getContentById(attribute.getValueLong())); } } } catch (TskCoreException ex) { logger.log(Level.WARNING, MessageFormat.format("Error getting content for path id attrbiute for artifact: ", artifact.getId()), ex); } return null; }

Target:
private static Content getPathIdFile(BlackboardArtifact artifact) throws ExecutionException { try { BlackboardAttribute attribute = artifact.getAttribute(new BlackboardAttribute.Type(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_PATH_ID)); if (attribute != null) { return contentCache.get(attribute.getValueLong(), () -> artifact.getSleuthkitCase().getContentById(attribute.getValueLong())); } } catch (TskCoreException ex) { logger.log(Level.WARNING, MessageFormat.format("Error getting content for path id attrbiute for artifact: ", artifact.getId()), ex); } return null; }
Source:
private String getProxyUri() { String scheme = Config.<Boolean>getValue(ConfigValues.ImageProxySSLEnabled) ? "https" : "http"; String address = Config.getValue(ConfigValues.ImageProxyAddress); return scheme + "://" + address + "/images"; }

Target:
private String getProxyUri() { String scheme = Config.<Boolean> getValue(ConfigValues.ImageProxySSLEnabled)? HTTPS_SCHEME : HTTP_SCHEME; String address = Config.getValue(ConfigValues.ImageProxyAddress); return scheme + address + IMAGES_PATH; }
Source:
protected VdcReturnValueBase convertToVdcReturnValueBase(final VDSReturnValue vdsReturnValue) { VdcReturnValueBase returnValue = new VdcReturnValueBase(); returnValue.setSucceeded(false); returnValue.setActionReturnValue(vdsReturnValue.getReturnValue()); returnValue.setExecuteFailedMessages(new ArrayList<String>() {{ add(getVdsDAO().get(vdsReturnValue.getVdsError().getVdsId()).getName() + " : " + vdsReturnValue.getVdsError().getMessage()); }} ); return returnValue; }

Target:
protected VdcReturnValueBase convertToVdcReturnValueBase(final VDSReturnValue vdsReturnValue) { VdcReturnValueBase returnValue = new VdcReturnValueBase(); returnValue.setSucceeded(false); returnValue.setActionReturnValue(vdsReturnValue.getReturnValue()); returnValue.setExecuteFailedMessages(new ArrayList<String>() {{ String failedMesssage = null; VDS vds = getVdsDAO().get(vdsReturnValue.getVdsError().getVdsId()); if (vds != null) { failedMesssage = vds.getName() + ":"; } add(failedMesssage == null ? vdsReturnValue.getVdsError().getMessage() : failedMesssage.concat(vdsReturnValue.getVdsError().getMessage())); }} ); return returnValue; }
Source:
public void testStickyPartitionCache() { final String topicA = "topicA"; final String topicB = "topicB"; List<PartitionInfo> allPartitions = asList(new PartitionInfo(topicA, 0, node0, nodes, nodes), new PartitionInfo(topicA, 1, node1, nodes, nodes), new PartitionInfo(topicA, 2, node2, nodes, nodes), new PartitionInfo(topicB, 0, node0, nodes, nodes) ); Cluster testCluster = new Cluster("clusterId", asList(node0, node1, node2), allPartitions, Collections.<String>emptySet(), Collections.<String>emptySet()); StickyPartitionCache stickyPartitionCache = new StickyPartitionCache(); int partA = stickyPartitionCache.partition(topicA, testCluster); assertEquals(partA, stickyPartitionCache.partition(topicA, testCluster)); int partB = stickyPartitionCache.partition(topicB, testCluster); assertEquals(partB, stickyPartitionCache.partition(topicB, testCluster)); int changedPartA = stickyPartitionCache.nextPartition(topicA, testCluster, partA); assertEquals(changedPartA, stickyPartitionCache.partition(topicA, testCluster)); assertNotEquals(partA, changedPartA); int changedPartA2 = stickyPartitionCache.partition(topicA, testCluster); assertEquals(changedPartA2, changedPartA); int changedPartA3 = stickyPartitionCache.nextPartition(topicA, testCluster, partA); assertEquals(changedPartA3, changedPartA2); int changedPartB = stickyPartitionCache.nextPartition(topicB, testCluster, partB); assertEquals(changedPartB, stickyPartitionCache.partition(topicB, testCluster)); }

Target:
public void testStickyPartitionCache() { List<PartitionInfo> allPartitions = asList(new PartitionInfo(TOPIC_A, 0, NODES[0], NODES, NODES), new PartitionInfo(TOPIC_A, 1, NODES[1], NODES, NODES), new PartitionInfo(TOPIC_A, 2, NODES[2], NODES, NODES), new PartitionInfo(TOPIC_B, 0, NODES[0], NODES, NODES) ); Cluster testCluster = new Cluster("clusterId", asList(NODES), allPartitions, Collections.<String>emptySet(), Collections.<String>emptySet()); StickyPartitionCache stickyPartitionCache = new StickyPartitionCache(); int partA = stickyPartitionCache.partition(TOPIC_A, testCluster); assertEquals(partA, stickyPartitionCache.partition(TOPIC_A, testCluster)); int partB = stickyPartitionCache.partition(TOPIC_B, testCluster); assertEquals(partB, stickyPartitionCache.partition(TOPIC_B, testCluster)); int changedPartA = stickyPartitionCache.nextPartition(TOPIC_A, testCluster, partA); assertEquals(changedPartA, stickyPartitionCache.partition(TOPIC_A, testCluster)); assertNotEquals(partA, changedPartA); int changedPartA2 = stickyPartitionCache.partition(TOPIC_A, testCluster); assertEquals(changedPartA2, changedPartA); int changedPartA3 = stickyPartitionCache.nextPartition(TOPIC_A, testCluster, partA); assertEquals(changedPartA3, changedPartA2); int changedPartB = stickyPartitionCache.nextPartition(TOPIC_B, testCluster, partB); assertEquals(changedPartB, stickyPartitionCache.partition(TOPIC_B, testCluster)); }
Source:
public PipelineTimelineEntrySet() { maximumId = -1; naturalOrderSet = new TreeSet<>(); scheduledOrderSet = new ArrayList<>(); }

Target:
public PipelineTimelineEntrySet() { naturalOrderSet = new TreeSet<>(); scheduledOrderSet = new ArrayList<>(); }
Source:
public String getErrorMessage(String clientID) { TranslationSystem translationSystem = context.get(TranslationSystem.class); if (isClientBlacklisted(clientID)) { return translationSystem.translate("${engine:menu#client-on-blacklist}"); } if (!isClientWhitelisted(clientID)) { return translationSystem.translate("${engine:menu#client-not-on-whitelist}"); } return null; }

Target:
public String getErrorMessage(String clientID) { if (isClientBlacklisted(clientID)) { return "client on blacklist"; } if (!isClientWhitelisted(clientID)) { return "client not on whitelist"; } return null; }
Source:
public void shouldAddLabelNode() throws Exception { long node; int labelId; final String labelName = "Town"; try ( org.neo4j.graphdb.Transaction ctx = graphDb.beginTx() ) { node = graphDb.createNode( label( labelName ) ).getId(); ctx.success(); } try ( Transaction tx = session.beginTransaction() ) { labelId = session.token().labelGetOrCreateForName( labelName ); tx.dataWrite().nodeAddLabel( node, labelId ); tx.success(); } try ( org.neo4j.graphdb.Transaction ctx = graphDb.beginTx() ) { assertThat( graphDb.getNodeById( node ).getLabels(), equalTo( Iterables.iterable( label( labelName ) ) ) ); } }

Target:
public void shouldAddLabelNode() throws Exception { long node; int labelId; final String labelName = "Town"; try ( org.neo4j.graphdb.Transaction ctx = graphDb.beginTx() ) { node = graphDb.createNode().getId(); ctx.success(); } try ( Transaction tx = session.beginTransaction() ) { labelId = session.token().labelGetOrCreateForName( labelName ); tx.dataWrite().nodeAddLabel( node, labelId ); tx.success(); } try ( org.neo4j.graphdb.Transaction ctx = graphDb.beginTx() ) { assertThat( graphDb.getNodeById( node ).getLabels(), equalTo( Iterables.iterable( label( labelName ) ) ) ); } }
Source:
private void updateActiveBucketId(final BucketID bucketId, final Bucket<IN, BucketID> restoredBucket) throws IOException { if (!restoredBucket.isActive()) { if (bucketLifeCycleListener != null) { bucketLifeCycleListener.bucketInactive(restoredBucket); } return; } final Bucket<IN, BucketID> bucket = activeBuckets.get(bucketId); if (bucket != null) { bucket.merge(restoredBucket); } else { activeBuckets.put(bucketId, restoredBucket); } }

Target:
private void updateActiveBucketId(final BucketID bucketId, final Bucket<IN, BucketID> restoredBucket) throws IOException { if (!restoredBucket.isActive()) { notifyBucketInactive(restoredBucket); return; } final Bucket<IN, BucketID> bucket = activeBuckets.get(bucketId); if (bucket != null) { bucket.merge(restoredBucket); } else { activeBuckets.put(bucketId, restoredBucket); } }
Source:
protected void pollItems( final long timeout, final TimeUnit timeoutTimeUnit, final ImmutableMap<K, Callable<V>> itemsToPoll) throws IllegalArgumentException, NullPointerException, IllegalStateException, InterruptedException, CancellationException, ExecutionException, PollerException { Validate.isTrue( notNull(timeoutTimeUnit).toMillis(timeout) >= MINIMUM_TIMEOUT_MS, "timeout argument may not be less than %d ms", MINIMUM_TIMEOUT_MS); notNull(itemsToPoll); if (pollThreadPool.isShutdown() || pollTimeoutWatcherThreadPool.isShutdown()) { final String message = "Unable to poll because pollThreadPool or pollTimeoutWatcherThreadPool is shutdown"; throw new IllegalStateException(message); } if (!pollItemsLock.tryLock()) { final String message = "Unable to poll items. Multiple threads may not pollItems at the same time"; LOGGER.debug(message); throw new IllegalStateException(message); } try { doPollItems(timeout, timeoutTimeUnit, itemsToPoll); } finally { pollItemsLock.unlock(); } }

Target:
protected void pollItems( final long timeout, final TimeUnit timeoutTimeUnit, final ImmutableMap<K, Callable<V>> itemsToPoll) throws InterruptedException, ExecutionException, PollerException { Validate.isTrue( notNull(timeoutTimeUnit).toMillis(timeout) >= MINIMUM_TIMEOUT_MS, "timeout argument may not be less than %d ms", MINIMUM_TIMEOUT_MS); notNull(itemsToPoll); if (pollThreadPool.isShutdown() || pollTimeoutWatcherThreadPool.isShutdown()) { final String message = "Unable to poll because pollThreadPool or pollTimeoutWatcherThreadPool is shutdown"; throw new IllegalStateException(message); } if (!pollItemsLock.tryLock()) { final String message = "Unable to poll items. Multiple threads may not pollItems at the same time"; LOGGER.debug(message); throw new IllegalStateException(message); } try { doPollItems(timeout, timeoutTimeUnit, itemsToPoll); } finally { pollItemsLock.unlock(); } }
Source:
public CatalogProtos.PartitionDescProto getPartition(String databaseName, String tableName, String partitionName) throws UndefinedDatabaseException, UndefinedTableException, UndefinedPartitionMethodException, UndefinedPartitionException { final int databaseId = getDatabaseId(databaseName); final int tableId = getTableId(databaseId, databaseName, tableName); ensurePartitionTable(tableName, tableId); Connection conn = null; ResultSet res = null; PreparedStatement pstmt = null; PartitionDescProto.Builder builder = null; try { String sql = "SELECT PATH, " + COL_PARTITIONS_PK + ", " + COL_PARTITION_BYTES + ", " + COL_PARTITION_FILES + " FROM " + TB_PARTTIONS + " WHERE " + COL_TABLES_PK + " = ? AND PARTITION_NAME = ? "; if (LOG.isDebugEnabled()) { LOG.debug(sql); } conn = getConnection(); pstmt = conn.prepareStatement(sql); pstmt.setInt(1, tableId); pstmt.setString(2, partitionName); res = pstmt.executeQuery(); if (res.next()) { builder = PartitionDescProto.newBuilder(); builder.setId(res.getInt(COL_PARTITIONS_PK)); builder.setPath(res.getString("PATH")); builder.setPartitionName(partitionName); builder.setNumBytes(res.getLong(COL_PARTITION_BYTES)); builder.setNumFiles(res.getLong(COL_PARTITION_FILES)); setPartitionKeys(res.getInt(COL_PARTITIONS_PK), builder); } else { throw new UndefinedPartitionException(partitionName); } } catch (SQLException se) { throw new TajoInternalError(se); } finally { CatalogUtil.closeQuietly(pstmt, res); } return builder.build(); }

Target:
public CatalogProtos.PartitionDescProto getPartition(String databaseName, String tableName, String partitionName) throws UndefinedDatabaseException, UndefinedTableException, UndefinedPartitionMethodException, UndefinedPartitionException { final int databaseId = getDatabaseId(databaseName); final int tableId = getTableId(databaseId, databaseName, tableName); ensurePartitionTable(tableName, tableId); Connection conn = null; ResultSet res = null; PreparedStatement pstmt = null; PartitionDescProto.Builder builder = null; try { String sql = "SELECT PATH, " + COL_PARTITIONS_PK + ", " + COL_PARTITION_BYTES + " FROM " + TB_PARTTIONS + " WHERE " + COL_TABLES_PK + " = ? AND PARTITION_NAME = ? "; if (LOG.isDebugEnabled()) { LOG.debug(sql); } conn = getConnection(); pstmt = conn.prepareStatement(sql); pstmt.setInt(1, tableId); pstmt.setString(2, partitionName); res = pstmt.executeQuery(); if (res.next()) { builder = PartitionDescProto.newBuilder(); builder.setId(res.getInt(COL_PARTITIONS_PK)); builder.setPath(res.getString("PATH")); builder.setPartitionName(partitionName); builder.setNumBytes(res.getLong(COL_PARTITION_BYTES)); setPartitionKeys(res.getInt(COL_PARTITIONS_PK), builder); } else { throw new UndefinedPartitionException(partitionName); } } catch (SQLException se) { throw new TajoInternalError(se); } finally { CatalogUtil.closeQuietly(pstmt, res); } return builder.build(); }
Source:
public void requiresNewSuspendsExisting() throws Exception { Transaction existingTrans = mock(Transaction.class); Transaction newTrans = mock(Transaction.class); when(mgr.getTransaction()).thenReturn(existingTrans).thenReturn(newTrans); when(mgr.suspend()).thenReturn(existingTrans); TransactionSupport.executeInNewTransaction(tm); verify(mgr).suspend(); verify(mgr).begin(); verify(mgr).commit(); verify(mgr).resume(existingTrans); }

Target:
public void requiresNewSuspendsExisting() throws Exception { Transaction existingTrans = mock(Transaction.class); Transaction newTrans = mock(Transaction.class); when(mgr.getTransaction()).thenReturn(existingTrans).thenReturn(newTrans); when(mgr.suspend()).thenReturn(existingTrans); TransactionSupport.executeInNewTransaction(tm); InOrder inOrder = inOrder(mgr); inOrder.verify(mgr).suspend(); inOrder.verify(mgr).begin(); inOrder.verify(mgr).commit(); inOrder.verify(mgr).resume(existingTrans); }
Source:
public JwtAuthenticator(final String signingSecret) { this(signingSecret, signingSecret); }

Target:
public JwtAuthenticator(final String signingSecret) { this(signingSecret, signingSecret); warning(); }
Source:
private void validateRequestParams(Map<String, String> requestParams) { String pipeLineName = requestParams.get(PIPELINE_NAME); String stageName = requestParams.get(STAGE_NAME); if (isEmpty(pipeLineName) || isEmpty(stageName)) { throw new RuntimeException("Expected to provide both pipeline name and stage name"); } String fromId = requestParams.get(FROM_ID); if (!isEmpty(fromId) && !isNumber(fromId)) { throw new RuntimeException("Invalid from-id"); } }

Target:
private void validateRequestParams(Map<String, String> requestParams) { String pipeLineName = requestParams.get(PIPELINE_NAME); String stageName = requestParams.get(STAGE_NAME); if ((isEmpty(pipeLineName) && !isEmpty(stageName)) || (!isEmpty(pipeLineName) && isEmpty(stageName))) { throw new RuntimeException(String.format("Expected to provide both pipeline name and stage name, but got Pipeline name as [%s] and stage name as [%s]", pipeLineName, stageName)); } String fromId = requestParams.get(FROM_ID); if (!isEmpty(fromId) && !isDigits(fromId)) { throw new RuntimeException("Invalid from-id"); } String toId = requestParams.get(TO_ID); if (!isEmpty(toId) && !isDigits(toId)) { throw new RuntimeException("Invalid to-id"); } }
Source:
public static void updateRouteRegistry(RouteRegistry registry, Set<Class<?>> addedClasses, Set<Class<?>> modifiedClasses, Set<Class<?>> deletedClasses) { RouteConfiguration routeConf = RouteConfiguration.forRegistry(registry); Logger logger = LoggerFactory.getLogger(RouteUtil.class); registry.update(() -> { deletedClasses.stream() .filter(Component.class::isAssignableFrom) .forEach(clazz -> { Class<? extends Component> componentClass = (Class<? extends Component>) clazz; logger.debug("Removing route to {}", componentClass); routeConf.removeRoute(componentClass); }); Stream.concat(addedClasses.stream(), modifiedClasses.stream()) .distinct() .filter(Component.class::isAssignableFrom) .filter(clazz -> clazz.isAnnotationPresent(Route.class)) .forEach(clazz -> { Class<? extends Component> componentClass = (Class<? extends Component>) clazz; logger.debug( "Updating route to {}", componentClass .getAnnotation(Route.class).value(), clazz); routeConf.removeRoute(componentClass); routeConf.setAnnotatedRoute(componentClass); }); }); }

Target:
public static void updateRouteRegistry(RouteRegistry registry, Set<Class<?>> addedClasses, Set<Class<?>> modifiedClasses, Set<Class<?>> deletedClasses) { RouteConfiguration routeConf = RouteConfiguration.forRegistry(registry); Logger logger = LoggerFactory.getLogger(RouteUtil.class); registry.update(() -> { Stream.concat(deletedClasses.stream(), modifiedClasses.stream().filter( clazz -> !clazz.isAnnotationPresent(Route.class))) .filter(Component.class::isAssignableFrom) .forEach(clazz -> { Class<? extends Component> componentClass = (Class<? extends Component>) clazz; logger.debug("Removing route to {}", componentClass); routeConf.removeRoute(componentClass); }); Stream.concat(addedClasses.stream(), modifiedClasses.stream()) .distinct() .filter(Component.class::isAssignableFrom) .filter(clazz -> clazz.isAnnotationPresent(Route.class)) .forEach(clazz -> { Class<? extends Component> componentClass = (Class<? extends Component>) clazz; logger.debug( "Updating route to {}", componentClass .getAnnotation(Route.class).value(), clazz); routeConf.removeRoute(componentClass); routeConf.setAnnotatedRoute(componentClass); }); }); }
Source:
@Override public boolean nextKeyValue() throws IOException { while (true) { String line; while (true) { if (!lineRecordReader.nextKeyValue()) { return false; } line = lineRecordReader.getCurrentValue().toString(); if (!line.startsWith("#")) { break; } } final VariantContext v; try { v = codec.decode(line); } catch (Exception e) { if (stringency == ValidationStringency.STRICT) { throw e; } else { if (stringency == ValidationStringency.LENIENT && logger.isWarnEnabled()) { logger.warn("Parsing line failed with {}. Skipping...", line, e); } continue; } } if (!overlaps(v)) { continue; } Integer chromIdx = contigDict.get(v.getContig()); if (chromIdx == null) chromIdx = (int) MurmurHash3.murmurhash3(v.getContig(), 0); key.set((long) chromIdx << 32 | (long) (v.getStart() - 1)); vc.set(v, header); return true; } }

Target:
@Override public boolean nextKeyValue() throws IOException { while (true) { String line; while (true) { if (!lineRecordReader.nextKeyValue()) { return false; } line = lineRecordReader.getCurrentValue().toString(); if (!line.startsWith("#")) { break; } } final VariantContext v; try { v = codec.decode(line); } catch (TribbleException e) { if (stringency == ValidationStringency.STRICT) { if (logger.isErrorEnabled()) { logger.error("Parsing line failed with {}.", line, e); } throw e; } else { if (stringency == ValidationStringency.LENIENT && logger.isWarnEnabled()) { logger.warn("Parsing line failed with {}. Skipping...", line, e); } continue; } } if (!overlaps(v)) { continue; } Integer chromIdx = contigDict.get(v.getContig()); if (chromIdx == null) chromIdx = (int) MurmurHash3.murmurhash3(v.getContig(), 0); key.set((long) chromIdx << 32 | (long) (v.getStart() - 1)); vc.set(v, header); return true; } }
Source:
public static final int compareTwoBinaryUnsigned(Binary first, Binary second) { byte[] array1 = first.getBytes(); byte[] array2 = second.getBytes(); if ((array1 == null) && (array2 == null)) return 0; if (array1 == array2) return 0; int length1 = array1.length; int length2 = array2.length; int min_length = (length1 < length2) ? length1 : length2; for (int i = 0; i < min_length; i++) { int value1 = array1[i] & 0xFF; int value2 = array2[i] & 0xFF; if (value1 != value2) { return value1 - value2; } } if (length1 == length2) { return 0; } else { return length1 - length2; } }

Target:
public static final int compareTwoBinaryUnsigned(Binary first, Binary second) { byte[] array1 = first.getBytes(); byte[] array2 = second.getBytes(); if ((array1 == null) && (array2 == null)) return 0; if (array1 == array2) return 0; int length1 = array1.length; int length2 = array2.length; int min_length = (length1 < length2) ? length1 : length2; for (int i = 0; i < min_length; i++) { int value1 = array1[i] & 0xFF; int value2 = array2[i] & 0xFF; if (value1 != value2) { return value1 - value2; } } return length1 - length2; }
Source:
public int getCrc() { return crc; }

Target:
public OptionalInt getCrc() { return crc; }
Source:
public static void reportPredictions(Data dataSet) { for (int docid = 0; docid < dataSet.documents.size(); docid++) { NERDocument doc = dataSet.documents.get(docid); logger.info("\nGetting document " + doc.docname); ArrayList<LinkedVector> sentences = doc.sentences; for (int k = 0; k < sentences.size(); k++) { LinkedVector sentence = sentences.get(k); int N = sentence.size(); for (int i = 0; i < N; ++i) { NEWord word = (NEWord) sentence.get(i); logger.info(word.form + "\tL:" + word.neLabel + "\t1:" + word.neTypeLevel1 + "\t2:" + word.neTypeLevel2 + "\t(" + doc.docname + ")"); for (String h2 : word.gazetteers) logger.info(" " + h2); logger.info(""); } } } }

Target:
public static void reportPredictions(Data dataSet) { for (int docid = 0; docid < dataSet.documents.size(); docid++) { NERDocument doc = dataSet.documents.get(docid); System.out.println("\nGetting document " + doc.docname); ArrayList<LinkedVector> sentences = doc.sentences; for (int k = 0; k < sentences.size(); k++) { LinkedVector sentence = sentences.get(k); int N = sentence.size(); for (int i = 0; i < N; ++i) { NEWord word = (NEWord) sentence.get(i); System.out.println(word.form + "\tL:" + word.neLabel + "\t1:" + word.neTypeLevel1 + "\t2:" + word.neTypeLevel2 + "\t(" + doc.docname + ")"); for (String h2 : word.gazetteers) System.out.print(" " + h2); System.out.println(); } } } }
Source:
public Set<Order> getOrders() { if (orders == null) { orders = new LinkedHashSet<Order>(); } return orders; }

Target:
public List<Order> getOrders() { if (orders == null) { orders = new ArrayList<Order>(); } return orders; }
Source:
public ServiceDate getEnd() { return end == UNBOUNDED_END ? null : end; }

Target:
public ServiceDate getEnd() { return end; }
Source:
public SingleMultimapAggregationState(Type keyType, Type valueType) { this.keyType = keyType; this.valueType = valueType; keyBlockBuilder = this.keyType.createBlockBuilder(null, EXPECTED_ENTRIES, expectedValueSize(keyType, EXPECTED_ENTRY_SIZE)); valueBlockBuilder = this.valueType.createBlockBuilder(null, EXPECTED_ENTRIES, expectedValueSize(valueType, EXPECTED_ENTRY_SIZE)); }

Target:
public SingleMultimapAggregationState(Type keyType, Type valueType) { this.keyType = requireNonNull(keyType); this.valueType = requireNonNull(valueType); keyBlockBuilder = keyType.createBlockBuilder(null, EXPECTED_ENTRIES, expectedValueSize(keyType, EXPECTED_ENTRY_SIZE)); valueBlockBuilder = valueType.createBlockBuilder(null, EXPECTED_ENTRIES, expectedValueSize(valueType, EXPECTED_ENTRY_SIZE)); }
Source:
public static void initDimension(int dim) { WorldServer overworld = getWorld(0); if (overworld == null) { throw new RuntimeException("Cannot Hotload Dim: Overworld is not Loaded!"); } try { DimensionType type = DimensionManager.getProviderType(dim); if(MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.world.DimensionPreloadEvent(dim, type))) return; } catch (Exception e) { System.err.println("Cannot Hotload Dim: " + e.getMessage()); return; } MinecraftServer mcServer = overworld.getMinecraftServer(); ISaveHandler savehandler = overworld.getSaveHandler(); WorldServer world = (dim == 0 ? overworld : (WorldServer)(new WorldServerMulti(mcServer, savehandler, dim, overworld, mcServer.theProfiler).init())); world.addEventListener(new ServerWorldEventHandler(mcServer, world)); MinecraftForge.EVENT_BUS.post(new WorldEvent.Load(world)); if (!mcServer.isSinglePlayer()) { world.getWorldInfo().setGameType(mcServer.getGameType()); } mcServer.setDifficultyForAllWorlds(mcServer.getDifficulty()); }

Target:
public static void initDimension(int dim) { WorldServer overworld = getWorld(0); if (overworld == null) { throw new RuntimeException("Cannot Hotload Dim: Overworld is not Loaded!"); } WorldServer alterantiveDimension = null; try { DimensionType type = DimensionManager.getProviderType(dim); if(dim != 0) { DimensionPreloadEvent adEvent = new DimensionPreloadEvent(dim, type); MinecraftForge.EVENT_BUS.post(adEvent); alterantiveDimension = adEvent.getAlternativeDimension(); } } catch (Exception e) { System.err.println("Cannot Hotload Dim: " + e.getMessage()); return; } MinecraftServer mcServer = overworld.getMinecraftServer(); WorldServer world = (dim == 0 ? overworld : ( alterantiveDimension != null ? alterantiveDimension : ((WorldServer)(new WorldServerMulti(mcServer, overworld.getSaveHandler(), dim, overworld, mcServer.theProfiler).init())))); world.addEventListener(new ServerWorldEventHandler(mcServer, world)); MinecraftForge.EVENT_BUS.post(new WorldEvent.Load(world)); if (!mcServer.isSinglePlayer()) { world.getWorldInfo().setGameType(mcServer.getGameType()); } mcServer.setDifficultyForAllWorlds(mcServer.getDifficulty()); }
Source:
@Test public void testFromBase64() { tester.setFor(MySqlOperatorTable.FROM_BASE64); SqlTester tester1 = mysqlTester(); tester1.checkString("from_base64('VGhpcyBpcyBhIHRlc3QgU3RyaW5nLg==')", "This is a test String.", "VARCHAR NOT NULL"); tester1.checkNull("from_base64(cast(null as varchar(1)))"); SqlTester tester2 = mysqlTester(SqlConformanceEnum.MYSQL_5); tester2.checkString("from_base64('VGhpcyBpcyBhIHRlc3QgU3RyaW5nLg==')", "This is a test String.", "VARCHAR NOT NULL"); tester2.checkNull("from_base64(cast(null as varchar(1)))"); }

Target:
@Test public void testFromBase64() { final SqlTester tester1 = tester(SqlLibrary.MYSQL); tester1.setFor(SqlLibraryOperators.FROM_BASE64); tester1.checkString("from_base64('VGhpcyBpcyBhIHRlc3QgU3RyaW5nLg==')", "546869732069732061207465737420537472696e672e", "VARBINARY NOT NULL"); tester1.checkString("from_base64('VGhpcyBpcyBhIHRlc\t3QgU3RyaW5nLg==')", "546869732069732061207465737420537472696e672e", "VARBINARY NOT NULL"); tester1.checkString("from_base64('VGhpcyBpcyBhIHRlc\t3QgU3\nRyaW5nLg==')", "546869732069732061207465737420537472696e672e", "VARBINARY NOT NULL"); tester1.checkString("from_base64('VGhpcyB pcyBhIHRlc3Qg\tU3Ry\naW5nLg==')", "546869732069732061207465737420537472696e672e", "VARBINARY NOT NULL"); tester1.checkNull("from_base64('-1')"); tester1.checkNull("from_base64('-100')"); }