auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void onValueChanged(final Consumer<Event> onValueChanged) { input.onkeyup = null; input.onkeyup = event -> { onValueChanged.accept(event); return this; }; }

Target:
public void onValueChanged(final Consumer<Event> onValueChanged) { input.onkeyup = event -> { onValueChanged.accept(event); return this; }; }
Source:
public void verifyViewAndViewIndexes() throws SQLException { ResultSet rs = conn.createStatement().executeQuery(VIEWS_QUERY); int countViews = -1, indexCount = -1; while(rs.next()) { countViews = rs.getInt(1); } Assert.assertEquals("view count in system table doesn't match", 2, countViews); rs = conn.createStatement().executeQuery(String.format(VIEW_INDEX_QUERY, "MOCK1_VIEW")); while (rs.next()) { indexCount = rs.getInt(1); } Assert.assertEquals("view-index count in system table doesn't match",1, indexCount); rs = conn.createStatement().executeQuery(String.format(VIEW_INDEX_QUERY, "MOCK1_VIEW1")); while (rs.next()) { indexCount = rs.getInt(1); } Assert.assertEquals("view-index count in system table doesn't match", 2, indexCount); }

Target:
public void verifyViewAndViewIndexes() throws SQLException { String tableName = "MOCK1"; String schemaName = "TEST"; String viewQuery = iut.getViewSql(tableName, schemaName); ResultSet rs = conn.createStatement().executeQuery(viewQuery); int countViews = 0; List<String> views = new ArrayList<>(); List<Integer> indexCount = new ArrayList<>(); while (rs.next()) { views.add(rs.getString(1)); countViews++; } Assert.assertEquals("view count in system table doesn't match", 2, countViews); for (int i=0; i < views.size(); i++) { String viewName = SchemaUtil.getTableNameFromFullName(views.get(i)); String viewIndexQuery = iut.getViewIndexesSql(viewName, schemaName, null); rs = conn.createStatement().executeQuery(viewIndexQuery); int indexes = 0; while (rs.next()) { indexes++; } indexCount.add(indexes); } Assert.assertEquals(VERIFY_COUNT_ASSERT_MESSAGE, 1, (int) indexCount.get(0)); Assert.assertEquals(VERIFY_COUNT_ASSERT_MESSAGE, 2, (int) indexCount.get(1)); }
Source:
public static void main(String[] args) { final long seed = 0; final boolean showTables = false; final CloudSim simulation0 = new CloudSim(); UniformDistr random0 = new UniformDistr(0, 1, seed); final DatacenterBrokerHeuristic broker0 = createHeuristicBroker(simulation0, random0); new DatacenterBrokersMappingComparison(broker0, random0, showTables); final CloudSim simulation1 = new CloudSim(); UniformDistr random1 = new UniformDistr(0, 1, seed); final DatacenterBroker broker1 = new DatacenterBrokerBestFit(simulation1); new DatacenterBrokersMappingComparison(broker1, random1, showTables); final CloudSim simulation2 = new CloudSim(); UniformDistr random2 = new UniformDistr(0, 1, seed); final DatacenterBroker broker2 = new DatacenterBrokerSimple(simulation2); new DatacenterBrokersMappingComparison(broker2, random2, showTables); }

Target:
public static void main(String[] args) { System.out.println("Starting comparison..."); final long seed = System.currentTimeMillis(); final boolean verbose = false; final CloudSim simulation0 = new CloudSim(); final UniformDistr random0 = new UniformDistr(0, 1, seed); final DatacenterBrokerHeuristic broker0 = createHeuristicBroker(simulation0, random0); new DatacenterBrokersMappingComparison(broker0, random0, verbose); final CloudSim simulation1 = new CloudSim(); final UniformDistr random1 = new UniformDistr(0, 1, seed); final DatacenterBroker broker1 = new DatacenterBrokerBestFit(simulation1); new DatacenterBrokersMappingComparison(broker1, random1, verbose); final CloudSim simulation2 = new CloudSim(); final UniformDistr random2 = new UniformDistr(0, 1, seed); final DatacenterBroker broker2 = new DatacenterBrokerSimple(simulation2); new DatacenterBrokersMappingComparison(broker2, random2, verbose); System.out.println("Comparison finished!"); }
Source:
protected TreeMap<KeyExtent,TabletData> splitTablet(Tablet tablet, byte[] splitPoint) throws IOException { long t1 = System.currentTimeMillis(); TreeMap<KeyExtent,TabletData> tabletInfo = tablet.split(splitPoint); if (tabletInfo == null) { return null; } log.info("Starting split: {}", tablet.getExtent()); statsKeeper.incrementStatusSplit(); long start = System.currentTimeMillis(); Tablet[] newTablets = new Tablet[2]; Entry<KeyExtent,TabletData> first = tabletInfo.firstEntry(); TabletResourceManager newTrm0 = resourceManager.createTabletResourceManager(first.getKey(), getTableConfiguration(first.getKey())); newTablets[0] = new Tablet(TabletServer.this, first.getKey(), newTrm0, first.getValue()); Entry<KeyExtent,TabletData> last = tabletInfo.lastEntry(); TabletResourceManager newTrm1 = resourceManager.createTabletResourceManager(last.getKey(), getTableConfiguration(last.getKey())); newTablets[1] = new Tablet(TabletServer.this, last.getKey(), newTrm1, last.getValue()); statsKeeper.saveMajorMinorTimes(tablet.getTabletStats()); onlineTablets.split(tablet.getExtent(), newTablets[0], newTablets[1]); enqueueMasterMessage(new SplitReportMessage(tablet.getExtent(), newTablets[0].getExtent(), new Text("/" + newTablets[0].getDirName()), newTablets[1].getExtent(), new Text("/" + newTablets[1].getDirName()))); statsKeeper.updateTime(Operation.SPLIT, start, false); long t2 = System.currentTimeMillis(); log.info("Tablet split: size0 size1 time {}ms", tablet.getExtent(), newTablets[0].estimateTabletSize(), newTablets[1].estimateTabletSize(), (t2 - t1)); return tabletInfo; }

Target:
TreeMap<KeyExtent,TabletData> splitTablet(Tablet tablet, byte[] splitPoint) throws IOException { long t1 = System.currentTimeMillis(); TreeMap<KeyExtent,TabletData> tabletInfo = tablet.split(splitPoint); if (tabletInfo == null) { return null; } log.info("Starting split: {}", tablet.getExtent()); statsKeeper.incrementStatusSplit(); long start = System.currentTimeMillis(); Tablet[] newTablets = new Tablet[2]; Entry<KeyExtent,TabletData> first = tabletInfo.firstEntry(); TabletResourceManager newTrm0 = resourceManager.createTabletResourceManager(first.getKey(), getTableConfiguration(first.getKey())); newTablets[0] = new Tablet(TabletServer.this, first.getKey(), newTrm0, first.getValue()); Entry<KeyExtent,TabletData> last = tabletInfo.lastEntry(); TabletResourceManager newTrm1 = resourceManager.createTabletResourceManager(last.getKey(), getTableConfiguration(last.getKey())); newTablets[1] = new Tablet(TabletServer.this, last.getKey(), newTrm1, last.getValue()); statsKeeper.saveMajorMinorTimes(tablet.getTabletStats()); onlineTablets.split(tablet.getExtent(), newTablets[0], newTablets[1]); enqueueMasterMessage(new SplitReportMessage(tablet.getExtent(), newTablets[0].getExtent(), new Text("/" + newTablets[0].getDirName()), newTablets[1].getExtent(), new Text("/" + newTablets[1].getDirName()))); statsKeeper.updateTime(Operation.SPLIT, start, false); long t2 = System.currentTimeMillis(); log.info("Tablet split: size0 size1 time {}ms", tablet.getExtent(), newTablets[0].estimateTabletSize(), newTablets[1].estimateTabletSize(), (t2 - t1)); return tabletInfo; }
Source:
private void setupAria() { if (!isAriaScanEnabled(operatorContext.getSession()) || columns.isEmpty()) { return; } int[] channels = new int[columns.size()]; for (int i = 0; i < channels.length; i++) { channels[i] = i; } PageSourceOptions options = new PageSourceOptions( channels, channels, reusePages, new PageSourceOptions.FilterFunction[0], false, 512 * 1024, ariaFlags(operatorContext.getSession())); source.pushdownFilterAndProjection(options); }

Target:
private void setupAria() { if (!isAriaScanEnabled(operatorContext.getSession()) || columns.isEmpty()) { return; } int[] channels = new int[columns.size()]; for (int i = 0; i < channels.length; i++) { channels[i] = i; } PageSourceOptions options = new PageSourceOptions( channels, channels, reusePages, new FilterFunction[0], false, 512 * 1024, ariaFlags(operatorContext.getSession())); source.pushdownFilterAndProjection(options); }
Source:
public String initialString() { String threads = ""; if (configuration.isFfmpegAviSynthMultithreading()) { threads = " -threads " + configuration.getNumberOfCpuCores(); } return configuration.getMPEG2MainSettingsFFmpeg() + " -ab " + configuration.getAudioBitrateAC3() + "k" + threads; }

Target:
public String initialString() { String threads = ""; if (configuration.isFfmpegAviSynthMultithreading()) { threads = " -threads " + configuration.getNumberOfCpuCores(); } return configuration.getMPEG2MainSettingsFFmpeg() + " -ab " + configuration.getAudioBitrate() + "k" + threads; }
Source:
public void testWithTemplateClassl() throws Exception { selectedMethods = new String[] { "virtual void baseFunc() const=0;" }; assertRefactoringSuccess(); }

Target:
public void testWithTemplateClassl() throws Exception { selectedMethods = new String[] { "baseFunc()const" }; assertRefactoringSuccess(); }
Source:
public void visit(final PropertyNode node) { if (node.isLeaf()) { switch (node.getFieldType()) { case CHECK: final CheckElementParameter check = visitCheck(node); settings.put(check.getName(), check); break; case CLOSED_LIST: final TaCoKitElementParameter closedList = visitClosedList(node); settings.put(closedList.getName(), closedList); break; case TABLE: final TaCoKitElementParameter table = visitTable((ListPropertyNode) node); settings.put(table.getName(), table); break; case SCHEMA_TYPE: if (node.getProperty().getConnection().getType() == PropertyDefinitionDecorator.Connection.Type.OUT) { final TaCoKitElementParameter outSchema = visitOutSchema(node); settings.put(outSchema.getName(), outSchema); } if (node.getProperty().getConnection().getType() == PropertyDefinitionDecorator.Connection.Type.IN) { final TaCoKitElementParameter inSchema = visitInSchema(node); settings.put(inSchema.getName(), inSchema); } break; case TACOKIT_VALUE_SELECTION: final TaCoKitElementParameter valueSelection = visitValueSelection(node); settings.put(valueSelection.getName(), valueSelection); break; default: final IElementParameter text; if (node.getProperty().getPlaceholder() == null) { text = new TaCoKitElementParameter(element); } else { final TextElementParameter advancedText = new TextElementParameter(element); advancedText.setMessage(node.getProperty().getPlaceholder()); text = advancedText; } commonSetup(text, node); settings.put(text.getName(), text); break; } } else { buildHealthCheck(node); buildUpdate(node); } }

Target:
public void visit(final PropertyNode node) { if (node.isLeaf()) { switch (node.getFieldType()) { case CHECK: final CheckElementParameter check = visitCheck(node); settings.put(check.getName(), check); break; case CLOSED_LIST: final TaCoKitElementParameter closedList = visitClosedList(node); settings.put(closedList.getName(), closedList); break; case TABLE: final TaCoKitElementParameter table = visitTable((ListPropertyNode) node); settings.put(table.getName(), table); break; case SCHEMA_TYPE: final TaCoKitElementParameter outSchema = visitOutSchema(node); settings.put(outSchema.getName(), outSchema); break; case TACOKIT_INPUT_SCHEMA: final TaCoKitElementParameter inSchema = visitInSchema(node); settings.put(inSchema.getName(), inSchema); break; case TACOKIT_VALUE_SELECTION: final TaCoKitElementParameter valueSelection = visitValueSelection(node); settings.put(valueSelection.getName(), valueSelection); break; default: final IElementParameter text; if (node.getProperty().getPlaceholder() == null) { text = new TaCoKitElementParameter(element); } else { final TextElementParameter advancedText = new TextElementParameter(element); advancedText.setMessage(node.getProperty().getPlaceholder()); text = advancedText; } commonSetup(text, node); settings.put(text.getName(), text); break; } } else { buildHealthCheck(node); buildUpdate(node); } }
Source:
public Partition getPartition(String dbName, String tableName, List<String> part_vals) throws NoSuchObjectException, MetaException { boolean committed = false; Partition part = null; try { openTransaction(); part = convertToPart(getMPartition(dbName, tableName, part_vals)); committed = commitTransaction(); if(part == null) { throw new NoSuchObjectException("partition values=" + part_vals.toString()); } } catch (NucleusObjectNotFoundException ex) { throw new NoSuchObjectException("Failed to find the partition, partition values = " + part_vals.toString()); } finally { if (!committed) { rollbackTransaction(); } } part.setValues(part_vals); return part; }

Target:
public Partition getPartition(String dbName, String tableName, List<String> part_vals) throws NoSuchObjectException, MetaException { Partition part = convertToPart(getMPartition(dbName, tableName, part_vals)); if(part == null) { throw new NoSuchObjectException("partition values=" + part_vals.toString()); } part.setValues(part_vals); return part; }
Source:
private void resetSoftToParent() throws IOException, GitAPIException, CheckoutConflictException { Ref orig_head = repo.getRef(Constants.ORIG_HEAD); if (orig_head == null) { throw new NoHeadException( JGitText.get().cannotRebaseWithoutCurrentHead); } ObjectId orig_headId = orig_head.getObjectId(); try { Git.wrap(repo).reset().setMode(ResetType.SOFT) .setRef("HEAD~1").call(); } finally { repo.writeOrigHead(orig_headId); } }

Target:
private void resetSoftToParent() throws IOException, GitAPIException, CheckoutConflictException { Ref ref = repo.getRef(Constants.ORIG_HEAD); ObjectId orig_head = ref == null ? null : ref.getObjectId(); try { Git.wrap(repo).reset().setMode(ResetType.SOFT) .setRef("HEAD~1").call(); } finally { repo.writeOrigHead(orig_head); } }
Source:
private BrokerCommandBase CreateCommand(AdActionType action, LdapBrokerBaseParameters parameters) { Class type; try { type = Class.forName(GetCommandTypeName(action)); Constructor info = ReflectionUtils.findConstructor(type, parameters.getClass()); Object tempVar = info.newInstance(parameters); return (BrokerCommandBase) ((tempVar instanceof BrokerCommandBase) ? tempVar : null); } catch (ClassNotFoundException | InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException e) { log.errorFormat("LdapBrokerCommandBase: Failed to get type information using reflection for Action: {0}", action); return null; } }

Target:
private BrokerCommandBase CreateCommand(AdActionType action, LdapBrokerBaseParameters parameters) { try { Class type = Class.forName(GetCommandTypeName(action)); Constructor info = ReflectionUtils.findConstructor(type, parameters.getClass()); Object tempVar = info.newInstance(parameters); return (BrokerCommandBase) ((tempVar instanceof BrokerCommandBase) ? tempVar : null); } catch (Exception e) { log.errorFormat("LdapBrokerCommandBase: Failed to get type information using reflection for Action: {0}", action); return null; } }
Source:
public static PRINTER_INFO_2 getPrinterInfo2(String printerName) { IntByReference pcbNeeded = new IntByReference(); IntByReference pcReturned = new IntByReference(); HANDLEByReference pHandle = new HANDLEByReference(); Winspool.INSTANCE.OpenPrinter(printerName, pHandle, null); Winspool.INSTANCE.GetPrinter(pHandle.getValue(), 2, null, 0, pcbNeeded); if (pcbNeeded.getValue() <= 0) { return new PRINTER_INFO_2(); } PRINTER_INFO_2 pinfo2 = new PRINTER_INFO_2(pcbNeeded.getValue()); Winspool.INSTANCE.GetPrinter(pHandle.getValue(), 2, pinfo2.getPointer(), pcbNeeded.getValue(), pcReturned); pinfo2.read(); return pinfo2; }

Target:
public static PRINTER_INFO_2 getPrinterInfo2(String printerName) { IntByReference pcbNeeded = new IntByReference(); IntByReference pcReturned = new IntByReference(); HANDLEByReference pHandle = new HANDLEByReference(); if (!Winspool.INSTANCE.OpenPrinter(printerName, pHandle, null)) throw new Win32Exception(Kernel32.INSTANCE.GetLastError()); Win32Exception we = null; PRINTER_INFO_2 pinfo2 = null; try { Winspool.INSTANCE.GetPrinter(pHandle.getValue(), 2, null, 0, pcbNeeded); if (pcbNeeded.getValue() <= 0) return new PRINTER_INFO_2(); pinfo2 = new PRINTER_INFO_2(pcbNeeded.getValue()); if (!Winspool.INSTANCE.GetPrinter(pHandle.getValue(), 2, pinfo2.getPointer(), pcbNeeded.getValue(), pcReturned)) throw new Win32Exception(Kernel32.INSTANCE.GetLastError()); pinfo2.read(); } catch (Win32Exception e) { we = e; } finally { if (!Winspool.INSTANCE.ClosePrinter(pHandle.getValue())) { Win32Exception ex = new Win32Exception(Kernel32.INSTANCE.GetLastError()); if (we != null) { ex.addSuppressed(we); } } } if (we != null) { throw we; } return pinfo2; }
Source:
public ExprEval apply(List<Expr> args, Expr.ObjectBinding bindings) { if (args.size() >= 1) { throw new IAE("Function[%s] needs 0 argument", name()); } return ExprEval.of(Math.PI); }

Target:
public ExprEval apply(List<Expr> args, Expr.ObjectBinding bindings) { if (args.size() >= 1) { throw new IAE("Function[%s] needs 0 argument", name()); } return ExprEval.of(PI); }
Source:
public void freeSlot(WorkerSlot slot) { for (SchedulerAssignmentImpl assignment : assignments.values()) { if (assignment.isSlotOccupied(slot)) { assertValidTopologyForModification(assignment.getTopologyId()); assignment.unassignBySlot(slot); String nodeId = slot.getNodeId(); assignment.setTotalSharedOffHeapNodeMemory( nodeId, calculateSharedOffHeapNodedMemory(nodeId, assignment)); nodeToScheduledResourcesCache.computeIfAbsent(nodeId, MAKE_MAP).put(slot, new NormalizedResourceRequest()); nodeToScheduledOffHeapNodeMemoryCache.computeIfAbsent(nodeId, MAKE_MAP_STRING_DOUBLE); nodeToUsedSlotsCache.computeIfAbsent(nodeId, MAKE_SET).remove(slot); } } totalResourcesPerNodeCache.remove(slot.getNodeId()); }

Target:
public void freeSlot(WorkerSlot slot) { for (SchedulerAssignmentImpl assignment : assignments.values()) { if (assignment.isSlotOccupied(slot)) { assertValidTopologyForModification(assignment.getTopologyId()); assignment.unassignBySlot(slot); String nodeId = slot.getNodeId(); assignment.setTotalSharedOffHeapNodeMemory( nodeId, calculateSharedOffHeapNodeMemory(nodeId, assignment)); nodeToScheduledResourcesCache.computeIfAbsent(nodeId, Cluster::makeMap).put(slot, new NormalizedResourceRequest()); nodeToUsedSlotsCache.computeIfAbsent(nodeId, Cluster::makeSet).remove(slot); } } totalResourcesPerNodeCache.remove(slot.getNodeId()); }
Source:
private static void composeMessage(PrivateMessage pm) { info("Opening private messages page"); mainPage.openPrivateMessages(); info("Clicking compose button"); pmPage.clickComposeMessage(); info("Start filling PM fields."); pmPage.fillPrivateMessageFields(pm); }

Target:
private static void composeMessage(PrivateMessage pm) { mainPage.openPrivateMessages(); pmPage.clickComposeMessage(); pmPage.fillPrivateMessageFields(pm); }
Source:
public void testCfEqualityChecker() throws TException { CassandraKeyValueServiceImpl kvs; if (keyValueService instanceof CassandraKeyValueServiceImpl) { kvs = (CassandraKeyValueServiceImpl) keyValueService; } else if (keyValueService instanceof SynchronousDelegate) { kvs = (CassandraKeyValueServiceImpl) ((SynchronousDelegate) keyValueService).delegate(); } else if (keyValueService instanceof AsyncDelegate) { kvs = (CassandraKeyValueServiceImpl) ((AsyncDelegate) keyValueService).delegate(); } else if (keyValueService instanceof TableSplittingKeyValueService) { KeyValueService delegate = ((TableSplittingKeyValueService) keyValueService).getDelegate(NEVER_SEEN); assertTrue("The nesting of Key Value Services has apparently changed", delegate instanceof CassandraKeyValueService); kvs = (CassandraKeyValueServiceImpl) delegate; } else { throw new IllegalArgumentException("Can't run this cassandra-specific test against a non-cassandra KVS"); } kvs.createTable(NEVER_SEEN, getMetadata()); List<CfDef> knownCfs = kvs.getClientPool().runWithRetry(client -> client.describe_keyspace(CASSANDRA.getConfig().getKeyspaceOrThrow()).getCf_defs()); CfDef clusterSideCf = Iterables.getOnlyElement(knownCfs.stream() .filter(cf -> cf.getName().equals(getInternalTestTableName())) .collect(Collectors.toList())); assertTrue("After serialization and deserialization to database, Cf metadata did not match.", ColumnFamilyDefinitions.isMatchingCf(kvs.getCfForTable(NEVER_SEEN, getMetadata(), FOUR_DAYS_IN_SECONDS), clusterSideCf)); }

Target:
public void testCfEqualityChecker() throws TException { CassandraKeyValueServiceImpl kvs; if (keyValueService instanceof CassandraKeyValueService) { kvs = getUnderlyingKvs(keyValueService); } else if (keyValueService instanceof TableSplittingKeyValueService) { KeyValueService delegate = ((TableSplittingKeyValueService) keyValueService).getDelegate(NEVER_SEEN); assertTrue("The nesting of Key Value Services has apparently changed", delegate instanceof CassandraKeyValueService); kvs = (CassandraKeyValueServiceImpl) delegate; } else { throw getUnrecognizedKeyValueServiceException(); } kvs.createTable(NEVER_SEEN, getMetadata()); List<CfDef> knownCfs = kvs.getClientPool().runWithRetry(client -> client.describe_keyspace(CASSANDRA.getConfig().getKeyspaceOrThrow()).getCf_defs()); CfDef clusterSideCf = Iterables.getOnlyElement(knownCfs.stream() .filter(cf -> cf.getName().equals(getInternalTestTableName())) .collect(Collectors.toList())); assertTrue("After serialization and deserialization to database, Cf metadata did not match.", ColumnFamilyDefinitions.isMatchingCf(kvs.getCfForTable(NEVER_SEEN, getMetadata(), FOUR_DAYS_IN_SECONDS), clusterSideCf)); }
Source:
public void sendEmailToEndorseds() { CronJob cronJob = new CronJob(); cronJob.setName(Constants.CRON_MAIL_ENDORSEMENT_JOB); cronJob.setStartTimestamp(new Date()); try { List<TechGalleryUser> usersList = techGalleryUserDao.findAll(); for (TechGalleryUser techGalleryUser : usersList) { List<Endorsement> endorsementsList = endorsementDao.findAllEndorsementsStartingFrom(techGalleryUser, findLastExecutedCronJob(Constants.CRON_MAIL_ENDORSEMENT_JOB)); if (endorsementsList != null) { TechGalleryActivitiesTO activities = new TechGalleryActivitiesTO(); activities.setTechnologyActivitiesTo(new ArrayList<TechnologyActivitiesTO>()); activities.setAppName(Constants.APP_NAME); activities.setTimestamp(new Date()); for (Endorsement endorsement : endorsementsList) { TechnologyActivitiesTO endorsementActivity = new TechnologyActivitiesTO(); endorsementActivity.setEndorserUser(endorsement.getEndorserEntity()); endorsementActivity.setTechnology(endorsement.getTechnologyEntity()); activities.getTechnologyActivitiesTo().add(endorsementActivity); } if (!activities.getTechnologyActivitiesTo().isEmpty()) { EmailConfig email = new EmailConfig(EmailTypeEnum.ENDORSED, EmailTypeEnum.ENDORSED.getSubject() + activities.getFormattedTimestamp(), activities, techGalleryUser.getEmail()); emailService.push(email); } } } cronJob.setEndTimestamp(new Date()); cronJob.setCronStatus(CronStatus.SUCCESS); } catch (Exception e) { _LOG.info(e.getMessage()); cronJob.setEndTimestamp(new Date()); cronJob.setCronStatus(CronStatus.FAILURE); cronJob.setDescription(e.getMessage()); } cronJobsDao.add(cronJob); }

Target:
public void sendEmailToEndorseds() { CronJob cronJob = new CronJob(); cronJob.setName(Constants.CRON_MAIL_ENDORSEMENT_JOB); cronJob.setStartTimestamp(new Date()); Date lastExecutedCronJob = findLastExecutedCronJob(Constants.CRON_MAIL_ENDORSEMENT_JOB); try { List<TechGalleryUser> usersList = techGalleryUserDao.findAll(); for (TechGalleryUser techGalleryUser : usersList) { List<Endorsement> endorsementsList = endorsementDao.findAllEndorsementsStartingFrom(techGalleryUser, lastExecutedCronJob); if (endorsementsList != null) { TechGalleryActivitiesTO activities = new TechGalleryActivitiesTO(Constants.APP_NAME, null, new ArrayList<TechnologyActivitiesTO>()); for (Endorsement endorsement : endorsementsList) { TechnologyActivitiesTO endorsementActivity = new TechnologyActivitiesTO(endorsement.getEndorserEntity(), endorsement.getTechnologyEntity(), null, null, null); activities.getTechnologyActivitiesTo().add(endorsementActivity); } if (!activities.getTechnologyActivitiesTo().isEmpty()) { EmailConfig email = new EmailConfig(EmailTypeEnum.ENDORSED, EmailTypeEnum.ENDORSED.getSubject() + activities.getFormattedTimestamp(), activities, techGalleryUser.getEmail()); emailService.push(email); } } } cronJob.setEndTimestamp(new Date()); cronJob.setCronStatus(CronStatus.SUCCESS); } catch (Exception e) { _LOG.info(e.getMessage()); cronJob.setEndTimestamp(new Date()); cronJob.setCronStatus(CronStatus.FAILURE); cronJob.setDescription(e.getMessage()); } cronJobsDao.add(cronJob); }
Source:
void save(String id, byte[] data) throws IOException { File file = new File(folder, filename(id)); BufferedSink sink = Okio.buffer(Okio.sink(file)); sink.write(data).flush(); }

Target:
void save(String id, byte[] data) throws IOException { final File file = toFile(id); BufferedSink sink = Okio.buffer(Okio.sink(file)); try { sink.write(data).flush(); } finally { closeQuitely(sink); } }
Source:
protected boolean checkTemplateInStorageDomain() { boolean retValue = getParameters().isImportAsNewEntity() || (!isUnregisteredVM() && checkIfDisksExist(imageList)) || isUnregisteredVM(); if (retValue && !VmTemplateHandler.BLANK_VM_TEMPLATE_ID.equals(getVm().getVmtGuid()) && !getParameters().getCopyCollapse()) { List<StorageDomain> domains = Backend.getInstance() .runInternalQuery(VdcQueryType.GetStorageDomainsByVmTemplateId, new IdQueryParameters(getVm().getVmtGuid())).getReturnValue(); List<Guid> domainsId = LinqUtils.foreach(domains, new Function<StorageDomain, Guid>() { @Override public Guid eval(StorageDomain storageDomainStatic) { return storageDomainStatic.getId(); } }); if (Collections.disjoint(domainsId, imageToDestinationDomainMap.values())) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_TEMPLATE_NOT_FOUND_ON_DESTINATION_DOMAIN); } } return retValue; }

Target:
protected boolean checkTemplateInStorageDomain() { boolean retValue = verifyDisksIfNeeded(); if (retValue && !VmTemplateHandler.BLANK_VM_TEMPLATE_ID.equals(getVm().getVmtGuid()) && !getParameters().getCopyCollapse()) { List<StorageDomain> domains = Backend.getInstance() .runInternalQuery(VdcQueryType.GetStorageDomainsByVmTemplateId, new IdQueryParameters(getVm().getVmtGuid())).getReturnValue(); List<Guid> domainsId = LinqUtils.foreach(domains, new Function<StorageDomain, Guid>() { @Override public Guid eval(StorageDomain storageDomainStatic) { return storageDomainStatic.getId(); } }); if (Collections.disjoint(domainsId, imageToDestinationDomainMap.values())) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_TEMPLATE_NOT_FOUND_ON_DESTINATION_DOMAIN); } } return retValue; }
Source:
public int getLaunchTimeout() { if( StringUtils.isEmpty(launchTimeout) || Integer.parseInt(launchTimeout) <= 0 ) launchTimeout = "" + Integer.MAX_VALUE; return Integer.parseInt(launchTimeout); }

Target:
public int getLaunchTimeout() { return launchTimeout <= 0 ? Integer.MAX_VALUE : launchTimeout; }
Source:
public static void assertPulled(CouchClient client, DatastoreExtended datastore) { logger.entering(DatabaseAssert.class.getCanonicalName(),"assertPulled", new Object[]{client,datastore}); Long start = System.currentTimeMillis(); Set<String> alreadyChecked = new HashSet<String>(); ChangesResultWrapper changesBatch = new ChangesResultWrapper(client.changes("0", BATCH_LIMIT)); while(changesBatch.size() > 0) { for(ChangesResult.Row row : changesBatch.getResults()) { ChangeRowAdaptor adaptor = new ChangeRowAdaptor(row); if(alreadyChecked.contains(adaptor.id)) { continue; } DatabaseAssert.checkChangeRow(adaptor, client, datastore); alreadyChecked.add(adaptor.id); } changesBatch = new ChangesResultWrapper(client.changes(changesBatch.getLastSeq(), BATCH_LIMIT)); } Long end = System.currentTimeMillis(); logger.finest(String.format("Done check took %1 seconds",(end - start)/1000.0)); }

Target:
public static void assertPulled(CouchClient client, DatastoreExtended datastore) { logger.entering("DatabaseAssert","assertPulled", new Object[]{client,datastore}); Long start = System.currentTimeMillis(); Set<String> alreadyChecked = new HashSet<String>(); ChangesResultWrapper changesBatch = new ChangesResultWrapper(client.changes("0", BATCH_LIMIT)); while(changesBatch.size() > 0) { for(ChangesResult.Row row : changesBatch.getResults()) { ChangeRowAdaptor adaptor = new ChangeRowAdaptor(row); if(alreadyChecked.contains(adaptor.id)) { continue; } DatabaseAssert.checkChangeRow(adaptor, client, datastore); alreadyChecked.add(adaptor.id); } changesBatch = new ChangesResultWrapper(client.changes(changesBatch.getLastSeq(), BATCH_LIMIT)); } Long end = System.currentTimeMillis(); logger.finest(String.format("Done check took %1 seconds",(end - start)/1000.0)); }
Source:
public EViewHolder(AndroidAnnotationsEnvironment environment, TypeElement annotatedElement) throws Exception { super(environment, annotatedElement); onFinishInflateCallBlock = new ArrayList<>(); addSuppressWarning(); createConstructorAndBuilder(); }

Target:
public EViewHolder(AndroidAnnotationsEnvironment environment, TypeElement annotatedElement) throws Exception { super(environment, annotatedElement); addSuppressWarning(); createConstructorAndBuilder(); }
Source:
public static void abandon(final PatchSet.Id patchSetId, final IdentifiedUser user, final String message, final ReviewDb db, final AbandonedSender.Factory senderFactory, final ChangeHookRunner hooks) throws NoSuchChangeException, InvalidChangeOperationException, EmailException, OrmException { final Change.Id changeId = patchSetId.getParentKey(); final PatchSet patch = db.patchSets().get(patchSetId); if (patch == null) { throw new NoSuchChangeException(changeId); } final ChangeMessage cmsg = new ChangeMessage(new ChangeMessage.Key(changeId, ChangeUtil .messageUUID(db)), user.getAccountId()); cmsg.setPatchSetId(patchSetId); final StringBuilder msgBuf = new StringBuilder("Patch Set " + patchSetId.get() + ": Abandoned"); if (message != null && message.length() > 0) { msgBuf.append("\n\n"); msgBuf.append(message); } cmsg.setMessage(msgBuf.toString()); final Change updatedChange = db.changes().atomicUpdate(changeId, new AtomicUpdate<Change>() { @Override public Change update(Change change) { if (change.getStatus().isOpen() && change.currentPatchSetId().equals(patchSetId)) { change.setStatus(Change.Status.ABANDONED); ChangeUtil.updated(change); return change; } else { return null; } } }); updatedChange(db, user, updatedChange, cmsg, senderFactory, "Change is no longer open or patchset is not latest"); hooks.doChangeAbandonedHook(updatedChange, user.getAccount(), message); }

Target:
public static void abandon(final PatchSet.Id patchSetId, final IdentifiedUser user, final String message, final ReviewDb db, final AbandonedSender.Factory senderFactory, final ChangeHookRunner hooks) throws NoSuchChangeException, InvalidChangeOperationException, EmailException, OrmException { final Change.Id changeId = patchSetId.getParentKey(); final PatchSet patch = db.patchSets().get(patchSetId); if (patch == null) { throw new NoSuchChangeException(changeId); } final ChangeMessage cmsg = new ChangeMessage(new ChangeMessage.Key(changeId, ChangeUtil .messageUUID(db)), user.getAccountId(), patchSetId); final StringBuilder msgBuf = new StringBuilder("Patch Set " + patchSetId.get() + ": Abandoned"); if (message != null && message.length() > 0) { msgBuf.append("\n\n"); msgBuf.append(message); } cmsg.setMessage(msgBuf.toString()); final Change updatedChange = db.changes().atomicUpdate(changeId, new AtomicUpdate<Change>() { @Override public Change update(Change change) { if (change.getStatus().isOpen() && change.currentPatchSetId().equals(patchSetId)) { change.setStatus(Change.Status.ABANDONED); ChangeUtil.updated(change); return change; } else { return null; } } }); updatedChange(db, user, updatedChange, cmsg, senderFactory, "Change is no longer open or patchset is not latest"); hooks.doChangeAbandonedHook(updatedChange, user.getAccount(), message); }
Source:
private void release() { terminationReleaseLock.lock(); try { statementLocks.close(); statementLocks = null; terminationReason = null; type = null; securityContext = null; transactionEvent = null; explicitIndexTransactionState = null; if ( txState != null ) { txState.release(); } txState = null; hooksState = null; closeListeners.clear(); reuseCount++; userMetaData = Collections.emptyMap(); userTransactionId = 0; statistics.reset(); operations.release(); pool.release( this ); } finally { terminationReleaseLock.unlock(); } }

Target:
private void release() { terminationReleaseLock.lock(); try { statementLocks.close(); statementLocks = null; terminationReason = null; type = null; securityContext = null; transactionEvent = null; explicitIndexTransactionState = null; if ( txState != null ) { txState.release(); txState = null; } hooksState = null; closeListeners.clear(); reuseCount++; userMetaData = Collections.emptyMap(); userTransactionId = 0; statistics.reset(); operations.release(); pool.release( this ); } finally { terminationReleaseLock.unlock(); } }
Source:
public void visitNode(AstNode astNode) { if (astNode.is(PythonGrammar.FUNCDEF) && currentFunction == null) { currentFunction = astNode; nestingLevel = 0; } if (currentFunction != null) { if (astNode.is(PythonGrammar.SUITE) && incrementsNestingLevel(astNode)) { nestingLevel++; } checkComplexity(astNode); } }

Target:
public void visitNode(AstNode astNode) { if (astNode.is(PythonGrammar.FUNCDEF, PythonGrammar.CLASSDEF)) { nestingLevelStack.push(new NestingLevel(nestingLevelStack.peek(), astNode)); } else if (astNode.is(PythonGrammar.SUITE)) { if (isSuiteIncrementsNestingLevel(astNode)) { nestingLevelStack.peek().increment(); } } else if (astNode.is(PythonGrammar.IF_STMT, PythonGrammar.WHILE_STMT, PythonGrammar.FOR_STMT, PythonGrammar.EXCEPT_CLAUSE)) { incrementWithNesting(astNode.getFirstChild()); } else if (astNode.is(PythonKeyword.ELIF) || (astNode.is(PythonKeyword.ELSE) && astNode.getNextSibling().is(PythonPunctuator.COLON))) { incrementWithoutNesting(astNode); } else if (astNode.is(PythonGrammar.AND_TEST, PythonGrammar.OR_TEST)) { incrementWithoutNesting(astNode.getFirstChild(PythonKeyword.AND, PythonKeyword.OR)); } else if (astNode.is(PythonGrammar.TEST) && astNode.hasDirectChildren(PythonKeyword.IF)) { incrementWithNesting(astNode.getFirstChild(PythonKeyword.IF)); nestingLevelStack.peek().increment(); } }
Source:
NamedTuple makeClassifiers(MultiEncoder encoder) { Map inferredFields = (Map<String, Class<? extends Classifier>>) params.get(KEY.INFERRED_FIELDS); if(inferredFields == null || inferredFields.entrySet().size() == 0) { throw new IllegalStateException( "KEY.AUTO_CLASSIFY has been set to \"true\", but KEY.INFERRED_FIELDS is null or\n\t" + "empty. Must specify desired Classifier for at least one input field in\n\t" + "KEY.INFERRED_FIELDS or set KEY.AUTO_CLASSIFY to \"false\"." ); } String[] names = new String[encoder.getEncoders(encoder).size()]; Classifier[] ca = new Classifier[names.length]; int i = 0; for(EncoderTuple et : encoder.getEncoders(encoder)) { names[i] = et.getName(); Object fieldClassifier = inferredFields.get(et.getName()); if(fieldClassifier == CLAClassifier.class) { LOGGER.info("Classifying \"" + et.getName() + "\" input field with CLAClassifier"); ca[i] = new CLAClassifier(); } else if(fieldClassifier == SDRClassifier.class) { LOGGER.info("Classifying \"" + et.getName() + "\" input field with SDRClassifier"); ca[i] = new SDRClassifier(); } else if(fieldClassifier != null) { throw new IllegalStateException( "Invalid Classifier class token, \"" + fieldClassifier + "\",\n\t" + "specified for, \"" + et.getName() + "\", input field.\n\t" + "Valid class tokens are CLAClassifier.class and SDRClassifier.class" ); } else { LOGGER.info("Not classifying \"" + et.getName() + "\" input field"); } i++; } return new NamedTuple(names, (Object[])ca); }

Target:
NamedTuple makeClassifiers(MultiEncoder encoder) { Map<String, Class<? extends Classifier>> inferredFields = (Map<String, Class<? extends Classifier>>) params.get(KEY.INFERRED_FIELDS); if(inferredFields == null || inferredFields.entrySet().size() == 0) { throw new IllegalStateException( "KEY.AUTO_CLASSIFY has been set to \"true\", but KEY.INFERRED_FIELDS is null or\n\t" + "empty. Must specify desired Classifier for at least one input field in\n\t" + "KEY.INFERRED_FIELDS or set KEY.AUTO_CLASSIFY to \"false\" (which is its default\n\t" + "value in Parameters)." ); } String[] names = new String[encoder.getEncoders(encoder).size()]; Classifier[] ca = new Classifier[names.length]; int i = 0; for(EncoderTuple et : encoder.getEncoders(encoder)) { names[i] = et.getName(); Object fieldClassifier = inferredFields.get(et.getName()); if(fieldClassifier == CLAClassifier.class) { LOGGER.info("Classifying \"" + et.getName() + "\" input field with CLAClassifier"); ca[i] = new CLAClassifier(); } else if(fieldClassifier == SDRClassifier.class) { LOGGER.info("Classifying \"" + et.getName() + "\" input field with SDRClassifier"); ca[i] = new SDRClassifier(); } else if(fieldClassifier != null) { throw new IllegalStateException( "Invalid Classifier class token, \"" + fieldClassifier + "\",\n\t" + "specified for, \"" + et.getName() + "\", input field.\n\t" + "Valid class tokens are CLAClassifier.class and SDRClassifier.class" ); } else { LOGGER.info("Not classifying \"" + et.getName() + "\" input field"); } i++; } return new NamedTuple(names, (Object[])ca); }
Source:
public ITmfTrace openMinimalTrace(String projectName, String traceName, Boolean isExperiment) throws FileNotFoundException, InstantiationException, IllegalAccessException, TmfTraceException, CoreException, TmfTraceImportException { String path = getTracePath(projectName, traceName, isExperiment); IFile file = getFile(path); String location = file.getLocationURI().getPath(); return openAndInitializeTrace(file, location, traceName, ""); }

Target:
public @Nullable ITmfTrace openMinimalTrace(String projectName, String traceName, Boolean isExperiment) throws FileNotFoundException { String path = getTracePath(projectName, traceName, isExperiment); IFile file = getFile(path); String location = file.getLocationURI().getPath(); if (location == null) { return null; } try { return openAndInitializeTrace(file, location, traceName, ""); } catch (InstantiationException | IllegalAccessException | TmfTraceException | TmfTraceImportException e) { throw new NullPointerException(e.toString()); } }
Source:
public boolean deleteContentJson(String uri) throws IOException { boolean deleteSuccessful; Path pathToDelete = toPath(uri); if (!Files.exists(pathToDelete)) { deleteSuccessful = false; } else if (isDataJsonFile(pathToDelete)) { Path parentDir = pathToDelete.getParent(); deleteSuccessful = deleteDataJsonFile(parentDir); } else { deleteSuccessful = Files.deleteIfExists(pathToDelete); } if (deleteSuccessful) { deleteEmptyParentDirectories(pathToDelete); } return deleteSuccessful; }

Target:
public boolean deleteContentJson(String uri) throws IOException { boolean deleteSuccessful; Path pathToDelete = toPath(uri); if (!Files.exists(pathToDelete)) { deleteSuccessful = false; } else if (isDataJsonFile(pathToDelete)) { Path parentDir = pathToDelete.getParent(); deleteSuccessful = deleteDataJsonFileAndRelatedPreviousVersionFiles(parentDir); } else { deleteSuccessful = Files.deleteIfExists(pathToDelete); } if (deleteSuccessful) { deleteEmptyParentDirectories(pathToDelete); } return deleteSuccessful; }
Source:
private Map readMapValue(ObjectMapper mapper, String messagePayload) { Map context = null; try { context = mapper.readValue(messagePayload, Map.class); } catch (IOException ioe) { log.error(ioe.getMessage()); } return context; }

Target:
private Map readMapValue(ObjectMapper mapper, String messagePayload) { Map context; try { context = mapper.readValue(messagePayload, Map.class); } catch (IOException ioe) { throw new RuntimeException(ioe); } return context; }
Source:
private String getDeviceIpAddressFromSessionProvider(final String iccId, final DlmsDevice dlmsDevice) throws SessionProviderException, SessionProviderUnsupportedException { final SessionProvider sessionProvider = this.sessionProviderService.getSessionProvider(dlmsDevice .getCommunicationProvider()); String deviceIpAddress; deviceIpAddress = sessionProvider.getIpAddress(iccId); if (deviceIpAddress == null) { this.jasperWirelessSmsClient.sendWakeUpSMS(iccId); for (int i = 0; i < this.dlmsJwccGetSessionRetries; i++) { try { Thread.sleep(this.dlmsJwccGetSessionSleepBetweenRetries); } catch (final InterruptedException e) { throw new SessionProviderException( "Interrupted while sleeping before calling the sessionProvider.getIpAddress", e); } deviceIpAddress = sessionProvider.getIpAddress(iccId); if (deviceIpAddress != null) { return deviceIpAddress; } } } return deviceIpAddress; }

Target:
private String getDeviceIpAddressFromSessionProvider(final String iccId, final DlmsDevice dlmsDevice) throws SessionProviderException, SessionProviderUnsupportedException { final SessionProvider sessionProvider = this.sessionProviderService.getSessionProvider(dlmsDevice .getCommunicationProvider()); String deviceIpAddress = sessionProvider.getIpAddress(iccId); if (deviceIpAddress == null) { this.jasperWirelessSmsClient.sendWakeUpSMS(iccId); for (int i = 0; i < this.jasperGetSessionRetries; i++) { try { Thread.sleep(this.jasperGetSessionSleepBetweenRetries); } catch (final InterruptedException e) { throw new SessionProviderException( "Interrupted while sleeping before calling the sessionProvider.getIpAddress", e); } deviceIpAddress = sessionProvider.getIpAddress(iccId); if (deviceIpAddress != null) { return deviceIpAddress; } } } return deviceIpAddress; }
Source:
public void setTopView(TopView tv) { topPanel.remove(0); switch(tv) { case MAIN: topPanel.add(new FlowPanel()); break; case COMMIT: topPanel.add(commitMessageBlock); break; case PREFERENCES: topPanel.add(settingsPanel); break; case PATCH_SETS: topPanel.add(historyTable); break; case FILES: topPanel.add(fileList); break; } }

Target:
public void setTopView(TopView tv) { topPanel.clear(); switch(tv) { case COMMIT: topPanel.add(commitMessageBlock); break; case PREFERENCES: topPanel.add(settingsPanel); break; case PATCH_SETS: topPanel.add(historyTable); break; case FILES: topPanel.add(fileList); break; } }
Source:
public static void main(String[] args) throws InterruptedException { ApplicationContext context = new GenericXmlApplicationContext("applicationContext.xml"); calculateInvocationTime(context); HazelcastClient.shutdownAll(); Hazelcast.shutdownAll(); }

Target:
public static void main(String[] args) throws InterruptedException { ApplicationContext context = new GenericXmlApplicationContext("applicationContext.xml"); doInvocation(context); HazelcastClient.shutdownAll(); Hazelcast.shutdownAll(); }
Source:
private CodeBlock javadocWithParameters() { CodeBlock.Builder builder = javadoc.toBuilder(); for (ParameterSpec parameterSpec : parameters) { if (!parameterSpec.javadoc.isEmpty()) { builder.add("@param $L $L", parameterSpec.name, parameterSpec.javadoc); } } return builder.build(); }

Target:
private CodeBlock javadocWithParameters() { CodeBlock.Builder builder = javadoc.toBuilder(); boolean emitTagNewline = true; for (ParameterSpec parameterSpec : parameters) { if (!parameterSpec.javadoc.isEmpty()) { if (emitTagNewline && !javadoc.isEmpty()) builder.add("\n"); emitTagNewline = false; builder.add("@param $L $L", parameterSpec.name, parameterSpec.javadoc); } } return builder.build(); }
Source:
private void parsingError(String message) { logger.error(message); String o = "Command Line Options:\n" + " -i <file or directory name> : the name of a directory or file containing the input.\n" + " -o <file or directory name>: the output directory or file where the output will be stored. For \n" + " directories files will share the same name as the input file, so this directory must be different" + " from the input directory.\n" + " -c <file name> : the name of the configuration file.\n" + " -t <number of threads> : Allows users to specify the number of threads to use, by default there will be one" + " thread for every core on the machine.\n"; logger.error(o); System.exit(-1); }

Target:
private void parsingError(String message) { System.err.println(message); String o = "Command Line Options:\n" + " -i <file or directory name> : the name of a directory or file containing the input.\n" + " -o <file or directory name>: the output directory or file where the output will be stored. For \n" + " directories files will share the same name as the input file, so this directory must be different" + " from the input directory.\n" + " -c <file name> : the name of the configuration file.\n" + " -t <number of threads> : Allows users to specify the number of threads to use, by default there will be one" + " thread for every core on the machine.\n"; System.err.println(o); System.exit(-1); }
Source:
public void testWriteProgressOrPriorityOrMetricsNotUpdatedAfterSweepRunsSuccessfully() { sweeperService.sweepTableFrom(TABLE_REF.getQualifiedName(), encodeStartRow(new byte[] {1, 2, 3})); verify(priorityStore, never()).update(any(), any(), any()); verify(progressStore, never()).saveProgress(any(), any()); Mockito.verifyZeroInteractions(sweepMetrics); }

Target:
public void testWriteProgressOrPriorityOrMetricsNotUpdatedAfterSweepRunsSuccessfully() { sweeperService.sweepTableFrom(TABLE_REF.getQualifiedName(), encodeStartRow(new byte[] {1, 2, 3})); Mockito.verifyZeroInteractions(sweepMetrics); }
Source:
private void loadFile(File file) throws ConfigurationException { Configuration config = null; try { config = Configuration.loadFile(file); ExtensionEntry entry = new ExtensionEntry(file, config); ExtensionEntry alreadyLoded = loadedEntries.get(entry.getName()); if (alreadyLoded != null) { throw new ConfigurationException("Could not load the configuration file \"" + file.getAbsolutePath() + "\". The configuration file + \"" + alreadyLoded.file.getAbsolutePath() + "\" already has the name " + entry.getName()); } loadedEntries.put(entry.name, entry); } catch (IOException exception) { throw new ConfigurationException( "Can't load object configuration file \"" + file.getAbsolutePath() + "\".", exception); } }

Target:
private void loadFile(File file) throws ConfigurationException { Configuration config = null; try { ExtensionEntry entry = new ExtensionEntry(file); ExtensionEntry alreadyLoded = loadedEntries.get(entry.getName()); if (alreadyLoded != null) { throw new ConfigurationException("Could not load the configuration file \"" + file.getAbsolutePath() + "\". The configuration file + \"" + alreadyLoded.file.getAbsolutePath() + "\" already has the name " + entry.getName()); } loadedEntries.put(entry.name, entry); } catch (IOException exception) { throw new ConfigurationException( "Can't load object configuration file \"" + file.getAbsolutePath() + "\".", exception); } }
Source:
public Key(final HttpRequest request, final int start) { String matchingPath = ((ResteasyUriInfo) request.getUri()).getMatchingPath(); this.path = start == 0 ? matchingPath : matchingPath.substring(start); this.start = start; this.method = request.getHttpMethod(); if (request.getHttpHeaders().getMediaType().getParameters().containsKey("boundary")) { this.contentType = new MediaType(request.getHttpHeaders().getMediaType().getType(), request.getHttpHeaders().getMediaType().getSubtype()); } else { this.contentType = request.getHttpHeaders().getMediaType(); } this.accepts = request.getHttpHeaders().getAcceptableMediaTypes(); }

Target:
public Key(final HttpRequest request, final int start) { String matchingPath = ((ResteasyUriInfo) request.getUri()).getMatchingPath(); this.path = start == 0 ? matchingPath : matchingPath.substring(start); this.start = start; this.method = request.getHttpMethod(); this.contentType = request.getHttpHeaders().getMediaType(); this.accepts = request.getHttpHeaders().getAcceptableMediaTypes(); }
Source:
public void CheckFiles() { boolean debug = true; if (debug) { downloadAgent = new ChannelDownloader(); } else { downloadAgent = new DefaultDownloader(); } checkNativeDir(); checkSoundDir(); MojamStartup.instance.startgame(); }

Target:
public void CheckFiles() { System.out.println(Options.getAsInteger(Options.DLSYSTEM)); if (Options.getAsInteger(Options.DLSYSTEM, 0)==1) { downloadAgent = new ChannelDownloader(); } else if(Options.getAsInteger(Options.DLSYSTEM, 0)==0){ downloadAgent = new DefaultDownloader(); } checkNativeDir(); checkSoundDir(); MojamStartup.instance.startgame(); }