auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void getAllReviewsForExpertMustReturnEmptyListIfNoReviewsHaveBeenSubmitted() { Integer expertId = 1; DiseaseGroup diseaseGroup = createDiseaseGroup(); List<DiseaseOccurrenceReview> reviews = diseaseOccurrenceReviewDao.getByExpertIdAndDiseaseGroupId(expertId, diseaseGroup.getId()); assertThat(reviews).isEmpty(); assertThat(reviews).hasSize(0); assertThat(reviews).isNotNull(); }

Target:
public void getAllReviewsForExpertMustReturnEmptyListIfNoReviewsHaveBeenSubmitted() { Integer expertId = 1; DiseaseGroup diseaseGroup = createDiseaseGroup(); List<DiseaseOccurrenceReview> reviews = diseaseOccurrenceReviewDao.getByExpertIdAndDiseaseGroupId(expertId, diseaseGroup.getId()); assertThat(reviews).isNotNull(); assertThat(reviews).isEmpty(); }
Source:
public QueryDefinition replaceQuery(KieServerConnectionInfo connectionInfo, QueryDefinition queryDefinition) { Client client = ClientBuilder.newClient(); WebTarget target = requestForQueryDefinition(connectionInfo, queryDefinition.getName(), client); return target.request() .accept(MEDIA_TYPE) .put(Entity.entity(queryDefinition, MEDIA_TYPE), QueryDefinition.class); }

Target:
public QueryDefinition replaceQuery(KieServerConnectionInfo connectionInfo, QueryDefinition queryDefinition) { Client client = ClientBuilder.newClient(); WebTarget target = requestForQueryDefinition(connectionInfo, queryDefinition.getName(), client); QueryDefinition def = target.request() .accept(REQUEST_MEDIA_TYPE) .put(Entity.entity(queryDefinition, REQUEST_MEDIA_TYPE), QueryDefinition.class); client.close(); return def; }
Source:
@Test public void initializerBlockInRightPlace() { TypeSpec taco = TypeSpec.classBuilder("Taco") .addField(String.class, "mFoo", Modifier.PRIVATE) .addField(String.class, "FOO", Modifier.PRIVATE, Modifier.STATIC, Modifier.FINAL) .addStaticBlock(CodeBlock.builder() .addStatement("FOO = $S", "FOO") .build()) .addMethod(MethodSpec.constructorBuilder().build()) .addMethod(MethodSpec.methodBuilder("toString") .addAnnotation(Override.class) .addModifiers(Modifier.PUBLIC) .returns(String.class) .addCode("return FOO;\n") .build()) .addInitializerBlock(CodeBlock.builder() .addStatement("mFoo = $S", "FOO") .build()) .build(); assertThat(toString(taco)).isEqualTo("" + "package com.squareup.tacos;\n" + "\n" + "import java.lang.Override;\n" + "import java.lang.String;\n" + "\n" + "class Taco {\n" + " private static final String FOO;\n\n" + " static {\n" + " FOO = \"FOO\";\n" + " }\n\n" + " private String mFoo;\n\n" + " {\n" + " mFoo = \"FOO\";\n" + " }\n\n" + " Taco() {\n" + " }\n\n" + " @Override\n" + " public String toString() {\n" + " return FOO;\n" + " }\n" + "}\n"); }

Target:
@Test public void initializerBlockInRightPlace() { TypeSpec taco = TypeSpec.classBuilder("Taco") .addField(String.class, "foo", Modifier.PRIVATE) .addField(String.class, "FOO", Modifier.PRIVATE, Modifier.STATIC, Modifier.FINAL) .addStaticBlock(CodeBlock.builder() .addStatement("FOO = $S", "FOO") .build()) .addMethod(MethodSpec.constructorBuilder().build()) .addMethod(MethodSpec.methodBuilder("toString") .addAnnotation(Override.class) .addModifiers(Modifier.PUBLIC) .returns(String.class) .addCode("return FOO;\n") .build()) .addInitializerBlock(CodeBlock.builder() .addStatement("foo = $S", "FOO") .build()) .build(); assertThat(toString(taco)).isEqualTo("" + "package com.squareup.tacos;\n" + "\n" + "import java.lang.Override;\n" + "import java.lang.String;\n" + "\n" + "class Taco {\n" + " private static final String FOO;\n" + "\n" + " static {\n" + " FOO = \"FOO\";\n" + " }\n" + "\n" + " private String foo;\n" + "\n" + " {\n" + " foo = \"FOO\";\n" + " }\n" + "\n" + " Taco() {\n" + " }\n" + "\n" + " @Override\n" + " public String toString() {\n" + " return FOO;\n" + " }\n" + "}\n"); }
Source:
void fun() { Object test = new Object[]{"1"}; String[] test2 = new Object[]{"1"}; Object[] test3 = new String[]{"1"}; System.out.println(((Object[])test)[0]); System.out.println(((Object[])test2)[0]); System.out.println(((String[])test3)[0]); }

Target:
void fun() { Object test = new Object[]{"1"}; String[] test2 = new String[]{"1"}; Object[] test3 = new String[]{"1"}; System.out.println(((Object[])test)[0]); System.out.println(((Object[])test2)[0]); System.out.println(((String[])test3)[0]); }
Source:
CRSConstraint() { }

Target:
public CRSConstraint() { }
Source:
public IBinding unmarshalBinding(ITypeMarshalBuffer buffer) throws CoreException { short firstBytes= buffer.getShort(); switch ((firstBytes & ITypeMarshalBuffer.KIND_MASK)) { case ITypeMarshalBuffer.UNKNOWN_MEMBER: return CPPUnknownMember.unmarshal(getPDOM(), firstBytes, buffer); case ITypeMarshalBuffer.UNKNOWN_MEMBER_CLASS_INSTANCE: return CPPUnknownClassInstance.unmarshal(getPDOM(), firstBytes, buffer); case ITypeMarshalBuffer.DEFERRED_CLASS_INSTANCE: return CPPDeferredClassInstance.unmarshal(getPDOM(), firstBytes, buffer); case ITypeMarshalBuffer.DEFERRED_FUNCTION: return CPPDeferredFunction.unmarshal(firstBytes, buffer); case ITypeMarshalBuffer.DEPENDENT_EXPRESSION_TYPE: IType type= TypeOfDependentExpression.unmarshal(firstBytes, buffer); if (type instanceof IBinding) return (IBinding) type; break; } throw new CoreException(CCorePlugin.createStatus("Cannot unmarshal a binding, first bytes=" + firstBytes)); }

Target:
public IBinding unmarshalBinding(ITypeMarshalBuffer buffer) throws CoreException { short firstBytes= buffer.getShort(); switch ((firstBytes & ITypeMarshalBuffer.KIND_MASK)) { case ITypeMarshalBuffer.UNKNOWN_MEMBER: return CPPUnknownMember.unmarshal(getPDOM(), firstBytes, buffer); case ITypeMarshalBuffer.UNKNOWN_MEMBER_CLASS_INSTANCE: return CPPUnknownClassInstance.unmarshal(getPDOM(), firstBytes, buffer); case ITypeMarshalBuffer.DEFERRED_CLASS_INSTANCE: return CPPDeferredClassInstance.unmarshal(getPDOM(), firstBytes, buffer); case ITypeMarshalBuffer.DEFERRED_FUNCTION: return CPPDeferredFunction.unmarshal(firstBytes, buffer); case ITypeMarshalBuffer.DEPENDENT_EXPRESSION_TYPE: IType type= TypeOfDependentExpression.unmarshal(firstBytes, buffer); if (type instanceof IBinding) return (IBinding) type; return new ProblemBinding(null, ISemanticProblem.TYPE_NOT_PERSISTED); } throw new CoreException(CCorePlugin.createStatus("Cannot unmarshal a binding, first bytes=" + firstBytes)); }
Source:
public List<Folder> findSubFoldersRecursively(Host host, User user, boolean respectFrontEndPermissions) throws DotDataException, DotSecurityException { if (!permissionAPI.doesUserHavePermission(host, PermissionAPI.PERMISSION_READ, user, respectFrontEndPermissions)) { throw new DotSecurityException("User " + user.getUserId() != null?user.getUserId():"" + " does not have permission to read Host " + host.getHostname()); } List<Folder> subFolders = folderFactory.findFoldersByHost(host); List<Folder> toIterateOver = new ArrayList<Folder>(subFolders); for (Folder f : toIterateOver) { if (permissionAPI.doesUserHavePermission(f, PermissionAPI.PERMISSION_READ, user, respectFrontEndPermissions)) { subFolders.addAll(findSubFoldersRecursively(f, user, respectFrontEndPermissions)); } } return subFolders; }

Target:
public List<Folder> findSubFoldersRecursively(Host host, User user, boolean respectFrontEndPermissions) throws DotDataException, DotSecurityException { if (!this.permissionAPI.doesUserHavePermission(host, PermissionAPI.PERMISSION_READ, user, respectFrontEndPermissions)) { throw new DotSecurityException("User " + user.getUserId() != null?user.getUserId():"" + " does not have permission to read Host " + host.getHostname()); } List<Folder> subFolders = folderFactory.findFoldersByHost(host); List<Folder> toIterateOver = new ArrayList<Folder>(subFolders); for (Folder subFolder : toIterateOver) { if (doesUserHavePermissions(subFolder, PermissionAPI.PERMISSION_READ, user, respectFrontEndPermissions)) { subFolders.addAll(findSubFoldersRecursively(subFolder, user, respectFrontEndPermissions)); } } return subFolders; }
Source:
public String toString() { return "None"; }

Target:
public String toString() { return "NoPointSensitivity"; }
Source:
private void resortFreeVariables() { final List<CalculatorVariable> resortedVariables = new ArrayList<>(); String chars = ""; for (final CalculatorVariable equ : equations) { chars = chars.concat(equ.getExpression()); } for (int i = 0; i<chars.length(); i++) { final char ch = chars.charAt(i); if ('a' <= ch && ch <= 'z') { if (findVariable(ch, resortedVariables) != null) { continue; } CalculatorVariable thisVariable = findVariable(ch, freeVariables); if (thisVariable == null) { thisVariable = new CalculatorVariable(getContext(), new CalculatorVariable.VariableData(ch), getString(R.string.free_variable_hint), new VariableWatcher()); } resortedVariables.add(thisVariable); } } freeVariables = resortedVariables; updateGrid(freeVariables, variableGrid, equations.size()); }

Target:
private void resortFreeVariables() { String equationStrings = ""; for (final CalculatorVariable equ : equations) { equationStrings = equationStrings.concat(equ.getExpression()); } freeVariables = sortVariables(freeVariables, equationStrings, new Range('a', 'z'), getString(R.string.free_variable_hint), new VariableWatcher()); updateGrid(freeVariables, variableGrid, equations.size()); }
Source:
public DbUser getDirectoryUser(DbUser dbUser) { DbUser directoryUser = null; try { ExtensionProxy authzExtension = EngineExtensionsManager.getInstance().getExtensionByName(dbUser.getDomain()); Collection<ExtMap> principalRecords = AuthzUtils.findPrincipalsByIds( authzExtension, dbUser.getNamespace(), Arrays.asList(dbUser.getExternalId()), true, true); if (!principalRecords.isEmpty()) { directoryUser = DirectoryUtils.mapPrincipalRecordToDbUser(dbUser.getDomain(), principalRecords.iterator().next()); directoryUser.setAdmin(dbUser.isAdmin()); directoryUser.setActive(dbUser.isActive()); } } catch (Exception ex) { log.error("Error during user synchronization of extension '{}': {}", dbUser.getDomain(), ex.getMessage()); log.debug("Exception", ex); } return directoryUser == null ? dbUser : directoryUser; }

Target:
public DbUser getDirectoryUser(DbUser dbUser) { DbUser directoryUser = null; try { ExtensionProxy authzExtension = EngineExtensionsManager.getInstance().getExtensionByName(dbUser.getDomain()); Collection<ExtMap> principalRecords = AuthzUtils.findPrincipalsByIds( authzExtension, dbUser.getNamespace(), Arrays.asList(dbUser.getExternalId()), true, true); if (!principalRecords.isEmpty()) { directoryUser = DirectoryUtils.mapPrincipalRecordToDbUser(dbUser.getDomain(), principalRecords.iterator().next()); directoryUser.setAdmin(dbUser.isAdmin()); directoryUser.setActive(dbUser.isActive()); } } catch (Exception ex) { log.error("Error retrieving user from directory '{}': {}", dbUser.getDomain(), ex.getMessage()); log.debug("Exception", ex); } return directoryUser == null ? dbUser : directoryUser; }
Source:
private void assertValidOpenAppEvent(AppOpenEventDto request) { if (request.operatingSystemStr == null) { Require.isNull(request.appVersion, () -> InvalidDataException.extraProperty("appVersion", "If the operating system is provided, the other properties must be present too")); Require.that(request.appVersionCode == 0, () -> InvalidDataException.extraProperty("appVersionCode", "If the operating system is provided, the other properties must be present too")); } else { Require.isNonNull(request.appVersion, () -> InvalidDataException.missingProperty("appVersion", "If the operating system is not provided, the other properties should not be provided either")); Require.that(request.appVersionCode != 0, () -> InvalidDataException.missingProperty("appVersionCode", "If the operating system is not provided, the other properties should not be provided either")); } }

Target:
private void assertValidOpenAppEvent(AppOpenEventDto request) { if (request.operatingSystemStr == null) { Require.isNull(request.appVersion, () -> InvalidDataException.extraProperty("appVersion", "If the operating system is not provided, the other properties should not be provided either")); Require.that(request.appVersionCode == 0, () -> InvalidDataException.extraProperty("appVersionCode", "If the operating system is not provided, the other properties should not be provided either")); } else { Require.isNonNull(request.appVersion, () -> InvalidDataException.missingProperty("appVersion", "If the operating system is provided, the other properties must be present too")); Require.that(request.appVersionCode != 0, () -> InvalidDataException.missingProperty("appVersionCode", "If the operating system is provided, the other properties must be present too")); } }
Source:
public List<ConfigMessage> validateTransaction(TransactionConfig config) { List<ConfigMessage> messages = new ArrayList<ConfigMessage>(); if (config.getFilter() == null || (config.getFilter().getInclusions().isEmpty() && config.getFilter().getInclusions().isEmpty())) { ConfigMessage cm = new ConfigMessage(); cm.setMessage(NO_FILTERS); messages.add(cm); } for (Processor processor : config.getProcessors()) { for (ProcessorAction action : processor.getActions()) { ProcessorActionHandler handler = ProcessorActionHandlerFactory.getHandler(action); if (handler != null) { handler.init(processor); } } } return messages; }

Target:
public List<ConfigMessage> validateTransaction(TransactionConfig config) { List<ConfigMessage> messages = new ArrayList<ConfigMessage>(); if (config.getFilter() == null || (config.getFilter().getInclusions().isEmpty() && config.getFilter().getInclusions().isEmpty())) { ConfigMessage cm = new ConfigMessage(); cm.setMessage(NO_FILTERS); messages.add(cm); } for (Processor processor : config.getProcessors()) { for (ProcessorAction action : processor.getActions()) { ProcessorActionHandler handler = ProcessorActionHandlerFactory.getHandler(action); if (handler != null) { messages.addAll(handler.init(processor)); } } } return messages; }
Source:
private int executeTool(Connection conn, ConnectionQueryServices queryServices, Configuration conf) { LOGGER.info("Executing " + operation); for (Map.Entry<String, HashSet<String>> entry :tablesAndIndexes.entrySet()) { String dataTableFullName = entry.getKey(); HashSet<String> indexes = entry.getValue(); try (Admin admin = queryServices.getAdmin()) { PTable dataTable = PhoenixRuntime.getTableNoCache(conn, dataTableFullName); LOGGER.info("Executing " + operation + " for " + dataTableFullName); boolean mutable = !(dataTable.isImmutableRows()); disableTable(admin, dataTableFullName, indexes); modifyTable(admin, dataTableFullName, indexes); if (!mutable) { LOGGER.info("Data table is immutable, waiting for " + (GLOBAL_INDEX_CHECKER_ENABLED_MAP_EXPIRATION_MIN + 1) + " minutes for client cache to expire"); if (!test) { Thread.sleep((GLOBAL_INDEX_CHECKER_ENABLED_MAP_EXPIRATION_MIN + 1) * 60 * 1000); } } enableTable(admin, dataTableFullName, indexes); rebuildIndexes(conn, conf, dataTableFullName); LOGGER.info("Completed " + operation + " for " + dataTableFullName); } catch (IOException | SQLException | InterruptedException e) { LOGGER.severe("Something went wrong while executing " + operation + " steps " + e); return -1; } } return 0; }

Target:
private int executeTool(Connection conn, ConnectionQueryServices queryServices, Configuration conf) { LOGGER.info("Executing " + operation); for (Map.Entry<String, HashSet<String>> entry :tablesAndIndexes.entrySet()) { String dataTableFullName = entry.getKey(); HashSet<String> indexes = entry.getValue(); try (Admin admin = queryServices.getAdmin()) { PTable dataTable = PhoenixRuntime.getTableNoCache(conn, dataTableFullName); LOGGER.info("Executing " + operation + " of " + dataTableFullName); disableTable(admin, dataTableFullName, indexes); modifyTable(admin, dataTableFullName, indexes); if (dataTable.isImmutableRows()) { LOGGER.info(dataTableFullName + " is an immutable table, waiting for " + (GLOBAL_INDEX_CHECKER_ENABLED_MAP_EXPIRATION_MIN + 1) + " minutes for client cache to expire"); if (!(test || dryRun || indexes.isEmpty())) { try { Thread.sleep((GLOBAL_INDEX_CHECKER_ENABLED_MAP_EXPIRATION_MIN + 1) * 60 * 1000); } catch (InterruptedException e) { LOGGER.warning("Sleep before starting index rebuild interrupted. " + e.getMessage()); } } } enableTable(admin, dataTableFullName, indexes); LOGGER.info("Completed " + operation + " of " + dataTableFullName); } catch (IOException | SQLException e) { LOGGER.severe("Something went wrong while executing " + operation + " steps " + e); return -1; } } if (upgrade) { for (String dataTableFullName : tablesAndIndexes.keySet()) { rebuildIndexes(conn, conf, dataTableFullName); LOGGER.info("Started index rebuild post " + operation + " of " + dataTableFullName); } } return 0; }
Source:
public boolean nextKeyValue() throws IOException, InterruptedException { if (!rows.hasNext() || (fileRowLimitMap.get(file.getName()) == 0)) { return false; } StringBuilder sb = new StringBuilder(); Row row = rows.next(); Iterator<Cell> cellIterator = row.cellIterator(); sb.append(row.getRowNum()).append(CELL_SEPERATION); sb.append(file).append(CELL_SEPERATION); sb.append(row.getSheet().getSheetName()).append(CELL_SEPERATION); int count = fileRowLimitMap.get(file.getName()); if (fileRowLimitMap.get(file.getName()) - 1 == 0 || !rows.hasNext()) { sb.append(END).append(CELL_SEPERATION); } else { sb.append(MID).append(CELL_SEPERATION); } fileRowLimitMap.put(file.getName(), count - 1); key = new LongWritable(rowIdx); while (cellIterator.hasNext()) { Cell cell = cellIterator.next(); String colName = CellReference.convertNumToColString(cell.getColumnIndex()); switch (cell.getCellType()) { case Cell.CELL_TYPE_STRING: sb.append(colName) .append(COLUMN_SEPERATION).append(cell.getStringCellValue()).append(CELL_SEPERATION); break; case Cell.CELL_TYPE_BOOLEAN: sb.append(colName) .append(COLUMN_SEPERATION).append(cell.getBooleanCellValue()).append(CELL_SEPERATION); break; case Cell.CELL_TYPE_NUMERIC: sb.append(colName) .append(COLUMN_SEPERATION).append(cell.getNumericCellValue()).append(CELL_SEPERATION); break; } } value = new Text(sb.toString()); rowIdx++; return true; }

Target:
public boolean nextKeyValue() throws IOException, InterruptedException { if (!rows.hasNext() || rowCount == 0) { return false; } StringBuilder sb = new StringBuilder(); Row row = rows.next(); Iterator<Cell> cellIterator = row.cellIterator(); sb.append(row.getRowNum()).append(CELL_SEPERATION); sb.append(file).append(CELL_SEPERATION); sb.append(row.getSheet().getSheetName()).append(CELL_SEPERATION); if (rowCount - 1 == 0 || !rows.hasNext()) { sb.append(END).append(CELL_SEPERATION); } else { sb.append(MID).append(CELL_SEPERATION); } rowCount--; key = new LongWritable(rowIdx); while (cellIterator.hasNext()) { Cell cell = cellIterator.next(); String colName = CellReference.convertNumToColString(cell.getColumnIndex()); switch (cell.getCellType()) { case Cell.CELL_TYPE_STRING: sb.append(colName) .append(COLUMN_SEPERATION).append(cell.getStringCellValue()).append(CELL_SEPERATION); break; case Cell.CELL_TYPE_BOOLEAN: sb.append(colName) .append(COLUMN_SEPERATION).append(cell.getBooleanCellValue()).append(CELL_SEPERATION); break; case Cell.CELL_TYPE_NUMERIC: sb.append(colName) .append(COLUMN_SEPERATION).append(cell.getNumericCellValue()).append(CELL_SEPERATION); break; } } value = new Text(sb.toString()); rowIdx++; return true; }
Source:
private Map<String, String> getCurrentExtras(MasterConfig masterConfig, Configuration configuration, Cluster cluster) { Map<String, String> extras = new HashMap<String, String>(); extras.put(Properties.PROPERTY_CONFIG_NAME, configuration.name); extras.put(Properties.PROPERTY_CLUSTER_SIZE, String.valueOf(cluster.getSize())); extras.put(Properties.PROPERTY_CLUSTER_MAX_SIZE, String.valueOf(masterConfig.getMaxClusterSize())); extras.put(Properties.PROPERTY_PLUGIN_NAME, "__no-plugin"); extras.put(Properties.PROPERTY_GROUP_NAME, "__master"); extras.put(Properties.PROPERTY_GROUP_SIZE, "0"); for (Cluster.Group group : cluster.getGroups()) { extras.put(Properties.PROPERTY_GROUP_PREFIX + group.name + Properties.PROPERTY_SIZE_SUFFIX, String.valueOf(group.size)); } extras.put(Properties.PROPERTY_SLAVE_INDEX, "-1"); extras.put(Properties.PROPERTY_PROCESS_ID, String.valueOf(Utils.getProcessID())); configuration.getSetups().forEach(setup -> setup.getEnvironment().forEach((k, v) -> { extras.put(k, v.toString()); }) ); return extras; }

Target:
private Map<String, String> getCurrentExtras(MasterConfig masterConfig, Configuration configuration, Cluster cluster) { Map<String, String> extras = new HashMap<String, String>(); extras.put(Properties.PROPERTY_CONFIG_NAME, configuration.name); extras.put(Properties.PROPERTY_CLUSTER_SIZE, String.valueOf(cluster.getSize())); extras.put(Properties.PROPERTY_CLUSTER_MAX_SIZE, String.valueOf(masterConfig.getMaxClusterSize())); extras.put(Properties.PROPERTY_PLUGIN_NAME, "__no-plugin"); extras.put(Properties.PROPERTY_GROUP_NAME, "__master"); extras.put(Properties.PROPERTY_GROUP_SIZE, "0"); for (Cluster.Group group : cluster.getGroups()) { extras.put(Properties.PROPERTY_GROUP_PREFIX + group.name + Properties.PROPERTY_SIZE_SUFFIX, String.valueOf(group.size)); } extras.put(Properties.PROPERTY_SLAVE_INDEX, "-1"); extras.put(Properties.PROPERTY_PROCESS_ID, String.valueOf(Utils.getProcessID())); return extras; }
Source:
private void zoomToLocation() { if (locationManager != null && !isAnimating) { isAnimating = true; Location myLoc = locationManager.getLastKnownLocation(locationManager.getBestProvider(new Criteria(), false)); if (myLoc == null) return; LatLng myLatLng = new LatLng(myLoc.getLatitude(), myLoc.getLongitude()); LogHelper.d("NearbyFrag", "animateCamera:onStart"); mMap.animateCamera(CameraUpdateFactory.newLatLngZoom(myLatLng, 17), new GoogleMap.CancelableCallback() { @Override public void onFinish() { LogHelper.d("NearbyFrag", "animateCamera:onFinish"); isAnimating = false; } @Override public void onCancel() { LogHelper.d("NearbyFrag", "animateCamera:onCancel"); isAnimating = false; } }); } }

Target:
private void zoomToLocation() { if (locationManager != null && !isAnimating) { isAnimating = true; Location myLoc = locationManager.getLastKnownLocation(locationManager.getBestProvider(new Criteria(), false)); if (myLoc == null) return; LatLng myLatLng = new LatLng(myLoc.getLatitude(), myLoc.getLongitude()); LogHelper.d(TAG, "animateCamera:onStart"); mMap.animateCamera(CameraUpdateFactory.newLatLngZoom(myLatLng, 17), new GoogleMap.CancelableCallback() { @Override public void onFinish() { LogHelper.d(TAG, "animateCamera:onFinish"); isAnimating = false; } @Override public void onCancel() { LogHelper.d(TAG, "animateCamera:onCancel"); isAnimating = false; } }); } }
Source:
public boolean isPage404(HttpMessage msg) { if (isCustomPage(msg, CustomPage.Type.OK_200) || isCustomPage(msg, CustomPage.Type.ERROR_500)) { return false; } return isCustomPage(msg, CustomPage.Type.NOTFOUND_404) ? true : msg.getResponseHeader().getStatusCode() == HttpStatusCode.NOT_FOUND; }

Target:
public boolean isPage404(HttpMessage msg) { if (isCustomPage(msg, CustomPage.Type.OK_200) || isCustomPage(msg, CustomPage.Type.ERROR_500)) { return false; } if (isCustomPage(msg, CustomPage.Type.NOTFOUND_404)) { return true; } return msg.getResponseHeader().getStatusCode() == HttpStatusCode.NOT_FOUND; }
Source:
public void monitor(SharedInformerFactory sharedInformerFactory) { SharedIndexInformer<V1NetworkAttachmentDefinition> networksInformer = sharedInformerFactory.sharedIndexInformerFor( (CallGeneratorParams params) -> { return cniApi.listV1NetworkAttachmentDefinitionForAllNamespacesCall( null, null, null, null, null, null, params.resourceVersion, params.timeoutSeconds, params.watch, null, null); }, V1NetworkAttachmentDefinition.class, V1NetworkAttachmentDefinitionList.class); networksInformer.addEventHandler( new ResourceEventHandler<>() { @Override public void onAdd(V1NetworkAttachmentDefinition network) { if (networkUpdater.addNetwork(network, clusterId)) { log.info("network added!", network.getMetadata().getName()); } } @Override public void onUpdate(V1NetworkAttachmentDefinition oldNet, V1NetworkAttachmentDefinition newNet) { log.debug("{} => network updated!", oldNet.getMetadata().getName(), newNet.getMetadata().getName()); } @Override public void onDelete(V1NetworkAttachmentDefinition network, boolean deletedFinalStateUnknown) { if (networkUpdater.removeNetwork(network.getMetadata().getName(), clusterId)) { log.info("network removed!", network.getMetadata().getName()); } } }); }

Target:
public void monitor(SharedInformerFactory sharedInformerFactory) { SharedIndexInformer<V1NetworkAttachmentDefinition> networksInformer = sharedInformerFactory.sharedIndexInformerFor( (CallGeneratorParams params) -> { return cniApi.listV1NetworkAttachmentDefinitionForAllNamespacesCall( null, null, null, null, null, null, params.resourceVersion, params.timeoutSeconds, params.watch, null, null); }, V1NetworkAttachmentDefinition.class, V1NetworkAttachmentDefinitionList.class); networksInformer.addEventHandler( new ResourceEventHandler<>() { @Override public void onAdd(V1NetworkAttachmentDefinition network) { if (networkUpdater.addNetwork(network, clusterId)) { log.info("network added!", network.getMetadata().getName()); } } @Override public void onUpdate(V1NetworkAttachmentDefinition oldNet, V1NetworkAttachmentDefinition newNet) { log.debug("{} => network updated!", oldNet.getMetadata().getName(), newNet.getMetadata().getName()); } @Override public void onDelete(V1NetworkAttachmentDefinition network, boolean deletedFinalStateUnknown) { if (networkUpdater.removeNetwork(NetworkUpdater.getNetworkName(network), clusterId)) { log.info("network removed!", network.getMetadata().getName()); } } }); }
Source:
public void close() throws IOException { level1.close(); level2.close(); }

Target:
public void close() throws IOException { try (Closeable closeable1 = level1; Closeable closeable2 = level2) { } }
Source:
public DOM(DOMProvider.Factory providerFactory) { mDOMProviderFactory = Util.throwIfNull(providerFactory); mPeerManager = new ChromePeerManager(); mPeerManager.setListener(new PeerManagerListener()); mObjectMapper = new ObjectMapper(); mObjectIdMapper = new DOMObjectIdMapper(); mSearchResults = Collections.synchronizedMap( new HashMap<String, List<Integer>>()); }

Target:
public DOM(DOMProvider.Factory providerFactory) { mDOMProviderFactory = Util.throwIfNull(providerFactory); mPeerManager = new ChromePeerManager(); mPeerManager.setListener(new PeerManagerListener()); mObjectMapper = new ObjectMapper(); mObjectIdMapper = new DOMObjectIdMapper(); mSearchResults = Collections.synchronizedMap( new HashMap<String, List<Integer>>()); mResultCounter = new AtomicInteger(0); }
Source:
protected void setContents(String contents) { this.contents = Arrays.asList(contents.split("\n")); ListIterator<String> li = this.contents.listIterator(getContentLineCount()); while (li.hasPrevious()) { int index = li.previousIndex(); if ("".equals(li.previous().trim())) { this.contents.remove(index); } else { break; } } }

Target:
protected void setContents(String contents) { this.contents = Arrays.asList(contents.split("\n")); ListIterator<String> li = this.contents.listIterator(getContentLineCount()); while (li.hasPrevious()) { int index = li.previousIndex(); if (li.previous().trim().length() == 0) { this.contents.remove(index); } else { break; } } }
Source:
protected void parseTransparencyAttestation(final PendingCertifiedProductEntity pendingCertifiedProduct, final CSVRecord record) { pendingCertifiedProduct.setTransparencyAttestationUrl(record.get(getColumnIndexMap().getK1Index()).trim()); if (getColumnIndexMap().getK2Index() >= 0) { String k2AttestationStr = record.get(getColumnIndexMap().getK2Index()).trim(); if (!StringUtils.isEmpty(k2AttestationStr)) { if ("0".equals(k2AttestationStr.trim())) { pendingCertifiedProduct.setTransparencyAttestation(AttestationType.Negative); } else if ("1".equals(k2AttestationStr.trim())) { pendingCertifiedProduct.setTransparencyAttestation(AttestationType.Affirmative); } else if ("2".equals(k2AttestationStr.trim())) { pendingCertifiedProduct.setTransparencyAttestation(AttestationType.NA); } } else { pendingCertifiedProduct.setTransparencyAttestation(null); } } }

Target:
protected void parseTransparencyAttestation(final PendingCertifiedProductEntity pendingCertifiedProduct, final CSVRecord record) { pendingCertifiedProduct.setTransparencyAttestationUrl(record.get(getColumnIndexMap().getK1Index()).trim()); if (getColumnIndexMap().getK2Index() >= 0) { String k2AttestationStr = record.get(getColumnIndexMap().getK2Index()).trim(); if (!StringUtils.isEmpty(k2AttestationStr)) { if ("0".equals(k2AttestationStr)) { pendingCertifiedProduct.setTransparencyAttestation(AttestationType.Negative); } else if ("1".equals(k2AttestationStr)) { pendingCertifiedProduct.setTransparencyAttestation(AttestationType.Affirmative); } else if ("2".equals(k2AttestationStr)) { pendingCertifiedProduct.setTransparencyAttestation(AttestationType.NA); } } else { pendingCertifiedProduct.setTransparencyAttestation(null); } } }
Source:
public String getAnonymousSubmissionId() { String anonTitle = rb.getString("grading.anonymous.title") ; String id = ""; try { Site site = SiteService.getSite( this.getAssignment().getContext() ); if(candidateDetailProvider.useInstitutionalAnonymousId(site)) { id = candidateDetailProvider.getCandidateID(UserDirectoryService.getUser(this.getSubmitterId()), site).orElse(this.getId().substring(27)); } else { id = this.getId().substring(27); } } catch(Exception ignore){ignore.printStackTrace();} return id + " (" + anonTitle + ")"; }

Target:
public String getAnonymousSubmissionId() { String id = this.getId().substring(27); try { Site site = SiteService.getSite( this.getAssignment().getContext() ); if(candidateDetailProvider.useInstitutionalAnonymousId(site)) { id = candidateDetailProvider.getCandidateID(UserDirectoryService.getUser(this.getSubmitterId()), site).orElse(this.getId().substring(27)); } } catch(IdUnusedException e){ M_log.warn("Site not found " + this.getAssignment().getContext(), e); } catch(UserNotDefinedException e){ M_log.warn("User not found " + this.getSubmitterId(), e); } return id + " (" + rb.getString("grading.anonymous.title") + ")"; }
Source:
protected void RunStage() { switch (_currentInstallStage) { case Start: case SignCertificateRequest: case UploadSignedCertificate: case UploadCA: case DownloadCertificateRequest: { log.infoFormat("Installation of {0}. Executing oVirt installation stage. (Stage: {1})", _serverName, getCurrentInstallStage()); super.RunStage(); break; } case ConnectToServer: { log.infoFormat("Installation of {0}. Executing oVirt installation stage. (Stage: {1})", _serverName, getCurrentInstallStage()); _executionSucceded = _wrapper.connect(_serverName); break; } case RunScript: { log.infoFormat("Installation of {0}. Executing oVirt installation stage. (Stage: {1})", _serverName, getCurrentInstallStage()); _wrapper.execute(createCertReqCommand); break; } case FinishCommand: { log.infoFormat( "Installation of {0}. Executing oVirt installation stage, sending SSH Command {1}. (Stage: {2})", _serverName, finishCommandInitial, getCurrentInstallStage()); _wrapper.execute(finishCommandInitial); break; } default: { _executionSucceded = true; _currentInstallStage = VdsInstallStages.forValue(_currentInstallStage.getValue() + 1); break; } } }

Target:
protected void RunStage() { switch (_currentInstallStage) { case Start: case SignCertificateRequest: case UploadSignedCertificate: case UploadCA: case DownloadCertificateRequest: { log.infoFormat("Installation of {0}. Executing oVirt installation stage. (Stage: {1})", _serverName, getCurrentInstallStage()); super.RunStage(); break; } case ConnectToServer: { log.infoFormat("Installation of {0}. Executing oVirt installation stage. (Stage: {1})", _serverName, getCurrentInstallStage()); _executionSucceded = _wrapper.connect(_serverName); break; } case RunScript: { log.infoFormat("Installation of {0}. Executing oVirt installation stage. (Stage: {1})", _serverName, getCurrentInstallStage()); _wrapper.executeCommand(createCertReqCommand); break; } case FinishCommand: { log.infoFormat( "Installation of {0}. Executing oVirt installation stage, sending SSH Command {1}. (Stage: {2})", _serverName, finishCommandInitial, getCurrentInstallStage()); _wrapper.executeCommand(finishCommandInitial); break; } default: { _executionSucceded = true; _currentInstallStage = VdsInstallStages.forValue(_currentInstallStage.getValue() + 1); break; } } }
Source:
List<GermplasmListData> getGermplasmListDataListWithExistingReservations(final List<GermplasmListData> germplasmListDataList) { final List<GermplasmListData> germplasmListDataListWithReservations = new ArrayList<>(); for (final GermplasmListData germplasmListData : germplasmListDataList) { if (germplasmListData.getInventoryInfo() != null && germplasmListData.getInventoryInfo().getLotRows() != null) { for (final LotDetails lotDetails : germplasmListData.getInventoryInfo().getLotRows()) { if (lotDetails.getWithdrawalBalance() > 0 && lotDetails.getWithdrawalStatus().equalsIgnoreCase(GermplasmInventory.RESERVED)) { germplasmListDataListWithReservations.add(germplasmListData); } } } } return germplasmListDataListWithReservations; }

Target:
List<GermplasmListData> getGermplasmListDataListWithExistingReservations(final List<GermplasmListData> germplasmListDataList) { final List<GermplasmListData> germplasmListDataListWithReservations = new ArrayList<>(); for (final GermplasmListData germplasmListData : germplasmListDataList) { if (germplasmListData.getInventoryInfo() != null && germplasmListData.getInventoryInfo().getLotRows() != null) { for (final LotDetails lotDetails : germplasmListData.getInventoryInfo().getLotRows()) { if (lotDetails.getWithdrawalStatus().equalsIgnoreCase(GermplasmInventory.RESERVED)) { germplasmListDataListWithReservations.add(germplasmListData); } } } } return germplasmListDataListWithReservations; }
Source:
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState){ layout = (LinearLayout) inflater.inflate(R.layout.recording_fragment, container); disableScreenRotation(); prepareButtons(); prepareText(); setWindowSize(); fileName = Environment.getExternalStorageDirectory().getAbsolutePath() + FILE_EXT; File f = new File(fileName); if(f.exists()){ recordAgain.setVisibility(View.VISIBLE); saveRecording.setVisibility(View.VISIBLE); recordingDuration.setVisibility(View.VISIBLE); toggleRecording.setBackgroundResource(R.drawable.play); toggleRecording.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { playAudio(); } }); saveRecording.setEnabled(true); instruction.setText(Localization.get("after.recording")); } return layout; }

Target:
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState){ layout = (LinearLayout) inflater.inflate(R.layout.recording_fragment, container); disableScreenRotation((Activity) getContext()); prepareButtons(); prepareText(); setWindowSize(); fileName = Environment.getExternalStorageDirectory().getAbsolutePath() + FILE_EXT + listener.getFileExtension(); File f = new File(fileName); if(f.exists()){ reloadSavedRecording(); } return layout; }
Source:
private ResolvableType obtainResolvableType(Message<?> message) { try { return this.valueTypeExpression.getValue(this.evaluationContext, message, ResolvableType.class); } catch (Exception ex) { if (ex.getCause() instanceof ClassNotFoundException) { logger.info("Cannot build a ResolvableType from a request message '" + message + "' evaluating expression '" + this.valueTypeExpression.getExpressionString() + "'", ex); return null; } else { throw ex; } } }

Target:
private ResolvableType obtainResolvableType(Message<?> message) { try { return this.valueTypeExpression.getValue(this.evaluationContext, message, ResolvableType.class); } catch (Exception ex) { if (ex.getCause() instanceof ClassNotFoundException) { logger.info("Cannot build a ResolvableType from the request message '" + message + "' evaluating expression '" + this.valueTypeExpression.getExpressionString() + "'", ex); return null; } else { throw ex; } } }
Source:
private boolean isNewerVersion(Version isoClusterVersion) { VDS vds = getVdsByVdsId(getParameters().getVdsId()); Version vdsClusterVersion = vds.getVdsGroupCompatibilityVersion(); log.debugFormat( "vdsClusterVersion {0} isoClusterVersion {1}", vdsClusterVersion.toString(), isoClusterVersion.toString() ); return (vdsClusterVersion.getMajor() == isoClusterVersion.getMajor() && vdsClusterVersion.getMinor() <= isoClusterVersion.getMinor()); }

Target:
private boolean isNewerVersion(Version isoClusterVersion) { VDS vds = getVdsByVdsId(getParameters().getVdsId()); Version vdsClusterVersion = vds.getVdsGroupCompatibilityVersion(); log.debugFormat( "vdsClusterVersion {0} isoClusterVersion {1}", vdsClusterVersion, isoClusterVersion ); return (vdsClusterVersion.getMajor() == isoClusterVersion.getMajor() && vdsClusterVersion.getMinor() <= isoClusterVersion.getMinor()); }
Source:
@Override public boolean capabilityExist( String id ) { for ( ICapabilityProvider iCapabilityProvider : providers.values() ) { boolean isTrue = iCapabilityProvider.capabilityExist( id ); if ( isTrue ) { return true; } } return false; }

Target:
@Override public boolean capabilityExist( String id ) { for ( ICapabilityProvider iCapabilityProvider : providers.values() ) { if ( iCapabilityProvider.capabilityExist( id ) ) { return true; } } return false; }
Source:
public void reload() { logger.debug("Requesting configuration from: " + configUrl); httpClient.send("GET", configUrl, new HashMap<String, String>(), null, new HttpClient.ResponseHandler<Void>() { @Override public Void handleResponse(HttpRequest<?> httpRequest, InputStream is, Integer statusCode, IOException e) throws IOException { if (e != null || statusCode != 200 || is == null) { logger.warn("Couldn't GET configuration. " + configUrl + " returned " + statusCode); return null; } logger.debug("Reloading RemotePropertiesConfigurationSource with: " + properties); properties.clear(); properties.load(is); return null; } }); }

Target:
public void reload() { logger.debug("Requesting configuration from: " + configUrl.toExternalForm()); httpClient.send("GET", configUrl.toExternalForm(), new HashMap<String, String>(), null, new HttpClient.ResponseHandler<Void>() { @Override public Void handleResponse(HttpRequest<?> httpRequest, InputStream is, Integer statusCode, IOException e) throws IOException { if (e != null || statusCode != 200 || is == null) { logger.warn("Couldn't GET configuration. " + configUrl.toExternalForm() + " returned " + statusCode); return null; } logger.debug("Reloading RemotePropertiesConfigurationSource with: " + properties); final Properties newProperties = new Properties(); newProperties.load(is); RemotePropertiesConfigurationSource.this.properties = newProperties; return null; } }); }
Source:
private void ensureAccessToken() { String href = getStringProperty(HREF_PROP_NAME); if (href != null) { Assert.isTrue(href.contains("/accessTokens/"), "href does not belong to an access token."); } }

Target:
private void ensureAccessToken() { String href = getStringProperty(HREF_PROP_NAME); if (href != null) { Assert.isTrue(href.contains(ACCESS_TOKEN_PATH), "href does not belong to an access token."); } }
Source:
void onDevtoolsLoadAll() { source_.withSaveFilesBeforeCommand(new Command() { @Override public void execute() { withDevtoolsLoadAllPath(new CommandWithArg<String>() { @Override public void execute(String loadAllPath) { sendLoadCommandToConsole( "devtools::load_all(\"" + loadAllPath + "\")"); } }); } }, new Command() { public void execute() { } }, "Build"); }

Target:
void onDevtoolsLoadAll() { source_.withSaveFilesBeforeCommand(() -> { withDevtoolsLoadAllPath(loadAllPath -> { sendLoadCommandToConsole("devtools::load_all(\"" + loadAllPath + "\")"); }); }, () -> {}, "Build"); }
Source:
public void setAndGetAttachmentsTest() { String attachmentName = "attachment_1.txt"; BasicDocumentRevision rev_1 = datastore.createDocument(bodyOne); File f = new File("fixture", attachmentName); UnsavedFileAttachment att = new UnsavedFileAttachment(f, "text/plain"); List<UnsavedFileAttachment> atts = new ArrayList<UnsavedFileAttachment>(); atts.add(att); DocumentRevision newRevision = null; try { newRevision = datastore.updateAttachments(rev_1, atts); } catch (ConflictException ce){ Assert.fail("ConflictException thrown: "+ce); } catch (IOException ioe) { Assert.fail("IOException thrown: "+ioe); } try { byte[] expectedSha1 = Misc.getSha1(new FileInputStream(f)); SavedAttachment savedAtt = (SavedAttachment) datastore.getAttachment(newRevision, attachmentName); Assert.assertArrayEquals(expectedSha1, savedAtt.key); SavedAttachment savedAtt2 = (SavedAttachment) datastore.attachmentsForRevision(newRevision).get(0); Assert.assertArrayEquals(expectedSha1, savedAtt2.key); } catch (FileNotFoundException fnfe) { Assert.fail("FileNotFoundException thrown "+fnfe); } }

Target:
public void setAndGetAttachmentsTest() { String attachmentName = "attachment_1.txt"; BasicDocumentRevision rev_1 = datastore.createDocument(bodyOne); File f = new File("fixture", attachmentName); Attachment att = new UnsavedFileAttachment(f, "text/plain"); List<Attachment> atts = new ArrayList<Attachment>(); atts.add(att); DocumentRevision newRevision = null; try { newRevision = datastore.updateAttachments(rev_1, atts); } catch (ConflictException ce){ Assert.fail("ConflictException thrown: "+ce); } try { byte[] expectedSha1 = Misc.getSha1(new FileInputStream(f)); SavedAttachment savedAtt = (SavedAttachment) datastore.getAttachment(newRevision, attachmentName); Assert.assertArrayEquals(expectedSha1, savedAtt.key); SavedAttachment savedAtt2 = (SavedAttachment) datastore.attachmentsForRevision(newRevision).get(0); Assert.assertArrayEquals(expectedSha1, savedAtt2.key); } catch (FileNotFoundException fnfe) { Assert.fail("FileNotFoundException thrown "+fnfe); } }
Source:
public Date getLastModified() { Date max = new Date(0); for (ChangeLog c : changeLog) { if (c.getTime().after(max)) { max = c.getTime(); } } return max; }

Target:
public Date getLastModified() { return (derivedInfo == null ? null : derivedInfo.getLastModified()); }
Source:
private IscsiDetails mapLogicalUnitToIscsiDetails(LogicalUnit logicalUnit) { IscsiDetails iscsiDetails = new IscsiDetails(); iscsiDetails.setAddress(logicalUnit.getAddress()); iscsiDetails.setPort(logicalUnit.getPort()); iscsiDetails.setTarget(logicalUnit.getTarget()); return iscsiDetails; }

Target:
private IscsiDetails mapLogicalUnitToIscsiDetails(LogicalUnit logicalUnit) { IscsiDetails iscsiDetails = new IscsiDetails(); iscsiDetails.setAddress(logicalUnit.getAddress()); iscsiDetails.setPort(logicalUnit.getPort()); iscsiDetails.setTarget(logicalUnit.getTarget()); iscsiDetails.setPortal(logicalUnit.getPortal()); iscsiDetails.setPaths(logicalUnit.getPaths()); iscsiDetails.setVendorId(logicalUnit.getVendorId()); iscsiDetails.setProductId(logicalUnit.getProductId()); iscsiDetails.setSerial(logicalUnit.getSerial()); return iscsiDetails; }
Source:
private static void log(String message) { System.out.println(message); }

Target:
public static void log(String message) { System.out.println(message); }
Source:
public void subscribeActual(Subscriber<? super T> t) { BaseEmitter<T> emitter; switch (backpressure) { case NONE: { emitter = new NoneEmitter<T>(t); break; } case ERROR: { emitter = new ErrorAsyncEmitter<T>(t); break; } case DROP: { emitter = new DropAsyncEmitter<T>(t); break; } case LATEST: { emitter = new LatestAsyncEmitter<T>(t); break; } case BUFFER: { emitter = new BufferAsyncEmitter<T>(t, bufferSize()); break; } default: { throw new UnsupportedOperationException(); } } t.onSubscribe(emitter); try { source.subscribe(emitter); } catch (Throwable ex) { Exceptions.throwIfFatal(ex); emitter.onError(ex); } }

Target:
public void subscribeActual(Subscriber<? super T> t) { BaseEmitter<T> emitter; switch (backpressure) { case NONE: { emitter = new NoneEmitter<T>(t); break; } case ERROR: { emitter = new ErrorAsyncEmitter<T>(t); break; } case DROP: { emitter = new DropAsyncEmitter<T>(t); break; } case LATEST: { emitter = new LatestAsyncEmitter<T>(t); break; } default: { emitter = new BufferAsyncEmitter<T>(t, bufferSize()); break; } } t.onSubscribe(emitter); try { source.subscribe(emitter); } catch (Throwable ex) { Exceptions.throwIfFatal(ex); emitter.onError(ex); } }
Source:
void configureServers(boolean dataStoreWithWriter, boolean accessorWithWriter) { dataStore1.invoke(() -> initDataStore(true, dataStoreWithWriter)); dataStore2.invoke(() -> initDataStore(true, dataStoreWithWriter)); dataStore3.invoke(() -> initDataStore(true, dataStoreWithWriter)); accessor.invoke(() -> initAccessor(true, accessorWithWriter)); dataStore1.invoke(() -> { Region region = getRegion(false); region.getAttributesMutator().setCacheWriter(null); }); dataStore2.invoke(() -> { Region region = getRegion(false); region.getAttributesMutator().setCacheWriter(null); }); }

Target:
void configureServers(boolean dataStoreWithWriter, boolean accessorWithWriter) { dataStore1.invoke(() -> initDataStore(dataStoreWithWriter)); dataStore2.invoke(() -> initDataStore(dataStoreWithWriter)); dataStore3.invoke(() -> initDataStore(dataStoreWithWriter)); accessor.invoke(() -> initAccessor(accessorWithWriter)); dataStore1.invoke(() -> { Region region = getRegion(false); region.getAttributesMutator().setCacheWriter(null); }); dataStore2.invoke(() -> { Region region = getRegion(false); region.getAttributesMutator().setCacheWriter(null); }); }
Source:
public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.people_management_activity); Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); setSupportActionBar(toolbar); ActionBar actionBar = getSupportActionBar(); if (actionBar != null) { actionBar.setTitle(R.string.people); actionBar.setHomeButtonEnabled(true); actionBar.setDisplayHomeAsUpEnabled(true); } int localBlogId = BlogUtils.getBlogLocalId(WordPress.getCurrentBlog()); Blog blog = WordPress.getBlog(localBlogId); if (savedInstanceState == null) { PeopleListFragment peopleListFragment = PeopleListFragment.newInstance(localBlogId); getFragmentManager().beginTransaction() .add(R.id.fragment_container, peopleListFragment, KEY_PEOPLE_LIST_FRAGMENT) .commit(); } if (blog != null) { refreshUsersList(blog.getDotComBlogId(), localBlogId); } }

Target:
public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.people_management_activity); Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); setSupportActionBar(toolbar); ActionBar actionBar = getSupportActionBar(); if (actionBar != null) { actionBar.setTitle(R.string.people); actionBar.setHomeButtonEnabled(true); actionBar.setDisplayHomeAsUpEnabled(true); } Blog blog = WordPress.getCurrentBlog(); if (blog == null) { ToastUtils.showToast(this, R.string.blog_not_found); finish(); return; } if (savedInstanceState == null) { if (NetworkUtils.isNetworkAvailable(this)) { PeopleTable.deletePeopleForLocalBlogIdExceptForFirstPage(blog.getLocalTableBlogId()); } PeopleListFragment peopleListFragment = PeopleListFragment.newInstance(blog.getLocalTableBlogId()); peopleListFragment.setOnPersonSelectedListener(this); peopleListFragment.setOnFetchPeopleListener(this); mPeopleEndOfListReached = false; mFetchRequestInProgress = false; getFragmentManager().beginTransaction() .add(R.id.fragment_container, peopleListFragment, KEY_PEOPLE_LIST_FRAGMENT) .commit(); } else { mPeopleEndOfListReached = savedInstanceState.getBoolean(KEY_END_OF_LIST_REACHED); mFetchRequestInProgress = savedInstanceState.getBoolean(KEY_FETCH_REQUEST_IN_PROGRESS); FragmentManager fragmentManager = getFragmentManager(); PeopleListFragment peopleListFragment = (PeopleListFragment) fragmentManager .findFragmentByTag(KEY_PEOPLE_LIST_FRAGMENT); if (peopleListFragment != null) { peopleListFragment.setOnPersonSelectedListener(this); peopleListFragment.setOnFetchPeopleListener(this); } } }
Source:
public FingerprintHandler(Context context, FingerprintManager fingerprintManager, Callback callback) { appContext = context; mFingerprintManager = fingerprintManager; mCallback = callback; }

Target:
public FingerprintHandler(Context context, FingerprintManager fingerprintManager, Callback callback) { mAppContext = context; mFingerprintManager = fingerprintManager; mCallback = callback; }
Source:
public void init() { _sut = new BasicScopeAuthorizationStrategy(TEST_SCOPE); _sut.setMetadataClient(metadataClient); }

Target:
public void init() { sut = new BasicScopeAuthorizationStrategy(TEST_SCOPE); sut.setMetadataService(metadataService); }