auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private boolean handleDefinedMappings() { boolean errorOccurred = false; Set<String> handledTargets = new HashSet<>(); if ( method.getMappingOptions().hasNestedTargetReferences() ) { errorOccurred = handleDefinedNestedTargetMapping( handledTargets ); } for ( Map.Entry<String, List<Mapping>> entry : methodMappings.entrySet() ) { String target = null; for ( Mapping mapping : entry.getValue() ) { TargetReference targetReference = mapping.getTargetReference(); if ( targetReference.isValid() ) { target = first( targetReference.getPropertyEntries() ).getFullName(); if ( !handledTargets.contains( target ) ) { if ( handleDefinedMapping( mapping, handledTargets ) ) { errorOccurred = true; } } if ( mapping.getSourceReference() != null && mapping.getSourceReference().isValid() ) { List<PropertyEntry> sourceEntries = mapping.getSourceReference().getPropertyEntries(); if ( !sourceEntries.isEmpty() ) { String source = first( sourceEntries ).getFullName(); unprocessedSourceProperties.remove( source ); } } } else { errorOccurred = true; } } } for ( String handledTarget : handledTargets ) { unprocessedTargetProperties.remove( handledTarget ); unprocessedDefinedTargets.remove( handledTarget ); } return errorOccurred; }

Target:
private boolean handleDefinedMappings() { boolean errorOccurred = false; Set<String> handledTargets = new HashSet<>(); if ( method.getMappingOptions().hasNestedTargetReferences() ) { errorOccurred = handleDefinedNestedTargetMapping( handledTargets ); } for ( Map.Entry<String, List<Mapping>> entry : methodMappings.entrySet() ) { for ( Mapping mapping : entry.getValue() ) { TargetReference targetReference = mapping.getTargetReference(); if ( targetReference.isValid() ) { String target = first( targetReference.getPropertyEntries() ).getFullName(); if ( !handledTargets.contains( target ) ) { if ( handleDefinedMapping( mapping, handledTargets ) ) { errorOccurred = true; } } if ( mapping.getSourceReference() != null && mapping.getSourceReference().isValid() ) { List<PropertyEntry> sourceEntries = mapping.getSourceReference().getPropertyEntries(); if ( !sourceEntries.isEmpty() ) { String source = first( sourceEntries ).getFullName(); unprocessedSourceProperties.remove( source ); } } } else { errorOccurred = true; } } } for ( String handledTarget : handledTargets ) { unprocessedTargetProperties.remove( handledTarget ); unprocessedDefinedTargets.remove( handledTarget ); } return errorOccurred; }
Source:
public void addPages() { addPage(selectRepoPage); addPage(importWithDirectoriesPage); addPage(myProjectsImportPage); addPage(myCreateGeneralProjectPage); addPage(mySharePage); }

Target:
public void addPages() { addPage(selectRepoPage); addPage(importWithDirectoriesPage); addPage(projectsImportPage); addPage(createGeneralProjectPage); addPage(shareProjectsPage); }
Source:
public void testCreateMtlsKeyStoreNoCert() throws Exception { final InputStream certMissing = getClass() .getClassLoader() .getResourceAsStream("com/google/api/client/util/privateKey.pem"); IllegalArgumentException exception = assertThrows( IllegalArgumentException.class, new ThrowingRunnable() { @Override public void run() throws Throwable { SecurityUtils.createMtlsKeyStore(certMissing); } }); assertThat(exception) .hasMessageThat() .isEqualTo("certificate is missing from certAndKey string"); }

Target:
public void testCreateMtlsKeyStoreNoCert() throws Exception { final InputStream certMissing = getClass() .getClassLoader() .getResourceAsStream("com/google/api/client/util/privateKey.pem"); boolean thrown = false; try { SecurityUtils.createMtlsKeyStore(certMissing); fail("should have thrown"); } catch (IllegalArgumentException e) { assertTrue(e.getMessage().contains("certificate is missing from certAndKey string")); thrown = true; } assertTrue("should have caught an IllegalArgumentException", thrown); }
Source:
private void checkConnectivity() throws IOException { final ObjectWalk ow = new ObjectWalk(db); for (final ReceiveCommand cmd : commands) { if (cmd.getResult() != Result.NOT_ATTEMPTED) continue; if (cmd.getType() == ReceiveCommand.Type.DELETE) continue; ow.markStart(ow.parseAny(cmd.getNewId())); } for (final Ref ref : refs.values()) ow.markUninteresting(ow.parseAny(ref.getObjectId())); ObjectIdSubclassMap<ObjectId> provided = new ObjectIdSubclassMap<ObjectId>(); if (ensureObjectsProvidedVisible) { for (ObjectId id : getNewObjectIds()) { provided.add(id); } } RevCommit c; while ((c = ow.next()) != null) { if (ensureObjectsProvidedVisible) { if (!provided.contains(c)) { reject(commands); break; } } } RevObject o; while ((o = ow.nextObject()) != null) { if (o instanceof RevBlob && !db.hasObject(o)) throw new MissingObjectException(o, Constants.TYPE_BLOB); if (ensureObjectsProvidedVisible) { if (!provided.contains(o)) { reject(commands); break; } } } }

Target:
private void checkConnectivity() throws IOException { final ObjectWalk ow = new ObjectWalk(db); for (final ReceiveCommand cmd : commands) { if (cmd.getResult() != Result.NOT_ATTEMPTED) continue; if (cmd.getType() == ReceiveCommand.Type.DELETE) continue; ow.markStart(ow.parseAny(cmd.getNewId())); } for (final Ref ref : refs.values()) ow.markUninteresting(ow.parseAny(ref.getObjectId())); ObjectIdSubclassMap<ObjectId> provided = new ObjectIdSubclassMap<ObjectId>(); if (ensureObjectsProvidedVisible) { for (ObjectId id : getBaseObjectIds()) { RevObject b = ow.lookupAny(id); if (!b.has(RevFlag.UNINTERESTING)) throw new MissingObjectException(b, b.getType()); } for (ObjectId id : getNewObjectIds()) { provided.add(id); } } RevCommit c; while ((c = ow.next()) != null) { if (ensureObjectsProvidedVisible && !provided.contains(c)) throw new MissingObjectException(c, Constants.TYPE_COMMIT); } RevObject o; while ((o = ow.nextObject()) != null) { if (o instanceof RevBlob && !db.hasObject(o)) throw new MissingObjectException(o, Constants.TYPE_BLOB); if (ensureObjectsProvidedVisible && !provided.contains(o)) throw new MissingObjectException(o, Constants.TYPE_BLOB); } }
Source:
private void logInitializationError(String message) { log.error("The Mac pool is not initialized"); AuditLogableBase logable = new AuditLogableBase(); logable.AddCustomValue("Message",message); AuditLogDirector.log(logable, AuditLogType.MAC_POOL_NOT_INITIALIZED); }

Target:
private void logInitializationError(String message) { log.error("The MAC addresses pool is not initialized"); AuditLogableBase logable = new AuditLogableBase(); logable.AddCustomValue("Message",message); AuditLogDirector.log(logable, AuditLogType.MAC_ADDRESSES_POOL_NOT_INITIALIZED); }
Source:
public List<PTOperator> getLeafOperators() { List<PTOperator> operators = new ArrayList<>(); for (OperatorMeta opMeta : dag.getLeafOperators()) { Collection<PTOperator> allOpers = getAllOperators(opMeta); if (allOpers != null) { operators.addAll(getAllOperators(opMeta)); } } return operators; }

Target:
public List<PTOperator> getLeafOperators() { List<PTOperator> operators = new ArrayList<>(); for (OperatorMeta opMeta : dag.getLeafOperators()) { Collection<PTOperator> allOpers = getAllOperators(opMeta); if (allOpers != null) { operators.addAll(allOpers); } } return operators; }
Source:
public void deleteSchema(Long id, Long maxRowsPerSecond) throws SQLException { String[] tables = { "columns", "tables", "databases" }; try ( Connection connection = connectionPool.getConnection() ) { connection.createStatement().execute("delete from `maxwell`.`schemas` where id = " + id); for ( String tName : tables ) { for (;;) { long nDeleted = connection.createStatement().executeUpdate( "DELETE FROM maxwell." + tName + " WHERE schema_id = " + id + " LIMIT " + maxRowsPerSecond ); if (isStopRequested()) return; if (nDeleted == 0) break; LOGGER.debug("deleted " + nDeleted + " rows from maxwell." + tName + " schema: " + id); try { Thread.sleep(1000); } catch (InterruptedException e) { } } } } }

Target:
public void deleteSchema(Long id, Long maxRowsPerSecond) throws SQLException { String[] tables = { "columns", "tables", "databases" }; try ( Connection connection = connectionPool.getConnection() ) { for ( String tName : tables ) { for (;;) { long nDeleted = connection.createStatement().executeUpdate( "DELETE FROM maxwell." + tName + " WHERE schema_id = " + id + " LIMIT " + maxRowsPerSecond ); if (isStopRequested()) return; if (nDeleted == 0) break; LOGGER.debug("deleted " + nDeleted + " rows from maxwell." + tName + " schema: " + id); try { Thread.sleep(1000); } catch (InterruptedException e) { } if (isStopRequested()) return; } } connection.createStatement().execute("delete from `maxwell`.`schemas` where id = " + id); } }
Source:
public void prepare() throws InfrastructureException { Client k8sClient = clientFactory.create(workspaceId); if (k8sClient.serviceAccounts().inNamespace(namespace).withName(serviceAccountName).get() == null) { createWorkspaceServiceAccount(k8sClient); } else { return; } createRole(k8sClient, EXEC_ROLE_NAME); createRole(k8sClient, VIEW_ROLE_NAME); roleBindings .apply(k8sClient) .inNamespace(namespace) .createOrReplace(createRoleBinding(EXEC_ROLE_NAME, serviceAccountName + "-exec", false)); roleBindings .apply(k8sClient) .inNamespace(namespace) .createOrReplace(createRoleBinding(VIEW_ROLE_NAME, serviceAccountName + "-view", false)); int idx = 0; for (String clusterRoleName : this.clusterRoleNames) { if (k8sClient.rbac().clusterRoles().withName(clusterRoleName).get() != null) { roleBindings .apply(k8sClient) .inNamespace(namespace) .createOrReplace( createRoleBinding(clusterRoleName, serviceAccountName + "-cluster" + idx++, true)); } else { LOG.warn( "Unable to find the cluster role {}. Skip creating custom role binding.", clusterRoleName); } } }

Target:
public void prepare() throws InfrastructureException { Client k8sClient = clientFactory.create(workspaceId); if (k8sClient.serviceAccounts().inNamespace(namespace).withName(serviceAccountName).get() == null) { createWorkspaceServiceAccount(k8sClient); createImplicitRolesWithBindings(k8sClient); createExplicitClusterRoleBindings(k8sClient); } }
Source:
private void tryInitialize() { keyValueService.createTable(AtlasDbConstants.PUNCH_TABLE, new TableMetadata( NameMetadataDescription.create(ImmutableList.of( new NameComponentDescription.Builder() .componentName("time_rounded_to_day") .type(ValueType.FIXED_LONG_LITTLE_ENDIAN) .build())), new ColumnMetadataDescription(new DynamicColumnDescription( NameMetadataDescription.create(ImmutableList.of(new NameComponentDescription.Builder() .componentName("millis_in_day") .type(ValueType.VAR_LONG) .build())), ColumnValueDescription.forType(ValueType.VAR_LONG))), ConflictHandler.IGNORE_ALL, TableMetadataPersistence.LogSafety.SAFE).persistToBytes()); }

Target:
private void tryInitialize() { keyValueService.createTable(AtlasDbConstants.PUNCH_TABLE, new TableMetadata( NameMetadataDescription.create(ImmutableList.of( new NameComponentDescription.Builder() .componentName("time_rounded_millis") .type(ValueType.FIXED_LONG_LITTLE_ENDIAN) .build())), new ColumnMetadataDescription(new DynamicColumnDescription( NameMetadataDescription.create(ImmutableList.of(new NameComponentDescription.Builder() .componentName("remainder_millis") .type(ValueType.VAR_LONG) .build())), ColumnValueDescription.forType(ValueType.VAR_LONG))), ConflictHandler.IGNORE_ALL, TableMetadataPersistence.LogSafety.SAFE).persistToBytes()); }
Source:
public void onReady() { try (LockResource lr = new LockResource(mLock)) { if (shouldRestartDataReader() && !mFinished.get()) { try { mDataReaderExecutor.submit(createDataReader(mContext, mResponseObserver)); mContext.setDataReaderActive(true); } catch (RejectedExecutionException e) { handleStreamEndingException(e, Status.RESOURCE_EXHAUSTED); } } } }

Target:
public void onReady() { try (LockResource lr = new LockResource(mLock)) { if (shouldRestartDataReader()) { try { mDataReaderExecutor.submit(createDataReader(mContext, mResponseObserver)); mContext.setDataReaderActive(true); } catch (RejectedExecutionException e) { handleStreamEndingException(Status.RESOURCE_EXHAUSTED.withCause(e) .withDescription("Failed to create a new data reader")); } } } }
Source:
public Map<SchemaTableName, List<ColumnMetadata>> listTableColumns(ConnectorSession session, SchemaTablePrefix prefix) { requireNonNull(prefix, "SchemaTablePrefix is null"); List<SchemaTableName> tables; if (prefix.getSchemaName() == null) { tables = listTables(session, null); } else if (prefix.getTableName() == null) { tables = listTables(session, prefix.getSchemaName()); } else { tables = ImmutableList.of(new SchemaTableName(prefix.getSchemaName(), prefix.getTableName())); } ImmutableMap.Builder<SchemaTableName, List<ColumnMetadata>> columns = ImmutableMap.builder(); for (SchemaTableName tableName : tables) { KuduTableHandle tableHandle = getTableHandle(session, tableName); ConnectorTableMetadata tableMetadata = getTableMetadata(tableHandle); columns.put(tableName, tableMetadata.getColumns()); } return columns.build(); }

Target:
public Map<SchemaTableName, List<ColumnMetadata>> listTableColumns(ConnectorSession session, SchemaTablePrefix prefix) { requireNonNull(prefix, "SchemaTablePrefix is null"); List<SchemaTableName> tables; if (prefix.getTableName() == null) { tables = listTables(session, prefix.getSchemaName()); } else { tables = ImmutableList.of(new SchemaTableName(prefix.getSchemaName(), prefix.getTableName())); } ImmutableMap.Builder<SchemaTableName, List<ColumnMetadata>> columns = ImmutableMap.builder(); for (SchemaTableName tableName : tables) { KuduTableHandle tableHandle = getTableHandle(session, tableName); if (tableHandle != null) { ConnectorTableMetadata tableMetadata = getTableMetadata(tableHandle); columns.put(tableName, tableMetadata.getColumns()); } } return columns.build(); }
Source:
public void removeFromDevicesTag( @Auth final AccessToken accessToken, @PathParam("tag_name") final String tagName, @PathParam("device_id") final String deviceId){ final List<String> ids = new ArrayList<>(); ids.add(deviceId); tagStore.remove(tagName, TagStoreDAODynamoDB.Type.DEVICES, ids); }

Target:
public void removeFromDevicesTag( @Auth final AccessToken accessToken, @PathParam("tag_name") final String tagName, @PathParam("device_id") final String deviceId){ final List<String> ids = Lists.newArrayList(); ids.add(deviceId); tagStore.remove(tagName, TagStoreDAODynamoDB.Type.DEVICES, ids); }
Source:
public static BiFunction<Object, Object[], Object> superMethod( Function<String, BiFunction> enhancer, Method method) { return enhancer.apply(signature(method)); }

Target:
static BiFunction<Object, Object[], Object> superMethod( Function<String, BiFunction> enhancer, Method method) { return enhancer.apply(signature(method)); }
Source:
protected void executeCommand(IDeviceManagementInteractor executor) throws DeploymentException { try { executor.startFB(resource, new FBDeploymentData("", resFB)); } catch (DeploymentException e) { throw e; } }

Target:
protected void executeCommand(IDeviceManagementInteractor executor) throws DeploymentException { executor.startFB(resource, new FBDeploymentData("", resFB)); }
Source:
String createOrUpdate(Request request, Response response) throws IOException { SiteUrls siteUrls = buildEntityFromRequestBody(request); try { serverConfigService.createOrUpdateServerSiteUrls(siteUrls); } catch (GoConfigInvalidException e) { response.status(HttpStatus.UNPROCESSABLE_ENTITY.value()); String errorMessage = entityConfigValidationFailed(siteUrls.getClass().getAnnotation(ConfigTag.class).value(), e.getAllErrorMessages()); return MessageJson.create(errorMessage, jsonWriter(siteUrls)); } return index(request, response); }

Target:
String createOrUpdate(Request request, Response response) throws IOException { SiteUrls siteUrls = buildEntityFromRequestBody(request); try { serverConfigService.createOrUpdateServerSiteUrls(siteUrls); return writerForTopLevelObject(request, response, writer -> ServerSiteUrlsConfigRepresenter.toJSON(writer, siteUrls)); } catch (GoConfigInvalidException e) { return writerForTopLevelObject(request, response, writer -> { writer.add("message", e.getMessage()); ServerSiteUrlsConfigRepresenter.toJSON(writer, siteUrls); }); } }
Source:
public void createValidation() { getMorphia().map(DocumentValidation.class); getDs().enableDocumentValidation(); try { getDs().save(new DocumentValidation("John", 1, new Date())); } catch (WriteConcernException e) { assertTrue(e.getMessage().contains("Document failed validation")); } }

Target:
public void createValidation() { getMorphia().map(DocumentValidation.class); getDs().enableDocumentValidation(); assertEquals(Document.parse(DocumentValidation.class.getAnnotation(Validation.class).value()), getValidator()); try { getDs().save(new DocumentValidation("John", 1, new Date())); fail("Document should have failed validation"); } catch (WriteConcernException e) { assertTrue(e.getMessage().contains("Document failed validation")); } getDs().save(new DocumentValidation("Harold", 100, new Date())); }
Source:
public Map<String, String> getAttributes() { Map<String, String> attributes = new HashMap<String, String>( BPUserLibraryElement.this.fAttributes.size()); for (Map.Entry<String, String> entry : BPUserLibraryElement.this.fAttributes .entrySet()) { attributes.put(entry.getKey(), entry.getValue()); } return attributes; }

Target:
public Map<String, String> getAttributes() { return fAttributes != null ? Collections.<String, String>unmodifiableMap(fAttributes) : Collections.<String, String> emptyMap(); }
Source:
public Object handleNoHandlerFoundException(NoHandlerFoundException e, HttpServletRequest httpServletRequest) { LOG.info("", e); return handleTypedException(isHtmlRequest(httpServletRequest), NotFoundController.URI, e.getLocalizedMessage(), NOT_FOUND); }

Target:
public Object handleNoHandlerFoundException(NoHandlerFoundException e, HttpServletRequest httpServletRequest) { LOG.info("", e); return handleTypedException(isHtmlRequest(httpServletRequest), BadRequestController.URI, e.getLocalizedMessage(), NOT_FOUND); }
Source:
private Long getHostsByCapability(List<Long> hostList, String hostCapability) { int totalHostswithCapability = 0; for (Long host : hostList) { Map<String, String> details = hostDetailsDao.findDetails(host); if (details.containsKey(Host.HOST_UEFI_ENABLE)) { if (details.get(Host.HOST_UEFI_ENABLE).equalsIgnoreCase("Yes")) { totalHostswithCapability++; } } } return totalHostswithCapability > 0 ? new Long(1) : new Long(0); }

Target:
private Long getHostsByCapability(List<Long> hostList, String hostCapability) { for (Long host : hostList) { Map<String, String> details = hostDetailsDao.findDetails(host); if (details.containsKey(Host.HOST_UEFI_ENABLE)) { if (details.get(Host.HOST_UEFI_ENABLE).equalsIgnoreCase("Yes")) { return new Long(1); } } } return new Long(0); }
Source:
public void purgeObs(Obs obs, boolean cascade) throws APIException { if (purgeComplexData(obs) == false) { throw new APIException("Unable to purge complex data for obs: " + obs); } purgeObsDao(obs, cascade); }

Target:
public void purgeObs(Obs obs, boolean cascade) throws APIException { if (purgeComplexData(obs) == false) { throw new APIException("Unable to purge complex data for obs: " + obs); } if (cascade) { throw new APIException("Cascading purge of obs not yet implemented"); } dao.deleteObs(obs); }
Source:
protected void nocache(final HttpServletResponse rsp) { rsp.setHeader("Expires", "Fri, 01 Jan 1980 00:00:00 GMT"); rsp.setHeader("Pragma", "no-cache"); rsp.setHeader("Cache-Control", "no-cache, max-age=0, must-revalidate"); }

Target:
protected void nocache(final HttpServletResponse rsp) { rsp.setHeader(HDR_EXPIRES, "Fri, 01 Jan 1980 00:00:00 GMT"); rsp.setHeader(HDR_PRAGMA, "no-cache"); rsp.setHeader(HDR_CACHE_CONTROL, "no-cache, max-age=0, must-revalidate"); }
Source:
public void test_example() { ComponentDto project = db.components().insertPrivateProject(p -> p.setDbKey("sonarqube")); ComponentDto longLivingBranch = db.components().insertProjectBranch(project, b -> b.setKey("feature/bar").setBranchType(BranchType.LONG)); ComponentDto shortLivingBranch = db.components().insertProjectBranch(project, b -> b.setKey("feature/foo").setBranchType(BranchType.SHORT).setMergeBranchUuid(longLivingBranch.uuid())); userSession.logIn().addProjectPermission(UserRole.USER, project); db.getDbClient().snapshotDao().insert(db.getSession(), SnapshotTesting.newAnalysis(longLivingBranch).setLast(true).setCreatedAt(DateUtils.parseDateTime("2017-04-01T01:15:42+0100").getTime())); db.getDbClient().snapshotDao().insert(db.getSession(), SnapshotTesting.newAnalysis(shortLivingBranch).setLast(true).setCreatedAt(DateUtils.parseDateTime("2017-04-03T13:37:00+0100").getTime())); db.commit(); String json = ws.newRequest() .setParam("project", project.getDbKey()) .execute() .getInput(); assertJson(json).isSimilarTo(ws.getDef().responseExampleAsString()); }

Target:
public void test_example() { ComponentDto project = db.components().insertPrivateProject(p -> p.setDbKey("sonarqube")); ComponentDto longLivingBranch = db.components() .insertProjectBranch(project, b -> b.setKey("feature/bar").setBranchType(LONG)); db.getDbClient().snapshotDao().insert(db.getSession(), newAnalysis(longLivingBranch).setLast(true).setCreatedAt(parseDateTime("2017-04-01T01:15:42+0100").getTime())); db.measures().insertLiveMeasure(longLivingBranch, qualityGateStatus, m -> m.setData("OK")); ComponentDto shortLivingBranch = db.components() .insertProjectBranch(project, b -> b.setKey("feature/foo").setBranchType(SHORT).setMergeBranchUuid(longLivingBranch.uuid())); db.getDbClient().snapshotDao().insert(db.getSession(), newAnalysis(shortLivingBranch).setLast(true).setCreatedAt(parseDateTime("2017-04-03T13:37:00+0100").getTime())); db.measures().insertLiveMeasure(shortLivingBranch, qualityGateStatus, m -> m.setData("OK")); RuleDefinitionDto rule = db.rules().insert(); db.issues().insert(rule, shortLivingBranch, shortLivingBranch, i -> i.setType(BUG).setResolution(null)); issueIndexer.indexOnStartup(emptySet()); userSession.logIn().addProjectPermission(USER, project); String json = ws.newRequest() .setParam("project", project.getDbKey()) .execute() .getInput(); assertJson(json).isSimilarTo(ws.getDef().responseExampleAsString()); assertJson(ws.getDef().responseExampleAsString()).isSimilarTo(json); }
Source:
public static BondMode getBondMode(String bondOptions){ if(bondOptions == null){ return BOND0; } int modeStartIndex = bondOptions.indexOf(MODE); int bondModeIndex = modeStartIndex + MODE.length(); if (modeStartIndex >= 0 && bondOptions.length() >= bondModeIndex +1){ int bondMode = Integer.parseInt(bondOptions.substring(bondModeIndex, bondModeIndex + 1)); if (bondMode >= 0 && bondMode < BondMode.values().length) return BondMode.values()[bondMode]; } return BOND0; }

Target:
public static BondMode getBondMode(String bondOptions){ if(bondOptions == null){ return BOND0; } String bondModeValue = findMode(bondOptions); if (bondModeValue == null){ return BOND0; } for (BondMode bondMode : BondMode.values()){ if (bondMode.getValue().equals(bondModeValue)){ return bondMode; } } return BOND0; }
Source:
private Collection<String> getBranchNames(Collection<Branch> branches) { return branches.stream().map(p -> p.getName()).collect(Collectors.toList()); }

Target:
private Collection<String> getBranchNames(Collection<Branch> branches) { return branches.stream().map(Branch::getName).collect(toList()); }
Source:
public Object getElementToHighlightAtPosition(Window element, int x, int y, Rect bounds) { final Descriptor.Host host = getHost(); if (host instanceof AndroidDescriptorHost) { final View view = element.peekDecorView(); final HighlightableDescriptor descriptor = ((AndroidDescriptorHost) host).getHighlightableDescriptor(view); return descriptor == null ? null : descriptor.getElementToHighlightAtPosition(view, x, y, bounds); } return null; }

Target:
public Object getElementToHighlightAtPosition(Window element, int x, int y, Rect bounds) { final Descriptor.Host host = getHost(); View view = null; HighlightableDescriptor descriptor = null; if (host instanceof AndroidDescriptorHost) { view = element.peekDecorView(); descriptor = ((AndroidDescriptorHost) host).getHighlightableDescriptor(view); } return descriptor == null ? null : descriptor.getElementToHighlightAtPosition(view, x, y, bounds); }
Source:
public TkText(final byte[] body) { super( new Take() { @Override @SuppressWarnings("PMD.AvoidThrowingRawExceptionTypes") public Response act(final Request req) { try { new RqPrint(req).printBody(); } catch (final IOException exc) { throw new RuntimeException(exc); } return new RsText(body); } } ); }

Target:
public TkText(final byte[] body) { super( new Take() { @Override public Response act(final Request req) { try { new RqPrint(req).printBody(); } catch (final IOException exc) { throw new IllegalStateException(exc); } return new RsText(body); } } ); }
Source:
private List<String> extractSinkIdentifierNames(List<ModifyOperation> operations) { List<ObjectIdentifier> identifiers = new ArrayList<>(operations.size()); Map<String, List<String>> tableName2DatabaseNames = new HashMap<>(); for (ModifyOperation operation : operations) { if (operation instanceof CatalogSinkModifyOperation) { ObjectIdentifier identifier = ((CatalogSinkModifyOperation) operation).getTableIdentifier(); identifiers.add(identifier); String tableName = identifier.getObjectName(); if (!tableName2DatabaseNames.containsKey(tableName)) { tableName2DatabaseNames.put(tableName, new ArrayList<>()); } tableName2DatabaseNames.get(tableName).add(identifier.getDatabaseName()); } else { throw new UnsupportedOperationException("Unsupported operation: " + operation); } } List<String> tableNames = new ArrayList<>(identifiers.size()); for (ObjectIdentifier i : identifiers) { List<String> databaseNames = tableName2DatabaseNames.get(i.getObjectName()); if (databaseNames.size() == 1) { tableNames.add(i.getObjectName()); } else if (databaseNames.size() == new HashSet<>(databaseNames).size()) { tableNames.add(String.join(".", i.getDatabaseName(), i.getObjectName())); } else { tableNames.add(String.join(".", i.getCatalogName(), i.getDatabaseName(),i.getObjectName())); } } return tableNames; }

Target:
private List<String> extractSinkIdentifierNames(List<ModifyOperation> operations) { List<String> tableNames = new ArrayList<>(operations.size()); for (ModifyOperation operation : operations) { if (operation instanceof CatalogSinkModifyOperation) { ObjectIdentifier identifier = ((CatalogSinkModifyOperation) operation).getTableIdentifier(); tableNames.add(identifier.asSummaryString()); } else { throw new UnsupportedOperationException("Unsupported operation: " + operation); } } return tableNames; }
Source:
public String getIdValue(Object object, int index) { switch ((StyleType) object) { case GENERIC: return "Generic"; case LINE: return "Line"; case POINT: return "Point"; case POLYGON: return "Polygon"; case RASTER: return "Raster"; default: return ""; } }

Target:
public String getIdValue(Object object, int index) { return object.toString(); }
Source:
public void testMemoryNodeCanBeCreatedWithMemoryNodeReferenceAsType() { MemoryNode mets = new MemoryNode(Mets.METS); assertThat(mets.getType(), is(equalTo(Mets.METS.getIdentifier()))); }

Target:
public void testMemoryNodeCanBeCreatedWithMemoryNodeReferenceAsType() { MemoryNode mets = new MemoryNode(METS_METS); assertThat(mets.getType(), is(equalTo(METS_METS.getIdentifier()))); }
Source:
public void updateZoomedEvent(ITimeEvent event) { int index = Collections.binarySearch(fZoomedEventList, event, (e1, e2) -> Long.compare(e1.getTime(), e2.getTime())); if (index >= 0) { ITimeEvent current = fZoomedEventList.get(index); if (!(current instanceof NullTimeEvent)) { Activator.getDefault().logWarning("The time event should be an instance of NullTimeEvent"); return; } if (current.getTime() == event.getTime()) { fZoomedEventList.set(index++, event); } else if (current.getTime() < event.getTime()) { fZoomedEventList.set(index++, new NullTimeEvent(this, current.getTime(), event.getTime() - current.getTime())); fZoomedEventList.add(index++, event); } long eventEndTime = (event.getTime() + event.getDuration()); long currentEndTime = (current.getTime() + current.getDuration()); if (eventEndTime < currentEndTime) { fZoomedEventList.add(index, new NullTimeEvent(this, eventEndTime + 1, currentEndTime - eventEndTime)); } } else { index = -index + 1; if (index < fZoomedEventList.size()) { fZoomedEventList.add(index, event); } else { fZoomedEventList.add(event); } } updateEntryBounds(event); }

Target:
public void updateZoomedEvent(ITimeEvent event) { try (TraceCompassLogUtils.ScopeLog poc = new TraceCompassLogUtils.ScopeLog(LOGGER, Level.INFO, "UpdateZoomedEvent")) { int index = Collections.binarySearch(fZoomedEventList, event, (e1, e2) -> Long.compare(e1.getTime(), e2.getTime())); if (index >= 0) { ITimeEvent current = fZoomedEventList.get(index); if (!(current instanceof NullTimeEvent)) { return; } if (current.getTime() == event.getTime()) { fZoomedEventList.set(index++, event); } else if (current.getTime() < event.getTime()) { fZoomedEventList.set(index++, new NullTimeEvent(this, current.getTime(), event.getTime() - current.getTime())); fZoomedEventList.add(index++, event); } long eventEndTime = (event.getTime() + event.getDuration()); long currentEndTime = (current.getTime() + current.getDuration()); if (eventEndTime < currentEndTime) { fZoomedEventList.add(index, new NullTimeEvent(this, eventEndTime + 1, currentEndTime - eventEndTime)); } } else { index = -index + 1; if (index < fZoomedEventList.size()) { fZoomedEventList.add(index, event); } else { fZoomedEventList.add(event); } } updateEntryBounds(event); } }
Source:
public void bindingChanged(BindingProvider provider, String itemName) { if (provider instanceof MCP23017BindingProvider) { if (provider.getItemNames().contains(itemName)) { bindGpioPin((MCP23017BindingProvider) provider, itemName); logger.debug("bindingChanged item bound " + itemName + " - " + Arrays.toString(provider.getItemNames().toArray())); } else { unBindGpioPin((MCP23017BindingProvider) provider, itemName); logger.debug("bindingChanged item unbound " + itemName + " - " + Arrays.toString(provider.getItemNames().toArray())); } } super.bindingChanged(provider, itemName); }

Target:
public void bindingChanged(BindingProvider provider, String itemName) { if (provider instanceof MCP23017BindingProvider) { String allItemNames = Arrays.toString(provider.getItemNames().toArray()); if (provider.getItemNames().contains(itemName)) { bindGpioPin((MCP23017BindingProvider) provider, itemName); logger.debug("bindingChanged item bound - {}", itemName, allItemNames); } else { unBindGpioPin((MCP23017BindingProvider) provider, itemName); logger.debug("bindingChanged item unbound - {}", itemName, allItemNames); } } super.bindingChanged(provider, itemName); }
Source:
public RebalanceProtocol rebalanceProtocol() { final String upgradeFrom = streamsConfig.getString(StreamsConfig.UPGRADE_FROM_CONFIG); if (upgradeFrom != null) { switch (upgradeFrom) { case StreamsConfig.UPGRADE_FROM_0100: case StreamsConfig.UPGRADE_FROM_0101: case StreamsConfig.UPGRADE_FROM_0102: case StreamsConfig.UPGRADE_FROM_0110: case StreamsConfig.UPGRADE_FROM_10: case StreamsConfig.UPGRADE_FROM_11: case StreamsConfig.UPGRADE_FROM_20: case StreamsConfig.UPGRADE_FROM_21: case StreamsConfig.UPGRADE_FROM_22: case StreamsConfig.UPGRADE_FROM_23: log.info("Turning off cooperative rebalancing for upgrade from {}.x", upgradeFrom); return RebalanceProtocol.EAGER; default: throw new IllegalArgumentException("Unknown configuration value for parameter 'upgrade.from': " + upgradeFrom); } } log.info("Cooperative rebalancing enabled now"); return RebalanceProtocol.COOPERATIVE; }

Target:
public RebalanceProtocol rebalanceProtocol() { final String upgradeFrom = streamsConfig.getString(StreamsConfig.UPGRADE_FROM_CONFIG); if (upgradeFrom != null) { switch (upgradeFrom) { case StreamsConfig.UPGRADE_FROM_0100: case StreamsConfig.UPGRADE_FROM_0101: case StreamsConfig.UPGRADE_FROM_0102: case StreamsConfig.UPGRADE_FROM_0110: case StreamsConfig.UPGRADE_FROM_10: case StreamsConfig.UPGRADE_FROM_11: case StreamsConfig.UPGRADE_FROM_20: case StreamsConfig.UPGRADE_FROM_21: case StreamsConfig.UPGRADE_FROM_22: case StreamsConfig.UPGRADE_FROM_23: log.info("Eager rebalancing enabled now for upgrade from {}.x", upgradeFrom); return RebalanceProtocol.EAGER; default: throw new IllegalArgumentException("Unknown configuration value for parameter 'upgrade.from': " + upgradeFrom); } } log.info("Cooperative rebalancing enabled now"); return RebalanceProtocol.COOPERATIVE; }
Source:
public static UID from(UUID v) { requireNonNull(v); return new UID(v); }

Target:
public static UID from(UUID v) { return new UID(v); }
Source:
public void validate(Object obj, Errors errors) { super.validate(obj, errors); DrugOrder order = (DrugOrder) obj; if (order == null) { errors.rejectValue("order", "error.general"); } else { ValidationUtils.rejectIfEmpty(errors, "asNeeded", "error.null"); ValidationUtils.rejectIfEmpty(errors, "dosingType", "error.null"); ValidationUtils.rejectIfEmpty(errors, "drug", "error.null"); if (order.getDrug() != null) ValidationUtils.rejectIfEmpty(errors, "drug.concept", "error.null"); if (!(order.getConcept() == null)) { if (!(order.getDrug() == null) && !(order.getDrug().getConcept().equals(order.getConcept()))) { errors.rejectValue("drug", "error.general"); errors.rejectValue("concept", "error.concept"); } } if (order.getDosingType() != null) { if (order.getDosingType().equals(DrugOrder.DosingType.SIMPLE)) { ValidationUtils.rejectIfEmpty(errors, "dose", "error.doseIsNullForDosingTypeSimple"); ValidationUtils.rejectIfEmpty(errors, "doseUnits", "error.doseUnitsIsNullForDosingTypeSimple"); ValidationUtils.rejectIfEmpty(errors, "route", "error.routeIsNullForDosingTypeSimple"); ValidationUtils.rejectIfEmpty(errors, "frequency", "error.frequencyIsNullForDosingTypeSimple"); } else if (order.getDosingType().equals(DrugOrder.DosingType.FREE_TEXT)) { ValidationUtils.rejectIfEmpty(errors, "instructions", "error.instructionIsNullForDosingTypeFreeText"); } else { ValidationUtils.rejectIfEmpty(errors, "dosingInstructions", "error.dosingInstructionsIsNullForDosingTypeOther"); } } validateFeildsForOutpatientCareSettingType(order, errors); } }

Target:
public void validate(Object obj, Errors errors) { super.validate(obj, errors); DrugOrder order = (DrugOrder) obj; if (order == null) { errors.rejectValue("order", "error.general"); } else { ValidationUtils.rejectIfEmpty(errors, "asNeeded", "error.null"); ValidationUtils.rejectIfEmpty(errors, "dosingType", "error.null"); if (order.getDrug() != null) ValidationUtils.rejectIfEmpty(errors, "drug.concept", "error.null"); if (!(order.getConcept() == null)) { if (!(order.getDrug() == null) && !(order.getDrug().getConcept().equals(order.getConcept()))) { errors.rejectValue("drug", "error.general"); errors.rejectValue("concept", "error.concept"); } } if (order.getDosingType() != null) { if (order.getDosingType().equals(DrugOrder.DosingType.SIMPLE)) { ValidationUtils.rejectIfEmpty(errors, "dose", "error.doseIsNullForDosingTypeSimple"); ValidationUtils.rejectIfEmpty(errors, "doseUnits", "error.doseUnitsIsNullForDosingTypeSimple"); ValidationUtils.rejectIfEmpty(errors, "route", "error.routeIsNullForDosingTypeSimple"); ValidationUtils.rejectIfEmpty(errors, "frequency", "error.frequencyIsNullForDosingTypeSimple"); } else if (order.getDosingType().equals(DrugOrder.DosingType.FREE_TEXT)) { ValidationUtils.rejectIfEmpty(errors, "instructions", "error.instructionIsNullForDosingTypeFreeText"); } else { ValidationUtils.rejectIfEmpty(errors, "dosingInstructions", "error.dosingInstructionsIsNullForDosingTypeOther"); } } validateFieldsForOutpatientCareSettingType(order, errors); validatePairedFields(order, errors); } }
Source:
private Response createResponse(Status status, Object entity) { ResponseBuilder rp = responseBuilder(status); if (entity == null) { return rp.build(); } PipedOutputStream out = new PipedOutputStream(); try { PipedInputStream in = new PipedInputStream(out); rp.entity(in); } catch (IOException e) { throw new IllegalStateException("I/O error occurred"+e); } Thread writerThread = new Thread(() -> { try (JsonWriter jsonWriter = new JsonWriter(new BufferedWriter(new OutputStreamWriter(out)))) { if (entity != null) { gson.toJson(entity, entity.getClass(), jsonWriter); jsonWriter.flush(); } } catch (IOException | JsonIOException e) { logger.error("Error streaming JSON through PipedInpuStream/PipedOutputStream: ", e); } }); writerThread.setDaemon(true); writerThread.start(); return rp.build(); }

Target:
private Response createResponse(Status status, Object entity) { ResponseBuilder rp = responseBuilder(status); if (entity == null) { return rp.build(); } PipedOutputStream out = new PipedOutputStream(); try { PipedInputStream in = new PipedInputStream(out); rp.entity(in); } catch (IOException e) { throw new IllegalStateException(e); } Thread writerThread = new Thread(() -> { try (JsonWriter jsonWriter = new JsonWriter(new BufferedWriter(new OutputStreamWriter(out)))) { if (entity != null) { gson.toJson(entity, entity.getClass(), jsonWriter); jsonWriter.flush(); } } catch (IOException | JsonIOException e) { logger.error("Error streaming JSON through PipedInpuStream/PipedOutputStream: ", e); } }); writerThread.setDaemon(true); writerThread.start(); return rp.build(); }
Source:
public double adjust(double baseValue, double modifyingValue) { return (baseValue + baseValue * modifyingValue); }

Target:
public double adjust(double baseValue, double modifyingValue) { return modifyingValue; }
Source:
protected ConfigNodeRoot setValue(String desiredPath, AbstractConfigNodeValue value, ConfigSyntax flavor) { ArrayList<AbstractConfigNode> childrenCopy = new ArrayList(children); for (int i = 0; i < childrenCopy.size(); i++) { AbstractConfigNode node = childrenCopy.get(i); if (node instanceof ConfigNodeComplexValue) { if (node instanceof ConfigNodeArray) { throw new ConfigException.Generic("The ConfigDocument had an array at the root level, and values cannot be replaced inside an array."); } else if (node instanceof ConfigNodeObject) { childrenCopy.set(i, ((ConfigNodeObject) node).setValueOnPath(desiredPath, value, flavor)); return new ConfigNodeRoot(childrenCopy); } } } throw new ConfigException.BugOrBroken("ConfigNodeRoot did not contain a value"); }

Target:
protected ConfigNodeRoot setValue(String desiredPath, AbstractConfigNodeValue value, ConfigSyntax flavor) { ArrayList<AbstractConfigNode> childrenCopy = new ArrayList<AbstractConfigNode>(children); for (int i = 0; i < childrenCopy.size(); i++) { AbstractConfigNode node = childrenCopy.get(i); if (node instanceof ConfigNodeComplexValue) { if (node instanceof ConfigNodeArray) { throw new ConfigException.WrongType(origin, "The ConfigDocument had an array at the root level, and values cannot be replaced inside an array."); } else if (node instanceof ConfigNodeObject) { childrenCopy.set(i, ((ConfigNodeObject) node).setValueOnPath(desiredPath, value, flavor)); return new ConfigNodeRoot(childrenCopy, origin); } } } throw new ConfigException.BugOrBroken("ConfigNodeRoot did not contain a value"); }
Source:
public TextCsvConverter() { enhanceMode = new HashSet<NetcdfDataset.Enhance>(); enhanceMode.add(NetcdfDataset.Enhance.ScaleMissing); enhanceMode.add(NetcdfDataset.Enhance.ConvertEnums); enhanceMode.add(NetcdfDataset.Enhance.CoordSystems); }

Target:
public TextCsvConverter() { enhanceMode = new HashSet<>(); enhanceMode.add(NetcdfDataset.Enhance.ScaleMissing); enhanceMode.add(NetcdfDataset.Enhance.ConvertEnums); enhanceMode.add(NetcdfDataset.Enhance.CoordSystems); }
Source:
public void visitMethodInvocation(MethodInvocationTree tree) { if (MAP_GET_METHOD.matches(tree)) { Tree firstArgument = Iterables.getOnlyElement(tree.arguments()); if (mapSymbol.equals(getMapSymbol(tree)) && firstArgument.is(Tree.Kind.IDENTIFIER) && ((IdentifierTree) firstArgument).symbol().equals(variable)) { result = true; } } super.visitMethodInvocation(tree); }

Target:
public void visitMethodInvocation(MethodInvocationTree tree) { if (MAP_GET_METHOD.matches(tree)) { Tree firstArgument = Iterables.getOnlyElement(tree.arguments()); if (mapSymbol.equals(getOwnerSymbol(tree)) && firstArgument.is(Tree.Kind.IDENTIFIER) && ((IdentifierTree) firstArgument).symbol().equals(variable)) { result = true; return; } } super.visitMethodInvocation(tree); }
Source:
public Type getAggColumnType(Type input, AggregationOp op) { switch (op) { case MIN: case MAX: return input; case COUNT: return Type.LONG_TYPE; case SUM: case SUM_SQUARED: if (input == Type.INT_TYPE || input == Type.LONG_TYPE) { return Type.LONG_TYPE; } if (input == Type.FLOAT_TYPE || input == Type.DOUBLE_TYPE) { return Type.DOUBLE_TYPE; } throw new IllegalArgumentException("SUM_SQUARED on " + op + " is invalid"); case AVG: case STDEV: return Type.DOUBLE_TYPE; default: throw new IllegalArgumentException(op + " is invalid"); } }

Target:
public Type getAggColumnType(Type input, AggregationOp op) { switch (op) { case MIN: case MAX: return input; case COUNT: return Type.LONG_TYPE; case SUM: case SUM_SQUARED: if (input == Type.INT_TYPE || input == Type.LONG_TYPE) { return Type.LONG_TYPE; } if (input == Type.FLOAT_TYPE || input == Type.DOUBLE_TYPE) { return Type.DOUBLE_TYPE; } throw new IllegalArgumentException(op + " on " + input + " is invalid"); case AVG: case STDEV: return Type.DOUBLE_TYPE; default: throw new IllegalArgumentException(op + " on " + input + " is invalid"); } }
Source:
public boolean offer(E e) { checkNotNull(e); boolean added = false; putLock.lock(); try { if (currentSize.get() >= capacity) { return false; } else { added = delegate.add(e); if (added) { elementAdded(e); } } } finally { putLock.unlock(); } if (added) { signalNotEmpty(); } return added; }

Target:
public boolean offer(E e) { checkNotNull(e); checkSize(e); boolean added = false; putLock.lock(); try { if (currentSize.get() + getBytesSize(e) > capacity) { return false; } else { added = delegate.add(e); if (added) { elementAdded(e); } } } finally { putLock.unlock(); } if (added) { signalNotEmpty(); } return added; }
Source:
public static void tearDownEnvironment() { checkCredentials(); log.info("Deleting Container Development Environment server adapter"); ServersView servers = new ServersView(); servers.open(); servers.getServer(SERVER_ADAPTER).delete(true); }

Target:
public static void tearDownEnvironment() { log.info("Deleting Container Development Environment server adapter"); ServersView servers = new ServersView(); servers.open(); try { servers.getServer(SERVER_ADAPTER).delete(true); } catch (EclipseLayerException exc) { exc.printStackTrace(); } }
Source:
public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; ProgressImpl other = (ProgressImpl) obj; if (creationTime == null) { if (other.creationTime != null) return false; } else if (!creationTime.equals(other.creationTime)) return false; if (lastModified == null) { if (other.lastModified != null) return false; } else if (!lastModified.equals(other.lastModified)) return false; if (steps == null) { if (other.steps != null) return false; } else if (!steps.equals(other.steps)) return false; if (user == null) { if (other.user != null) return false; } else if (!user.equals(other.user)) return false; if (workflowProgressId != other.workflowProgressId) return false; if (workflowType != other.workflowType) return false; return true; }

Target:
public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; ProgressImpl other = (ProgressImpl) obj; if (creationTime == null) { if (other.creationTime != null) return false; } else if (!creationTime.equals(other.creationTime)) return false; if (lastModified == null) { if (other.lastModified != null) return false; } else if (!lastModified.equals(other.lastModified)) return false; if (user == null) { if (other.user != null) return false; } else if (!user.equals(other.user)) return false; if (workflowProgressId != other.workflowProgressId) return false; if (workflowName != other.workflowName) return false; return true; }
Source:
public int getattrCallback(String path, ByteBuffer buf) { try { return getattr(path, FileStat.wrap(buf)); } catch (Exception e) { e.printStackTrace(); return -ErrorCodes.EIO(); } }

Target:
public int getattrCallback(String path, ByteBuffer buf) { try { return getattr(path, FileStat.wrap(buf)); } catch (Exception e) { LOG.error("Failed to getattr {}: ", path, e); return -ErrorCodes.EIO(); } }
Source:
public SamzaContainerController( Object taskFactory, long containerShutdownMs, Map<String, MetricsReporter> metricsReporterMap) { this.executorService = Executors.newSingleThreadExecutor(new ThreadFactoryBuilder() .setNameFormat("container-thread-%d").build()); this.taskFactory = taskFactory; this.metricsReporterMap = metricsReporterMap; if (containerShutdownMs == -1) { this.containerShutdownMs = TaskConfigJava.DEFAULT_TASK_SHUTDOWN_MS; } else { this.containerShutdownMs = containerShutdownMs; } }

Target:
public SamzaContainerController( Object taskFactory, long containerShutdownMs, Map<String, MetricsReporter> metricsReporterMap) { this.taskFactory = taskFactory; this.metricsReporterMap = metricsReporterMap; if (containerShutdownMs == -1) { this.containerShutdownMs = TaskConfigJava.DEFAULT_TASK_SHUTDOWN_MS; } else { this.containerShutdownMs = containerShutdownMs; } }
Source:
public byte[] toBytes(String charset) { ByteArrayOutputStream bos = new ByteArrayOutputStream(); try (FoldingWriter f = new FoldingWriter(new OutputStreamWriter(bos, charset))) { for (Property p : getProperties()) { f.write(p); } f.flush(); } catch (IOException io) { throw new ProcessingException("Failed to convert ical to bytes"); } return bos.toByteArray(); }

Target:
public byte[] toBytes(String charset) { return BEANS.get(ICalVCardHelper.class).toBytes(this, charset); }
Source:
public Integer call() throws Exception { Thread.sleep(timeout); return 1; }

Target:
public Integer call() throws Exception { latch.await(); return 1; }
Source:
public void setLocationErrorOccurred(boolean errorOccurred) { this.loginValidatorWatcher.setLocationErrorOccurred(errorOccurred); mDropdownLocation.setVisibility(View.GONE); }

Target:
public void setLocationErrorOccurred(boolean errorOccurred) { this.loginValidatorWatcher.setLocationErrorOccurred(errorOccurred); mDropdownLocation.setVisibility(View.GONE); mLoginButton.setEnabled(!errorOccurred); }
Source:
public void exitFunctionExpr(ExprParser.FunctionExprContext ctx) { String fnName = ctx.getChild(0).getText(); final List<Expr> args = ctx.getChildCount() > 3 ? (List<Expr>) nodes.get(ctx.getChild(2)) : Collections.emptyList(); Expr expr = macroTable.get(fnName, args); if (expr == null) { final Function function = Parser.getFunction(fnName); if (function == null) { throw new RuntimeException("function '" + fnName + "' is not defined."); } expr = new FunctionExpr(function, fnName, args); } nodes.put(ctx, expr); }

Target:
public void exitFunctionExpr(ExprParser.FunctionExprContext ctx) { String fnName = ctx.getChild(0).getText(); final List<Expr> args = ctx.getChildCount() > 3 ? (List<Expr>) nodes.get(ctx.getChild(2)) : Collections.emptyList(); Expr expr = macroTable.get(fnName, args); if (expr == null) { final Function function = Parser.getFunction(fnName); if (function == null) { throw new RE("function '%s' is not defined.", fnName); } expr = new FunctionExpr(function, fnName, args); } nodes.put(ctx, expr); }