auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void handleSignInResponse(int resultCode, Intent data) { if (resultCode == RESULT_OK) { final String prevUid = data.getStringExtra(ExtraConstants.EXTRA_MERGE_FAILED); if (prevUid != null) { FirebaseDatabase.getInstance() .getReference() .child("chats") .addListenerForSingleValueEvent( new ValueEventListener() { @Override public void onDataChange(DataSnapshot snapshot) { if (snapshot.getValue() != null) { for (DataSnapshot chatSnapshot : snapshot.getChildren()) { Chat chat = chatSnapshot.getValue(Chat.class); if (chat.getUid().equals(prevUid)) { String currentUid = FirebaseAuth .getInstance() .getCurrentUser() .getUid(); chatSnapshot.getRef() .child("uid") .setValue(currentUid); chatSnapshot.getRef() .child("name") .setValue("User " + currentUid .substring(0, 6)); } } } } @Override public void onCancelled(DatabaseError error) { Log.e(TAG, "onCancelled: ", error.toException()); } }); } startActivity(SignedInActivity.createIntent(this)); finish(); return; } if (resultCode == RESULT_CANCELED) { showSnackbar(R.string.sign_in_cancelled); return; } showSnackbar(R.string.unknown_sign_in_response); }

Target:
private void handleSignInResponse(int resultCode, Intent data) { IdpResponse response = IdpResponse.fromResultIntent(data); if (resultCode == RESULT_OK) { startSignedInActivity(response); setResult(RESULT_OK); finish(); } else { if (response == null) { showSnackbar(R.string.sign_in_cancelled); return; } if (response.getError().getErrorCode() == ErrorCodes.NO_NETWORK) { showSnackbar(R.string.no_internet_connection); return; } showSnackbar(R.string.unknown_error); Log.e(TAG, "Sign-in error: ", response.getError()); } }
Source:
public void getGroups(String id, Handler<Either<String, JsonArray>> results) { String query = "" + "MATCH (g:Group)<-[:IN]-(u:User { id: {id} }) WHERE exists(g.id) " + "OPTIONAL MATCH (c:Class)<-[:DEPENDS]-(g) " + "OPTIONAL MATCH (s:Structure)<-[:DEPENDS]-(g) " + "WITH g, collect( distinct {name: c.name, id: c.id}) as classes, collect( distinct {name: s.name, id: s.id}) as structures, " + "HEAD(filter(x IN labels(g) WHERE x <> 'Visible' AND x <> 'Group')) as type " + "RETURN DISTINCT " + "g.id as id, " + "g.name as name, " + "g.filter as filter, " + "g.displayName as displayName, " + "g.users as internalCommunicationRule, " + "type, " + "CASE WHEN any(x in classes where x <> {name: null, id: null}) THEN classes END as classes, " + "CASE WHEN any(x in structures where x <> {name: null, id: null}) THEN structures END as structures, " + "CASE WHEN (g: ProfileGroup)-[:DEPENDS]-(:Structure) THEN 'StructureGroup' END as subType"; JsonObject params = new JsonObject().put("id", id); neo.execute(query, params, validResultHandler(results)); }

Target:
public void getGroups(String id, Handler<Either<String, JsonArray>> results) { String query = "" + "MATCH (g:Group)<-[:IN]-(u:User { id: {id} }) " + "OPTIONAL MATCH (c:Class)<-[:DEPENDS]-(g) " + "OPTIONAL MATCH (s:Structure)<-[:DEPENDS]-(g) " + "WITH g, collect( distinct {name: c.name, id: c.id}) as classes, collect( distinct {name: s.name, id: s.id}) as structures, " + "HEAD(filter(x IN labels(g) WHERE x <> 'Visible' AND x <> 'Group')) as type " + "RETURN DISTINCT " + "g.id as id, " + "g.name as name, " + "g.filter as filter, " + "g.displayName as displayName, " + "g.users as internalCommunicationRule, " + "type, " + "CASE WHEN any(x in classes where x <> {name: null, id: null}) THEN classes END as classes, " + "CASE WHEN any(x in structures where x <> {name: null, id: null}) THEN structures END as structures, " + "CASE WHEN (g: ProfileGroup)-[:DEPENDS]-(:Structure) THEN 'StructureGroup' END as subType"; JsonObject params = new JsonObject().put("id", id); neo.execute(query, params, validResultHandler(results)); }
Source:
public boolean matches(@NonNull Pattern pattern) { if (pattern.matcher(getName()).find()) { return true; } if (pattern.matcher(Integer.toString(fThreadId)).find()) { return true; } if (pattern.matcher(Integer.toString(fParentThreadId)).find()) { return true; } if (pattern.matcher(Integer.toString(fThreadQuark)).find()) { return true; } return pattern.matcher(Utils.formatTime(getStartTime(), TimeFormat.CALENDAR, Resolution.NANOSEC)).find(); }

Target:
public boolean matches(@NonNull Pattern pattern) { if (pattern.matcher(getName()).find()) { return true; } if (pattern.matcher(Integer.toString(fThreadId)).find()) { return true; } if (pattern.matcher(Integer.toString(fParentThreadId)).find()) { return true; } if (pattern.matcher(Integer.toString(fThreadQuark)).find()) { return true; } if (pattern.matcher(Utils.formatTime(getStartTime(), TimeFormat.CALENDAR, Resolution.NANOSEC)).find()) { return true; } return pattern.matcher(fTrace.getName()).find(); }
Source:
public static ProviderConfigurationBuilder configurationBuilder() { return ProviderConfigurationBuilder.create() .property(Attributes.PRIORITY_PROPERTY) .property(Attributes.ENABLED_PROPERTY) .property(Attributes.ACTIVE_PROPERTY); }

Target:
public final static ProviderConfigurationBuilder configurationBuilder() { return ProviderConfigurationBuilder.create() .property(Attributes.PRIORITY_PROPERTY) .property(Attributes.ENABLED_PROPERTY) .property(Attributes.ACTIVE_PROPERTY); }
Source:
private static URI dockerDaemonUri() { if (SystemInfo.isLinux()) { return UNIX_SOCKET_URI; } String host = System.getenv(BOOT2DOCKER_HOST_PROPERTY); if (host != null) { URI userURI; try { userURI = new URI(host); } catch (URISyntaxException e) { LOG.error(String.format("Unable to parse {0} property with value {1}", BOOT2DOCKER_HOST_PROPERTY, host), e); return DEFAULT_BOOT2DOCKER_URI; } String tls = System.getenv(BOOT2DOCKER_TLS_VERIFY_PROPERTY); String protocol = "1".equals(tls) ? "https" : "http"; try { return new URI(protocol, null, userURI.getHost(), userURI.getPort(), null, null, null); } catch (URISyntaxException e) { LOG.error(String.format("Unable to create URI {0} property with value {1} and TLS {2}", BOOT2DOCKER_HOST_PROPERTY, host, BOOT2DOCKER_TLS_VERIFY_PROPERTY), e); return DEFAULT_BOOT2DOCKER_URI; } } return DEFAULT_BOOT2DOCKER_URI; }

Target:
private static URI dockerDaemonUri() { return dockerDaemonUri(SystemInfo.isLinux(), System.getenv()); }
Source:
protected void exportSampleData() { if (preView == null) { return; } final EObject sampleData = preView.getSampleData(); if (sampleData == null) { return; } final FileDialog dialog = new FileDialog(parent.getShell(), SWT.SAVE); dialog.setFilterExtensions(new String[] { "*.xmi" }); final String result = dialog.open(); if (result == null) { return; } final ResourceSet rs = new ResourceSetImpl(); final Resource resource = rs.createResource(URI.createFileURI(result)); resource.getContents().add(sampleData); try { resource.save(null); } catch (final IOException ex) { } }

Target:
protected void exportSampleData() { if (preView == null) { return; } final EObject sampleData = preView.getSampleData(); if (sampleData == null) { return; } final FileDialog dialog = new FileDialog(parent.getShell(), SWT.SAVE); dialog.setFilterExtensions(new String[] { "*.xmi" }); final String result = dialog.open(); if (result == null) { return; } final ResourceSet rs = new ResourceSetImpl(); final Resource resource = rs.createResource(URI.createFileURI(result)); resource.getContents().add(sampleData); try { resource.save(null); } catch (final IOException e) { final StringWriter sw = new StringWriter(); e.printStackTrace(new PrintWriter(sw)); final String stackTrace = sw.toString(); final List<Status> childStatuses = new ArrayList<Status>(); for (final String line : stackTrace.split(System.getProperty("line.separator"))) { childStatuses.add(new Status(IStatus.ERROR, Activator.PLUGIN_ID, line)); } final MultiStatus status = new MultiStatus(Activator.PLUGIN_ID, IStatus.ERROR, childStatuses.toArray(new Status[] {}), e.getLocalizedMessage(), null); ErrorDialog.openError(parent.getShell(), Messages.PreviewView_SaveErrorDialogTitle, Messages.PreviewView_SaveErrorDescription, status); } }
Source:
protected void configure(HttpSecurity http) throws Exception { http .addFilterAfter(new CsrfHeaderFilter(), CsrfFilter.class) .csrf().csrfTokenRepository(csrfTokenRepository()) .and() .exceptionHandling().authenticationEntryPoint(new Http403ForbiddenEntryPoint()) .and() .userDetailsService(userDetailsService()) .formLogin() .permitAll() .failureHandler(authenticationFailureHandler) .and() .logout() .permitAll() .logoutSuccessUrl("/#/login") .and() .authorizeRequests() .antMatchers("/api/admin/**").access("hasRole('palga')") .antMatchers( "/", "/index.html", "/*.css", "/*.js", "/*.json", "/css/**", "/content/**", "/robots.txt", "/*.ico", "/api/public/**", "/api/password/request-new", "/api/password/reset" ).permitAll() .antMatchers(HttpMethod.POST, "/api/register/users").permitAll() .antMatchers(HttpMethod.POST, "/api/register/users/**").permitAll() .antMatchers(HttpMethod.GET, "/api/register/users/activate/**").permitAll() .antMatchers(HttpMethod.GET, "/api/status").permitAll() .antMatchers(HttpMethod.GET, "/api/ping").permitAll() .antMatchers("/api/**", "/error").authenticated() .and() .headers() .addHeaderWriter(new StaticHeadersWriter("Content-Security-Policy-Report-Only", "default-src 'self' 'unsafe-inline'; img-src 'self' data:; font-src 'self' data:")) ; }

Target:
protected void configure(HttpSecurity http) throws Exception { http .addFilterAfter(new CsrfHeaderFilter(), CsrfFilter.class) .csrf().csrfTokenRepository(csrfTokenRepository()) .and() .exceptionHandling().authenticationEntryPoint(new Http403ForbiddenEntryPoint()) .and() .userDetailsService(userDetailsService()) .formLogin() .permitAll() .failureHandler(authenticationFailureHandler) .and() .logout() .permitAll() .logoutSuccessUrl("/#/login") .and() .authorizeRequests() .antMatchers("/api/admin/**").access("hasRole('palga')") .antMatchers( "/", "/index.html", "/*.css", "/*.js", "/*.json", "/css/**", "/content/**", "/robots.txt", "/*.ico", "/api/public/**", "/api/password/request-new", "/api/password/reset", "/error" ).permitAll() .antMatchers(HttpMethod.POST, "/api/register/users").permitAll() .antMatchers(HttpMethod.POST, "/api/register/users/**").permitAll() .antMatchers(HttpMethod.GET, "/api/register/users/activate/**").permitAll() .antMatchers(HttpMethod.GET, "/api/status").permitAll() .antMatchers(HttpMethod.GET, "/api/ping").permitAll() .antMatchers("/api/**").authenticated() .and() .headers() .addHeaderWriter(new StaticHeadersWriter("Content-Security-Policy-Report-Only", "default-src 'self' 'unsafe-inline'; img-src 'self' data:; font-src 'self' data:")) ; }
Source:
protected void setExtra(Query call) { this.extra = call.getMap(); this.query = call.get("query", "fossasia"); this.setParam(); }

Target:
protected void setExtra(Query call) { this.extra = call.getMap(); this.query = call.get("query", ""); this.setParam(); }
Source:
public void update() { FBO sceneOpaque = dynamicFBM.getFBO(DefaultDynamicFBOs.ReadOnlyGBuffer.getResourceUrn()); sceneOpaque.attachDepthBufferTo(dynamicFBM.getFBO(REFRACTIVE_REFLECTIVE_URN)); }

Target:
public void update() { READ_ONLY_GBUFFER.attachDepthBufferTo(displayResolutionDependentFBOs.get(REFRACTIVE_REFLECTIVE)); }
Source:
public Label getLabel(SkyKey key) { if (key instanceof ActionLookupKey) { return Preconditions.checkNotNull(((ActionLookupKey) key.argument()).getLabel(), key); } else if (SkyFunctions.isSkyFunction(SkyFunctions.TRANSITIVE_TARGET).apply(key)) { return ((TransitiveTargetKey) key).getLabel(); } else { throw new UnsupportedOperationException(key.toString()); } }

Target:
public Label getLabel(SkyKey key) { if (key instanceof ActionLookupKey) { return Preconditions.checkNotNull(((ActionLookupKey) key.argument()).getLabel(), key); } else if (key instanceof TransitiveTargetKey) { return ((TransitiveTargetKey) key).getLabel(); } else { throw new UnsupportedOperationException(key.toString()); } }
Source:
public List<SnapshotDescription> listSnapshots() throws IOException { ListSnapshotsRequest request = ListSnapshotsRequest.newBuilder() .setParent(getSnapshotClusterName().toString()) .build(); ListSnapshotsResponse snapshotList = Futures.getChecked(bigtableTableAdminClient .listSnapshotsAsync(request), IOException.class); List<SnapshotDescription> response = new ArrayList<>(); for (Snapshot snapshot : snapshotList.getSnapshotsList()) { BigtableSnapshotName snapshotName = new BigtableSnapshotName(snapshot.getName()); BigtableTableName tableName = new BigtableTableName(snapshot.getSourceTable().getName()); HBaseProtos.SnapshotDescription snapDesc = HBaseProtos.SnapshotDescription.newBuilder() .setName(snapshotName.getSnapshotId()) .setTable(tableName.getTableId()) .setCreationTime(TimeUnit.SECONDS.toMillis(snapshot.getCreateTime().getSeconds())) .build(); response.add(new SnapshotDescription(snapDesc.getName(), TableName.valueOf(snapDesc.getTable()), SnapshotType.valueOf(snapDesc.getType().toString()) , snapDesc.getOwner(), snapDesc.getCreationTime(), snapDesc.getVersion())); } return response; }

Target:
public List<SnapshotDescription> listSnapshots() throws IOException { ListSnapshotsRequest request = ListSnapshotsRequest.newBuilder() .setParent(getSnapshotClusterName().toString()) .build(); ListSnapshotsResponse snapshotList = Futures.getChecked(bigtableTableAdminClient .listSnapshotsAsync(request), IOException.class); List<SnapshotDescription> response = new ArrayList<>(); for (Snapshot snapshot : snapshotList.getSnapshotsList()) { response.add(new SnapshotDescription( snapshot.getName(), TableName.valueOf(snapshot.getSourceTable().getName()))); } return response; }
Source:
public boolean isKeyFrame(byte[] buff, int off, int len) { if (buff == null || len < 1 || buff.length < len) { return false; } int nalType = buff[off] & kTypeMask; if (nalType == kFuA) { if (parseFuaNaluForKeyFrame(buff, off, len)) { return true; } } else { if (parseSingleNaluForKeyFrame(buff, off, len)) { return true; } } return false; }

Target:
public static boolean isKeyFrame(byte[] buff, int off, int len) { if (buff == null || buff.length < off + Math.max(len, 1)) { return false; } int nalType = buff[off] & kTypeMask; if (nalType == kFuA) { if (parseFuaNaluForKeyFrame(buff, off, len)) { return true; } } else { if (parseSingleNaluForKeyFrame(buff, off, len)) { return true; } } return false; }
Source:
public void stop(ComponentContext context) throws InterruptedException { super.stop(context); redirectResolver = new DefaultRedirectResolver(); }

Target:
public void stop(ComponentContext context) throws InterruptedException { super.stop(context); redirectResolver = null; }
Source:
private String parameterValidation(final Boolean active, final String sortBy, final String sortOrder) { final List<String> sortbyFields = ImmutableList.<String>builder().add("trialDbId").add("trialName").add("programDbId").add("programName").add("startDate").add("endDate").add("active").build(); final List<String> sortOrders = ImmutableList.<String>builder().add(TrialResourceBrapi.ASCENDING).add(TrialResourceBrapi.DESCENDING).build(); if (active != null && !active) { return gerMessageError(1); } if (!StringUtils.isBlank(sortBy) && !sortbyFields.contains(sortBy)) { return gerMessageError(2); } if (!StringUtils.isBlank(sortOrder) && !sortOrders.contains(sortOrder)) { return gerMessageError(3); } return ""; }

Target:
private String parameterValidation(final Boolean active, final String sortBy, final String sortOrder) { final List<String> sortbyFields = ImmutableList.<String>builder().add("trialDbId").add("trialName").add("programDbId").add("programName").add("startDate").add("endDate").add("active").build(); final List<String> sortOrders = ImmutableList.<String>builder().add(TrialResourceBrapi.ORDER_BY_ASCENDING).add(TrialResourceBrapi.ORDER_BY_DESCENDING).build(); if (active != null && !active) { return "No inactive studies found."; } if (!StringUtils.isBlank(sortBy) && !sortbyFields.contains(sortBy)) { return "sortBy bad filter, expect trialDbId/trialName/programDbId/programName/startDate/endDate/active"; } if (!StringUtils.isBlank(sortOrder) && !sortOrders.contains(sortOrder)) { return "sortOrder bad filter, expect asc/desc"; } return ""; }
Source:
public void startTraining(SilentUpdatesMessage message) { if (accumulator != null) { if (message.getOriginatorId() == transport.getOwnOriginatorId()) { return; } ; try { if (!bypassMode.get()) { updatesBuffer.put(message.getUpdates()); } } catch (Exception e) { throw new RuntimeException(e); } } else if (params != null && stepFunction != null) { synchronized (this) { int encoding = message.getUpdates().data().getInt(3); if (encoding == 0) { Nd4j.getExecutioner().thresholdDecode(message.getUpdates(), updates); sparseCounter.incrementAndGet(); } else if (encoding == 1) { Nd4j.getExecutioner().bitmapDecode(message.getUpdates(), updates); denseCounter.incrementAndGet(); } if ((sparseCounter.get() + denseCounter.get()) % 100 == 0) { log.info("Sparse/Dense ratio: {}", String.format("%.2f", (sparseCounter.get() +1) / (double) (denseCounter.get() + 1))); } hasSomething.set(true); if (updatesCount.incrementAndGet() % Math.max(transport.numberOfKnownClients(), 5) == 0) { stepFunction.step(params, updates); Nd4j.getMemoryManager().memset(updates); hasSomething.set(false); } } if (transport.numberOfKnownClients() > 1) { transport.sendMessageToAllClients(message, message.getOriginatorId(), transport.getOwnOriginatorId()); } } else throw new DL4JInvalidConfigException("Neither GradientsAccumulator or StepFunction is defined!"); }

Target:
public void startTraining(SilentUpdatesMessage message) { if (accumulator != null) { if (message.getOriginatorId() == transport.getOwnOriginatorId()) { return; } ; try { if (!bypassMode.get()) { updatesBuffer.put(message.getUpdates()); } } catch (Exception e) { throw new RuntimeException(e); } } else if (params != null && stepFunction != null) { synchronized (this) { int encoding = message.getUpdates().data().getInt(3); if (encoding == ThresholdCompression.FLEXIBLE_ENCODING) { Nd4j.getExecutioner().thresholdDecode(message.getUpdates(), updates); sparseCounter.incrementAndGet(); } else if (encoding == ThresholdCompression.BITMAP_ENCODING) { Nd4j.getExecutioner().bitmapDecode(message.getUpdates(), updates); denseCounter.incrementAndGet(); } else throw new DL4JInvalidConfigException("Unknown compression header received: " + encoding); hasSomething.set(true); if (updatesCount.incrementAndGet() % Math.max(transport.numberOfKnownClients(), 5) == 0) { stepFunction.step(params, updates); Nd4j.getMemoryManager().memset(updates); hasSomething.set(false); } } if (transport.numberOfKnownClients() > 1) { transport.sendMessageToAllClients(message, message.getOriginatorId(), transport.getOwnOriginatorId()); } } else throw new DL4JInvalidConfigException("Neither GradientsAccumulator or StepFunction is defined!"); }
Source:
public void commence(HttpServletRequest request, HttpServletResponse response, AuthenticationException authException) throws IOException, ServletException { BufferedRequestWrapper bufferedRequest = new BufferedRequestWrapper(request); log.debug(MessageFormat.format("requestXML:{0},uri:{1}", bufferedRequest.getInputStreamString(),request.getRequestURI())); BaseResponseDto dto = mobileAppTokenProvider.generateResponseDto(ReturnMessage.UNAUTHORIZED); response.setContentType("application/json; charset=UTF-8"); response.setCharacterEncoding(StandardCharsets.UTF_8.name()); PrintWriter out = response.getWriter(); String jsonString = objectMapper.writeValueAsString(dto); out.print(jsonString); }

Target:
public void commence(HttpServletRequest request, HttpServletResponse response, AuthenticationException authException) throws IOException, ServletException { BufferedRequestWrapper bufferedRequest = new BufferedRequestWrapper(request); log.debug(MessageFormat.format("[Authentication Entry Point] uri: {0} body: {1}",request.getRequestURI(),bufferedRequest.getInputStreamString())); BaseResponseDto dto = mobileAppTokenProvider.generateResponseDto(ReturnMessage.UNAUTHORIZED); response.setContentType("application/json; charset=UTF-8"); response.setCharacterEncoding(StandardCharsets.UTF_8.name()); PrintWriter out = response.getWriter(); String jsonString = objectMapper.writeValueAsString(dto); out.print(jsonString); }
Source:
protected void closeConnection() { for (IpNode receiverNode : receiverNodes.keySet()) { Socket socket = receiverNodes.get(receiverNode); if ((socket != null) && (!socket.isClosed())) { try { socket.close(); } catch (IOException e) { logger.warn("Could not close socket in {}: ", receiverNode, this.thing.getUID(), e); } } receiverNodes.put(receiverNode, null); } }

Target:
protected void closeConnection() { for (IpNode receiverNode : receiverNodes.keySet()) { Socket socket = receiverNodes.get(receiverNode); if ((socket != null) && (!socket.isClosed())) { try { socket.close(); } catch (IOException e) { logger.warn("Could not close socket in {}: {}", receiverNode, this.thing.getUID(), e.getMessage()); } } receiverNodes.put(receiverNode, null); } }
Source:
public List<String> getItems() throws Exception { if (kit == null) { throw new Exception(tl("kitNotFound")); } try { final Object kitItems = kit.get("items"); if (kitItems instanceof List) { return (List) kitItems; } throw new Exception("Invalid item list"); } catch (Exception e) { ess.getLogger().log(Level.WARNING, "Error parsing kit " + kitName + ": " + e.getMessage()); throw new Exception(tl("kitError2"), e); } }

Target:
public List<String> getItems() throws Exception { if (kit == null) { throw new Exception(tl("kitNotFound")); } try { final List<String> itemList = new ArrayList<String>(); final Object kitItems = kit.get("items"); if (kitItems instanceof List) { for (Object item : (List) kitItems) { if (item instanceof String) { itemList.add(item.toString()); continue; } throw new Exception("Invalid kit item: " + item.toString()); } return itemList; } throw new Exception("Invalid item list"); } catch (Exception e) { ess.getLogger().log(Level.WARNING, "Error parsing kit " + kitName + ": " + e.getMessage()); throw new Exception(tl("kitError2"), e); } }
Source:
public void refresh() { EEFIdeUiPlugin.getPlugin().debug("EEFSection#refresh(...)"); IMessageManager messageManager = this.tabbedPropertySheetPage.getForm().getMessageManager(); EAttribute auditEAttribute = EefPackage.Literals.EEF_RULE_AUDIT_DESCRIPTION__AUDIT_EXPRESSION; EAttribute messageEAttribute = EefPackage.Literals.EEF_VALIDATION_RULE_DESCRIPTION__MESSAGE_EXPRESSION; EEFPage page = this.eefSectionDescriptor.getEEFPage(); List<EEFSemanticValidationRuleDescription> semanticValidationRules = page.getDescription().getSemanticValidationRules(); for (EEFSemanticValidationRuleDescription semanticValidationRule : semanticValidationRules) { boolean isValid = true; for (EEFRuleAuditDescription audit : semanticValidationRule.getAudits()) { String auditExpression = audit.getAuditExpression(); Boolean result = new Eval(page.getInterpreter(), page.getVariableManager()).get(auditEAttribute, auditExpression, Boolean.class); isValid = isValid && (result != null && result.booleanValue()); if (!isValid) { break; } } if (isValid) { messageManager.removeMessage(semanticValidationRule); } else { String messageExpression = semanticValidationRule.getMessageExpression(); String message = new Eval(page.getInterpreter(), page.getVariableManager()).get(messageEAttribute, messageExpression, String.class); messageManager.addMessage(semanticValidationRule, message, null, semanticValidationRule.getSeverity().getValue()); } } for (ILifecycleManager lifecycleManager : lifecycleManagers) { lifecycleManager.refresh(); } this.tabbedPropertySheetPage.getForm().getMessageManager().update(); }

Target:
public void refresh() { EEFIdeUiPlugin.getPlugin().debug("EEFSection#refresh(...)"); this.lifecycleManager.refresh(); }
Source:
public boolean verifyCreated(int timeToLive, int futureTimeToLive, Date invocationDate) { Date date = invocationDate == null ? new Date() : invocationDate; long invocationTime = date.getTime(); if (futureTimeToLive > 0) { date.setTime(invocationTime + futureTimeToLive * 1000); } if (!verifyCreatedAfter(date)) { return false; } invocationTime -= timeToLive * 1000; date.setTime(invocationTime); if (!verifyCreatedBefore(date)) { return false; } LOG.info("Validation of Timestamp: Everything is ok"); return true; }

Target:
public boolean verifyCreated(int timeToLive, int futureTimeToLive, Date invocationDate) { Date currentInvocationDate = invocationDate == null ? new Date() : invocationDate; long invocationTime = currentInvocationDate.getTime(); if (futureTimeToLive > 0) { currentInvocationDate.setTime(invocationTime + futureTimeToLive * 1000); } if (!verifyCreatedAfter(currentInvocationDate)) { return false; } invocationTime -= timeToLive * 1000; currentInvocationDate.setTime(invocationTime); if (!verifyCreatedBefore(currentInvocationDate)) { return false; } LOG.info("Validation of Timestamp: Everything is ok"); return true; }
Source:
public MessageQueue queue() { return MessageQueue.CertificationSuccess_EventMessage; }

Target:
public MessageQueue queue() { return MessageQueue.RegisterBankAccount_EventMessage; }
Source:
public Map<String, Serializable> getCachedMetaData( final String key ) { final IPluginCacheManager cacheManager = PentahoSystem.get( IPluginCacheManager.class ); final IReportContentCache cache = cacheManager.getCache(); return cache.getMetaData( key ); }

Target:
private Map<String, Serializable> getCachedMetaData( final String key ) { final IPluginCacheManager cacheManager = PentahoSystem.get( IPluginCacheManager.class ); final IReportContentCache cache = cacheManager.getCache(); return cache.getMetaData( key ); }
Source:
protected void setAdditionalParameters() { String moderatedInstructorEmail = getRequestParamValue(Const.ParamsNames.FEEDBACK_SESSION_MODERATED_INSTRUCTOR); Assumption.assertPostParamNotNull(Const.ParamsNames.FEEDBACK_SESSION_MODERATED_INSTRUCTOR, moderatedInstructorEmail); moderatedInstructor = logic.getInstructorForEmail(courseId, moderatedInstructorEmail); }

Target:
protected void setAdditionalParameters() throws EntityDoesNotExistException { String moderatedInstructorEmail = getRequestParamValue(Const.ParamsNames.FEEDBACK_SESSION_MODERATED_PERSON); Assumption.assertPostParamNotNull(Const.ParamsNames.FEEDBACK_SESSION_MODERATED_PERSON, moderatedInstructorEmail); moderatedInstructor = logic.getInstructorForEmail(courseId, moderatedInstructorEmail); if (moderatedInstructor == null) { throw new EntityDoesNotExistException("Instructor Email " + moderatedInstructorEmail + " does not exist in " + courseId + "."); } }
Source:
public boolean isThis() { if (this.token == Token.NAME) { return "this".equals(this.getOriginalName()); } return this.token == Token.THIS; }

Target:
public boolean isThis() { return this.token == Token.THIS; }
Source:
public BrokerReduceService(PinotConfiguration config) { _maxReduceThreadsPerQuery = config.getProperty(CommonConstants.Broker.CONFIG_OF_MAX_REDUCE_THREADS_PER_QUERY, CommonConstants.Broker.MAX_REDUCE_THREADS_PER_QUERY); LOGGER.info("Initializing BrokerReduceService with reduce threads.", _maxReduceThreadsPerQuery); ThreadFactory reduceThreadFactory = new ThreadFactoryBuilder().setDaemon(false).setPriority(QUERY_RUNNER_THREAD_PRIORITY) .setNameFormat(REDUCE_THREAD_NAME_FORMAT).build(); ExecutorService delegate = Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors(), reduceThreadFactory); _reduceExecutorService = MoreExecutors.listeningDecorator(delegate); }

Target:
public BrokerReduceService(PinotConfiguration config) { _maxReduceThreadsPerQuery = config.getProperty(CommonConstants.Broker.CONFIG_OF_MAX_REDUCE_THREADS_PER_QUERY, CommonConstants.Broker.DEFAULT_MAX_REDUCE_THREADS_PER_QUERY); int numThreadsInExecutorService = Runtime.getRuntime().availableProcessors(); LOGGER.info("Initializing BrokerReduceService with threads, and max reduce threads.", numThreadsInExecutorService, _maxReduceThreadsPerQuery); ThreadFactory reduceThreadFactory = new ThreadFactoryBuilder().setDaemon(false).setPriority(QUERY_RUNNER_THREAD_PRIORITY) .setNameFormat(REDUCE_THREAD_NAME_FORMAT).build(); _reduceExecutorService = Executors.newFixedThreadPool(numThreadsInExecutorService, reduceThreadFactory); }
Source:
public URI reconstructURI(ServiceInstance instance, URI original) { Assert.notNull(instance, "instance can not be null"); String serviceId = instance.getServiceId(); RibbonLoadBalancerContext context = this.clientFactory .getLoadBalancerContext(serviceId); Server server = new Server(instance.getHost(), instance.getPort()); boolean secure = isSecure(server, serviceId); URI uri = original; if (secure) { uri = UriComponentsBuilder.fromUri(uri).scheme("https").build(true).toUri(); } return context.reconstructURIWithServer(server, uri); }

Target:
public URI reconstructURI(ServiceInstance instance, URI original) { Assert.notNull(instance, "instance can not be null"); String serviceId = instance.getServiceId(); RibbonLoadBalancerContext context = this.clientFactory .getLoadBalancerContext(serviceId); Server server = new Server(instance.getHost(), instance.getPort()); IClientConfig clientConfig = clientFactory.getClientConfig(serviceId); ServerIntrospector serverIntrospector = serverIntrospector(serviceId); URI uri = RibbonUtils.updateToHttpsIfNeeded(original, clientConfig, serverIntrospector, server); return context.reconstructURIWithServer(server, uri); }
Source:
public Long countDocuments(String query) throws DataException { SearchRestClient restClient = initiateRestClient(); String response = restClient.countDocuments(overrideNullQuery(query)); if (!response.equals("")) { JsonReader jsonReader = Json.createReader(new StringReader(response)); JsonObject result = jsonReader.readObject(); return result.getJsonNumber("count").longValue(); } else { return 0L; } }

Target:
public Long countDocuments(String query) throws DataException { SearchRestClient restClient = initiateRestClient(); String response = restClient.countDocuments(overrideNullQuery(query)); if (!response.equals("")) { try (JsonReader jsonReader = Json.createReader(new StringReader(response))) { JsonObject result = jsonReader.readObject(); return result.getJsonNumber("count").longValue(); } } else { return 0L; } }
Source:
private void start() { for (IServer server : ServerCore.getServers()) { if (server.getServerType() == null || server.getServerType().getId().equals(WSTUtils.LIVERELOAD_SERVER_TYPE)) { continue; } Logger.info("Adding ServerListener to existing server: " + server.getName()); addServerListener(server); if (server.getServerState() == IServer.STATE_STARTED) { Logger.info("Also adding PublishListener to existing server: " + server.getName()); addPublishListener(server); } } }

Target:
private void start() { for (IServer server : ServerCore.getServers()) { if (server.getServerType() == null || WSTUtils.LIVERELOAD_SERVER_TYPE.equals(server.getServerType().getId())) { continue; } Logger.info("Adding ServerListener to existing server: " + server.getName()); addServerListener(server); if (server.getServerState() == IServer.STATE_STARTED) { Logger.info("Also adding PublishListener to existing server: " + server.getName()); addPublishListener(server); } } }
Source:
public BlockBreakHandler getItemHandler() { return new BlockBreakHandler() { @Override public boolean isPrivate() { return false; } @Override public boolean onBlockBreak(BlockBreakEvent e, ItemStack item, int fortune, List<ItemStack> drops) { if (isItem(item)) { if (Slimefun.hasUnlocked(e.getPlayer(), ExplosivePickaxe.this, true)) { e.getBlock().getWorld().createExplosion(e.getBlock().getLocation(), 0.0F); e.getBlock().getWorld().playSound(e.getBlock().getLocation(), Sound.ENTITY_GENERIC_EXPLODE, 0.3F, 1F); List<Block> blocks = new ArrayList<>(); for (int x = -1; x <= 1; x++) { for (int y = -1; y <= 1; y++) { for (int z = -1; z <= 1; z++) { if (x == 0 && y == 0 && z == 0) { continue; } blocks.add(e.getBlock().getRelative(x, y, z)); } } } EntityExplodeEvent entityExplodeEvent = new EntityExplodeEvent(e.getPlayer(), e.getBlock().getLocation(), blocks, 0); Bukkit.getServer().getPluginManager().callEvent(entityExplodeEvent); if (!entityExplodeEvent.isCancelled()) { entityExplodeEvent.blockList().forEach(b -> { breakBlock(e.getPlayer(), item, b, fortune, drops); }); } } return true; } else { return false; } } }; }

Target:
public BlockBreakHandler getItemHandler() { return new BlockBreakHandler() { @Override public boolean isPrivate() { return false; } @Override public boolean onBlockBreak(BlockBreakEvent e, ItemStack item, int fortune, List<ItemStack> drops) { if (isItem(item)) { if (Slimefun.hasUnlocked(e.getPlayer(), ExplosivePickaxe.this, true)) { e.getBlock().getWorld().createExplosion(e.getBlock().getLocation(), 0.0F); e.getBlock().getWorld().playSound(e.getBlock().getLocation(), Sound.ENTITY_GENERIC_EXPLODE, 0.3F, 1F); List<Block> blocks = new ArrayList<>(); for (int x = -1; x <= 1; x++) { for (int y = -1; y <= 1; y++) { for (int z = -1; z <= 1; z++) { if (x == 0 && y == 0 && z == 0) { continue; } blocks.add(e.getBlock().getRelative(x, y, z)); } } } BlockExplodeEvent blockExplodeEvent = new BlockExplodeEvent(e.getBlock(), blocks, 0); Bukkit.getServer().getPluginManager().callEvent(blockExplodeEvent); if (!blockExplodeEvent.isCancelled()) { blockExplodeEvent.blockList().forEach(b -> breakBlock(e.getPlayer(), item, b, fortune, drops)); } } return true; } else { return false; } } }; }
Source:
public void displayHelpWidget() { Window.alert( "Coming soon!" ); }

Target:
public void displayHelpWidget() { }
Source:
public void testCreateAndDeleteInstance() { String testInstance = generateId(); String testCluster = generateId(); try { InstanceAdminExample testInstanceAdmin = new InstanceAdminExample(projectId, testInstance, testCluster); testInstanceAdmin.createProdInstance(); assertTrue(adminClient.exists(testInstance)); testInstanceAdmin.deleteInstance(); assertFalse(adminClient.exists(testInstance)); } catch (Exception e) { e.printStackTrace(); fail(); } }

Target:
public void testCreateAndDeleteInstance() throws IOException { String testInstance = generateId(); String testCluster = generateId(); InstanceAdminExample testInstanceAdmin = new InstanceAdminExample(projectId, testInstance, testCluster); testInstanceAdmin.createProdInstance(); assertTrue(adminClient.exists(testInstance)); testInstanceAdmin.deleteInstance(); assertFalse(adminClient.exists(testInstance)); }
Source:
public void testInstanceWithLowestIdFailedIsNotConsideredTheElector() { Set<InstanceId> failed = new HashSet<>(); failed.add( new InstanceId( 1 ) ); failed.add( new InstanceId( 2 ) ); Map<InstanceId, URI> members = new HashMap<>(); members.put( new InstanceId( 1 ), URI.create( "server1" ) ); members.put( new InstanceId( 2 ), URI.create( "server2" ) ); members.put( new InstanceId( 3 ), URI.create( "server3" ) ); members.put( new InstanceId( 4 ), URI.create( "server4" ) ); members.put( new InstanceId( 5 ), URI.create( "server5" ) ); Config config = mock( Config.class ); when( config.get( ClusterSettings.max_acceptors ) ).thenReturn( 10 ); ClusterConfiguration clusterConfiguration = mock( ClusterConfiguration.class ); when( clusterConfiguration.getMembers() ).thenReturn( members ); when( clusterConfiguration.getMemberIds() ).thenReturn( members.keySet() ); ClusterContext clusterContext = mock( ClusterContext.class ); when( clusterContext.getConfiguration() ).thenReturn( clusterConfiguration ); MultiPaxosContext context = new MultiPaxosContext( new InstanceId(3 ), Iterables.iterable( new ElectionRole( "coordinator" ) ), clusterConfiguration, mock( Executor.class ), NullLogProvider.getInstance(), mock( ObjectInputStreamFactory.class ), mock( ObjectOutputStreamFactory.class ), mock( AcceptorInstanceStore.class ), mock( Timeouts.class ), mock( ElectionCredentialsProvider.class), config ); context.getHeartbeatContext().getFailed().addAll( failed ); ElectionContext toTest = context.getElectionContext(); assertTrue( toTest.isElector() ); }

Target:
public void testInstanceWithLowestIdFailedIsNotConsideredTheElector() { Set<InstanceId> failed = new HashSet<>(); failed.add( new InstanceId( 1 ) ); failed.add( new InstanceId( 2 ) ); InstanceId lowestNonFailedInstanceId = new InstanceId( 3 ); Map<InstanceId, URI> members = new HashMap<>(); members.put( new InstanceId( 1 ), URI.create( "server1" ) ); members.put( new InstanceId( 2 ), URI.create( "server2" ) ); members.put( lowestNonFailedInstanceId, URI.create( "server3" ) ); members.put( new InstanceId( 4 ), URI.create( "server4" ) ); members.put( new InstanceId( 5 ), URI.create( "server5" ) ); Config config = Config.defaults(); ClusterConfiguration clusterConfiguration = mock( ClusterConfiguration.class ); when( clusterConfiguration.getMembers() ).thenReturn( members ); when( clusterConfiguration.getMemberIds() ).thenReturn( members.keySet() ); ClusterContext clusterContext = mock( ClusterContext.class ); when( clusterContext.getConfiguration() ).thenReturn( clusterConfiguration ); MultiPaxosContext context = new MultiPaxosContext( lowestNonFailedInstanceId, Iterables.iterable( new ElectionRole( "coordinator" ) ), clusterConfiguration, mock( Executor.class ), NullLogProvider.getInstance(), mock( ObjectInputStreamFactory.class ), mock( ObjectOutputStreamFactory.class ), mock( AcceptorInstanceStore.class ), mock( Timeouts.class ), mock( ElectionCredentialsProvider.class), config ); ElectionContext toTest = context.getElectionContext(); assertFalse( toTest.isElector() ); context.getHeartbeatContext().getFailed().addAll( failed ); assertTrue( toTest.isElector() ); }
Source:
private BitSet newPartitions() { BitSet bitSet = new BitSet(20); for(int k=0;k<bitSet.length();k++){ bitSet.set(k); } return bitSet; }

Target:
private BitSet newPartitions() { HazelcastProperties properties = new HazelcastProperties(config); BitSet bitSet = new BitSet(properties.getInteger(PARTITION_COUNT)); for (int k = 0; k < bitSet.size(); k++) { bitSet.set(k); } return bitSet; }
Source:
public void should_canUserSeeProcessInstance_call_engine_api() throws Exception { final boolean expected = true; checkCanUserSeeProcessInstanceWhenApiReturn(expected); }

Target:
public void should_canUserSeeProcessInstance_call_engine_api() throws Exception { checkCanUserSeeProcessInstanceWhenApiReturn(true); }
Source:
public String toString() { return toStringHelper(this) .add("streamName", streamName) .add("streamId", streamId) .add("streamType", streamType) .add("path", orcDataSource) .toString(); }

Target:
public String toString() { return toStringHelper(this) .add("streamName", streamName) .add("streamId", streamId) .add("streamType", streamType) .add("dataSource", orcDataSource.getId()) .toString(); }
Source:
private static RebaseTodoLine parseLine(byte[] buf, int tokenBegin, int lineEnd) { RebaseTodoLine.Action action = null; AbbreviatedObjectId commit = null; int nextSpace = RawParseUtils.next(buf, tokenBegin, ' '); int tokenCount = 0; while (tokenCount < 3 && nextSpace < lineEnd) { switch (tokenCount) { case 0: String actionToken = new String(buf, tokenBegin, nextSpace - tokenBegin - 1, StandardCharsets.UTF_8); tokenBegin = nextSpace; action = RebaseTodoLine.Action.parse(actionToken); if (action == null) return null; break; case 1: nextSpace = RawParseUtils.next(buf, tokenBegin, ' '); String commitToken = new String(buf, tokenBegin, nextSpace - tokenBegin - 1, StandardCharsets.UTF_8); tokenBegin = nextSpace; commit = AbbreviatedObjectId.fromString(commitToken); break; case 2: return new RebaseTodoLine(action, commit, RawParseUtils.decode( buf, tokenBegin, 1 + lineEnd)); } tokenCount++; } if (tokenCount == 2) return new RebaseTodoLine(action, commit, ""); return null; }

Target:
private static RebaseTodoLine parseLine(byte[] buf, int tokenBegin, int lineEnd) { RebaseTodoLine.Action action = null; AbbreviatedObjectId commit = null; int nextSpace = RawParseUtils.next(buf, tokenBegin, ' '); int tokenCount = 0; while (tokenCount < 3 && nextSpace < lineEnd) { switch (tokenCount) { case 0: String actionToken = new String(buf, tokenBegin, nextSpace - tokenBegin - 1, UTF_8); tokenBegin = nextSpace; action = RebaseTodoLine.Action.parse(actionToken); if (action == null) return null; break; case 1: nextSpace = RawParseUtils.next(buf, tokenBegin, ' '); String commitToken = new String(buf, tokenBegin, nextSpace - tokenBegin - 1, UTF_8); tokenBegin = nextSpace; commit = AbbreviatedObjectId.fromString(commitToken); break; case 2: return new RebaseTodoLine(action, commit, RawParseUtils.decode(buf, tokenBegin, 1 + lineEnd)); } tokenCount++; } if (tokenCount == 2) return new RebaseTodoLine(action, commit, ""); return null; }
Source:
@Override public E take() throws InterruptedException { lock.lock(); try { while (queue.isEmpty()) { nonEmpty.await(); } E peek = queue.peek(); if (peek == null) { throw new NoSuchElementException(); } queue.remove(); return peek; } catch (IOException e) { QueueFile.<Error>getSneakyThrowable(e); return null; } finally { lock.unlock(); } }

Target:
@Override public E take() throws InterruptedException { lock.lock(); try { while (queue.isEmpty()) { nonEmpty.await(); } E peek = queue.peek(); if (peek == null) { throw new ConcurrentModificationException(); } queue.remove(); return peek; } catch (IOException e) { throw QueueFile.<Error>getSneakyThrowable(e); } finally { lock.unlock(); } }
Source:
void privilegesToAnonymousShouldBeAdded(String privilegeName, String acceptHeader) { PrivilegeListForm privilegeListForm = new PrivilegeListForm(); List<PrivilegeForm> privilegeForms = new ArrayList<>(); PrivilegeForm privilegeForm = new PrivilegeForm(privilegeName, ""); privilegeForms.add(privilegeForm); privilegeListForm.setPrivileges(privilegeForms); given().contentType(MediaType.APPLICATION_JSON_VALUE) .header(HttpHeaders.ACCEPT, acceptHeader) .body(privilegeListForm) .when() .post(getContextBaseUrl() + "/authorization/anonymous/privileges") .peek() .then() .statusCode(HttpStatus.OK.value()) .body(containsString(SUCCESSFUL_ASSIGN_PRIVILEGES)); }

Target:
void privilegesToAnonymousShouldBeAdded(String privilegeName, String acceptHeader) { PrivilegeListForm privilegeListForm = new PrivilegeListForm(); List<PrivilegeForm> privilegeForms = new ArrayList<>(); PrivilegeForm privilegeForm = new PrivilegeForm(privilegeName, ""); privilegeForms.add(privilegeForm); privilegeListForm.setPrivileges(privilegeForms); given().contentType(MediaType.APPLICATION_JSON_VALUE) .accept(acceptHeader) .body(privilegeListForm) .when() .post(getContextBaseUrl() + "/authorization/anonymous/privileges") .peek() .then() .statusCode(HttpStatus.OK.value()) .body(containsString(SUCCESSFUL_ASSIGN_PRIVILEGES)); }
Source:
public String getCeTaskUuid() { return ceTaskUuid; }

Target:
public Optional<String> getCeTaskUuid() { return ofNullable(ceTaskUuid); }
Source:
private String formatForMotorDisplay(String prefix, Double value) { if (value == null) { return ""; } if (advancedMinimalMotorView) { return String.format("%s %.3f", prefix, value); } else { return String.format("%s: %.2f", prefix, value); } }

Target:
private String formatForMotorDisplay(String prefix, Double value) { if (value == null) { return ""; } if (advancedMinimalMotorView) { return String.format("%s %.3f", prefix, value); } else { return String.format("%s: %.3f", prefix, value); } }
Source:
public void process(final K key, final V value) { final long startNs = time.nanoseconds(); try { processor.process(key, value); } catch (final ClassCastException e) { final String keyClass = key == null ? "unknown because key is null" : key.getClass().getName(); final String valueClass = value == null ? "unknown because value is null" : value.getClass().getName(); throw new StreamsException(String.format("ClassCastException invoking Processor. Do the Processor's " + "input types match the deserialized types? Check the serde setup and change the default serdes in " + "StreamConfig or provide correct serdes via method parameters. Make sure the Processor can accept " + "the deserialized input of type key: %s, and value: %s.%n" + "Note that also although wrong serdes are a common cause of error, the cast exception might have " + "another cause (in user code, for example). For example, if a processor wires in a store, but casts " + "the generics incorrectly, a class cast exception could be raiused during processing, but the " + "cause would not be wrong serdes.", keyClass, valueClass), e); } nodeMetrics.nodeProcessTimeSensor.record(time.nanoseconds() - startNs); }

Target:
public void process(final K key, final V value) { final long startNs = time.nanoseconds(); try { processor.process(key, value); } catch (final ClassCastException e) { final String keyClass = key == null ? "unknown because key is null" : key.getClass().getName(); final String valueClass = value == null ? "unknown because value is null" : value.getClass().getName(); throw new StreamsException(String.format("ClassCastException invoking Processor. Do the Processor's " + "input types match the deserialized types? Check the Serde setup and change the default Serdes in " + "StreamConfig or provide correct Serdes via method parameters. Make sure the Processor can accept " + "the deserialized input of type key: %s, and value: %s.%n" + "Note that although incorrect Serdes are a common cause of error, the cast exception might have " + "another cause (in user code, for example). For example, if a processor wires in a store, but casts " + "the generics incorrectly, a class cast exception could be raised during processing, but the " + "cause would not be wrong Serdes.", keyClass, valueClass), e); } nodeMetrics.nodeProcessTimeSensor.record(time.nanoseconds() - startNs); }
Source:
public void onCompleted(JSONObject object, GraphResponse response) { FacebookRequestError error = response.getError(); if (error != null || object == null) { setResult(IdpResponse.fromError(error == null ? new FirebaseUiException( ErrorCodes.PROVIDER_ERROR, "Facebook graph request failed") : error.getException())); return; } String email = null; String name = null; Uri photoUri = null; try { email = object.getString("email"); } catch (JSONException ignored) try { name = object.getString("name"); } catch (JSONException ignored) try { photoUri = Uri.parse(object.getJSONObject("picture") .getJSONObject("data") .getString("url")); } catch (JSONException ignored) setResult(createIdpResponse(mResult, email, name, photoUri)); }

Target:
public void onCompleted(JSONObject object, GraphResponse response) { FacebookRequestError error = response.getError(); if (error != null) { setResult(Resource.<IdpResponse>forFailure(new FirebaseUiException( ErrorCodes.PROVIDER_ERROR, error.getException()))); return; } if (object == null) { setResult(Resource.<IdpResponse>forFailure(new FirebaseUiException( ErrorCodes.PROVIDER_ERROR, "Facebook graph request failed"))); return; } String email = null; String name = null; Uri photoUri = null; try { email = object.getString("email"); } catch (JSONException ignored) try { name = object.getString("name"); } catch (JSONException ignored) try { photoUri = Uri.parse(object.getJSONObject("picture") .getJSONObject("data") .getString("url")); } catch (JSONException ignored) setResult(Resource.forSuccess(createIdpResponse(mResult, email, name, photoUri))); }
Source:
private boolean isPassthrough(String hcid) { String propertyName; NhincConstants.UDDI_SPEC_VERSION specVersion = getOrganizationSpecVersion(hcid); if(specVersion.equals(NhincConstants.UDDI_SPEC_VERSION.SPEC_2_0)) { propertyName = "docquery.20.outboundDocQuery"; } else { propertyName = "docquery.30.outboundDocQuery"; } String propValue = null; try { propValue = getPropAccessor().getProperty(NhincConstants.GATEWAY_PROPERTY_FILE, propertyName); } catch (PropertyAccessException ex) { LOG.warn("Unable to read property: {})", propertyName, ex); } return NullChecker.isNotNullish(propValue); }

Target:
private static boolean isPassthrough(String hcid) { String propertyName; NhincConstants.UDDI_SPEC_VERSION specVersion = getOrganizationSpecVersion(hcid); if(specVersion.equals(NhincConstants.UDDI_SPEC_VERSION.SPEC_2_0)) { propertyName = DOC_QUERY_20_MODE_OUT_PROPNAME; } else { propertyName = DOC_QUERY_30_MODE_OUT_PROPNAME; } String propValue = null; try { propValue = getPropAccessor().getProperty(NhincConstants.GATEWAY_PROPERTY_FILE, propertyName); } catch (PropertyAccessException ex) { LOG.warn("Unable to read property: {})", propertyName, ex); } return NullChecker.isNotNullish(propValue); }