auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void serialize( final Event event, final JsonGenerator jsonGenerator, final SerializerProvider provider) throws IOException { jsonGenerator.writeStartObject(); jsonGenerator.writeStringField("version", "2f"); jsonGenerator.writeObjectField("annotations", event.getAnnotations()); if (!event.getCounterSamples().isEmpty()) { jsonGenerator.writeObjectFieldStart("counters"); serializeSamples(event.getCounterSamples(), jsonGenerator); jsonGenerator.writeEndObject(); } if (!event.getGaugeSamples().isEmpty()) { jsonGenerator.writeObjectFieldStart("gauges"); serializeSamples(event.getGaugeSamples(), jsonGenerator); jsonGenerator.writeEndObject(); } if (!event.getTimerSamples().isEmpty()) { jsonGenerator.writeObjectFieldStart("timers"); serializeSamples(event.getTimerSamples(), jsonGenerator); jsonGenerator.writeEndObject(); } jsonGenerator.writeEndObject(); }

Target:
public void serialize( final Event event, final JsonGenerator jsonGenerator, final SerializerProvider provider) throws IOException { jsonGenerator.writeStartObject(); jsonGenerator.writeStringField("version", VERSION); jsonGenerator.writeObjectField("annotations", event.getAnnotations()); if (!event.getCounterSamples().isEmpty()) { jsonGenerator.writeObjectFieldStart("counters"); serializeSamples(event.getCounterSamples(), jsonGenerator); jsonGenerator.writeEndObject(); } if (!event.getGaugeSamples().isEmpty()) { jsonGenerator.writeObjectFieldStart("gauges"); serializeSamples(event.getGaugeSamples(), jsonGenerator); jsonGenerator.writeEndObject(); } if (!event.getTimerSamples().isEmpty()) { jsonGenerator.writeObjectFieldStart("timers"); serializeSamples(event.getTimerSamples(), jsonGenerator); jsonGenerator.writeEndObject(); } jsonGenerator.writeEndObject(); }
Source:
private static void xcopy(ArrayList<File> copiedFiles, File source, File target, boolean overwrite, IBackupStore backupStore) throws IOException { if (!source.exists()) throw new IOException("Source: " + source + "does not exists"); if (source.isDirectory()) { if (target.exists() && target.isFile()) { if (!overwrite) throw new IOException("Target: " + target + " already exists"); if (backupStore != null) backupStore.backup(target); else target.delete(); } if (!target.exists()) target.mkdirs(); copiedFiles.add(target); File[] children = source.listFiles(); if (children == null) throw new IOException("Error while retrieving children of directory: " + source); for (File children1 : children) { xcopy(copiedFiles, children1, new File(target, children1.getName()), overwrite, backupStore); } return; } if (target.exists() && !overwrite) throw new IOException("Target: " + target + " already exists"); if (!target.getParentFile().exists() && !target.getParentFile().mkdirs()) throw new IOException("Target: Path " + target.getParent() + " could not be created"); try { Util.copyStream(new FileInputStream(source), true, new FileOutputStream(target), true); } catch (IOException e) { e.printStackTrace(); throw new IOException("Error while copying:" + source.getAbsolutePath()); } copiedFiles.add(target); }

Target:
private static void xcopy(ArrayList<File> copiedFiles, File source, File target, boolean overwrite, IBackupStore backupStore) throws IOException { if (!source.exists()) throw new IOException("Source: " + source + "does not exists"); if (source.isDirectory()) { if (target.exists() && target.isFile()) { if (!overwrite) throw new IOException("Target: " + target + " already exists"); if (backupStore != null) backupStore.backup(target); else target.delete(); } if (!target.exists()) target.mkdirs(); copiedFiles.add(target); File[] children = source.listFiles(); if (children == null) throw new IOException("Error while retrieving children of directory: " + source); for (File child : children) { xcopy(copiedFiles, child, new File(target, child.getName()), overwrite, backupStore); } return; } if (target.exists() && !overwrite) throw new IOException("Target: " + target + " already exists"); if (!target.getParentFile().exists() && !target.getParentFile().mkdirs()) throw new IOException("Target: Path " + target.getParent() + " could not be created"); try { Util.copyStream(new FileInputStream(source), true, new FileOutputStream(target), true); } catch (IOException e) { e.printStackTrace(); throw new IOException("Error while copying:" + source.getAbsolutePath()); } copiedFiles.add(target); }
Source:
public void testGetProducerTaskCountForIntermediateStreams() { SystemStream input1 = new SystemStream("system1", "intput1"); SystemStream input2 = new SystemStream("system2", "intput2"); SystemStream input3 = new SystemStream("system2", "intput3"); SystemStream int1 = new SystemStream("system1", "int1"); SystemStream int2 = new SystemStream("system1", "int2"); String task0 = "Task 0"; String task1 = "Task 1"; String task2 = "Task 2"; Multimap<SystemStream, String> streamToConsumerTasks = HashMultimap.create(); streamToConsumerTasks.put(input1, task0); streamToConsumerTasks.put(input1, task1); streamToConsumerTasks.put(input2, task1); streamToConsumerTasks.put(input2, task2); streamToConsumerTasks.put(input3, task1); streamToConsumerTasks.put(int1, task0); streamToConsumerTasks.put(int1, task1); streamToConsumerTasks.put(int2, task0); Multimap<SystemStream, SystemStream> intermediateToInputStreams = HashMultimap.create(); intermediateToInputStreams.put(int1, input1); intermediateToInputStreams.put(int1, input2); intermediateToInputStreams.put(int1, input3); intermediateToInputStreams.put(int2, input2); intermediateToInputStreams.put(int2, input3); Map<SystemStream, Integer> counts = OperatorImplGraph.getProducerTaskCountForIntermediateStreams( streamToConsumerTasks, intermediateToInputStreams); assertTrue(counts.get(int1) == 3); assertTrue(counts.get(int2) == 2); }

Target:
public void testGetProducerTaskCountForIntermediateStreams() { SystemStream input1 = new SystemStream("system1", "intput1"); SystemStream input2 = new SystemStream("system2", "intput2"); SystemStream input3 = new SystemStream("system2", "intput3"); SystemStream int1 = new SystemStream("system1", "int1"); SystemStream int2 = new SystemStream("system1", "int2"); String task0 = "Task 0"; String task1 = "Task 1"; String task2 = "Task 2"; Multimap<SystemStream, String> streamToConsumerTasks = HashMultimap.create(); streamToConsumerTasks.put(input1, task0); streamToConsumerTasks.put(input1, task1); streamToConsumerTasks.put(input2, task1); streamToConsumerTasks.put(input2, task2); streamToConsumerTasks.put(input3, task1); streamToConsumerTasks.put(int1, task0); streamToConsumerTasks.put(int1, task1); streamToConsumerTasks.put(int2, task0); Multimap<SystemStream, SystemStream> intermediateToInputStreams = HashMultimap.create(); intermediateToInputStreams.put(int1, input1); intermediateToInputStreams.put(int1, input2); intermediateToInputStreams.put(int2, input2); intermediateToInputStreams.put(int2, input3); Map<SystemStream, Integer> counts = OperatorImplGraph.getProducerTaskCountForIntermediateStreams( streamToConsumerTasks, intermediateToInputStreams); assertTrue(counts.get(int1) == 3); assertTrue(counts.get(int2) == 2); }
Source:
public Properties getConsumerProperties(String inputChannelName) { if (isPartitionedConsumer(inputChannelName)) { Properties channelConsumerProperties = new Properties(); if (consumerProperties != null) { channelConsumerProperties.putAll(consumerProperties); } channelConsumerProperties.setProperty(BinderProperties.COUNT, Integer.toString(getInstanceCount())); channelConsumerProperties.setProperty(BinderProperties.PARTITION_INDEX, Integer.toString(getInstanceIndex())); return channelConsumerProperties; } else { return getConsumerProperties(); } }

Target:
public Properties getConsumerProperties(String inputChannelName) { if (isPartitionedConsumer(inputChannelName)) { Properties channelConsumerProperties = new Properties(); channelConsumerProperties.putAll(consumerProperties); channelConsumerProperties.setProperty(BinderProperties.COUNT, Integer.toString(getInstanceCount())); channelConsumerProperties.setProperty(BinderProperties.PARTITION_INDEX, Integer.toString(getInstanceIndex())); return channelConsumerProperties; } else { return getConsumerProperties(); } }
Source:
protected void assertQueryEquals(String graphQLRequest, String expectedResponse, Map<String, Object> variables) throws Exception { boolean isMutation = graphQLRequest.startsWith("mutation"); ExecutionResult result = api.execute(graphQLRequest, requestScope, variables); if (isMutation) { requestScope.saveOrCreateObjects(); } requestScope.getTransaction().commit(requestScope); assertEquals(result.getErrors().size(), 0, "Errors [" + errorsToString(result.getErrors()) + "]:"); try { LOG.info(mapper.writeValueAsString(result.getData())); assertEquals(mapper.readTree(mapper.writeValueAsString(result.getData())), mapper.readTree(expectedResponse)); } catch (JsonProcessingException e) { fail("JSON parsing exception", e); } }

Target:
protected void assertQueryEquals(String graphQLRequest, String expectedResponse, Map<String, Object> variables) throws Exception { boolean isMutation = graphQLRequest.startsWith("mutation"); ExecutionResult result = api.execute(graphQLRequest, requestScope, variables); if (isMutation) { requestScope.saveOrCreateObjects(); } requestScope.getTransaction().commit(requestScope); assertEquals(0, result.getErrors().size(), "Errors [" + errorsToString(result.getErrors()) + "]:"); try { LOG.info(mapper.writeValueAsString(result.getData())); assertEquals( mapper.readTree(expectedResponse), mapper.readTree(mapper.writeValueAsString(result.getData())) ); } catch (JsonProcessingException e) { fail("JSON parsing exception", e); } }
Source:
protected void mergePatches(List<SchemaPatch> patches) { final List<DatabaseObject> objects = new ArrayList<>(); patches.stream().forEachOrdered(patch -> { validatePatch(patches, patch); objects.clear(); List<DatabaseObject> tempObjects = new ArrayList<>(); tempObjects.addAll(patch.getObjects()); patch.clearObjects(); patch.addObjects(mergeDatabaseObjects(tempObjects)); targetStore.addPatch(patch); }); }

Target:
protected void mergePatches(List<SchemaPatch> patches) { patches.stream().forEachOrdered(patch -> { validatePatch(patches, patch); List<DatabaseObject> tempObjects = new ArrayList<>(); tempObjects.addAll(patch.getObjects()); patch.clearObjects(); patch.addObjects(mergeDatabaseObjects(tempObjects)); targetStore.addPatch(patch); }); }
Source:
public void init() { try { passThrough = getInitParameter("passThrough", true); headers = getInitParameter("headers", true); body = getInitParameter("body", true); bodyMax = (getInitParameter("maxBody") == null) ? 0 : Integer.parseInt(getInitParameter("maxBody")); if(bodyMax < 0){ logger.error("Parsed a negative maxBody value and caused initialization failure"); throw new IllegalArgumentException("The value of maxBody cannot be negative."); } comment = getInitParameter("comment"); } catch (NumberFormatException e){ logger.error("Caught exception while parsing maxBody value", e); } catch (NullPointerException e) { logger.error("Caught exception because mailet configuration has not been set yet.", e); } }

Target:
public void init() { try { logLevel = getInitParameter("level", LogLevel.class, LogLevel.INFO); specificHeaderNames = getInitParameter("specificHeaders", List.class, Collections.emptyList()); specificAttributeNames = getInitParameter("specificAttributes", List.class, Collections.emptyList()); headers = getInitParameter("headers", false); body = getInitParameter("body", false); passThrough = getInitParameter("passThrough", true); bodyMax = Optional.ofNullable(getInitParameter("maxBody", Integer.class)).orElse(0); comment = getInitParameter("comment"); } catch (ClassCastException e) { logger.error("Caught exception while parsing initial parameter values", e); } }
Source:
public void updateSessionData( @PathParam("sessionId") int sessionId) { SessionModel sessionModel = new SessionModel(); long currentTime = System.currentTimeMillis(); Session session = GTFSDB.initSessionBeginTrans(); sessionModel = (SessionModel) session.createQuery(" FROM SessionModel WHERE sessionId = " + sessionId).uniqueResult(); sessionModel.setSessionEndTime(currentTime); List<String> errorAndWarningList = session.createQuery(QueryHelper.sessionErrorsAndWarnings) .setParameter("gtfsRtId", sessionModel.getGtfsRtFeedModel().getGtfsRtId()) .setParameter("startTime", sessionModel.getSessionStartTime()) .setParameter("endTime", currentTime) .list(); int warningCount = 0; int errorCount = 0; for (String errorOrWarning: errorAndWarningList) { if (errorOrWarning.startsWith("W")) { warningCount++; } else { errorCount++; } } sessionModel.setErrorCount(errorCount); sessionModel.setWarningCount(warningCount); session.saveOrUpdate(sessionModel); GTFSDB.commitAndCloseSession(session); }

Target:
public void updateSessionData( @PathParam("sessionId") int sessionId) { long currentTime = System.currentTimeMillis(); Session session = GTFSDB.initSessionBeginTrans(); SessionModel sessionModel = (SessionModel) session.createQuery(" FROM SessionModel WHERE sessionId = " + sessionId).uniqueResult(); sessionModel.setSessionEndTime(currentTime); List<String> errorAndWarningList = session.createQuery(QueryHelper.sessionErrorsAndWarnings) .setParameter("gtfsRtId", sessionModel.getGtfsRtFeedModel().getGtfsRtId()) .setParameter("startTime", sessionModel.getSessionStartTime()) .setParameter("endTime", currentTime) .list(); int warningCount = 0; int errorCount = 0; for (String errorOrWarning: errorAndWarningList) { if (errorOrWarning.startsWith("W")) { warningCount++; } else { errorCount++; } } sessionModel.setErrorCount(errorCount); sessionModel.setWarningCount(warningCount); session.saveOrUpdate(sessionModel); GTFSDB.commitAndCloseSession(session); }
Source:
public String getLabel(Category category) { List<LeafNode> leafs = findLeafNodes(category); Collections.sort(leafs, new Comparator<LeafNode>() { public int compare(LeafNode o1, LeafNode o2) { return o1.getName().compareTo(o2.getName()); } }); List<String> labels = new ArrayList<String>(); for (LeafNode leaf : leafs) { labels.add(getLabel(leaf)); } Collections.sort(labels); if(labels.size() < 2) { return StringUtils.join(labels, ") OR ("); } else { return "(" + StringUtils.join(labels, ") OR (") + ")"; } }

Target:
public String getLabel(Category category) { List<LeafNode> leafs = findLeafNodes(category); List<String> labels = new ArrayList<String>(); for (LeafNode leaf : leafs) { labels.add(getLabel(leaf)); } Collections.sort(labels); if(labels.size() < 2) { return StringUtils.join(labels, ") OR ("); } else { return "(" + StringUtils.join(labels, ") OR (") + ")"; } }
Source:
private void setItemSelected(int position, boolean isSelected) { PhotoPickerItem item = getItemAtPosition(position); if (item == null) { return; } if (isSelected) { if (!canMultiselect() && !mSelectedItems.isEmpty()) { ThumbnailViewHolder prevHolder = getViewHolderAtPosition(mSelectedItems.get(0)); if (prevHolder != null) { AniUtils.scale(prevHolder.mImgThumbnail, SCALE_SELECTED, SCALE_NORMAL, AniUtils.Duration.SHORT); } mSelectedItems.clear(); } mSelectedItems.add(position); } else { int selectedIndex = mSelectedItems.indexOf(position); if (selectedIndex > -1) { mSelectedItems.remove(selectedIndex); } } ThumbnailViewHolder holder = getViewHolderAtPosition(position); if (holder != null) { if (canMultiselect()) { if (isSelected) { int count = mSelectedItems.indexOf(position) + 1; holder.mTxtSelectionCount.setText(String.format(Locale.getDefault(), "%d", count)); } else if (!isSelected) { holder.mTxtSelectionCount.setText(null); } AniUtils.startAnimation(holder.mTxtSelectionCount, R.anim.pop); } else { if (isSelected) { AniUtils.scaleIn(holder.mTxtSelectionCount, AniUtils.Duration.MEDIUM); } else { AniUtils.scaleOut(holder.mTxtSelectionCount, AniUtils.Duration.MEDIUM); } } holder.mTxtSelectionCount.setSelected(isSelected); if (isSelected) { AniUtils.scale(holder.mImgThumbnail, SCALE_NORMAL, SCALE_SELECTED, AniUtils.Duration.SHORT); } else { AniUtils.scale(holder.mImgThumbnail, SCALE_SELECTED, SCALE_NORMAL, AniUtils.Duration.SHORT); } } if (mListener != null) { mListener.onSelectedCountChanged(getNumSelected()); } long delayMs = AniUtils.Duration.SHORT.toMillis(mContext); new Handler().postDelayed(new Runnable() { @Override public void run() { notifyDataSetChangedInternal(); } }, delayMs); }

Target:
private void setItemSelected(int position, boolean isSelected) { setItemSelected(position, isSelected, true); }
Source:
public Optional<MethodSpec> generate() { ReturnType returnType = parseReturnType(methodElement.getReturnType()); if (!SUPPORTED_RETURN_TYPES.contains(returnType.kind)) { context .getMessager() .error( methodElement, "Invalid return type: %s methods must return void, boolean, Integer, Row, " + "an entity class, a result set, a mapped iterable, or a " + "CompletionStage/CompletableFuture of any of the above", QueryProvider.class.getSimpleName()); return Optional.empty(); } MethodSpec.Builder methodBuilder = GeneratedCodePatterns.override(methodElement); List<ClassName> entityHelperTypes = getEntityHelperTypes(); String providerName = enclosingClass.addQueryProvider(methodElement, getProviderClass(), entityHelperTypes); String providerMethod = methodElement.getAnnotation(QueryProvider.class).providerMethod(); if (providerMethod.isEmpty()) { providerMethod = methodElement.getSimpleName().toString(); } methodBuilder.addCode("$["); if (returnType.kind != VOID) { methodBuilder.addCode("return "); } methodBuilder.addCode("$L.$L(", providerName, providerMethod); boolean first = true; for (VariableElement parameter : methodElement.getParameters()) { if (first) { first = false; } else { methodBuilder.addCode(", "); } methodBuilder.addCode("$L", parameter.getSimpleName().toString()); } methodBuilder.addCode(");$]\n"); return Optional.of(methodBuilder.build()); }

Target:
public Optional<MethodSpec> generate() { MethodSpec.Builder methodBuilder = GeneratedCodePatterns.override(methodElement); List<ClassName> entityHelperTypes = getEntityHelperTypes(); String providerName = enclosingClass.addQueryProvider(methodElement, getProviderClass(), entityHelperTypes); String providerMethod = methodElement.getAnnotation(QueryProvider.class).providerMethod(); if (providerMethod.isEmpty()) { providerMethod = methodElement.getSimpleName().toString(); } methodBuilder.addCode("$["); if (methodElement.getReturnType().getKind() != TypeKind.VOID) { methodBuilder.addCode("return "); } methodBuilder.addCode("$L.$L(", providerName, providerMethod); boolean first = true; for (VariableElement parameter : methodElement.getParameters()) { if (first) { first = false; } else { methodBuilder.addCode(", "); } methodBuilder.addCode("$L", parameter.getSimpleName().toString()); } methodBuilder.addCode(");$]\n"); return Optional.of(methodBuilder.build()); }
Source:
protected static void convertFromProperties(EclipsePreferences node, Properties table, boolean notify) { String version = table.getProperty(VERSION_KEY); if (version == null || !VERSION_VALUE.equals(version)) { } table.remove(VERSION_KEY); for (Object name2 : table.keySet()) { String fullKey = (String) name2; String value = table.getProperty(fullKey); if (value != null) { String[] splitPath = decodePath(fullKey); String path = splitPath[0]; path = makeRelative(path); String key = splitPath[1]; if (DEBUG_PREFERENCE_SET) PrefsMessages.message("Setting preference: " + path + '/' + key + '=' + value); EclipsePreferences childNode = (EclipsePreferences) node.internalNode(path, false, null); String oldValue = childNode.internalPut(key, value); if (notify && !value.equals(oldValue)) childNode.firePreferenceEvent(key, oldValue, value); } } PreferencesService.getDefault().shareStrings(); }

Target:
protected static void convertFromProperties(EclipsePreferences node, Properties table, boolean notify) { String version = table.getProperty(VERSION_KEY); if (version == null || !VERSION_VALUE.equals(version)) { } table.remove(VERSION_KEY); for (Object propName : table.keySet()) { String fullKey = (String) propName; String value = table.getProperty(fullKey); if (value != null) { String[] splitPath = decodePath(fullKey); String path = splitPath[0]; path = makeRelative(path); String key = splitPath[1]; if (DEBUG_PREFERENCE_SET) PrefsMessages.message("Setting preference: " + path + '/' + key + '=' + value); EclipsePreferences childNode = (EclipsePreferences) node.internalNode(path, false, null); String oldValue = childNode.internalPut(key, value); if (notify && !value.equals(oldValue)) childNode.firePreferenceEvent(key, oldValue, value); } } PreferencesService.getDefault().shareStrings(); }
Source:
public void setUp() throws Exception { setBrickPosition = 1; changeBrickPosition = 2; Script project = BrickTestUtils.createProjectAndGetStartScript("variableBricksTest"); project.addBrick(new SetVariableBrick()); project.addBrick(new ChangeVariableBrick()); baseActivityTestRule.launchActivity(null); }

Target:
public void setUp() throws Exception { setBrickPosition = 1; changeBrickPosition = 2; Script script = BrickTestUtils.createProjectAndGetStartScript("variableBricksTest"); script.addBrick(new SetVariableBrick()); script.addBrick(new ChangeVariableBrick()); baseActivityTestRule.launchActivity(null); }
Source:
public static boolean isOptional(@NotNull ErlangCallbackSpec spec) { ErlangCallbackSpecStub stub = spec.getStub(); if (stub != null) return stub.isOptional(); boolean isOptional = false; ErlangFile file = ObjectUtils.tryCast(spec.getContainingFile(), ErlangFile.class); String specName = getCallbackSpecName(spec); int specArity = getCallBackSpecArguments(spec).size(); assert file != null && specName != null; for (ErlangCallbackFunction callback : file.getOptionalCallbacks()) { ErlangAtom functionNameAtom = callback.getQAtom().getAtom(); String functionName = functionNameAtom != null ? getName(functionNameAtom) : null; if (specName.equals(functionName) && specArity == getArity(callback.getInteger())) { isOptional = true; break; } } return isOptional; }

Target:
public static boolean isOptional(@NotNull ErlangCallbackSpec spec) { ErlangCallbackSpecStub stub = spec.getStub(); if (stub != null) return stub.isOptional(); ErlangFile file = ObjectUtils.tryCast(spec.getContainingFile(), ErlangFile.class); String specName = getCallbackSpecName(spec); int specArity = getCallBackSpecArguments(spec).size(); assert file != null && specName != null; for (ErlangCallbackFunction callback : file.getOptionalCallbacks()) { ErlangAtom functionNameAtom = callback.getQAtom().getAtom(); String functionName = functionNameAtom != null ? getName(functionNameAtom) : null; if (specName.equals(functionName) && specArity == getArity(callback.getInteger())) { return true; } } return false; }
Source:
private List<Flight> searchByPrice(SearchParams searchParams){ searchFlights.clear(); try { allFlights = dao.getAllFlights(); } catch (SQLException e) { e.printStackTrace(); } for(int i=0; i < allFlights.size(); i++ ) { if(allFlights.get(i).getPrice() <= searchParams.getPrice()) { searchFlights.add(allFlights.get(i)); } } Collections.sort(searchFlights, new Comparator<Flight>() { public int compare(Flight p1, Flight p2) { return Float.compare(p1.getPrice(), p2.getPrice()); } }); return searchFlights; }

Target:
private List<Flight> searchByPrice(SearchParams searchParams) throws ParseException { searchFlights.clear(); try { allFlights = dao.getAllFlights(); } catch (SQLException e) { e.printStackTrace(); } for(int i=0; i < allFlights.size(); i++ ) { if(allFlights.get(i).getPrice() <= searchParams.getPrice()) { searchFlights.add(allFlights.get(i)); } } Collections.sort(searchFlights, new Comparator<Flight>() { public int compare(Flight p1, Flight p2) { return Float.compare(p1.getPrice(), p2.getPrice()); } }); return searchFlights; }
Source:
public ConfigurationBuilder read(Configuration template) { this.classLoader = new WeakReference<ClassLoader>(template.classLoader()); this.asyncExecutorFactory.read(template.asyncExecutorFactory()); this.balancingStrategyClass = template.balancingStrategyClass(); this.balancingStrategy = template.balancingStrategy(); this.connectionPool.read(template.connectionPool()); this.connectionTimeout = template.connectionTimeout(); for (int i = 0; i < consistentHashImpl.length; i++) { this.consistentHashImpl[i] = template.consistentHashImpl(i + 1); } this.forceReturnValues = template.forceReturnValues(); this.keySizeEstimate = template.keySizeEstimate(); this.marshaller = template.marshaller(); this.marshallerClass = template.marshallerClass(); this.protocolVersion = template.version(); this.servers.clear(); for (ServerConfiguration server : template.servers()) { this.addServer().host(server.host()).port(server.port()); } this.socketTimeout = template.socketTimeout(); this.security.read(template.security()); this.tcpNoDelay = template.tcpNoDelay(); this.tcpKeepAlive = template.tcpKeepAlive(); this.transportFactory = template.transportFactory(); this.valueSizeEstimate = template.valueSizeEstimate(); this.maxRetries = template.maxRetries(); this.nearCache.read(template.nearCache()); for (String className : template.serialWhitelist()) this.whiteListRegExs.add(className); return this; }

Target:
public ConfigurationBuilder read(Configuration template) { this.classLoader = new WeakReference<ClassLoader>(template.classLoader()); this.asyncExecutorFactory.read(template.asyncExecutorFactory()); this.balancingStrategyClass = template.balancingStrategyClass(); this.balancingStrategy = template.balancingStrategy(); this.connectionPool.read(template.connectionPool()); this.connectionTimeout = template.connectionTimeout(); for (int i = 0; i < consistentHashImpl.length; i++) { this.consistentHashImpl[i] = template.consistentHashImpl(i + 1); } this.forceReturnValues = template.forceReturnValues(); this.keySizeEstimate = template.keySizeEstimate(); this.marshaller = template.marshaller(); this.marshallerClass = template.marshallerClass(); this.protocolVersion = template.version(); this.servers.clear(); for (ServerConfiguration server : template.servers()) { this.addServer().host(server.host()).port(server.port()); } this.socketTimeout = template.socketTimeout(); this.security.read(template.security()); this.tcpNoDelay = template.tcpNoDelay(); this.tcpKeepAlive = template.tcpKeepAlive(); this.transportFactory = template.transportFactory(); this.valueSizeEstimate = template.valueSizeEstimate(); this.maxRetries = template.maxRetries(); this.nearCache.read(template.nearCache()); this.whiteListRegExs.addAll(template.serialWhitelist()); return this; }
Source:
private Cursor find(Session session, SearchRow first, SearchRow last, SearchRow intersection) { if (recursive) { return findRecursive(first, last); } setupQueryParameters(session, first, last, intersection); query.setNeverLazy(true); ResultInterface result = query.query(0); return new ViewCursor(this, result, first, last); }

Target:
private Cursor find(Session session, SearchRow first, SearchRow last, SearchRow intersection) { if (recursive) { return findRecursive(first, last); } setupQueryParameters(session, first, last, intersection); ResultInterface result = query.query(0); return new ViewCursor(this, result, first, last); }
Source:
public Configuration getConfiguration(RuleLoaderContext context) { return ConfigurationBuilder.begin() .addRule() .when(FileContent.matches("{taglib1}").inFileNamed("{*}.{extension}")) .perform(new AbstractIterationOperation<FileLocationModel>() { @Override public void perform(GraphRewrite event, EvaluationContext context, FileLocationModel payload) { GraphService.addTypeToModel(event.getGraphContext(), payload.getFile(), JsfSourceFileModel.class); } }) .where("taglib1") .matches("(java\\.sun\\.com/jsf/core)|(java\\.sun\\.com/jsf/html)|(http://java\\.sun\\.com/jsf/facelets)") .where("extension") .matches("(jsp)|(xhtml)") ; }

Target:
public Configuration getConfiguration(RuleLoaderContext context) { return ConfigurationBuilder.begin() .addRule() .when(FileContent.matches("{taglib1}").inFileNamed("{*}.{extension}")) .perform(new AbstractIterationOperation<FileLocationModel>() { @Override public void perform(GraphRewrite event, EvaluationContext context, FileLocationModel payload) { GraphService.addTypeToModel(event.getGraphContext(), payload.getFile(), JsfSourceFileModel.class); } }) .where("taglib1") .matches("(java\\.sun\\.com/jsf/)|(java\\.sun\\.com/jsf/)|(xmlns\\.jcp\\.org/jsf)") .where("extension") .matches("(jsp)|(xhtml)|(jspx)") ; }
Source:
public List<ObservationUnitRow> reorder( final CollectionOrder collectionOrder, final int trialDatasetId, final String instanceNumber, final List<ObservationUnitRow> observationUnitRows) { final String blockId = this.fieldbookMiddlewareService.getBlockId(trialDatasetId, instanceNumber); FieldmapBlockInfo fieldmapBlockInfo = null; if (blockId != null) { fieldmapBlockInfo = this.fieldbookMiddlewareService.getBlockInformation(Integer.valueOf(blockId)); } if (collectionOrder == CollectionOrder.PLOT_ORDER || fieldmapBlockInfo == null) { return observationUnitRows; } else if (collectionOrder == CollectionOrder.SERPENTINE_ALONG_ROWS) { return this.dataCollectionSorter.orderByRange(fieldmapBlockInfo, observationUnitRows); } else if (collectionOrder == CollectionOrder.SERPENTINE_ALONG_COLUMNS) { return this.dataCollectionSorter.orderByColumn(fieldmapBlockInfo, observationUnitRows); } else { return observationUnitRows; } }

Target:
public List<ObservationUnitRow> reorder( final CollectionOrder collectionOrder, final int trialDatasetId, final String instanceNumber, final List<ObservationUnitRow> observationUnitRows) { final String blockId = this.fieldMapService.getBlockId(trialDatasetId, instanceNumber); FieldmapBlockInfo fieldmapBlockInfo = null; if (blockId != null) { fieldmapBlockInfo = this.fieldMapService.getBlockInformation(Integer.valueOf(blockId)); } if (collectionOrder == CollectionOrder.PLOT_ORDER || fieldmapBlockInfo == null) { return observationUnitRows; } else if (collectionOrder == CollectionOrder.SERPENTINE_ALONG_ROWS) { return this.dataCollectionSorter.orderByRange(fieldmapBlockInfo, observationUnitRows); } else if (collectionOrder == CollectionOrder.SERPENTINE_ALONG_COLUMNS) { return this.dataCollectionSorter.orderByColumn(fieldmapBlockInfo, observationUnitRows); } else { return observationUnitRows; } }
Source:
protected Control createDialogArea(Composite parent) { fDialogComposite = new Composite(parent, SWT.NONE); GridLayout layout = new GridLayout(1, true); fDialogComposite.setLayout(layout); fDialogComposite.setLayoutData(new GridData(GridData.FILL_BOTH)); createSelectionGroup(); createOptionComposite(); fLocalComposite = null; fFileWidget = null; createLocalComposite(); setMessage(Messages.TraceControl_SelectProfileText); return fDialogComposite; }

Target:
protected Control createDialogArea(Composite parent) { fDialogComposite = new Composite(parent, SWT.NONE); GridLayout layout = new GridLayout(1, true); fDialogComposite.setLayout(layout); GridData data = new GridData(GridData.FILL_BOTH); data.heightHint = 300; fDialogComposite.setLayoutData(data); createSelectionGroup(); createOptionComposite(); fLocalComposite = null; fFileWidget = null; createLocalComposite(); setMessage(Messages.TraceControl_SelectProfileText); return fDialogComposite; }
Source:
public ReceiveCommand(final ObjectId oldId, final ObjectId newId, final String name, final Type type) { if (oldId == null) { throw new IllegalArgumentException(JGitText.get().oldIdMustNotBeNull); } if (newId == null) { throw new IllegalArgumentException(JGitText.get().newIdMustNotBeNull); } this.oldId = oldId; this.newId = newId; this.name = name; switch (type) { case CREATE: if (!ObjectId.zeroId().equals(oldId)) { throw new IllegalArgumentException( JGitText.get().createRequiresZeroOldId); } break; case DELETE: if (!ObjectId.zeroId().equals(newId)) { throw new IllegalArgumentException( JGitText.get().deleteRequiresZeroNewId); } break; case UPDATE: case UPDATE_NONFASTFORWARD: if (ObjectId.zeroId().equals(newId) || ObjectId.zeroId().equals(oldId)) { throw new IllegalArgumentException( JGitText.get().updateRequiresOldIdAndNewId); } break; default: throw new IllegalStateException(); } this.type = type; }

Target:
public ReceiveCommand(final ObjectId oldId, final ObjectId newId, final String name, final Type type) { if (oldId == null) { throw new IllegalArgumentException(JGitText.get().oldIdMustNotBeNull); } if (newId == null) { throw new IllegalArgumentException(JGitText.get().newIdMustNotBeNull); } this.oldId = oldId; this.newId = newId; this.name = name; switch (type) { case CREATE: if (!ObjectId.zeroId().equals(oldId)) { throw new IllegalArgumentException( JGitText.get().createRequiresZeroOldId); } break; case DELETE: if (!ObjectId.zeroId().equals(newId)) { throw new IllegalArgumentException( JGitText.get().deleteRequiresZeroNewId); } break; case UPDATE: case UPDATE_NONFASTFORWARD: if (ObjectId.zeroId().equals(newId) || ObjectId.zeroId().equals(oldId)) { throw new IllegalArgumentException( JGitText.get().updateRequiresOldIdAndNewId); } break; default: throw new IllegalStateException(JGitText.get().enumValueNotSupported0); } this.type = type; }
Source:
public void testCreateTwoNodesWithRunScript() throws Exception { try { client.destroyNodesMatching(inGroup(group)); } catch (NoSuchElementException e) { } refreshTemplate(); try { nodes = newTreeSet(client.createNodesInGroup(group, 2, template)); } catch (RunNodesException e) { nodes = newTreeSet(concat(e.getSuccessfulNodes(), e.getNodeErrors().keySet())); throw e; } assertEquals(nodes.size(), 2, "nodes is " + nodes); checkNodes(nodes, group, "bootstrap"); NodeMetadata node1 = nodes.first(); NodeMetadata node2 = nodes.last(); assertLocationSameOrChild(checkNotNull(node1.getLocation(), "location of %s", node1), template.getLocation()); assertLocationSameOrChild(checkNotNull(node2.getLocation(), "location of %s", node2), template.getLocation()); checkImageIdMatchesTemplate(node1); checkImageIdMatchesTemplate(node2); checkOsMatchesTemplate(node1); checkOsMatchesTemplate(node2); }

Target:
public void testCreateTwoNodesWithRunScript() throws Exception { try { client.destroyNodesMatching(inGroup(group)); } catch (NoSuchElementException e) { } refreshTemplate(); try { nodes = newTreeSet(client.createNodesInGroup(group, 2, template)); } catch (RunNodesException e) { nodes = newTreeSet(concat(e.getSuccessfulNodes(), e.getNodeErrors().keySet())); throw e; } assertEquals(nodes.size(), 2, "expected two nodes but was " + nodes); checkNodes(nodes, group, "bootstrap"); NodeMetadata node1 = nodes.first(); NodeMetadata node2 = nodes.last(); assertLocationSameOrChild(checkNotNull(node1.getLocation(), "location of %s", node1), template.getLocation()); assertLocationSameOrChild(checkNotNull(node2.getLocation(), "location of %s", node2), template.getLocation()); checkImageIdMatchesTemplate(node1); checkImageIdMatchesTemplate(node2); checkOsMatchesTemplate(node1); checkOsMatchesTemplate(node2); }
Source:
public void visitNode(Tree tree) { if (!hasSemantic()) { return; } MethodTree methodTree = (MethodTree) tree; if (!methodTree.symbol().isPublic()) { return; } for (VariableTree parameter : methodTree.parameters()) { for (IdentifierTree paramUsage : parameter.symbol().usages()) { Tree paramParent = paramUsage.identifierToken().parent(); while (!paramParent.equals(methodTree) && !assertReported.contains(paramParent)) { if (parentType(paramParent)) { break; } paramParent = paramParent.parent(); } } } }

Target:
public void visitNode(Tree tree) { if (!hasSemantic()) { return; } MethodTree methodTree = (MethodTree) tree; if (!methodTree.symbol().isPublic()) { return; } methodTree.parameters().stream() .map(VariableTree::symbol) .map(Symbol::usages) .flatMap(List::stream) .forEach(parameter -> checkUsage(parameter, methodTree)); }
Source:
public void onCreate() { super.onCreate(); CrashlyticsCore core = new CrashlyticsCore.Builder() .disabled(BuildConfig.DEBUG) .build(); Fabric.with(this, new Crashlytics.Builder().core(core).build()); if (BuildConfig.DEBUG) { Timber.plant(new Timber.DebugTree()); } Timber.plant(new CrashlyticsTree()); }

Target:
public void onCreate() { super.onCreate(); LoggingUtils.createLogger(this); }
Source:
public static byte[] readContent(final InputStream inputStream) throws IOException { final ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); int read = inputStream.read(); while (read != -1) { byteArrayOutputStream.write(read); read = inputStream.read(); } return byteArrayOutputStream.toByteArray(); }

Target:
public static byte[] readContent(final InputStream inputStream) throws IOException { Assert.requireNonNull(inputStream, "inputStream"); final ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); int read = inputStream.read(); while (read != -1) { byteArrayOutputStream.write(read); read = inputStream.read(); } return byteArrayOutputStream.toByteArray(); }
Source:
public static String[] getOptionArguments(final String[] args) { final List<String> temporary = Arrays.asList(args); final int index = temporary.indexOf(BARE_DOUBLE_DASH); if (index == -1) { return args; } else if (index == 0) { return new String[0]; } else { return temporary.subList(0, index).toArray(new String[index]); } }

Target:
public static String[] getOptionArguments(final String[] args) { final List<String> temporary = new ArrayList<>(args.length); for (int i = 0; i < args.length; i++) { if (BARE_DOUBLE_DASH.equals(args[i])) { break; } temporary.add(args[i]); } return temporary.toArray(new String[temporary.size()]); }
Source:
public String getArticlesPerMonth(@SiteParam Site site, @PathVariable String year, @PathVariable String month, @RequestParam String cursor, @RequestParam String pageNumber, Model model) throws IOException, ParseException { Map<String, ?> searchResult = (Map<String, Map>) articleArchiveServiceImpl .getArticleDoisPerMonth(site, year, month, cursor); model.addAttribute("month", month); model.addAttribute("year", year); model.addAttribute("searchResult", searchResult); model.addAttribute("nextCursorMark", searchResult.get("nextCursorMark")); int pageNumberCount = Integer.parseInt(pageNumber); final int listStartNumber = pageNumberCount * MAXIMUM_SOLR_RESULTS + 1; model.addAttribute("listStart", listStartNumber); final boolean isLastPage = (Double) searchResult.get("numFound") <= listStartNumber + MAXIMUM_SOLR_RESULTS; model.addAttribute("showMoreLink", !isLastPage); pageNumberCount = pageNumberCount + 1; model.addAttribute("pageNumber", pageNumberCount); return site + "/ftl/lockss/dois"; }

Target:
public String getArticlesPerMonth(@SiteParam Site site, @PathVariable String year, @PathVariable String month, @RequestParam String cursor, @RequestParam String pageNumber, Model model) throws IOException, ParseException { Map<String, ?> searchResult = (Map<String, Map>) articleArchiveServiceImpl .getArticleDoisPerMonth(site, year, month, cursor); model.addAttribute("month", month); model.addAttribute("year", year); model.addAttribute("searchResult", searchResult); model.addAttribute("nextCursorMark", searchResult.get("nextCursorMark")); int pageNumberCount = Integer.parseInt(pageNumber); final int listStartNumber = pageNumberCount * MAXIMUM_SOLR_RESULTS + 1; model.addAttribute("listStart", listStartNumber); final boolean isLastPage = (Double) searchResult.get("numFound") < listStartNumber + MAXIMUM_SOLR_RESULTS; model.addAttribute("showMoreLink", !isLastPage); pageNumberCount = pageNumberCount + 1; model.addAttribute("pageNumber", pageNumberCount); return site + "/ftl/lockss/dois"; }
Source:
public DomainShareReliable(String[][] rawHierarchy, String[] encodedValues, int[][] encodedHierarchy) { this.duplicates = new LongObjectOpenHashMap<BigFraction>(); this.shares = new BigFraction[encodedValues.length]; Arrays.fill(shares, NOT_AVAILABLE); @SuppressWarnings("unchecked") ObjectIntOpenHashMap<String>[] maps = new ObjectIntOpenHashMap[rawHierarchy[0].length]; for (int level = 0; level < maps.length; level++) { maps[level] = new ObjectIntOpenHashMap<String>(); } for (int value = 0; value < rawHierarchy.length; value++) { String[] transformation = rawHierarchy[value]; for (int level = 0; level < transformation.length; level++) { ObjectIntOpenHashMap<String> map = maps[level]; String key = transformation[level]; if (!map.containsKey(key)) { map.put(key, 0); } map.put(key, map.get(key) + 1); } } for (int row = 0; row < encodedHierarchy.length; row++) { int[] strategy = encodedHierarchy[row]; for (int level = 0; level < strategy.length; level++){ ObjectIntOpenHashMap<String> map = maps[level]; int value = strategy[level]; String keyString = encodedValues[value]; BigFraction share = new BigFraction(map.get(keyString), rawHierarchy.length); BigFraction stored = shares[value]; if (stored != NOT_AVAILABLE) { if (stored == share) { continue; } if (stored.compareTo(BigFraction.ZERO) >= 0) { shares[value] = shares[value].multiply(BigFraction.MINUS_ONE); } long dkey = (((long) value) << 32) | (level & 0xffffffffL); duplicates.put(dkey, share); } else { shares[value] = share; } } } }

Target:
public DomainShareReliable(String[][] rawHierarchy, String[] encodedValues, int[][] encodedHierarchy) { this.duplicates = new LongObjectOpenHashMap<BigFraction>(); this.shares = new BigFraction[encodedValues.length]; Arrays.fill(shares, NOT_AVAILABLE); @SuppressWarnings("unchecked") ObjectIntOpenHashMap<String>[] maps = new ObjectIntOpenHashMap[rawHierarchy[0].length]; for (int level = 0; level < maps.length; level++) { maps[level] = new ObjectIntOpenHashMap<String>(); } for (int value = 0; value < rawHierarchy.length; value++) { String[] transformation = rawHierarchy[value]; for (int level = 0; level < transformation.length; level++) { ObjectIntOpenHashMap<String> map = maps[level]; String key = transformation[level]; if (!map.containsKey(key)) { map.put(key, 0); } map.put(key, map.get(key) + 1); } } for (int row = 0; row < encodedHierarchy.length; row++) { int[] strategy = encodedHierarchy[row]; for (int level = 0; level < strategy.length; level++){ ObjectIntOpenHashMap<String> map = maps[level]; int value = strategy[level]; String keyString = encodedValues[value]; BigFraction share = new BigFraction(map.get(keyString), rawHierarchy.length); BigFraction stored = shares[value]; if (stored != NOT_AVAILABLE) { if (stored.equals(share)) { continue; } if (stored.compareTo(BigFraction.ZERO) >= 0) { shares[value] = shares[value].multiply(BigFraction.MINUS_ONE); } long dkey = (((long) value) << 32) | (level & 0xffffffffL); duplicates.put(dkey, share); } else { shares[value] = share; } } } }
Source:
protected boolean canDoAction() { if (getVds() == null) { return failCanDoAction(VdcBllMessages.VDS_NOT_EXIST); } if (getVds().getStatus() != VDSStatus.Up) { return failCanDoAction(VdcBllMessages.CANNOT_FORCE_SELECT_SPM_VDS_NOT_UP); } if (getStoragePoolForVds() == null) { return failCanDoAction(VdcBllMessages.CANNOT_FORCE_SELECT_SPM_VDS_NOT_IN_POOL); } if (getVds().getSpmStatus() != VdsSpmStatus.None) { return failCanDoAction(VdcBllMessages.CANNOT_FORCE_SELECT_SPM_VDS_ALREADY_SPM); } if (getVds().getVdsSpmPriority() == BusinessEntitiesDefinitions.HOST_MIN_SPM_PRIORITY) { return failCanDoAction(VdcBllMessages.CANNOT_FORCE_SELECT_SPM_VDS_MARKED_AS_NEVER_SPM); } if (getStoragePoolForVds().getStatus() != StoragePoolStatus.Up) { return failCanDoAction(VdcBllMessages.CANNOT_FORCE_SELECT_SPM_STORAGE_POOL_NOT_UP); } if (isAsyncTasksRunningOnPool(getStoragePoolForVds().getId())) { return failCanDoAction(VdcBllMessages.CANNOT_FORCE_SELECT_SPM_STORAGE_POOL_HAS_RUNNING_TASKS); } return true; }

Target:
protected boolean canDoAction() { if (getVds() == null) { return failCanDoAction(VdcBllMessages.VDS_NOT_EXIST); } if (getVds().getStatus() != VDSStatus.Up) { return failCanDoAction(VdcBllMessages.CANNOT_FORCE_SELECT_SPM_VDS_NOT_UP); } if (getStoragePoolForVds() == null) { return failCanDoAction(VdcBllMessages.CANNOT_FORCE_SELECT_SPM_VDS_NOT_IN_POOL); } if (getVds().getSpmStatus() != VdsSpmStatus.None) { return failCanDoAction(VdcBllMessages.CANNOT_FORCE_SELECT_SPM_VDS_ALREADY_SPM); } if (getVds().getVdsSpmPriority() == BusinessEntitiesDefinitions.HOST_MIN_SPM_PRIORITY) { return failCanDoAction(VdcBllMessages.CANNOT_FORCE_SELECT_SPM_VDS_MARKED_AS_NEVER_SPM); } if (!validate(new StoragePoolValidator(getStoragePoolForVds()).isUp())) { return false; } if (isAsyncTasksRunningOnPool(getStoragePoolForVds().getId())) { return failCanDoAction(VdcBllMessages.CANNOT_FORCE_SELECT_SPM_STORAGE_POOL_HAS_RUNNING_TASKS); } return true; }
Source:
public void delayBeforeNextRetry(PollingStrategyContext pollingStrategyContext) throws InterruptedException { int requestNumber = pollingStrategyContext.getRetriesAttempted(); Double msToWait; if (requestNumber == 0) { msToWait = THOUSAND * Math.min( Math.max(FIRST_POLL_RATIO * expectedRuntimeSeconds, STABLE_POLLING_INTERVAL_SECONDS_MIN), MAX_POLLING_INTERVAL_SECONDS); } else if (requestNumber == 1) { msToWait = THOUSAND * Math.min( Math.max(SECOND_POLL_RATIO * expectedRuntimeSeconds, STABLE_POLLING_INTERVAL_SECONDS_MIN), MAX_POLLING_INTERVAL_SECONDS); } else { msToWait = THOUSAND * Math.max(STABLE_POLLING_INTERVAL_SECONDS_MIN, RANDOM.nextInt(STABLE_POLLING_INTERVAL_SECONDS_MAX)); } LOGGER.info("Polling attempt: {}, Sleeping for: {}ms for request: {}. ExpectedRuntime={}s", requestNumber, msToWait.longValue(), pollingStrategyContext.getOriginalRequest(), expectedRuntimeSeconds); Thread.sleep(msToWait.longValue()); }

Target:
public void delayBeforeNextRetry(PollingStrategyContext pollingStrategyContext) throws InterruptedException { int requestNumber = pollingStrategyContext.getRetriesAttempted(); long msToWait; if (requestNumber == 0) { msToWait = msToWaitRequest0; } else if (requestNumber == 1) { msToWait = msToWaitRequest1; } else { msToWait = (long) (THOUSAND * Math.max(STABLE_POLLING_INTERVAL_SECONDS_MIN, RANDOM.nextInt(STABLE_POLLING_INTERVAL_SECONDS_MAX))); } LOGGER.info("Polling attempt: {}, Sleeping for: {}ms for request: {}. ExpectedRuntime={}s", requestNumber, msToWait, pollingStrategyContext.getOriginalRequest(), expectedRuntimeSeconds); Thread.sleep(msToWait); }
Source:
public boolean hasCapability(String capability) { if (capability.equals(CAPABILITY_OFFHEAP) && isSubscriptionBasedLicense()) { return true; } else { Long v = getLimit(capability); return v != null && v != 0; } }

Target:
public boolean hasCapability(String capability) { Long v = getLimit(capability); return v != null && v != 0; }
Source:
void onBindFeedViewHolder(StatisticsHolder holder, int position) { DBReader.StatisticsItem statsItem = statisticsData.feeds.get(position - 1); Glide.with(context) .load(statsItem.feed.getImageLocation()) .apply(new RequestOptions() .placeholder(R.color.light_gray) .error(R.color.light_gray) .diskCacheStrategy(ApGlideSettings.AP_DISK_CACHE_STRATEGY) .fitCenter() .dontAnimate()) .into(holder.image); holder.title.setText(statsItem.feed.getTitle()); holder.value.setText(Converter.byteToString(statsItem.totalDownloadSize)); }

Target:
void onBindFeedViewHolder(StatisticsHolder holder, int position) { DBReader.StatisticsItem statsItem = statisticsData.feeds.get(position - 1); holder.value.setText(Converter.byteToString(statsItem.totalDownloadSize)); }
Source:
default List<T> getItems() { IterableStream<T> iterableStream = this.getElements(); return iterableStream == null ? null : this.getElements().stream().collect(Collectors.toList()); }

Target:
default List<T> getItems() { IterableStream<T> iterableStream = this.getElements(); return iterableStream == null ? new ArrayList<>() : this.getElements().stream().collect(Collectors.toList()); }