auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public Guid getEntityGuid(Object entity) { if (entity instanceof BusinessEntity) { Object id = getEntityGuid((BusinessEntity<? extends Guid>) entity); if (id instanceof Guid) { return (Guid) id; } } if (entity instanceof VmPool) { return ((VmPool) entity).getVmPoolId(); } else if (entity instanceof DbUser) { return ((DbUser) entity).getId(); } else if (entity instanceof DbGroup) { return ((DbGroup) entity).getId(); } else { return Guid.Empty; } }

Target:
public Guid getEntityGuid(Object entity) { if (entity instanceof BusinessEntity) { Object id = getEntityGuid((BusinessEntity) entity); if (id instanceof Guid) { return (Guid) id; } } if (entity instanceof VmPool) { return ((VmPool) entity).getVmPoolId(); } else if (entity instanceof DbUser) { return ((DbUser) entity).getId(); } else if (entity instanceof DbGroup) { return ((DbGroup) entity).getId(); } else { return Guid.Empty; } }
Source:
protected String getId() { return "GNU C compiler (gcc)"; }

Target:
protected String getId() { return "GNU compiler (gcc)"; }
Source:
public void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception { if (args.length != 1) { throw new NotEnoughArgumentsException(); } String kitname = args[0]; if (!ess.getSettings().isPastebinCreateKit()) { ess.getKits().removeKit(kitname); user.sendMessage(tl("deletedKit", kitname)); } else { user.sendMessage("You have tried to remove the kit from pastebin.com which is not very easy."); } }

Target:
public void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception { if (args.length != 1) { throw new NotEnoughArgumentsException(); } String kitname = args[0]; if (!ess.getSettings().isPastebinCreateKit()) { ess.getKits().removeKit(kitname); user.sendMessage(tl("deleteKit", kitname)); } else { user.sendMessage(tl("pastebinDeleteKit")); } }
Source:
void checkChildren(TreeItem item) { TreeItem dummy; if (item.getItemCount() == 1 && (dummy = item.getItem(0)).getData() == null) { dummy.dispose(); Node node = (Node)item.getData(); NodeList childNodes = node.getChildNodes(); for (int i = 0, length = childNodes.getLength(); i < length; i++) { addChild(childNodes.item(i), item); } TreeItem[] items = item.getItems(); for (TreeItem item2 : items) { TreeItem[] children = item2.getItems(); int checkedCount = 0; for (TreeItem element : children) { if (element.getChecked()) checkedCount++; if (element.getGrayed()) break; } item2.setChecked(checkedCount != 0); item2.setGrayed(checkedCount != children.length); } } }

Target:
void checkChildren(TreeItem item) { TreeItem dummy; if (item.getItemCount() == 1 && (dummy = item.getItem(0)).getData() == null) { dummy.dispose(); Node node = (Node)item.getData(); NodeList childNodes = node.getChildNodes(); for (int i = 0, length = childNodes.getLength(); i < length; i++) { addChild(childNodes.item(i), item); } for (TreeItem child : item.getItems()) { TreeItem[] children = child.getItems(); int checkedCount = 0; for (TreeItem element : children) { if (element.getChecked()) checkedCount++; if (element.getGrayed()) break; } child.setChecked(checkedCount != 0); child.setGrayed(checkedCount != children.length); } } }
Source:
public String getNoVncPageUrl() { String noVncPageUrl = properties.get(NOVNC_PAGE_URL); if (noVncPageUrl == null) { String noVncPageUrlFromCurrentLocation = getWindowsLocationUrl(); noVncPageUrlFromCurrentLocation += "/rest/novnc.html"; return noVncPageUrlFromCurrentLocation; } return noVncPageUrl; }

Target:
public String getNoVncPageUrl() { String noVncPageUrl = properties.get(NOVNC_PAGE_URL); if (noVncPageUrl == null) { String noVncPageUrlFromCurrentLocation = getWindowsLocationUrl(); noVncPageUrlFromCurrentLocation += "/rest/novnc.html"; noVncPageUrlFromCurrentLocation.replace(":","\\:"); return noVncPageUrlFromCurrentLocation; } return noVncPageUrl; }
Source:
public void run() throws Exception { WebResource webResource = getClient().resource(endpoint + "/v1/catalog/policies"); ClientResponse clientResponse = webResource.accept(MediaType.APPLICATION_JSON).get(ClientResponse.class); String jsonResponse = clientResponse.getEntity(String.class); List<String> policies = getJsonParser().readValue(jsonResponse, new TypeReference<List<String>>() { }); for (String policy : policies) { getOut().println(policy); } }

Target:
public void run() throws Exception { WebResource webResource = getClient().resource(endpoint + "/v1/catalog/policies"); ClientResponse clientResponse = webResource.accept(MediaType.APPLICATION_JSON).get(ClientResponse.class); if (clientResponse.getStatus() != Response.Status.OK.getStatusCode()) { String err = getErrorMessage(clientResponse); throw new CommandExecutionException(err); } String jsonResponse = clientResponse.getEntity(String.class); List<String> policies = getJsonParser().readValue(jsonResponse, new TypeReference<List<String>>() {}); for (String policy : policies) { getOut().println(policy); } }
Source:
private void subscribeToSession(Id sessionId) { subscriptions.add( dataRepository.getEvent(sessionId) .map(asSession()) .observeOn(AndroidSchedulers.mainThread()) .subscribe(new SessionObserver()) ); subscriptions.add( dataRepository.getScheduleSyncEvents() .observeOn(AndroidSchedulers.mainThread()) .subscribe(new SyncEventObserver()) ); subscriptions.add( dataRepository.getFavoriteIds() .map(asFavouriteBoolean(sessionId)) .observeOn(AndroidSchedulers.mainThread()) .subscribe(new FavouriteObserver()) ); }

Target:
private void subscribeToSession(Id sessionId) { subscriptions.add( dataRepository.getEvent(sessionId) .map(asSession()) .observeOn(AndroidSchedulers.mainThread()) .subscribe(new SessionObserver()) ); subscriptions.add( dataRepository.getScheduleSyncEvents() .observeOn(AndroidSchedulers.mainThread()) .subscribe(new SyncEventObserver()) ); subscriptions.add( dataRepository.getFavoriteIds() .map(asFavoriteBoolean(sessionId)) .observeOn(AndroidSchedulers.mainThread()) .subscribe(new FavouriteObserver()) ); }
Source:
public void IAR_error2() throws IOException { Collection<FileAnnotation> warnings = new IarParser().parse(openFile("issue8823.txt")); Iterator<FileAnnotation> iterator = warnings.iterator(); FileAnnotation annotation = iterator.next(); annotation = iterator.next(); checkWarning(annotation, 3767, "enumerated type mixed with another type", "D:/continuousIntegration/modifiedcomps/forcedproduct/MHSM-Cascade/Cascade-Config/config/src/RDR_Config.c", "Pe188", Priority.NORMAL); }

Target:
public void IAR_error2() throws IOException { FileAnnotation annotation = getErrorNumber(2); checkWarning(annotation, 3767, "enumerated type mixed with another type", "D:/continuousIntegration/modifiedcomps/forcedproduct/MHSM-Cascade/Cascade-Config/config/src/RDR_Config.c", "Pe188", Priority.NORMAL); }
Source:
public void purgeConceptStateConversion_shouldTestPurgeConceptStateConversion() { ConceptStateConversion conceptStateConversion = pws.getAllConceptStateConversions().get(0); Context.getProgramWorkflowService().purgeConceptStateConversion(conceptStateConversion, false); List<ConceptStateConversion> list = pws.getAllConceptStateConversions(); int len = list.size(); assertEquals(len, 0); }

Target:
public void purgeConceptStateConversion_shouldTestPurgeConceptStateConversion() { ConceptStateConversion conceptStateConversion = pws.getAllConceptStateConversions().get(0); Context.getProgramWorkflowService().purgeConceptStateConversion(conceptStateConversion, false); List<ConceptStateConversion> list = pws.getAllConceptStateConversions(); assertEquals(list.size(), 0); }
Source:
SpacesAPIImpl getSpaces(BeanManager bm) { final Bean<SpacesAPIImpl> spacesBean = (Bean<SpacesAPIImpl>) bm.getBeans(SpacesAPIImpl.class).iterator().next(); final CreationalContext<SpacesAPIImpl> spacesCtx = bm.createCreationalContext(spacesBean); return (SpacesAPIImpl) bm.getReference(spacesBean, SpacesAPIImpl.class, spacesCtx); }

Target:
SpacesAPI getSpaces(BeanManager bm) { final Bean<SpacesAPI> spacesBean = (Bean<SpacesAPI>) bm.getBeans(SpacesAPI.class).iterator().next(); final CreationalContext<SpacesAPI> spacesCtx = bm.createCreationalContext(spacesBean); return (SpacesAPI) bm.getReference(spacesBean, SpacesAPI.class, spacesCtx); }
Source:
public String filePath() { return fileName; }

Target:
public String filePath() { return String.format("%d/%s/%s", task.getId(), language, fileName); }
Source:
protected boolean canDoAction() { List<Network> all = getNetworks(); return validate(vmNetworkSetCorrectly()) && validate(stpForVmNetworkOnly()) && validate(mtuValid()) && validate(networkPrefixValid()) && validate(networkDoesNotExist(all)) && validate(vlanIsFree(all)); }

Target:
protected boolean canDoAction() { if (!validate(vmNetworkSetCorrectly()) || !validate(stpForVmNetworkOnly()) || !validate(mtuValid()) || !validate(networkPrefixValid()) || !validate(storagePoolExists())) { return false; } List<Network> all = getNetworks(); return validate(networkDoesNotExist(all)) && validate(vlanIsFree(all)); }
Source:
public void processAttributeSet(String msg, MessageBeans beans) { Perun perun = ldapcManager.getPerunBl(); if(beans.getAttribute() == null || beans.getFacility() == null) { return; } try { log.debug("Getting resources assigned to facility {}", beans.getFacility().getId()); List<Resource> resources = perun.getFacilitiesManager().getAssignedResources(ldapcManager.getPerunSession(), beans.getFacility()); Attribute virtAttributeWithValue = null; if (beans.getAttribute().getNamespace().contains(":virt")) { virtAttributeWithValue = ldapcManager.getPerunBl().getAttributesManager().getAttribute(ldapcManager.getPerunSession(), beans.getFacility(), beans.getAttribute().getName()); } for(Resource resource: resources) { log.debug("Setting attribute for resource {}", beans.getAttribute(), resource); if (virtAttributeWithValue != null) { perunResource.modifyEntry(resource, virtAttributeWithValue); } else { perunResource.modifyEntry(resource, beans.getAttribute()); } } } catch (PerunException e) { log.error("Error setting attribute:", e); } }

Target:
public void processAttributeSet(String msg, MessageBeans beans) { PerunBl perun = (PerunBl) ldapcManager.getPerunBl(); if (beans.getAttribute() == null || beans.getFacility() == null) { return; } try { log.debug("Setting attribute for facility {}", beans.getAttribute(), beans.getFacility()); perunFacility.modifyEntry(beans.getFacility(), beans.getAttribute()); log.debug("Getting resources assigned to facility {}", beans.getFacility().getId()); List<Resource> resources = perun.getFacilitiesManagerBl().getAssignedResources(ldapcManager.getPerunSession(), beans.getFacility()); for (Resource resource : resources) { log.debug("Setting attribute for resource {}", beans.getAttribute(), resource); perunResource.modifyEntry(resource, beans.getAttribute()); } } catch (NamingException | InternalErrorException e) { log.error("Error setting attribute:", e); } }
Source:
public DeviceBinaryInput(JsonObject jsonObject) { try { for (Entry<String, JsonElement> entry : jsonObject.entrySet()) { try { getClass().getDeclaredField(entry.getKey()).set(this, entry.getValue().getAsShort()); } catch (NoSuchFieldException e) { } catch (NumberFormatException e) { } } if (stateValue == null && jsonObject.get(JSONApiResponseKeysEnum.STATE.getKey()) != null) { stateValue = jsonObject.get(JSONApiResponseKeysEnum.STATE.getKey()).getAsShort(); } } catch (IllegalArgumentException e) { logger.error("A IllegalArgumentException occurred: ", e); } catch (IllegalAccessException e) { logger.error("A IllegalAccessException occurred: ", e); } catch (SecurityException e) { logger.error("A SecurityException occurred: ", e); } }

Target:
public DeviceBinaryInput(JsonObject jsonObject) { if (jsonObject.get(JSONApiResponseKeysEnum.TARGET_GROUP_TYPE.getKey()) != null) { targetGroupType = jsonObject.get(JSONApiResponseKeysEnum.TARGET_GROUP_TYPE.getKey()).getAsShort(); } else { targetGroupType = null; } if (jsonObject.get(JSONApiResponseKeysEnum.TARGET_GROUP.getKey()) != null) { targetGroup = jsonObject.get(JSONApiResponseKeysEnum.TARGET_GROUP.getKey()).getAsShort(); } else { targetGroup = null; } if (jsonObject.get(JSONApiResponseKeysEnum.INPUT_TYPE.getKey()) != null) { inputType = jsonObject.get(JSONApiResponseKeysEnum.INPUT_TYPE.getKey()).getAsShort(); } else { inputType = null; } if (jsonObject.get(JSONApiResponseKeysEnum.INPUT_ID.getKey()) != null) { inputId = jsonObject.get(JSONApiResponseKeysEnum.INPUT_ID.getKey()).getAsShort(); } else { inputId = null; } if (jsonObject.get(JSONApiResponseKeysEnum.STATE_VALUE.getKey()) != null) { stateValue = jsonObject.get(JSONApiResponseKeysEnum.STATE_VALUE.getKey()).getAsShort(); } if (stateValue == null && jsonObject.get(JSONApiResponseKeysEnum.STATE.getKey()) != null) { stateValue = jsonObject.get(JSONApiResponseKeysEnum.STATE.getKey()).getAsShort(); } else { stateValue = null; } }
Source:
protected void initDefaultOutput(ISCTFileSystemAccess access, GeneratorEntry entry) { String folderName = helper.getTargetFolderValue(entry).getStringValue(); access.setOutputPath(IFileSystemAccess.DEFAULT_OUTPUT, helper.getTargetFolderValue(entry).getStringValue()); access.getOutputConfigurations().get(IFileSystemAccess.DEFAULT_OUTPUT).setCreateOutputDirectory(true); checkWriteAccess(access, IFileSystemAccess.DEFAULT_OUTPUT, folderName); }

Target:
protected void initDefaultOutput(ISCTFileSystemAccess access, GeneratorEntry entry) { String folderName = helper.getTargetFolderValue(entry).getStringValue(); access.setOutputPath(IFileSystemAccess.DEFAULT_OUTPUT, folderName); access.getOutputConfigurations().get(IFileSystemAccess.DEFAULT_OUTPUT).setCreateOutputDirectory(true); checkWriteAccess(access, IFileSystemAccess.DEFAULT_OUTPUT, folderName); }
Source:
public List<Future<Boolean>> primeConnectionsAsync(final List<Server> servers, final PrimeConnectionListener listener) { if (servers == null) { return Collections.emptyList(); } List<Server> allServers = new ArrayList<Server>(); allServers.addAll(servers); if (allServers.size() == 0){ logger.debug("RestClient:" + name + ". No nodes/servers to prime connections"); return Collections.emptyList(); } logger.info("Priming Connections for RestClient:" + name + ", numServers:" + allServers.size()); List<Future<Boolean>> ftList = new ArrayList<Future<Boolean>>(); for (Server s : allServers) { s.setReadyToServe(false); if (aSync) { Future<Boolean> ftC = null; try { ftC = makeConnectionASync(s, listener); ftList.add(ftC); } catch (RejectedExecutionException ree) { logger.error("executor submit failed", ree); } catch (Throwable e) { logger.error("general error", e); } } else { connectToServer(s, listener); } } return ftList; }

Target:
public List<Future<Boolean>> primeConnectionsAsync(final List<Server> servers, final PrimeConnectionListener listener) { if (servers == null) { return Collections.emptyList(); } List<Server> allServers = new ArrayList<Server>(); allServers.addAll(servers); if (allServers.size() == 0){ logger.debug("RestClient:" + name + ". No nodes/servers to prime connections"); return Collections.emptyList(); } logger.info("Priming Connections for RestClient:" + name + ", numServers:" + allServers.size()); List<Future<Boolean>> ftList = new ArrayList<Future<Boolean>>(); for (Server s : allServers) { s.setReadyToServe(false); if (aSync) { Future<Boolean> ftC = null; try { ftC = makeConnectionASync(s, listener); ftList.add(ftC); } catch (RejectedExecutionException ree) { logger.error("executor submit failed", ree); } catch (Exception e) { logger.error("general error", e); } } else { connectToServer(s, listener); } } return ftList; }
Source:
public Promise<? extends Location> getStackFrameLocation(long threadId, int frameIndex) { if (isConnected()) { return service.getStackFrameLocation(debugSessionDto.getId(), threadId, frameIndex); } return Promises.reject(JsPromiseError.create("Debugger is not connected")); }

Target:
public Promise<? extends Location> getStackFrameLocation(long threadId, int frameIndex) { if (isConnected()) { return service.getStackFrameLocation(debugSessionDto.getId(), threadId, frameIndex); } return promiseProvider.reject(JsPromiseError.create("Debugger is not connected")); }
Source:
public ConfiguredTarget create(RuleContext ruleContext) throws InterruptedException, RuleErrorException, ActionConflictException { ProtoCommon.checkRuleHasValidMigrationTag(ruleContext); NestedSetBuilder<Artifact> blacklistedProtos = NestedSetBuilder.stableOrder(); for (TransitiveInfoCollection protos : ruleContext.getPrerequisites("blacklisted_protos", TARGET)) { ProtoInfo protoInfo = protos.get(ProtoInfo.PROVIDER); if (ruleContext.getFragment(ProtoConfiguration.class).blacklistedProtosRequiresProtoInfo() && protoInfo == null) { ruleContext.ruleError( "'" + ruleContext.getLabel().toString() + "' does not have mandatory provider 'ProtoInfo'."); } if (protoInfo != null) { blacklistedProtos.addTransitive(protoInfo.getOriginalTransitiveProtoSources()); } else { blacklistedProtos.addTransitive(protos.getProvider(FileProvider.class).getFilesToBuild()); } } return new RuleConfiguredTargetBuilder(ruleContext) .addProvider( ProtoLangToolchainProvider.create( ruleContext.attributes().get("command_line", Type.STRING), ruleContext.getPrerequisite("plugin", HOST, FilesToRunProvider.class), ruleContext.getPrerequisite("runtime", TARGET), blacklistedProtos.build())) .setFilesToBuild(NestedSetBuilder.<Artifact>emptySet(STABLE_ORDER)) .addProvider(RunfilesProvider.simple(Runfiles.EMPTY)) .build(); }

Target:
public ConfiguredTarget create(RuleContext ruleContext) throws InterruptedException, RuleErrorException, ActionConflictException { ProtoCommon.checkRuleHasValidMigrationTag(ruleContext); NestedSetBuilder<Artifact> blacklistedProtos = NestedSetBuilder.stableOrder(); for (TransitiveInfoCollection protos : ruleContext.getPrerequisites("blacklisted_protos", TARGET)) { ProtoInfo protoInfo = protos.get(ProtoInfo.PROVIDER); if (protoInfo == null && ruleContext .getFragment(ProtoConfiguration.class) .blacklistedProtosRequiresProtoInfo()) { ruleContext.ruleError( "'" + ruleContext.getLabel().toString() + "' does not have mandatory provider 'ProtoInfo'."); } if (protoInfo != null) { blacklistedProtos.addTransitive(protoInfo.getOriginalTransitiveProtoSources()); } else { blacklistedProtos.addTransitive(protos.getProvider(FileProvider.class).getFilesToBuild()); } } return new RuleConfiguredTargetBuilder(ruleContext) .addProvider( ProtoLangToolchainProvider.create( ruleContext.attributes().get("command_line", Type.STRING), ruleContext.getPrerequisite("plugin", HOST, FilesToRunProvider.class), ruleContext.getPrerequisite("runtime", TARGET), blacklistedProtos.build())) .setFilesToBuild(NestedSetBuilder.<Artifact>emptySet(STABLE_ORDER)) .addProvider(RunfilesProvider.simple(Runfiles.EMPTY)) .build(); }
Source:
private ExporterJob createCVSExportJob(final File outputFile) { ExporterJob result = new ExporterJob("Export project") { @Override protected IStatus run() { OutputStream outputStream = null; try { outputFile.createNewFile(); outputStream = new BufferedOutputStream(new FileOutputStream(outputFile)); GanttCSVExport exporter = new GanttCSVExport(getProject(), ((GanttProject) getProject()).getGanttOptions().getCSVOptions()); exporter.save(outputStream, myFileTypeOption.proposeFileExtension()); } catch (IOException e) { getUIFacade().showErrorDialog(e); return Status.CANCEL_STATUS; } finally { if (outputStream != null) { try { outputStream.close(); } catch (IOException e) { GPLogger.logToLogger(e); } } } return Status.OK_STATUS; } }; return result; }

Target:
private ExporterJob createCVSExportJob(final File outputFile) { ExporterJob result = new ExporterJob("Export project") { @Override protected IStatus run() { OutputStream outputStream = null; try { outputFile.createNewFile(); outputStream = new BufferedOutputStream(new FileOutputStream(outputFile)); CSVOptions csvOptions = ((GanttProject) getProject()).getGanttOptions().getCSVOptions(); GanttCSVExport exporter = new GanttCSVExport(getProject(), csvOptions); exporter.save(outputStream, myFileTypeOption.proposeFileExtension()); } catch (IOException e) { getUIFacade().showErrorDialog(e); return Status.CANCEL_STATUS; } finally { if (outputStream != null) { try { outputStream.close(); } catch (IOException e) { GPLogger.logToLogger(e); } } } return Status.OK_STATUS; } }; return result; }
Source:
public void validateLotNotes(final List<String> notes, final BindingResult errors) { if (notes.stream().anyMatch(s -> StringUtils.isBlank(s))) { errors.reject("lot.input.list.notes.null.or.empty", ""); throw new ApiRequestValidationException(errors.getAllErrors()); } final List<String> filteredNotes = notes.stream().filter(loteNotes -> loteNotes.length() > LOT_NOTES_MAX_LENGTH).map(s -> s).collect(Collectors.toList()); if (!Collections.isEmpty(filteredNotes)) { errors.reject("lot.notes.length", ""); throw new ApiRequestValidationException(errors.getAllErrors()); } }

Target:
public void validateLotNotes(final List<String> notes, final BindingResult errors) { if (notes.stream().filter(s -> StringUtils.isBlank(s)).findAny().isPresent()) { errors.reject("lot.input.list.notes.null.or.empty", ""); throw new ApiRequestValidationException(errors.getAllErrors()); } final List<String> filteredNotes = notes.stream().filter(loteNotes -> loteNotes.length() > LOT_NOTES_MAX_LENGTH).map(s -> s).collect(Collectors.toList()); if (!Collections.isEmpty(filteredNotes)) { errors.reject("lot.notes.length", ""); throw new ApiRequestValidationException(errors.getAllErrors()); } }
Source:
public AlteredFiles(Project project, String diff) { this.project = project; changedFilesStatuses = new LinkedHashMap<>(); if (!"".equals(diff)) { for (String item : diff.split("\n")) { changedFilesStatuses.put(item.substring(2, item.length()), defineStatus(item.substring(0, 1))); } } changedFilesList = new ArrayList<>(changedFilesStatuses.keySet()); }

Target:
public AlteredFiles(Project project, String diff) { this.project = project; alteredFilesStatuses = new LinkedHashMap<>(); if (!isNullOrEmpty(diff)) { for (String item : diff.split("\n")) { if (item.length() < 3 || item.charAt(1) != '\t') { throw new IllegalArgumentException("Invalid git diff format. Invalid record: " + item); } alteredFilesStatuses.put( item.substring(2, item.length()), defineStatus(item.substring(0, 1))); } } alteredFilesList = new ArrayList<>(alteredFilesStatuses.keySet()); }
Source:
public void deliverResult(List<Entity<TreeReference>> entities, List<TreeReference> references) { loader = null; Detail detail = session.getDetail(selectDatum.getShortDetail()); int[] order = detail.getSortOrder(); for(int i = 0 ; i < detail.getFields().length ; ++i) { String header = detail.getFields()[i].getHeader().evaluate(); if(order.length == 0 && !"".equals(header)) { order = new int[] {i}; } } ListView view = ((ListView)this.findViewById(R.id.screen_entity_select_list)); System.out.println("717 in aweomse select : " + inAwesomeMode); adapter = new EntityListAdapter(EntitySelectActivity.this, detail, references, entities, order, tts, this); view.setAdapter(adapter); findViewById(R.id.entity_select_loading).setVisibility(View.GONE); if(adapter != null) { adapter.applyFilter(filterString); } if(inAwesomeMode) { updateSelectedItem(true); } }

Target:
public void deliverResult(List<Entity<TreeReference>> entities, List<TreeReference> references) { loader = null; Detail detail = session.getDetail(selectDatum.getShortDetail()); int[] order = detail.getSortOrder(); for(int i = 0 ; i < detail.getFields().length ; ++i) { String header = detail.getFields()[i].getHeader().evaluate(); if(order.length == 0 && !"".equals(header)) { order = new int[] {i}; } } ListView view = ((ListView)this.findViewById(R.id.screen_entity_select_list)); adapter = new EntityListAdapter(EntitySelectActivity.this, detail, references, entities, order, tts, this); view.setAdapter(adapter); findViewById(R.id.entity_select_loading).setVisibility(View.GONE); if(adapter != null) { adapter.applyFilter(filterString); } if(inAwesomeMode) { updateSelectedItem(true); } }
Source:
public Map<String, String> connectorConfig(String connName) { FutureCallback<Map<String, String>> connectorConfigCallback = new FutureCallback<>(); herder.connectorConfig(connName, connectorConfigCallback); try { Map<String, String> result = connectorConfigCallback.get(herderRequestTimeoutMs, TimeUnit.MILLISECONDS); return new HashMap<>(result); } catch (InterruptedException | ExecutionException | TimeoutException e) { throw new ConnectException( String.format("Failed to retrieve configuration for connector '%s'", connName), e ); } }

Target:
public Map<String, String> connectorConfig(String connName) { FutureCallback<Map<String, String>> connectorConfigCallback = new FutureCallback<>(); herder.connectorConfig(connName, connectorConfigCallback); try { return new HashMap<>(connectorConfigCallback.get(herderRequestTimeoutMs, TimeUnit.MILLISECONDS)); } catch (InterruptedException | ExecutionException | TimeoutException e) { throw new ConnectException( String.format("Failed to retrieve configuration for connector '%s'", connName), e ); } }
Source:
protected Set<byte[]> executeOperation(Transport transport) { HeaderParams params = writeHeader(transport, BULK_GET_KEYS_REQUEST); transport.flush(); System.out.println("hello"); readHeaderAndValidate(transport, params); System.out.println("validated"); Set<byte[]> result = new HashSet<byte[]>(); while ( transport.readByte() == 1) { result.add(transport.readArray()); } return result; }

Target:
protected Set<byte[]> executeOperation(Transport transport) { HeaderParams params = writeHeader(transport, BULK_GET_KEYS_REQUEST); transport.flush(); readHeaderAndValidate(transport, params); Set<byte[]> result = new HashSet<byte[]>(); while ( transport.readByte() == 1) { result.add(transport.readArray()); } return result; }
Source:
public String toString() { String implKind = MethodHandleInfo.referenceKindToString(implMethodKind); return String.format("SerializedLambda[%s=%s, %s=%s.%s:%s, " + "%s=%s %s.%s:%s, %s=%s, %s=%d]", "capturingClass", capturingClass, "functionalInterfaceMethod", functionalInterfaceClass, functionalInterfaceMethodName, functionalInterfaceMethodSignature, "implementation", implKind, implClass, implMethodName, implMethodSignature, "instantiatedMethodType", instantiatedMethodType, "numCaptured", capturedArgs.length); }

Target:
public String toString() { String implKind = MethodHandleInfo.referenceKindToString(implMethodKind); return "SerializedLambda[capturingClass=" + capturingClass + ", functionalInterfaceMethod=" + functionalInterfaceClass + "." + functionalInterfaceMethodName + ":" + functionalInterfaceMethodSignature + ", " + "implementation=" + implKind + " " + implClass + "." + implMethodName + ":" + implMethodSignature + ", instantiatedMethodType=" + instantiatedMethodType + ", numCaptured=" + capturedArgs.length + "]"; }
Source:
public void testSplitOmitEmptyLine() { List<String> clazzNames = Utils.splitClassNames("", ","); Arrays.equals(clazzNames.toArray(new String[2]), null); clazzNames = Utils.splitClassNames("a,b", ","); Arrays.equals(clazzNames.toArray(new String[2]), new String[]{"a", "b"}); clazzNames = Utils.splitClassNames("a,b,", ","); Arrays.equals(clazzNames.toArray(new String[2]), new String[]{"a", "b"}); clazzNames = Utils.splitClassNames("a, b,", ","); Arrays.equals(clazzNames.toArray(new String[2]), new String[]{"a", "b"}); }

Target:
public void testSplitOmitEmptyLine() { List<String> clazzNames = Utils.splitClassNames("", ","); Assert.assertEquals(Collections.<String>emptyList(), clazzNames); clazzNames = Utils.splitClassNames("a,b", ","); Assert.assertEquals(Arrays.asList("a", "b"), clazzNames); clazzNames = Utils.splitClassNames("a,b,", ","); Assert.assertEquals(Arrays.asList("a", "b"), clazzNames); clazzNames = Utils.splitClassNames("a, b,", ","); Assert.assertEquals(Arrays.asList("a", "b"), clazzNames); }
Source:
public List<Object> getJustificationList() { return Collections.unmodifiableList(justificationList); }

Target:
public List<Object> getJustificationList() { return justificationList; }
Source:
private String actResponse( final URI home, final String method, final String... headers ) throws IOException { return new RsPrint(new TkProxy( String.format( FORMAT, home.getHost(), home.getPort() ) ).act( new RqWithHeaders( new RqFake( method, DASH ), headers ) ) ).print(); }

Target:
private String actResponse( final URI home, final String method, final String... headers ) throws IOException { return new RsPrint(new TkProxy( proxy(home) ).act( new RqWithHeaders( new RqFake( method, "/" ), headers ) ) ).print(); }
Source:
void write(ChannelOutboundInvoker out, ChannelPromise promise, ByteBufAllocator allocator) throws IOException { Consumer<ByteBuf> consumer = (bb) -> { bb.writeInt(credit); receiverId.writeTo(bb); }; writeToChannel(out, promise, allocator, consumer, ID, LENGTH); }

Target:
void write(ChannelOutboundInvoker out, ChannelPromise promise, ByteBufAllocator allocator) throws IOException { ByteBuf result = null; try { result = allocateBuffer(allocator, ID, 4 + 16); result.writeInt(credit); receiverId.writeTo(result); out.write(result, promise); } catch (Throwable t) { handleException(result, null, t); } }
Source:
public AbstractFlatTextFormatParser( @Nullable final String listDelimiter, @Nullable final Map<String, String> multiValueDelimiter, final boolean hasHeaderRow, final int maxSkipHeaderRows ) { this.listDelimiter = listDelimiter != null ? listDelimiter : Parsers.DEFAULT_LIST_DELIMITER; this.multiValueDelimiter = multiValueDelimiter; this.multiValueTransformer = new Maps.EntryTransformer<String, String, Object>() { @Override public Object transformEntry(String key, String value) { String deli = null; if (AbstractFlatTextFormatParser.this.multiValueDelimiter == null) { deli = AbstractFlatTextFormatParser.this.listDelimiter; } else if (AbstractFlatTextFormatParser.this.multiValueDelimiter.get(key) != null) { deli = AbstractFlatTextFormatParser.this.multiValueDelimiter.get(key); } if (deli != null && value.contains(deli)) { Splitter multiSplitter = Splitter.on(deli); return StreamSupport.stream(multiSplitter.split(value).spliterator(), false) .map(Strings::emptyToNull) .collect(Collectors.toList()); } else { return Strings.emptyToNull(value); } } }; this.hasHeaderRow = hasHeaderRow; this.maxSkipHeaderRows = maxSkipHeaderRows; }

Target:
public AbstractFlatTextFormatParser( @Nullable final String listDelimiter, @Nullable final Map<String, String> multiValueDelimiter, final boolean hasHeaderRow, final int maxSkipHeaderRows ) { this.listDelimiter = listDelimiter != null ? listDelimiter : Parsers.DEFAULT_LIST_DELIMITER; this.multiValueDelimiter = multiValueDelimiter; this.deliSpliterMap = new HashMap<>(); this.hasHeaderRow = hasHeaderRow; this.maxSkipHeaderRows = maxSkipHeaderRows; }
Source:
@Override public int read(byte[] buffer) throws IOException { if (offset + buffer.length >= limit) { setLimit(2 * (offset + buffer.length)); } int count = in.read(buffer); if (count != -1) { offset += count; } return count; }

Target:
@Override public int read(byte[] buffer) throws IOException { if (!allowExpire && (offset + buffer.length > limit)) { setLimit(offset + buffer.length + limitIncrement); } int count = in.read(buffer); if (count != -1) { offset += count; } return count; }
Source:
protected RowExpression visitSymbolReference(SymbolReference node, Void context) { Integer field = layout.get(Symbol.from(node)); if (field != null) { return field(field, getType(node)); } return new VariableReferenceExpression(node.getName(), getType(node)); }

Target:
protected RowExpression visitSymbolReference(SymbolReference node, Void context) { Integer channel = layout.get(Symbol.from(node)); if (channel != null) { return field(channel, getType(node)); } return new VariableReferenceExpression(node.getName(), getType(node)); }
Source:
private static void registerResources( TimeLockServerConfiguration configuration, Environment environment, TimeLockServer serverImpl) { Map<String, TimeLockServices> clientToServices = ImmutableMap.copyOf(Maps.asMap( configuration.clients(), client -> serverImpl.createInvalidatingTimeLockServices(client, configuration.slowLockLogTriggerMillis()))); environment.getObjectMapper().registerModule(new Jdk8Module()); environment.jersey().register( HttpRemotingJerseyFeature.with(HttpRemotingJerseyFeature.StacktracePropagation.PROPAGATE)); environment.jersey().register(new TimeLockResource(clientToServices)); }

Target:
private static void registerResources( TimeLockServerConfiguration configuration, Environment environment, TimeLockServer serverImpl) { Map<String, TimeLockServices> clientToServices = ImmutableMap.copyOf(Maps.asMap( configuration.clients(), client -> serverImpl.createInvalidatingTimeLockServices(client, configuration.slowLockLogTriggerMillis()))); environment.getObjectMapper().registerModule(new Jdk8Module()); environment.jersey().register(HttpRemotingJerseyFeature.DEFAULT); environment.jersey().register(new TimeLockResource(clientToServices)); }
Source:
public void setSizes(String... sizes) { if (this.sizes == null) { this.sizes = new ArrayList<>(); } this.sizes.clear(); this.sizes.addAll(Arrays.asList(sizes)); }

Target:
public void setSizes(String... sizes) { if (this.sizes == null) { this.sizes = new ArrayList<>(); } else { this.sizes.clear(); } this.sizes.addAll(Arrays.asList(sizes)); }
Source:
private void handlePackError(IOException e, PackFile p) { String warnTmpl = null; if ((e instanceof CorruptObjectException) || (e instanceof PackInvalidException)) { warnTmpl = JGitText.get().corruptPack; removePack(p); } else if (e instanceof FileNotFoundException) { if (!p.getPackFile().exists()) { warnTmpl = JGitText.get().packWasDeleted; } removePack(p); } else if (FileUtils.isStaleFileHandle(e)) { warnTmpl = JGitText.get().packHandleIsStale; removePack(p); } if (warnTmpl != null) { if (LOG.isDebugEnabled()) { LOG.debug(MessageFormat.format(warnTmpl, p.getPackFile().getAbsolutePath()), e); } else { LOG.warn(MessageFormat.format(warnTmpl, p.getPackFile().getAbsolutePath())); } } else { LOG.error(MessageFormat.format( JGitText.get().exceptionWhileReadingPack, p.getPackFile() .getAbsolutePath()), e); } }

Target:
private void handlePackError(IOException e, PackFile p) { String warnTmpl = null; if ((e instanceof CorruptObjectException) || (e instanceof PackInvalidException)) { warnTmpl = JGitText.get().corruptPack; removePack(p); } else if (e instanceof FileNotFoundException) { if (!p.getPackFile().exists()) { warnTmpl = JGitText.get().packInaccessible; } removePack(p); } else if (FileUtils.isStaleFileHandle(e)) { warnTmpl = JGitText.get().packHandleIsStale; removePack(p); } if (warnTmpl != null) { if (LOG.isDebugEnabled()) { LOG.debug(MessageFormat.format(warnTmpl, p.getPackFile().getAbsolutePath()), e); } else { LOG.warn(MessageFormat.format(warnTmpl, p.getPackFile().getAbsolutePath())); } } else { LOG.error(MessageFormat.format( JGitText.get().exceptionWhileReadingPack, p.getPackFile() .getAbsolutePath()), e); } }
Source:
public void getConceptsCount_shouldGetCorrectConceptCount() { mDatabase.conceptRoomDAO().saveConcept(expectedConceptEntity1); mDatabase.conceptRoomDAO().saveConcept(expectedConceptEntity2); mDatabase.conceptRoomDAO().getConceptsCount() .test() .assertValue(aLong -> Objects.equals(aLong, 2L)); }

Target:
public void getConceptsCount_shouldGetCorrectConceptCount() { mDatabase.conceptRoomDAO().saveConcept(expectedConceptEntity1); mDatabase.conceptRoomDAO().saveConcept(expectedConceptEntity2); mDatabase.conceptRoomDAO().getConceptsCount() .test() .assertValue(actualConceptsCount -> Objects.equals(actualConceptsCount, 2L)); }
Source:
public Object perform(InvocationContext ctx) throws Throwable { MVCCEntry<Object, Object> e = (MVCCEntry) ctx.lookupEntry(key); if (e == null) { throw new IllegalStateException("Not wrapped"); } Object oldValue = e.getValue(); if (oldValue != null) { Object newValue = remappingBiFunction.apply(key, oldValue); if (newValue != null) { notifier.notifyCacheEntryModified(key, newValue, metadata, oldValue, e.getMetadata(), true, ctx, this); e.setChanged(true); e.setValue(newValue); Metadatas.updateMetadata(e, metadata); return newValue; } else { notifier.notifyCacheEntryRemoved(key, oldValue, e.getMetadata(), true, ctx, this); e.setRemoved(true); e.setValid(false); e.setChanged(true); e.setValue(null); return null; } } else if (!computeIfPresent) { Object newValue = remappingBiFunction.apply(key, oldValue); notifier.notifyCacheEntryCreated(key, newValue, metadata, true, ctx, this); e.setValue(newValue); e.setChanged(true); Metadatas.updateMetadata(e, metadata); if (e.isRemoved()) { e.setCreated(true); e.setExpired(false); e.setRemoved(false); e.setValid(true); } return newValue; } return oldValue; }

Target:
public Object perform(InvocationContext ctx) throws Throwable { MVCCEntry<Object, Object> e = (MVCCEntry) ctx.lookupEntry(key); if (e == null) { throw new IllegalStateException("Not wrapped"); } Object oldValue = e.getValue(); Object newValue; if(computeIfPresent && oldValue == null) { successful = true; return oldValue; } try { newValue = remappingBiFunction.apply(key, oldValue); } catch (RuntimeException ex) { throw new UserRaisedFunctionalException(ex); } if (oldValue == null && newValue == null) { successful = true; return null; } Object computeResult = newValue; if (oldValue != null) { if (newValue != null) { notifier.notifyCacheEntryModified(key, newValue, metadata, oldValue, e.getMetadata(), true, ctx, this); e.setChanged(true); e.setValue(newValue); Metadatas.updateMetadata(e, metadata); } else { notifier.notifyCacheEntryRemoved(key, oldValue, e.getMetadata(), true, ctx, this); e.setRemoved(true); e.setValid(false); e.setChanged(true); e.setValue(null); } } else { notifier.notifyCacheEntryCreated(key, newValue, metadata, true, ctx, this); e.setValue(newValue); e.setChanged(true); Metadatas.updateMetadata(e, metadata); if (e.isRemoved()) { e.setCreated(true); e.setExpired(false); e.setRemoved(false); e.setValid(true); } } successful = true; return computeResult; }
Source:
public String getQuestionAdditionalInfoHtml(int questionNumber, String additionalInfoId) { StringBuilder optionListHtml = new StringBuilder(200); String optionFragmentTemplate = FormTemplates.MSQ_ADDITIONAL_INFO_FRAGMENT; if (generateOptionsFor != FeedbackParticipantType.NONE) { String optionHelpText = String.format( "<br>The options for this question is automatically generated from the list of all %s in this course.", generateOptionsFor.toString().toLowerCase()); optionListHtml.append(optionHelpText); } if (!msqChoices.isEmpty()) { optionListHtml.append("<ul style=\"list-style-type: disc;margin-left: 20px;\" >"); for (int i = 0; i < msqChoices.size(); i++) { String optionFragment = Templates.populateTemplate(optionFragmentTemplate, Slots.MSQ_CHOICE_VALUE, SanitizationHelper.sanitizeForHtml(msqChoices.get(i))); optionListHtml.append(optionFragment); } if (otherEnabled) { String optionFragment = Templates.populateTemplate(optionFragmentTemplate, Slots.MSQ_CHOICE_VALUE, "Other"); optionListHtml.append(optionFragment); } optionListHtml.append("</ul>"); } String additionalInfo = Templates.populateTemplate( FormTemplates.MSQ_ADDITIONAL_INFO, Slots.QUESTION_TYPE_NAME, this.getQuestionTypeDisplayName(), Slots.MSQ_ADDITIONAL_INFO_FRAGMENTS, optionListHtml.toString()); return Templates.populateTemplate( FormTemplates.FEEDBACK_QUESTION_ADDITIONAL_INFO, Slots.MORE, "[more]", Slots.LESS, "[less]", Slots.QUESTION_NUMBER, Integer.toString(questionNumber), Slots.ADDITIONAL_INFO_ID, additionalInfoId, Slots.QUESTION_ADDITIONAL_INFO, additionalInfo); }

Target:
public String getQuestionAdditionalInfoHtml(int questionNumber, String additionalInfoId) { StringBuilder optionListHtml = new StringBuilder(200); String optionFragmentTemplate = FormTemplates.MSQ_ADDITIONAL_INFO_FRAGMENT; if (generateOptionsFor != FeedbackParticipantType.NONE) { String optionHelpText = String.format( "<br>The options for this question is automatically generated from the list of all %s in this course.", generateOptionsFor.toString().toLowerCase()); optionListHtml.append(optionHelpText); } else if (!msqChoices.isEmpty()) { optionListHtml.append("<ul style=\"list-style-type: disc;margin-left: 20px;\" >"); for (String msqChoice : msqChoices) { String optionFragment = Templates.populateTemplate(optionFragmentTemplate, Slots.MSQ_CHOICE_VALUE, SanitizationHelper.sanitizeForHtml(msqChoice)); optionListHtml.append(optionFragment); } if (otherEnabled) { String optionFragment = Templates.populateTemplate(optionFragmentTemplate, Slots.MSQ_CHOICE_VALUE, "Other"); optionListHtml.append(optionFragment); } optionListHtml.append("</ul>"); } String additionalInfo = Templates.populateTemplate( FormTemplates.MSQ_ADDITIONAL_INFO, Slots.QUESTION_TYPE_NAME, this.getQuestionTypeDisplayName(), Slots.MSQ_ADDITIONAL_INFO_FRAGMENTS, optionListHtml.toString()); return Templates.populateTemplate( FormTemplates.FEEDBACK_QUESTION_ADDITIONAL_INFO, Slots.MORE, "[more]", Slots.LESS, "[less]", Slots.QUESTION_NUMBER, Integer.toString(questionNumber), Slots.ADDITIONAL_INFO_ID, additionalInfoId, Slots.QUESTION_ADDITIONAL_INFO, additionalInfo); }
Source:
public T deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException { JsonNode root = jsonParser.getCodec().readTree(jsonParser); T tupelStore = deserialize(root); ObjectNode tuplesObject = (ObjectNode) root.get("tuples"); Map<String, Collection<Tuple>> tuples = jsonParser.getCodec().readValue(jsonParser.getCodec().treeAsTokens(tuplesObject), TR); tupelStore.putAll(concat(tuples.values())); return tupelStore; }

Target:
public T deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException { JsonNode root = jsonParser.getCodec().readTree(jsonParser); T tupleStore = deserialize(root); ObjectNode tuplesObject = (ObjectNode) root.get("tuples"); Map<String, Collection<Tuple>> tuples = jsonParser.getCodec().readValue(jsonParser.getCodec().treeAsTokens(tuplesObject), TR); tupleStore.putAll(concat(tuples.values())); return tupleStore; }
Source:
public ActiveMQBuffer encode(CoreRemotingConnection connection) { if (connection != null && connection.getTransportConnection() instanceof NettyConnection) { ActiveMQBuffer buffer; int bufferSize = expectedEncodeSize(); if (fileId != -1 && dataSize > 0) { bufferSize -= dataSize; } buffer = createPacket(connection, bufferSize); encodeHeader(buffer); encodeRest(buffer, connection); encodeSize(buffer, expectedEncodeSize()); return fileId != -1 && dataSize > 0 ? new FileDelegatedChannelBufferWrapper(file, offset, dataSize, buffer) : buffer; } else { ActiveMQBuffer buffer = createPacket(connection); encodeHeader(buffer); encodeRest(buffer, connection); if (fileId != -1 && dataSize > 0) { readFile(buffer.toByteBuffer(buffer.writerIndex(), buffer.writableBytes())); buffer.writerIndex(buffer.capacity()); } encodeSize(buffer); return buffer; } }

Target:
public ActiveMQBuffer encode(CoreRemotingConnection connection) { if (fileId != -1 && dataSize > 0) { ActiveMQBuffer buffer; int bufferSize = expectedEncodeSize(); int encodedSize = bufferSize; boolean isNetty = false; if (connection != null && connection.getTransportConnection() instanceof NettyConnection) { bufferSize -= dataSize; isNetty = true; } buffer = createPacket(connection, bufferSize); encodeHeader(buffer); encodeRest(buffer, connection); if (!isNetty) { ByteBuffer byteBuffer; if (buffer.byteBuf() != null && buffer.byteBuf().nioBufferCount() == 1) { byteBuffer = buffer.byteBuf().internalNioBuffer(buffer.writerIndex(), buffer.writableBytes()); } else { byteBuffer = buffer.toByteBuffer(buffer.writerIndex(), buffer.writableBytes()); } readFile(byteBuffer); buffer.writerIndex(buffer.capacity()); } encodeSize(buffer, encodedSize); return buffer; } else { return super.encode(connection); } }
Source:
public Response putReport(@BeanParam final Coordinates coordinates, final List<JUnitFeature> root) { final MongoDatabase bdd = this.client.getDatabase("bdd"); final FeatureMapper featureMapper = new FeatureMapper(this.imageDao); this.summaryDao.updateSummary(coordinates); List<XbddFeature> mappedFeatures = root.stream().map(feature -> featureMapper.map(feature, coordinates)).collect(Collectors.toList()); this.featureDao.saveFeatures(mappedFeatures); List<XbddFeature> persistedFeatures = this.featureDao.getFeatures(coordinates); this.statsDao.updateStatsForFeatures(coordinates, persistedFeatures); return Response.ok(SerializerUtil.serialise(persistedFeatures)).build(); }

Target:
public Response putReport(@BeanParam final Coordinates coordinates, final List<JUnitFeature> root) { final FeatureMapper featureMapper = new FeatureMapper(this.imageDao); this.summaryDao.updateSummary(coordinates); List<XbddFeature> mappedFeatures = root.stream().map(feature -> featureMapper.map(feature, coordinates)).collect(Collectors.toList()); this.featureDao.saveFeatures(mappedFeatures); List<XbddFeature> persistedFeatures = this.featureDao.getFeatures(coordinates); this.statsDao.updateStatsForFeatures(coordinates, persistedFeatures); return Response.ok(persistedFeatures).build(); }
Source:
public static OGCGeometry deserialize(Slice shape) { requireNonNull(shape, "shape is null"); int wkid = shape.getInt(0); ByteBuffer shapeBuffer = getShapeByteBuffer(shape); if (shapeBuffer.limit() < 4) { return null; } else { if (shapeBuffer.getInt(0) == Geometry.Type.Unknown.value()) { return null; } else { SpatialReference spatialReference = null; if (wkid != WKID_UNKNOWN) { spatialReference = SpatialReference.create(wkid); } Geometry esriGeom = OperatorImportFromESRIShape.local().execute(0, Geometry.Type.Unknown, shapeBuffer); OGCGeometry createdGeom = OGCGeometry.createFromEsriGeometry(esriGeom, spatialReference); return createdGeom; } } }

Target:
public static OGCGeometry deserialize(Slice shape) { if (shape == null) { return null; } BasicSliceInput input = shape.getInput(); int spatialReferenceId = input.readInt(); SpatialReference spatialReference = null; if (spatialReferenceId != SPATIAL_REFERENCE_UNKNOWN) { spatialReference = SpatialReference.create(spatialReferenceId); } List<OGCGeometry> geometries = new ArrayList<>(); while (input.available() > 0) { int length = input.readInt(); ByteBuffer buffer = input.readSlice(length).toByteBuffer().slice().order(LITTLE_ENDIAN); Geometry esriGeometry = local().execute(0, Unknown, buffer); OGCGeometry geometry = createFromEsriGeometry(esriGeometry, spatialReference); geometries.add(geometry); } if (geometries.isEmpty()) { return new OGCConcreteGeometryCollection(emptyList(), spatialReference); } else if (geometries.size() == 1) { return geometries.get(0); } return new OGCConcreteGeometryCollection(geometries, spatialReference); }
Source:
public void onBindViewHolder(ViewHolder holder, Repository repository) { holder.tvTitle.setText(repository.owner().login() + "/" + repository.name()); if (!StringUtils.isBlank(repository.description())) { holder.tvDesc.setVisibility(View.VISIBLE); holder.tvDesc.setText( EmojiParser.parseToUnicode(StringUtils.doTeaser(repository.description()))); } else { holder.tvDesc.setVisibility(View.GONE); } holder.tvLanguage.setText(repository.language() != null ? repository.language() : mContext.getString(R.string.unknown)); holder.tvForks.setText(String.valueOf(repository.forksCount())); holder.tvStars.setText(String.valueOf(repository.subscribersCount())); holder.tvSize.setText(Formatter.formatFileSize(mContext, 1024L * repository.size())); holder.tvPrivate.setVisibility(repository.isPrivate() ? View.VISIBLE : View.GONE); holder.tvFork.setVisibility(repository.isFork() ? View.VISIBLE : View.GONE); }

Target:
public void onBindViewHolder(ViewHolder holder, Repository repository) { holder.tvTitle.setText(repository.owner().login() + "/" + repository.name()); if (!StringUtils.isBlank(repository.description())) { holder.tvDesc.setVisibility(View.VISIBLE); holder.tvDesc.setText( EmojiParser.parseToUnicode(StringUtils.doTeaser(repository.description()))); } else { holder.tvDesc.setVisibility(View.GONE); } holder.tvLanguage.setText(repository.language() != null ? repository.language() : mContext.getString(R.string.unknown)); holder.tvForks.setText(String.valueOf(repository.forksCount())); holder.tvStars.setText(String.valueOf(repository.stargazersCount())); holder.tvSize.setText(Formatter.formatFileSize(mContext, 1024L * repository.size())); holder.tvPrivate.setVisibility(repository.isPrivate() ? View.VISIBLE : View.GONE); holder.tvFork.setVisibility(repository.isFork() ? View.VISIBLE : View.GONE); }