auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected void processCommunication(String tenantId, TraceCompletionInformation item, Communication c, CommunicationDetails cd) { long targetFragmentBaseDuration = c.getBaseDuration() + cd.getLatency(); long durationWithTargetFragment = targetFragmentBaseDuration + cd.getTargetFragmentDuration(); if (durationWithTargetFragment > item.getCompletionTime().getDuration()) { item.getCompletionTime().setDuration(durationWithTargetFragment); } if (!cd.getProperties().isEmpty()) { item.getCompletionTime().getProperties().addAll(cd.getProperties()); } for (int j = 0; j < cd.getOutbound().size(); j++) { CommunicationDetails.Outbound ob = cd.getOutbound().get(j); Communication newc = new Communication(); newc.setIds(ob.getIds()); newc.setMultipleConsumers(ob.isMultiConsumer()); newc.setBaseDuration(targetFragmentBaseDuration + ob.getProducerOffset()); if (ob.isMultiConsumer()) { newc.setExpire(cd.getTimestamp() + TraceCompletionInformation.Communication.DEFAULT_EXPIRY_WINDOW); } else { newc.setExpire(System.currentTimeMillis() + TraceCompletionInformation.Communication.DEFAULT_EXPIRY_WINDOW); } if (log.isLoggable(Level.FINEST)) { log.finest("Completion info " + item + ": new communication = " + newc); } item.getCommunications().add(newc); } }

Target:
protected void processCommunication(String tenantId, TraceCompletionInformation item, Communication c, CommunicationDetails cd) { long targetFragmentBaseDuration = c.getBaseDuration() + cd.getLatency(); long durationWithTargetFragment = targetFragmentBaseDuration + cd.getTargetFragmentDuration(); if (durationWithTargetFragment > item.getCompletionTime().getDuration()) { item.getCompletionTime().setDuration(durationWithTargetFragment); } if (!cd.getProperties().isEmpty()) { item.getCompletionTime().getProperties().addAll(cd.getProperties()); } for (int j = 0; j < cd.getOutbound().size(); j++) { CommunicationDetails.Outbound ob = cd.getOutbound().get(j); Communication newc = new Communication(); newc.setIds(ob.getIds()); newc.setMultipleConsumers(ob.isMultiConsumer()); newc.setBaseDuration(targetFragmentBaseDuration + ob.getProducerOffset()); long baseTimeStamp = ob.isMultiConsumer() ? cd.getTimestamp() : System.currentTimeMillis(); newc.setExpire(baseTimeStamp + TraceCompletionInformation.Communication.DEFAULT_EXPIRY_WINDOW); if (log.isLoggable(Level.FINEST)) { log.finest("Completion info " + item + ": new communication = " + newc); } item.getCommunications().add(newc); } }
Source:
private static Iterable<Expression> pullNullableConjunctsThroughOuterJoin(List<Expression> conjuncts, Collection<Symbol> outputSymbols, Predicate<Symbol>... nullSymbolScopes) { return conjuncts.stream() .map(expression -> pullExpressionThroughSymbols(expression, outputSymbols)) .map(expression -> SymbolsExtractor.extractAll(expression).anyMatch(alwaysTrue()) ? TRUE_LITERAL : expression) .map(expressionOrNullSymbols(nullSymbolScopes)) .collect(toImmutableList()); }

Target:
private static Iterable<Expression> pullNullableConjunctsThroughOuterJoin(List<Expression> conjuncts, Collection<Symbol> outputSymbols, Predicate<Symbol>... nullSymbolScopes) { return conjuncts.stream() .map(expression -> pullExpressionThroughSymbols(expression, outputSymbols)) .map(expression -> isEmpty(SymbolsExtractor.extractAll(expression)) ? TRUE_LITERAL : expression) .map(expressionOrNullSymbols(nullSymbolScopes)) .collect(toImmutableList()); }
Source:
public IItemDescriptor<T> add(IItemDescriptor<T> itemDescriptor) { Preconditions.checkArgument(itemDescriptor != null); Preconditions.checkArgument(itemDescriptor.getID() != null); return registry.put(itemDescriptor.getID(), itemDescriptor); }

Target:
public IItemDescriptor<T> add(IItemDescriptor<T> itemDescriptor) { Preconditions.checkNotNull(itemDescriptor); Preconditions.checkNotNull(itemDescriptor.getID()); return registry.put(itemDescriptor.getID(), itemDescriptor); }
Source:
public boolean equals(Object obj) { if (!(obj instanceof SerializableProtobuf<?>)) { return false; } SerializableProtobuf<?> other = ((SerializableProtobuf<?>) obj); if (hash != other.hash) { return false; } if (object != null && other.object != null) { return object.equals(other.object); } return Arrays.equals(buf, other.buf); }

Target:
public boolean equals(Object obj) { if (!(obj instanceof SerializableProtobuf<?>)) { return false; } SerializableProtobuf<T> other = ((SerializableProtobuf<T>) obj); if (hash != other.hash) { return false; } T thisObject = toObject(this, this.codec, other.codec); T otherObject = toObject(other, this.codec, other.codec); if (thisObject != null && otherObject != null) { return thisObject.equals(otherObject); } else if (this.buf != null && other.buf != null) { return Arrays.equals(this.buf, other.buf); } else { return false; } }
Source:
public static void main(String[] args) throws Exception{ if (args.length != 4) { System.out.println("Usage: CliClient <endpoing> <username> <password> <command>"); } String endpoint = args[0]; String username = args[1]; String password = args[2]; String cmd = args[3]; WinRmTool client = WinRmTool.Builder.builder(endpoint, username, password) .disableCertificateChecks(true) .workingDirectory("C:\\") .build(); int exitCode = 999; try { WinRmToolResponse response = client.executeCommand(cmd); System.err.print(response.getStdErr()); System.out.println(response.getStdOut()); exitCode = response.getStatusCode(); } finally { CXFBusFactory.clearDefaultBusForAnyThread(CXFBusFactory.getDefaultBus()); } System.exit(exitCode); }

Target:
public static void main(String[] args) throws Exception{ if (args.length != 4) { System.out.println("Usage: CliClient <endpoing> <username> <password> <command>"); System.exit(1); } String endpoint = args[0]; String username = args[1]; String password = args[2]; String cmd = args[3]; WinRmTool client = WinRmTool.Builder.builder(endpoint, username, password) .disableCertificateChecks(true) .workingDirectory("C:\\") .disableCertificateChecks(true) .build(); int exitCode = 999; try { WinRmToolResponse response = client.executeCommand(cmd); System.err.print(response.getStdErr()); System.out.println(response.getStdOut()); exitCode = response.getStatusCode(); } finally { CXFBusFactory.clearDefaultBusForAnyThread(CXFBusFactory.getDefaultBus()); } System.exit(exitCode); }
Source:
public void setLeftPortletWidthPercent(int percent) { if (percent < 0) { throw new IllegalArgumentException("Width can't be negative!"); } useCssStyle(true); this.cssLeftPortletWidth.set(percent + "%"); }

Target:
public void setLeftPortletWidthPercent(int percent) { setPortletWidthOnControl(cssLeftPortletWidth, percent, PERCENTAGE_SYMBOL); }
Source:
public void setTradSpiderEnabled(boolean isTradSpiderEnabled) { this.isTradSpiderEnabled = isTradSpiderEnabled; getConfig().setProperty(PARAM_TRAD_SPIDER_ENABLED, isTradSpiderEnabled); try { getConfig().save(); QuickStartHelper.raiseOptionsChangedEvent(); } catch (ConfigurationException e) { LOGGER.error("Failed to save the \"Quick Start\" configuration", e); } }

Target:
public void setTradSpiderEnabled(boolean isTradSpiderEnabled) { this.isTradSpiderEnabled = isTradSpiderEnabled; getConfig().setProperty(PARAM_TRAD_SPIDER_ENABLED, isTradSpiderEnabled); QuickStartHelper.raiseOptionsChangedEvent(); }
Source:
public void testEditVLAN() throws Exception { Map<String, String> meta = Maps.newHashMap(); meta.put("test", "test data"); VLANInfo vlanInfo = new VLANInfo.Builder() .meta(meta) .build(); if (api.listVLANs().concat().size() > 0) { checkVlAN(vlanInfo, api.editVLAN(api.listVLANs().concat().get(0).getUuid(), vlanInfo)); } }

Target:
public void testEditVLAN() throws Exception { Map<String, String> meta = Maps.newHashMap(); meta.put("test", "test data"); VLANInfo vlanInfo = new VLANInfo.Builder() .meta(meta) .build(); if (!api.listVLANs().concat().isEmpty()) { checkVlAN(vlanInfo, api.editVLAN(api.listVLANs().concat().get(0).getUuid(), vlanInfo)); } }
Source:
protected HealthCheckResult getOrRunHealthCheck(String probe) { if (StringUtils.isEmpty(probe)) { return Framework.getService(ProbeManager.class).getOrRunHealthCheck(); } return Framework.getService(ProbeManager.class).getOrRunHealthCheckSingleProbe(probe); }

Target:
protected HealthCheckResult getOrRunHealthCheck(String probe) { ProbeManager pm = Framework.getService(ProbeManager.class); if (StringUtils.isEmpty(probe)) { return pm.getOrRunHealthChecks(); } else { return pm.getOrRunHealthCheck(probe); } }
Source:
public void testExtAndDirWithOneRule() { HashMap<String, Rule> rules = new HashMap<>(); rules.put("Rule", new Rule("testExtAndDirWithOneRule", new Rule.ExtensionCondition("jpg"), new MetaTypeCondition(MetaTypeCondition.Type.FILES), new ParentPathCondition("dir1"), null, null, null)); FilesSet Files_Ext_Dirs_Filter = new FilesSet("Filter", "Filter to find all jpg files in dir1.", false, true, rules); try { Case openCase = Case.getOpenCase(); runIngestJob(openCase.getDataSources(), Files_Ext_Dirs_Filter); FileManager fileManager = Case.getOpenCase().getServices().getFileManager(); List<AbstractFile> results = fileManager.findFiles("%.jpg%"); assertEquals(12, results.size()); for (AbstractFile file : results) { if (file.getParentPath().equalsIgnoreCase("/dir1/") && file.getNameExtension().equalsIgnoreCase("jpg")) { String errMsg = String.format("File %s (objId=%d) unexpectedly blocked by the file filter.", file.getName(), file.getId()); assertTrue(errMsg, !(file.getMIMEType() == null || file.getMIMEType().isEmpty())); } else { String errMsg = String.format("File %s (objId=%d) unexpectedly passed by the file filter.", file.getName(), file.getId()); assertTrue(errMsg, file.getMIMEType() == null); } } } catch (NoCurrentCaseException | TskCoreException ex) { Exceptions.printStackTrace(ex); Assert.fail(ex); } }

Target:
public void testExtAndDirWithOneRule() { HashMap<String, Rule> rules = new HashMap<>(); rules.put("Rule", new Rule("testExtAndDirWithOneRule", new Rule.ExtensionCondition("jpg"), new MetaTypeCondition(MetaTypeCondition.Type.FILES), new ParentPathCondition("dir1"), null, null, null)); FilesSet filesExtDirsFilter = new FilesSet("Filter", "Filter to find all jpg files in dir1.", false, true, rules); try { Case openCase = Case.getOpenCase(); runIngestJob(openCase.getDataSources(), filesExtDirsFilter); FileManager fileManager = Case.getOpenCase().getServices().getFileManager(); List<AbstractFile> results = fileManager.findFiles("%%"); assertEquals(62, results.size()); for (AbstractFile file : results) { if (file.getParentPath().equalsIgnoreCase("/dir1/") && file.getNameExtension().equalsIgnoreCase("jpg")) { String errMsg = String.format("File %s (objId=%d) unexpectedly blocked by the file filter.", file.getName(), file.getId()); assertTrue(errMsg, file.getMIMEType() != null && !file.getMIMEType().isEmpty()); } else { String errMsg = String.format("File %s (objId=%d) unexpectedly passed by the file filter.", file.getName(), file.getId()); assertTrue(errMsg, file.getMIMEType() == null); } } } catch (NoCurrentCaseException | TskCoreException ex) { Exceptions.printStackTrace(ex); Assert.fail(ex); } }
Source:
public CustomConversions(List<?> converters) { Assert.notNull(converters); this.readingPairs = new LinkedHashSet<ConvertiblePair>(); this.writingPairs = new LinkedHashSet<ConvertiblePair>(); this.customSimpleTypes = new HashSet<Class<?>>(); this.customReadTargetTypes = new ConcurrentHashMap<GenericConverter.ConvertiblePair, CacheValue>(); List<Object> toRegister = new ArrayList<Object>(); toRegister.addAll(converters); toRegister.add(CustomToStringConverter.INSTANCE); toRegister.add(BigDecimalToStringConverter.INSTANCE); toRegister.add(StringToBigDecimalConverter.INSTANCE); toRegister.add(BigIntegerToStringConverter.INSTANCE); toRegister.add(StringToBigIntegerConverter.INSTANCE); toRegister.add(URLToStringConverter.INSTANCE); toRegister.add(StringToURLConverter.INSTANCE); toRegister.add(DBObjectToStringConverter.INSTANCE); toRegister.add(TermToStringConverter.INSTANCE); toRegister.add(CallableMongoScriptToDBObjectConverter.INSTNACE); toRegister.add(DBObjectToCallableMongoScriptCoverter.INSTANCE); toRegister.addAll(JodaTimeConverters.getConvertersToRegister()); toRegister.addAll(GeoConverters.getConvertersToRegister()); toRegister.addAll(Jsr310Converters.getConvertersToRegister()); for (Object c : toRegister) { registerConversion(c); } Collections.reverse(toRegister); this.converters = Collections.unmodifiableList(toRegister); this.simpleTypeHolder = new SimpleTypeHolder(customSimpleTypes, MongoSimpleTypes.HOLDER); }

Target:
public CustomConversions(List<?> converters) { Assert.notNull(converters); this.readingPairs = new LinkedHashSet<ConvertiblePair>(); this.writingPairs = new LinkedHashSet<ConvertiblePair>(); this.customSimpleTypes = new HashSet<Class<?>>(); this.customReadTargetTypes = new ConcurrentHashMap<ConvertiblePair, CacheValue<Class<?>>>(); this.customWriteTargetTypes = new ConcurrentHashMap<ConvertiblePair, CacheValue<Class<?>>>(); this.rawWriteTargetTypes = new ConcurrentHashMap<Class<?>, CacheValue<Class<?>>>(); List<Object> toRegister = new ArrayList<Object>(); toRegister.addAll(converters); toRegister.add(CustomToStringConverter.INSTANCE); toRegister.add(BigDecimalToStringConverter.INSTANCE); toRegister.add(StringToBigDecimalConverter.INSTANCE); toRegister.add(BigIntegerToStringConverter.INSTANCE); toRegister.add(StringToBigIntegerConverter.INSTANCE); toRegister.add(URLToStringConverter.INSTANCE); toRegister.add(StringToURLConverter.INSTANCE); toRegister.add(DBObjectToStringConverter.INSTANCE); toRegister.add(TermToStringConverter.INSTANCE); toRegister.add(CallableMongoScriptToDBObjectConverter.INSTANCE); toRegister.add(DBObjectToCallableMongoScriptCoverter.INSTANCE); toRegister.addAll(JodaTimeConverters.getConvertersToRegister()); toRegister.addAll(GeoConverters.getConvertersToRegister()); toRegister.addAll(Jsr310Converters.getConvertersToRegister()); toRegister.addAll(ThreeTenBackPortConverters.getConvertersToRegister()); for (Object c : toRegister) { registerConversion(c); } Collections.reverse(toRegister); this.converters = Collections.unmodifiableList(toRegister); this.simpleTypeHolder = new SimpleTypeHolder(customSimpleTypes, MongoSimpleTypes.HOLDER); }
Source:
public void stop() { giant.lock(); try { log.info("Naptime!"); queue.clear(); running.clear(); active = false; } finally { giant.unlock(); } }

Target:
public void stop() { giant.lock(); try { log.info("Naptime! Shutting down until we are started again."); queue.clear(); running.clear(); active = false; } finally { giant.unlock(); } }
Source:
public static void setOCToPreferences(String ocPath) { WorkbenchPreferenceDialog dialog = new WorkbenchPreferenceDialog(); OpenShift3PreferencePage page = new OpenShift3PreferencePage(dialog); dialog.open(); dialog.select(page); page.setOCLocation(ocPath); try { new WaitUntil(new ControlIsEnabled(new PushButton("Apply")), TimePeriod.DEFAULT); } catch (WaitTimeoutExpiredException exc) { fail("WaitTimeoutExpiredException occured while processing oc binary on path " + ocPath); } page.apply(); dialog.cancel(); }

Target:
public static void setOCToPreferences(String ocPath) { WorkbenchPreferenceDialog dialog = new WorkbenchPreferenceDialog(); OpenShift3PreferencePage page = new OpenShift3PreferencePage(dialog); dialog.open(); dialog.select(page); page.setOCLocation(ocPath); try { new WaitUntil(new ControlIsEnabled(new PushButton(CDKLabel.Buttons.APPLY)), TimePeriod.DEFAULT); } catch (WaitTimeoutExpiredException exc) { fail("WaitTimeoutExpiredException occured while processing oc binary on path " + ocPath); } page.apply(); dialog.cancel(); }
Source:
@Test public void testFullOuterJoinUniqueness1() { final String sql = "select e.jb, d.nm \n" + "from (select cast(null as int) jb from sales.emp " + " where empno = 10 group by cast(null as int)) as e \n" + "full outer join (select cast (null as int) nm from sales.dept " + "group by cast(null as int)) as d on e.jb = d.nm \n" + "group by e.jb, d.nm"; RelNode rel = convertSql(sql); final RelMetadataQuery mq = RelMetadataQuery.instance(); final ImmutableBitSet allCols = ImmutableBitSet.range(0, rel.getRowType().getFieldCount()); Boolean areGroupByKeysUnique = mq.areColumnsUnique(rel.getInput(0), allCols); assertThat(areGroupByKeysUnique, is(false)); }

Target:
@Test public void testFullOuterJoinUniqueness1() { final String sql = "select e.empno, d.deptno \n" + "from (select cast(null as int) empno from sales.emp " + " where empno = 10 group by cast(null as int)) as e \n" + "full outer join (select cast (null as int) deptno from sales.dept " + "group by cast(null as int)) as d on e.empno = d.deptno \n" + "group by e.empno, d.deptno"; RelNode rel = convertSql(sql); final RelMetadataQuery mq = RelMetadataQuery.instance(); final ImmutableBitSet allCols = ImmutableBitSet.range(0, rel.getRowType().getFieldCount()); Boolean areGroupByKeysUnique = mq.areColumnsUnique(rel.getInput(0), allCols); assertThat(areGroupByKeysUnique, is(false)); }
Source:
public void scheduleAll(final Project project, final String submitUser) throws SchedulerException, ProjectManagerException { for (final Flow flow : project.getFlows()) { if (flow.isEmbeddedFlow()) { continue; } final String flowFileName = flow.getId() + ".flow"; final int latestFlowVersion = this.projectLoader .getLatestFlowVersion(flow.getProjectId(), flow .getVersion(), flowFileName); if (latestFlowVersion > 0) { final File tempDir = Files.createTempDir(); final File flowFile; try { flowFile = this.projectLoader .getUploadedFlowFile(project.getId(), project.getVersion(), flowFileName, latestFlowVersion, tempDir); final FlowTrigger flowTrigger = FlowLoaderUtils.getFlowTriggerFromYamlFile(flowFile); if (flowTrigger != null) { final Map<String, Object> contextMap = ImmutableMap .of(FlowTriggerQuartzJob.SUBMIT_USER, submitUser, FlowTriggerQuartzJob.FLOW_TRIGGER, flowTrigger, FlowTriggerQuartzJob.FLOW_ID, flow.getId(), FlowTriggerQuartzJob.FLOW_VERSION, latestFlowVersion, FlowTriggerQuartzJob.PROJECT_ID, project.getId()); logger.info("scheduling flow " + flow.getProjectId() + "." + flow.getId()); this.scheduler .registerJob(flowTrigger.getSchedule().getCronExpression(), new QuartzJobDescription (FlowTriggerQuartzJob.class, FlowTriggerQuartzJob.JOB_NAME, generateGroupName(flow), contextMap)); } } catch (final Exception ex) { logger.error("error in registering flow", ex); } finally { FlowLoaderUtils.cleanUpDir(tempDir); } } } }

Target:
public void scheduleAll(final Project project, final String submitUser) throws SchedulerException, ProjectManagerException { for (final Flow flow : project.getFlows()) { if (flow.isEmbeddedFlow()) { continue; } final String flowFileName = flow.getId() + ".flow"; final int latestFlowVersion = this.projectLoader .getLatestFlowVersion(flow.getProjectId(), flow .getVersion(), flowFileName); if (latestFlowVersion > 0) { final File tempDir = Files.createTempDir(); final File flowFile; try { flowFile = this.projectLoader .getUploadedFlowFile(project.getId(), project.getVersion(), flowFileName, latestFlowVersion, tempDir); final FlowTrigger flowTrigger = FlowLoaderUtils.getFlowTriggerFromYamlFile(flowFile); if (flowTrigger != null) { final Map<String, Object> contextMap = ImmutableMap .of(FlowTriggerQuartzJob.SUBMIT_USER, submitUser, FlowTriggerQuartzJob.FLOW_TRIGGER, flowTrigger, FlowTriggerQuartzJob.FLOW_ID, flow.getId(), FlowTriggerQuartzJob.FLOW_VERSION, latestFlowVersion, FlowTriggerQuartzJob.PROJECT_ID, project.getId()); logger.info("scheduling flow " + flow.getProjectId() + "." + flow.getId()); this.scheduler .registerJob(flowTrigger.getSchedule().getCronExpression(), new QuartzJobDescription (FlowTriggerQuartzJob.class, FlowTriggerQuartzJob.JOB_NAME, generateGroupName(flow), contextMap)); } } catch (final Exception ex) { logger.error(String.format("error in registering flow [project: %s, flow: %s]", project .getName(), flow.getId()), ex); } finally { FlowLoaderUtils.cleanUpDir(tempDir); } } } }
Source:
protected Collection<TaskAttribute> getAttributes() { Map<String, TaskAttribute> allAttributes = getTaskData().getRoot().getAttributes(); List<TaskAttribute> attributes = new ArrayList<TaskAttribute>(allAttributes.size()); attributes.add(getTaskData().getRoot().getMappedAttribute(TaskAttribute.USER_ASSIGNED)); attributes.add(getTaskData().getRoot() .getMappedAttribute(BugzillaRestTaskSchema.getDefault().RESET_ASSIGNED_TO.getKey())); attributes.add(getTaskData().getRoot().getMappedAttribute(TaskAttribute.USER_REPORTER)); attributes.add(getTaskData().getRoot().getMappedAttribute(TaskAttribute.ADD_SELF_CC)); attributes.add(getTaskData().getRoot().getMappedAttribute(TaskAttribute.USER_CC)); for (TaskAttribute attribute : allAttributes.values()) { TaskAttributeMetaData properties = attribute.getMetaData(); if (TaskAttribute.KIND_PEOPLE.equals(properties.getKind())) { if (!attributes.contains(attribute)) { attributes.add(attribute); } } } return attributes; }

Target:
protected Collection<TaskAttribute> getAttributes() { Collection<TaskAttribute> attributes = super.getAttributes(); Integer nextEmptyPosition = attributeOrder.size(); ArrayList<TaskAttribute> resultAttributes = new ArrayList<>(attributes.size()); resultAttributes.addAll(attributes); for (TaskAttribute taskAttribute : attributes) { if (taskAttribute != null) { Integer newPosition = attributeOrder.get(taskAttribute.getId()); if (newPosition == null) { newPosition = nextEmptyPosition++; } resultAttributes.set(newPosition, taskAttribute); } } return resultAttributes; }
Source:
public BytecodeNode generateCall(FunctionHandle functionHandle, BytecodeGeneratorContext context, Type returnType, List<RowExpression> arguments, Optional<Variable> outputBlockVariable) { FunctionManager functionManager = context.getFunctionManager(); ScalarFunctionImplementation function = functionManager.getScalarFunctionImplementation(functionHandle); List<BytecodeNode> argumentsBytecode = new ArrayList<>(); for (int i = 0; i < arguments.size(); i++) { RowExpression argument = arguments.get(i); ScalarFunctionImplementation.ArgumentProperty argumentProperty = function.getArgumentProperty(i); if (argumentProperty.getArgumentType() == VALUE_TYPE) { argumentsBytecode.add(context.generate(argument, Optional.empty())); } else { argumentsBytecode.add(context.generate(argument, Optional.empty(), Optional.of(argumentProperty.getLambdaInterface()))); } } return context.generateCall( functionManager.getFunctionMetadata(functionHandle).getName().getUnqualifiedName(), function, argumentsBytecode, outputBlockVariable.map(variable -> new OutputBlockVariableAndType(variable, returnType))); }

Target:
public BytecodeNode generateCall(FunctionHandle functionHandle, BytecodeGeneratorContext context, Type returnType, List<RowExpression> arguments, Optional<Variable> outputBlockVariable) { FunctionManager functionManager = context.getFunctionManager(); BuiltInScalarFunctionImplementation function = functionManager.getBuiltInScalarFunctionImplementation(functionHandle); List<BytecodeNode> argumentsBytecode = new ArrayList<>(); for (int i = 0; i < arguments.size(); i++) { RowExpression argument = arguments.get(i); BuiltInScalarFunctionImplementation.ArgumentProperty argumentProperty = function.getArgumentProperty(i); if (argumentProperty.getArgumentType() == VALUE_TYPE) { argumentsBytecode.add(context.generate(argument, Optional.empty())); } else { argumentsBytecode.add(context.generate(argument, Optional.empty(), Optional.of(argumentProperty.getLambdaInterface()))); } } return context.generateCall( functionManager.getFunctionMetadata(functionHandle).getName().getFunctionName(), function, argumentsBytecode, outputBlockVariable.map(variable -> new OutputBlockVariableAndType(variable, returnType))); }
Source:
public static co.cask.cdap.etl.proto.v2.ETLPlugin getPlugin(String tableName) { Map<String, String> properties = new HashMap<>(); properties.put("tableName", tableName); return new co.cask.cdap.etl.proto.v2.ETLPlugin("Mock", BatchSink.PLUGIN_TYPE, properties, null); }

Target:
public static ETLPlugin getPlugin(String tableName) { Map<String, String> properties = new HashMap<>(); properties.put("tableName", tableName); return new ETLPlugin("Mock", BatchSink.PLUGIN_TYPE, properties, null); }
Source:
public static <T> T[] addAll(final T[] array1, final T... array2) { if (array1 == null) { return clone(array2); } else if (array2 == null) { return clone(array1); } final Class<?> type1 = array1.getClass().getComponentType(); @SuppressWarnings("unchecked") final T[] joinedArray = (T[]) Array.newInstance(type1, array1.length + array2.length); System.arraycopy(array1, 0, joinedArray, 0, array1.length); try { System.arraycopy(array2, 0, joinedArray, array1.length, array2.length); } catch (final ArrayStoreException ase) { final Class<?> type2 = array2.getClass().getComponentType(); if (!type1.isAssignableFrom(type2)) { throw IllegalArgumentExceptions.format(ase, "Cannot store %s in an array of %s", type2.getName(), type1.getName(), ase); } throw ase; } return joinedArray; }

Target:
public static <T> T[] addAll(final T[] array1, final T... array2) { if (array1 == null) { return clone(array2); } else if (array2 == null) { return clone(array1); } final Class<?> type1 = array1.getClass().getComponentType(); @SuppressWarnings("unchecked") final T[] joinedArray = (T[]) Array.newInstance(type1, array1.length + array2.length); System.arraycopy(array1, 0, joinedArray, 0, array1.length); try { System.arraycopy(array2, 0, joinedArray, array1.length, array2.length); } catch (final ArrayStoreException ase) { final Class<?> type2 = array2.getClass().getComponentType(); if (!type1.isAssignableFrom(type2)) { throw IllegalArgumentExceptions.format(ase, "Cannot store %s in an array of %s", type2.getName(), type1.getName()); } throw ase; } return joinedArray; }
Source:
public void testDeactivatingTaskAndSavingAllWithOnlyDirtyFiles() throws Exception { List<IEditorPart> dirtyFiles = activateTaskAndOpenFiles(); doReturn(0).when(listener).openTaskDeactivationDialog(anyList()); assertTrue(listener.shouldDeactivateTask(task1)); assertFalse(dirtyFiles.get(0).isDirty()); assertFalse(dirtyFiles.get(1).isDirty()); }

Target:
public void testDeactivatingTaskAndSavingAllWithOnlyDirtyFiles() throws Exception { List<IEditorPart> dirtyFiles = activateTaskAndEditFiles(); doReturn(0).when(listener).openTaskDeactivationDialog(anyList()); assertTrue(listener.shouldDeactivateTask(task1)); assertFalse(dirtyFiles.get(0).isDirty()); assertFalse(dirtyFiles.get(1).isDirty()); verify(listener).openTaskDeactivationDialog( Matchers.argThat(new CompareListOfReferencesWithoutOrder(makeDirtyReferencesFromParts(dirtyFiles)))); }
Source:
public void testGetDataCenterWith404() throws InterruptedException { server.enqueue(response404()); DataCenter dataCenter = dataCenterApi().getDataCenter("some-id"); assertEquals(dataCenter, null); assertEquals(server.getRequestCount(), 1); assertSent(server, "GET", "/datacenters/some-id"); }

Target:
public void testGetDataCenterWith404() throws InterruptedException { server.enqueue(response404()); DataCenter dataCenter = dataCenterApi().getDataCenter("some-id"); assertNull(dataCenter); assertEquals(server.getRequestCount(), 1); assertSent(server, "GET", "/datacenters/some-id"); }
Source:
private List<CodeGen.Converter> loadJsonMappers() { boolean loadOK = false; List<CodeGen.Converter> merged = new ArrayList<>(); for (StandardLocation loc : StandardLocation.values()) { try { FileObject file = processingEnv.getFiler().getResource(loc, "", JSON_MAPPERS_PROPERTIES_PATH); try(InputStream is = file.openInputStream()) { try { loadJsonMappers(merged, is); loadOK = true; } catch (IOException e) { log.log(Level.SEVERE, COULD_NOT_LOAD_JSON_MAPPERS_PROPERTIES, e); } } } catch (Exception ignore) { } } if (!loadOK) { try { Enumeration<URL> resources = getClass().getClassLoader().getResources(JSON_MAPPERS_PROPERTIES_PATH); while (resources.hasMoreElements()) { URL url = resources.nextElement(); try (InputStream is = url.openStream()) { loadJsonMappers(merged, is); processingEnv.getMessager().printMessage(Diagnostic.Kind.NOTE, "Loaded json-mappers.properties " + url); loadOK = true; } } } catch (IOException e) { } } if (!loadOK) { Path source = fetchSourcePath().getParent().getParent().resolve("src/main/resources").resolve(JSON_MAPPERS_PROPERTIES_PATH); if (source.toFile().exists()) { try (InputStream is = source.toUri().toURL().openStream()) { loadJsonMappers(merged, is); loadOK = true; processingEnv.getMessager().printMessage(Diagnostic.Kind.NOTE, "Loaded json-mappers.properties from '" + source + "'"); } catch (IOException e) { log.log(Level.SEVERE, COULD_NOT_LOAD_JSON_MAPPERS_PROPERTIES, e); processingEnv.getMessager().printMessage(Diagnostic.Kind.WARNING, "Unable to open properties file at " + source); } } } return merged; }

Target:
private List<CodeGen.Converter> loadJsonMappers() { Exception exception = null; List<CodeGen.Converter> merged = new ArrayList<>(); for (StandardLocation loc : StandardLocation.values()) { try { FileObject file = processingEnv.getFiler().getResource(loc, "", JSON_MAPPERS_PROPERTIES_PATH); try(InputStream is = file.openInputStream()) { try { loadJsonMappers(merged, is); exception = null; } catch (IOException e) { exception = e; } } } catch (Exception ignore) { exception = ignore; } } if (exception != null) { try { Enumeration<URL> resources = getClass().getClassLoader().getResources(JSON_MAPPERS_PROPERTIES_PATH); while (resources.hasMoreElements()) { URL url = resources.nextElement(); try (InputStream is = url.openStream()) { loadJsonMappers(merged, is); exception = null; processingEnv.getMessager().printMessage(Diagnostic.Kind.NOTE, "Loaded json-mappers.properties " + url); } } } catch (IOException e) { exception = e; } } if (exception != null) { Path source = fetchSourcePath().getParent().getParent().resolve("src/main/resources").resolve(JSON_MAPPERS_PROPERTIES_PATH); if (source.toFile().exists()) { try (InputStream is = source.toUri().toURL().openStream()) { loadJsonMappers(merged, is); processingEnv.getMessager().printMessage(Diagnostic.Kind.NOTE, "Loaded json-mappers.properties from '" + source + "'"); } catch (IOException e) { log.log(Level.SEVERE, "Could not load json-mappers.properties", e); processingEnv.getMessager().printMessage(Diagnostic.Kind.WARNING, "Unable to open properties file at " + source); } } } return merged; }
Source:
private Network findCurrentNetwork(Map<Network, Set<Guid>> networks) { Network result = networks == null ? null : networks.keySet() .stream() .filter(network -> Objects.equals(network.getProvidedBy().getExternalId(), id)) .findFirst() .orElse(null); if (result == null) { notFound(); } return result; }

Target:
private Network findCurrentNetwork(Map<Network, Set<Guid>> networks) { final Network result; if (networks == null) { result = null; } else { result = networks.keySet() .stream() .filter(network -> Objects.equals(network.getProvidedBy().getExternalId(), id)) .findFirst() .orElse(null); } if (result == null) { notFound(); } return result; }
Source:
private static boolean makeNodeUpToDate() { if (System.getProperty(NODE_URL_PROPERTY) != null) { String jarUrl = System.getProperty(NODE_URL_PROPERTY); String jarFile = DEFAULT_SCHEDULER_NODE_JAR; if (System.getProperty(NODE_JAR_SAVEAS_PROPERTY) != null) { jarFile = System.getProperty(NODE_JAR_SAVEAS_PROPERTY); } if (!isLocalJarUpToDate(jarUrl, jarFile)) { System.out.println("Downloading node.jar from " + jarUrl + " to " + jarFile); try { File destination = new File(jarFile); File lockFile = null; FileLock lock = null; if (destination.exists()) { lockFile = new File(StandardSystemProperty.JAVA_IO_TMPDIR.value(), "lock"); if (!lockFile.exists()) { lockFile.createNewFile(); } System.out.println("Getting the lock on " + lockFile.getAbsoluteFile()); FileChannel channel = new RandomAccessFile(lockFile, "rw").getChannel(); lock = channel.lock(); if (isLocalJarUpToDate(jarUrl, jarFile)) { System.out.println("Another process downloaded node.jar - don't do it anymore"); System.out.println("Releasing the lock on " + lockFile.getAbsoluteFile()); lock.release(); channel.close(); return false; } } FileUtils.copyURLToFile(new URL(jarUrl), destination); System.out.println("Download finished"); cleanExpandDirectory(jarFile); if (lock != null && lockFile != null) { System.out.println("Releasing the lock on " + lockFile.getAbsoluteFile()); lock.release(); } return true; } catch (Exception e) { System.err.println("Cannot download node.jar from " + jarUrl); e.printStackTrace(); return false; } } else { return true; } } else { throw new IllegalArgumentException("No java property " + NODE_URL_PROPERTY + " specified. This property must be set when using " + RMNodeUpdater.class.getSimpleName()); } }

Target:
private boolean makeNodeUpToDate() { if (!isLocalJarUpToDate(nodeJarUrl, nodeJarSaveAs)) { logger.info("Downloading node.jar from " + nodeJarUrl + " to " + nodeJarSaveAs); try { File destination = new File(nodeJarSaveAs); File lockFile = null; FileLock lock = null; if (destination.exists()) { lockFile = new File(StandardSystemProperty.JAVA_IO_TMPDIR.value(), "lock"); if (!lockFile.exists()) { lockFile.createNewFile(); } logger.info("Getting the lock on " + lockFile.getAbsoluteFile()); FileChannel channel = new RandomAccessFile(lockFile, "rw").getChannel(); lock = channel.lock(); if (isLocalJarUpToDate(nodeJarUrl, nodeJarSaveAs)) { logger.warn("Another process downloaded node.jar - don't do it anymore"); logger.info("Releasing the lock on " + lockFile.getAbsoluteFile()); lock.release(); channel.close(); return false; } } fetchUrl(nodeJarUrl, destination); destination.setLastModified(getRemoteLastModifiedMillis(nodeJarUrl)); logger.info("Download finished"); cleanExpandDirectory(nodeJarSaveAs); if (lock != null && lockFile != null) { logger.info("Releasing the lock on " + lockFile.getAbsoluteFile()); lock.release(); } return true; } catch (Exception e) { logError("Cannot download node.jar from " + nodeJarUrl, e); return false; } } else { return true; } }
Source:
public ExprEval eval(ObjectBinding bindings) { ExprEval ret = expr.eval(bindings); if (ret.type() == ExprType.LONG) { return ExprEval.of(-ret.longValue()); } if (ret.type() == ExprType.DOUBLE) { return ExprEval.of(-ret.doubleValue()); } throw new IllegalArgumentException("unsupported type " + ret.type()); }

Target:
public ExprEval eval(ObjectBinding bindings) { ExprEval ret = expr.eval(bindings); if (ret.type() == ExprType.LONG) { return ExprEval.of(-ret.asLong()); } if (ret.type() == ExprType.DOUBLE) { return ExprEval.of(-ret.asDouble()); } throw new IAE("unsupported type " + ret.type()); }
Source:
public Exchange createExchange(long messageIndex) throws Exception { Exchange exchange = createExchange(); getDataSet().populateMessage(exchange, messageIndex); if (null == disableDataSetIndex || !disableDataSetIndex) { Message in = exchange.getIn(); in.setHeader(Exchange.DATASET_INDEX, messageIndex); } return exchange; }

Target:
public Exchange createExchange(long messageIndex) throws Exception { Exchange exchange = createExchange(); getDataSet().populateMessage(exchange, messageIndex); if (!getDataSetIndex().equals("off")) { Message in = exchange.getIn(); in.setHeader(Exchange.DATASET_INDEX, messageIndex); } return exchange; }
Source:
public int vote(Authentication authentication, Object object, Collection collection) { int vote = ACCESS_ABSTAIN; this.authentication = authentication; SpringSecurityUser user = (SpringSecurityUser) authentication.getPrincipal(); Features features = user.getFeatures(); if (features == null) { return vote; } if (object instanceof FilterInvocation) { user.setUrl(((FilterInvocation) object).getRequestUrl()); } else if (object instanceof ProxyMethodInvocation) { String repositoryId = getRepositoryIdFromUrl(user.getUrl()); logger.debug("Load additional repository privileges by ID " + repositoryId); Collection<String> privilegeNames = user.getFeatures() .getPerRepositoryAuthorities() .get(repositoryId); if (privilegeNames != null) { List<GrantedAuthority> updatedAuthorities = new ArrayList<>(authentication.getAuthorities()); privilegeNames.forEach(name -> { SimpleGrantedAuthority authority = new SimpleGrantedAuthority(name); updatedAuthorities.add(authority); logger.debug("\tAdd " + name + " privilege..."); }); user.setAuthorities(updatedAuthorities); this.authentication = new UsernamePasswordAuthenticationToken(user, authentication.getCredentials(), updatedAuthorities); } } return vote; }

Target:
public int vote(Authentication authentication, Object object, Collection collection) { int vote = ACCESS_ABSTAIN; SpringSecurityUser user = (SpringSecurityUser) authentication.getPrincipal(); AccessModel accessModel = user.getAccessModel(); if (accessModel == null) { return vote; } String requestUri = UrlUtils.getRequestUri(); if (!requestUri.startsWith(MavenArtifactController.ROOT_CONTEXT)) { return vote; } if (!(object instanceof ProxyMethodInvocation)) { return vote; } String storageId = UrlUtils.getCurrentStorageId(); String repositoryId = UrlUtils.getCurrentRepositoryId(); if (storageId == null || repositoryId == null) { return vote; } final Collection<String> customAuthorities = accessModel.getPathPrivileges(UrlUtils.getRequestUri()); if (customAuthorities != null && !customAuthorities.isEmpty()) { List<GrantedAuthority> authorities = new ArrayList<>(authentication.getAuthorities()); customAuthorities.forEach(privilege -> authorities.add(new SimpleGrantedAuthority(privilege))); logger.debug("Privileges was extended to " + authorities); SecurityContextHolder.getContext() .setAuthentication(new UsernamePasswordAuthenticationToken(user, authentication.getCredentials(), authorities)); } return vote; }
Source:
public void shutdown(String taskId) { if (pendingTasks.containsKey(taskId)) { pendingTasks.remove(taskId); return; } final ZkWorker zkWorker = findWorkerRunningTask(taskId); if (zkWorker == null) { log.info("Can't shutdown! No worker running task %s", taskId); return; } try { final URL url = makeWorkerURL(zkWorker.getWorker(), String.format("/task/%s/shutdown", taskId)); final StatusResponseHolder response = httpClient.post(url) .go(RESPONSE_HANDLER) .get(); log.info( "Sent shutdown message to worker: %s, status %s, response: %s", zkWorker.getWorker().getHost(), response.getStatus(), response.getContent() ); if (!response.getStatus().equals(HttpResponseStatus.ACCEPTED)) { throw new ISE("Shutdown failed"); } } catch (Exception e) { throw Throwables.propagate(e); } }

Target:
public void shutdown(String taskId) { if (pendingTasks.containsKey(taskId)) { pendingTasks.remove(taskId); return; } final ZkWorker zkWorker = findWorkerRunningTask(taskId); if (zkWorker == null) { log.info("Can't shutdown! No worker running task %s", taskId); return; } try { final URL url = makeWorkerURL(zkWorker.getWorker(), String.format("/task/%s/shutdown", taskId)); final StatusResponseHolder response = httpClient.post(url) .go(RESPONSE_HANDLER) .get(); log.info( "Sent shutdown message to worker: %s, status %s, response: %s", zkWorker.getWorker().getHost(), response.getStatus(), response.getContent() ); if (!response.getStatus().equals(HttpResponseStatus.ACCEPTED)) { log.error("Shutdown failed for %s! Are you sure the task was running?", taskId); } } catch (Exception e) { throw Throwables.propagate(e); } }
Source:
public String formHeronExecCommand(String[] inStringArray) { StringBuilder builder = new StringBuilder(); for (String string : inStringArray) { if (builder.length() > 0) { builder.append(" "); } builder.append(string); } String stringToReturn = builder.toString(); return stringToReturn; }

Target:
private String formHeronExecCommand(String[] inStringArray) { StringBuilder builder = new StringBuilder(); for (String string : inStringArray) { if (builder.length() > 0) { builder.append(" "); } builder.append(string); } builder.append(" "); builder.append(EcsContext.AmiInstanceUrl(config)); String stringToReturn = builder.toString(); return stringToReturn; }
Source:
public Map<String, Boolean> getModePreview() { return singletonMap("preview", Boolean.parseBoolean(System.getProperty("crafter.modePreview", Boolean.FALSE.toString()))); }

Target:
public Map<String, Boolean> getModePreview() { return singletonMap("preview", modePreview); }
Source:
private IncomingPhoneNumber findSingleNumber(String number, Sid sourceOrganizationSid, Sid destinationOrganizationSid) { IncomingPhoneNumber matchedNumber = null; IncomingPhoneNumberFilter.Builder filterBuilder = IncomingPhoneNumberFilter.Builder.builder(); filterBuilder.byPhoneNumber(number); if (destinationOrganizationSid != null) { filterBuilder.byOrgSid(destinationOrganizationSid.toString()); } if (sourceOrganizationSid!= null && !sourceOrganizationSid.equals(destinationOrganizationSid)) { filterBuilder.byPureSIP(Boolean.FALSE); } IncomingPhoneNumberFilter numFilter = filterBuilder.build(); if (logger.isDebugEnabled()) { logger.debug("Searching with filter:" + numFilter); } List<IncomingPhoneNumber> matchedNumbers = numbersDao.getIncomingPhoneNumbersByFilter(numFilter); if (logger.isDebugEnabled()) { logger.debug("Num of results:" + matchedNumbers.size()); } if (matchedNumbers != null && matchedNumbers.size() > 0) { if (logger.isDebugEnabled()) { logger.debug("Matched number with filter:" + matchedNumbers.get(0)); } matchedNumber = matchedNumbers.get(0); } return matchedNumber; }

Target:
private IncomingPhoneNumber findSingleNumber(String number, Sid sourceOrganizationSid, Sid destinationOrganizationSid) { IncomingPhoneNumber matchedNumber = null; IncomingPhoneNumberFilter.Builder filterBuilder = IncomingPhoneNumberFilter.Builder.builder(); filterBuilder.byPhoneNumber(number); if (destinationOrganizationSid != null) { filterBuilder.byOrgSid(destinationOrganizationSid.toString()); } if (sourceOrganizationSid == null || destinationOrganizationSid == null) { filterBuilder.byPureSIP(Boolean.FALSE); } if (sourceOrganizationSid != null && !sourceOrganizationSid.equals(destinationOrganizationSid)) { filterBuilder.byPureSIP(Boolean.FALSE); } IncomingPhoneNumberFilter numFilter = filterBuilder.build(); if (logger.isDebugEnabled()) { logger.debug("Searching with filter:" + numFilter); } List<IncomingPhoneNumber> matchedNumbers = numbersDao.getIncomingPhoneNumbersByFilter(numFilter); if (logger.isDebugEnabled()) { logger.debug("Num of results:" + matchedNumbers.size()); } if (matchedNumbers != null && matchedNumbers.size() > 0) { if (logger.isDebugEnabled()) { logger.debug("Matched number with filter:" + matchedNumbers.get(0)); } matchedNumber = matchedNumbers.get(0); } return matchedNumber; }
Source:
public SpatialJoinOperatorFactory( int operatorId, PlanNodeId planNodeId, JoinNode.Type joinType, List<Type> probeTypes, List<Integer> probeOutputChannels, int probeGeometryChannel, PagesSpatialIndexFactory pagesSpatialIndexFactory) { checkArgument(joinType == INNER || joinType == LEFT); this.operatorId = operatorId; this.planNodeId = planNodeId; this.joinType = joinType; this.probeTypes = ImmutableList.copyOf(probeTypes); this.probeOutputTypes = probeOutputChannels.stream() .map(probeTypes::get) .collect(toImmutableList()); this.buildOutputTypes = pagesSpatialIndexFactory.getOutputTypes(); this.probeOutputChannels = ImmutableList.copyOf(probeOutputChannels); this.probeGeometryChannel = probeGeometryChannel; this.pagesSpatialIndexFactory = pagesSpatialIndexFactory; }

Target:
public SpatialJoinOperatorFactory( int operatorId, PlanNodeId planNodeId, JoinNode.Type joinType, List<Type> probeTypes, List<Integer> probeOutputChannels, int probeGeometryChannel, PagesSpatialIndexFactory pagesSpatialIndexFactory) { checkArgument(joinType == INNER || joinType == LEFT, "unsupported join type: %s", joinType); this.operatorId = operatorId; this.planNodeId = planNodeId; this.joinType = joinType; this.probeTypes = ImmutableList.copyOf(probeTypes); this.probeOutputTypes = probeOutputChannels.stream() .map(probeTypes::get) .collect(toImmutableList()); this.buildOutputTypes = pagesSpatialIndexFactory.getOutputTypes(); this.probeOutputChannels = ImmutableList.copyOf(probeOutputChannels); this.probeGeometryChannel = probeGeometryChannel; this.pagesSpatialIndexFactory = pagesSpatialIndexFactory; }
Source:
protected Guid getQuotaId() { if (getNewDisk() != null && (isInternalManagedDisk())) { return ((DiskImage) getNewDisk()).getQuotaId(); } return null; }

Target:
protected Guid getQuotaId() { if (getNewDisk() != null && isInternalManagedDisk()) { return ((DiskImage) getNewDisk()).getQuotaId(); } return null; }
Source:
public void testDefaultSettings() { ActivityLogEntry.Builder builder = new ActivityLogEntry.Builder("instructorHome", "URL", 10); String logMessage = "TEAMMATESLOG|||instructorHome|||instructorHome|||true|||Unknown|||Unknown|||Unknown" + "|||Unknown|||Unknown|||URL"; AssertHelper.assertLogMessageEquals(logMessage, builder.build().generateLogMessage()); }

Target:
public void testDefaultSettings() { Builder builder = new Builder("instructorHome", "URL", 10); String logMessage = "TEAMMATESLOG|||instructorHome|||instructorHome|||true|||Unknown|||Unknown|||Unknown" + "|||Unknown|||Unknown|||URL"; AssertHelper.assertLogMessageEquals(logMessage, builder.build().generateLogMessage()); }
Source:
public MigratableTableTranslation<DBOOrganization, DBOOrganization> getTranslator() { return new BasicMigratableTableTranslation<DBOOrganization>(); }

Target:
public MigratableTableTranslation<DBOOrganization, DBOOrganization> getTranslator() { return TRANSLATOR; }
Source:
public int resetAt(int seq) { int delta = Vp8Utils.getExtendedPictureIdDelta(seq, highestSeqNumReceived); if (delta < 0) { roc++; highestSeqNumReceived = seq; } return getIndex(seq, true); }

Target:
public void resetAt(int seq) { int delta = Vp8Utils.getExtendedPictureIdDelta(seq, highestSeqNumReceived); if (delta < 0) { roc++; highestSeqNumReceived = seq; } getIndex(seq, true); }
Source:
default Either<Seq<? extends E>, T> toEither() { return isValid() ? Either.right(get()) : Either.left(getErrors()); }

Target:
default Either<Seq<E>, T> toEither() { return isValid() ? Either.right(get()) : Either.left(getErrors()); }
Source:
AcquireTokenInteractiveRequest(final Context context, final AuthenticationRequest authRequest, final TokenCacheAccessor tokenCacheAccessor) { mContext = context; mTokenCacheAccessor = tokenCacheAccessor; mAuthRequest = authRequest; if (mTokenCacheAccessor != null) { mTokenCacheAccessor.setAuthRequest(authRequest); } }

Target:
AcquireTokenInteractiveRequest(final Context context, final AuthenticationRequest authRequest, final TokenCacheAccessor tokenCacheAccessor) { mContext = context; mTokenCacheAccessor = tokenCacheAccessor; mAuthRequest = authRequest; }
Source:
private void startForegroundService() { startForeground(1, NotificationHelpers.getNotification(this)); }

Target:
private void startForegroundService() { startForeground(NotificationHelpers.APPIUM_NOTIFICATION_IDENTIFIER, NotificationHelpers.getNotification(this)); }
Source:
public void testValidTimeRange() throws Exception { String args = {"--deleteall", "--starttime", "1" , "--endtime", "10"}; runIndexTool(args, 0); Assert.assertEquals(5, countRowsInIndex()); }

Target:
public void testValidTimeRange() throws Exception { String args = {"--deleteall", "--starttime", "1" , "--endtime", "9"}; runIndexTool(args, 0); Assert.assertEquals(5, countRowsInIndex()); }
Source:
public static String removeNewLine(String hash) { if (hash != null && hash.contains("\n")) { return hash.substring(0, hash.lastIndexOf("\n")); } return hash; }

Target:
public static String removeNewLine(String hash) { if (hash != null && hash.endsWith("\n")) { return hash.substring(0, hash.lastIndexOf("\n")); } return hash; }
Source:
public User createAccountWithHashedPassword(String userName, String hashedPassword) throws IOException { if (!hashedPassword.startsWith(JBCRYPT_HEADER)) { throw new IllegalArgumentException("Hashed passwords must start with: "+ JBCRYPT_HEADER); } User user = User.getById(userName, true); user.addProperty(Details.fromHashedPassword(hashedPassword)); return user; }

Target:
public User createAccountWithHashedPassword(String userName, String hashedPassword) throws IOException { if (!PASSWORD_ENCODER.isPasswordHashed(hashedPassword)) { throw new IllegalArgumentException("this method should only be called with a pre-hashed password"); } User user = User.getById(userName, true); user.addProperty(Details.fromHashedPassword(hashedPassword)); return user; }