auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void prepare() { string = new StringBuilder(32); date = new MutableDateTime(2015, 9, 24, 0, 0, 0, 0); timeOnly = new MutableDateTime(2015, 9, 24, 9, 30, 5, 250); timestamp = new MutableDateTime(2015, 9, 24, 9, 30, 5, 250); charValue = new FIXValue(32); charValue.setChar('Y'); intValue = new FIXValue(32); intValue.setInt(123); floatValue = new FIXValue(32); floatValue.setFloat(12.30, 2); stringValue = new FIXValue(32); stringValue.setString("FOO"); dateValue = new FIXValue(32); dateValue.setDate(date); timeOnlyValue = new FIXValue(32); timeOnlyValue.setTimeOnly(timeOnly, true); timestampValue = new FIXValue(64); timestampValue.setTimestamp(timestamp, true); timestampValueDestination = new FIXValue(64); }

Target:
public void prepare() { string = new StringBuilder(32); date = new MutableDateTime(2015, 9, 24, 0, 0, 0, 0); timeOnly = new MutableDateTime(2015, 9, 24, 9, 30, 5, 250); timestamp = new MutableDateTime(2015, 9, 24, 9, 30, 5, 250); charValue = new FIXValue(64); charValue.setChar('Y'); intValue = new FIXValue(64); intValue.setInt(123); floatValue = new FIXValue(64); floatValue.setFloat(12.30, 2); stringValue = new FIXValue(64); stringValue.setString("FOO"); dateValue = new FIXValue(64); dateValue.setDate(date); timeOnlyValue = new FIXValue(64); timeOnlyValue.setTimeOnly(timeOnly, true); timestampValue = new FIXValue(64); timestampValue.setTimestamp(timestamp, true); copyValue = new FIXValue(64); }
Source:
private String obfuscate(TableReference tableRef) { return Sha256Hash.computeHash(tableRef.getTablename().getBytes()).serializeToHexString().substring(0, 8); }

Target:
private String obfuscate(TableReference tableRef) { return Sha256Hash.computeHash(tableRef.getTablename().getBytes()).serializeToHexString().substring(0, 16); }
Source:
StackItemsModelChangeListener(Map<VStackLayout, Setting> stackToSetting) { this.stackToSetting = new LinkedHashMap<VStackLayout, EStructuralFeature.Setting>(); this.stackToSetting.putAll(stackToSetting); }

Target:
StackItemsModelChangeListener(Map<VStackLayout, Setting> stackToSetting) { this.stackToSetting = stackToSetting; }
Source:
public final int hashCode() { return (enabled ? 1 : 0); }

Target:
public final int hashCode() { return Boolean.hashCode(enabled); }
Source:
public List<DataAccount> getUsersDataAccounts(Collection<User> users, Pager pager) throws DataAccessException { List<Long> accountIds = new ArrayList<Long>(); StringBuffer commaDelimitedUserIds = new StringBuffer(); if (users != null && users.size() > 0) { for (User user : users) { if (commaDelimitedUserIds.length() != 0) { commaDelimitedUserIds.append("','"); } commaDelimitedUserIds.append(user.id); } } if (commaDelimitedUserIds != null && commaDelimitedUserIds.length() != 0) { String getDataAccountIdsQuery = String.format( "SELECT `dataaccountid` FROM `userdataaccount` WHERE `deleted`='n' AND `userid` IN ('%s') ORDER BY `%s` %s LIMIT %d, %d", commaDelimitedUserIds, pager.sortBy == null ? "id" : pager.sortBy, pager.sortDirection == SortDirectionType.SortDirectionTypeAscending ? "ASC" : "DESC", pager.start == null ? Pager.DEFAULT_START.longValue() : pager.start.longValue(), pager.count == null ? Pager.DEFAULT_COUNT : pager.count.longValue()); Connection userConnection = DatabaseServiceProvider.provide().getNamedConnection(DatabaseType.DatabaseTypeUser.toString()); try { userConnection.connect(); userConnection.executeQuery(getDataAccountIdsQuery); while (userConnection.fetchNextRow()) { Long accountId = userConnection.getCurrentRowLong("dataaccountid"); if (accountId != null) { accountIds.add(accountId); } } } finally { if (userConnection != null) { userConnection.disconnect(); } } } return accountIds.size() == 0 ? new ArrayList<DataAccount>() : DataAccountServiceProvider.provide().getIdsDataAccounts(accountIds, pager); }

Target:
public List<DataAccount> getUsersDataAccounts(Collection<User> users, Pager pager) throws DataAccessException { List<Long> accountIds = new ArrayList<Long>(); StringBuffer commaDelimitedUserIds = new StringBuffer(); if (users != null && users.size() > 0) { for (User user : users) { if (commaDelimitedUserIds.length() != 0) { commaDelimitedUserIds.append("','"); } commaDelimitedUserIds.append(user.id); } } if (commaDelimitedUserIds != null && commaDelimitedUserIds.length() != 0) { String getDataAccountIdsQuery = String.format( "SELECT `dataaccountid` FROM `userdataaccount` WHERE `deleted`='n' AND `userid` IN ('%s') ORDER BY `%s` %s LIMIT %d, %d", commaDelimitedUserIds, pager.sortBy == null ? "id" : pager.sortBy, pager.sortDirection == SortDirectionType.SortDirectionTypeAscending ? "ASC" : "DESC", pager.start == null ? Pager.DEFAULT_START.longValue() : pager.start.longValue(), pager.count == null ? Pager.DEFAULT_COUNT.longValue() : pager.count.longValue()); Connection userConnection = DatabaseServiceProvider.provide().getNamedConnection(DatabaseType.DatabaseTypeUser.toString()); try { userConnection.connect(); userConnection.executeQuery(getDataAccountIdsQuery); while (userConnection.fetchNextRow()) { Long accountId = userConnection.getCurrentRowLong("dataaccountid"); if (accountId != null) { accountIds.add(accountId); } } } finally { if (userConnection != null) { userConnection.disconnect(); } } } return accountIds.size() == 0 ? new ArrayList<DataAccount>() : DataAccountServiceProvider.provide().getIdsDataAccounts(accountIds, pager); }
Source:
private LocalDateTime convertToLocalDateTime(ObjectMapper mapper, JsonNode jsonNode) { TemporalAccessor parsedTimestamp = ISO8601_TIMESTAMP_FORMAT.parse(jsonNode.asText()); ZoneOffset zoneOffset = parsedTimestamp.query(TemporalQueries.offset()); if (zoneOffset != null && zoneOffset.getTotalSeconds() != 0) { throw new IllegalStateException( "Invalid timestamp format. Only a timestamp in UTC timezone is supported yet. " + "Format: yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"); } LocalTime localTime = parsedTimestamp.query(TemporalQueries.localTime()); LocalDate localDate = parsedTimestamp.query(TemporalQueries.localDate()); return LocalDateTime.of(localDate, localTime); }

Target:
private LocalDateTime convertToLocalDateTime(ObjectMapper mapper, JsonNode jsonNode) { TemporalAccessor parsedTimestamp = RFC3339_TIMESTAMP_FORMAT.parse(jsonNode.asText()); ZoneOffset zoneOffset = parsedTimestamp.query(TemporalQueries.offset()); if (zoneOffset != null && zoneOffset.getTotalSeconds() != 0) { throw new IllegalStateException( "Invalid timestamp format. Only a timestamp in UTC timezone is supported yet. " + "Format: yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"); } LocalTime localTime = parsedTimestamp.query(TemporalQueries.localTime()); LocalDate localDate = parsedTimestamp.query(TemporalQueries.localDate()); return LocalDateTime.of(localDate, localTime); }
Source:
private CNLOHBalancedCall isBalanced(final double rho, final int m, final int n) { if ((m == n) || (rho <= getRhoThreshold())) { return CNLOHBalancedCall.BALANCED; } else { return CNLOHBalancedCall.NOT_BALANCED; } }

Target:
private CNLOHBalancedCall isBalanced(final double rho, final int m, final int n) { return ( (m == n) || (rho <= getRhoThreshold()) ? CNLOHBalancedCall.BALANCED : CNLOHBalancedCall.NOT_BALANCED); }
Source:
protected void executeCommand() { T params = getParameters(); String address = params.getAddress(); String subnet = StringUtils.isEmpty(params.getSubnet()) ? params.getNetwork() .getsubnet() : params.getSubnet(); String gateway = StringUtils.isEmpty(params.getGateway()) ? params.getNetwork() .getgateway() : params.getGateway(); NetworkVdsmVDSCommandParameters parameters = new NetworkVdsmVDSCommandParameters(params.getVdsId(), params.getNetwork(), params.getBondName(), params.getNics(), address, subnet, gateway, params.getBondingOptions(), params.getBootProtocol()); VDSReturnValue retVal = Backend.getInstance().getResourceManager() .RunVdsCommand(VDSCommandType.AddNetwork, parameters); if (retVal.getSucceeded()) { retVal = Backend .getInstance() .getResourceManager() .RunVdsCommand(VDSCommandType.CollectVdsNetworkData, new VdsIdAndVdsVDSCommandParametersBase(params.getVdsId())); if (retVal.getSucceeded()) { VdsStatic vdsStatic = DbFacade.getInstance().getVdsStaticDAO().get(params.getVdsId()); AttachNetworkToVdsGroupCommand.SetNetworkStatus(vdsStatic.getvds_group_id(), params .getNetwork()); setSucceeded(true); } } }

Target:
protected void executeCommand() { T params = getParameters(); String address = params.getAddress(); String subnet = StringUtils.isEmpty(params.getSubnet()) ? params.getNetwork() .getsubnet() : params.getSubnet(); String gateway = StringUtils.isEmpty(params.getGateway()) ? params.getNetwork() .getgateway() : params.getGateway(); NetworkVdsmVDSCommandParameters vdsParams = new NetworkVdsmVDSCommandParameters(params.getVdsId(), params.getNetwork(), params.getBondName(), params.getNics(), address, subnet, gateway, params.getBondingOptions(), params.getBootProtocol()); VDSReturnValue retVal = Backend.getInstance().getResourceManager() .RunVdsCommand(VDSCommandType.AddNetwork, vdsParams); if (retVal.getSucceeded()) { retVal = Backend .getInstance() .getResourceManager() .RunVdsCommand(VDSCommandType.CollectVdsNetworkData, new VdsIdAndVdsVDSCommandParametersBase(params.getVdsId())); if (retVal.getSucceeded()) { VdsStatic vdsStatic = DbFacade.getInstance().getVdsStaticDAO().get(params.getVdsId()); AttachNetworkToVdsGroupCommand.SetNetworkStatus(vdsStatic.getvds_group_id(), params .getNetwork()); setSucceeded(true); } } }
Source:
public TestTpchTaskUpdateSizeLimitIntegrationTest() { this(() -> createQueryRunner(ImmutableMap.of("experimental.internal-communication.max-task-update-size", "100B"))); }

Target:
public TestTpchTaskUpdateSizeLimitIntegrationTest() { super(() -> createQueryRunner(ImmutableMap.of("experimental.internal-communication.max-task-update-size", "100B"))); }
Source:
public Element build(final CallbackProperties properties) throws Exception { LOG.debug("SamlCallbackHandler.createHOKSAMLAssertion20() -- Begin Minh version 33333"); Element signedAssertion; try { Assertion assertion; assertion = OpenSAML2ComponentBuilder.getInstance().createAssertion(); final String aID = createAssertionId(); LOG.debug("Assertion ID: " + aID); assertion.setID(aID); final DateTime issueInstant = new DateTime(); assertion.setIssueInstant(issueInstant); assertion.setIssuer(createIssuer(properties)); final X509Certificate certificate = certificateManager.getDefaultCertificate(); final PublicKey publicKey = certificateManager.getDefaultPublicKey(); final Subject subject = createSubject(properties, certificate, publicKey); assertion.setSubject(subject); final Subject evidenceSubject = createEvidenceSubject(properties, certificate, publicKey); assertion.getStatements().addAll(createAttributeStatements(properties, evidenceSubject)); final PrivateKey privateKey = certificateManager.getDefaultPrivateKey(); signedAssertion = sign(assertion, certificate, privateKey, publicKey); } catch (final Exception ex) { LOG.error("Unable to create HOK Assertion: {}", ex.getLocalizedMessage()); throw ex; } LOG.debug("SamlCallbackHandler.createHOKSAMLAssertion20() -- End"); return signedAssertion; }

Target:
public Element build(final CallbackProperties properties) throws Exception { LOG.debug("SamlCallbackHandler.createHOKSAMLAssertion20()"); Element signedAssertion; try { Assertion assertion; assertion = OpenSAML2ComponentBuilder.getInstance().createAssertion(); final String aID = createAssertionId(); LOG.debug("Assertion ID: {}", aID); assertion.setID(aID); final DateTime issueInstant = new DateTime(); assertion.setIssueInstant(issueInstant); assertion.setIssuer(createIssuer(properties)); final X509Certificate certificate = certificateManager.getDefaultCertificate(); final PublicKey publicKey = certificateManager.getDefaultPublicKey(); final Subject subject = createSubject(properties, certificate, publicKey); assertion.setSubject(subject); final Subject evidenceSubject = createEvidenceSubject(properties, certificate, publicKey); assertion.getStatements().addAll(createAttributeStatements(properties, evidenceSubject)); final PrivateKey privateKey = certificateManager.getDefaultPrivateKey(); signedAssertion = sign(assertion, certificate, privateKey, publicKey); } catch (final Exception ex) { LOG.error("Unable to create HOK Assertion: {}", ex.getLocalizedMessage()); throw ex; } LOG.debug("SamlCallbackHandler.createHOKSAMLAssertion20() -- End"); return signedAssertion; }
Source:
public void configurePipeline(PipelineConfigurer pipelineConfigurer) { super.configurePipeline(pipelineConfigurer); FailureCollector collector = pipelineConfigurer.getStageConfigurer().getFailureCollector(); excelInputreaderConfig.validate(collector); if (Strings.isNullOrEmpty(excelInputreaderConfig.columnList) && Strings.isNullOrEmpty(excelInputreaderConfig.outputSchema)) { collector.addFailure( "'Field Name Schema Type Mapping' and 'Columns To Be Extracted' cannot both be empty.", null) .withConfigProperty(OUTPUT_SCHEMA).withConfigProperty(COLUMN_LIST); } createDatasets(pipelineConfigurer, null); init(collector); getOutputSchema(); pipelineConfigurer.getStageConfigurer().setOutputSchema(outputSchema); }

Target:
public void configurePipeline(PipelineConfigurer pipelineConfigurer) { super.configurePipeline(pipelineConfigurer); FailureCollector collector = pipelineConfigurer.getStageConfigurer().getFailureCollector(); excelInputreaderConfig.validate(collector); createDatasets(pipelineConfigurer); collector.getOrThrowException(); init(collector); collector.getOrThrowException(); getOutputSchema(); pipelineConfigurer.getStageConfigurer().setOutputSchema(outputSchema); }
Source:
public static BeanPostProcessor upcase() { return new BeanPostProcessor() { @Override public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException { if (beanName.equals("interceptedSource")) { ProxyFactory pf = new ProxyFactory(bean); MethodInterceptor interceptor = new MethodInterceptor() { @Override public Object invoke(MethodInvocation invocation) throws Throwable { if (invocation.getMethod().getName().equals("receive")) { org.springframework.messaging.Message<?> message = (org.springframework.messaging.Message<?>) invocation.proceed(); if (message == null) { return null; } return MessageBuilder.withPayload(((String) message.getPayload()).toUpperCase()) .copyHeaders(message.getHeaders()) .build(); } else { return invocation.proceed(); } } }; pf.addAdvice(interceptor); return pf.getProxy(); } return bean; } }; }

Target:
public static BeanPostProcessor upcase() { return new BeanPostProcessor() { @Override public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException { if (beanName.equals("interceptedSource")) { ProxyFactory pf = new ProxyFactory(bean); pf.addAdvice((MethodInterceptor) invocation -> { if (invocation.getMethod().getName().equals("receive")) { org.springframework.messaging.Message<?> message = (org.springframework.messaging.Message<?>) invocation.proceed(); if (message == null) { return null; } return MessageBuilder.withPayload(((String) message.getPayload()).toUpperCase()) .copyHeaders(message.getHeaders()) .build(); } else { return invocation.proceed(); } }); return pf.getProxy(); } return bean; } }; }
Source:
private List<String> fixInvalidIndexes(ArrayListMultimap<String, byte[]> result) throws StandardException { try { WriteCoordinator writeCoordinator = PipelineDriver.driver().writeCoordinator(); WriteConfiguration writeConfiguration = writeCoordinator.defaultWriteConfiguration(); Partition indexPartition = SIDriver.driver().getTableFactory().getTable(Long.toString(conglomerate)); RecordingCallBuffer<KVPair> writeBuffer = writeCoordinator.writeBuffer(indexPartition, txn, null, writeConfiguration); List<String> messages = new LinkedList<>(); int i = 0; messages.add(String.format("The following %d indexes are deleted:", invalidIndexCount)); for (String baseRowId : result.keySet()) { List<byte[]> keys = result.get(baseRowId); for (byte[] key : keys) { if (i == maxCheckTableErrors) { messages.add("..."); return messages; } writeBuffer.add(new KVPair(key, new byte[0], KVPair.Type.DELETE)); if (i > maxCheckTableErrors) { continue; } indexKeyDecoder.set(key, 0, key.length); indexKeyDecoder.decode(indexKeyTemplate); messages.add(indexKeyTemplate.getClone().toString() + "=>" + baseRowId); i++; } } writeBuffer.flushBuffer(); return messages; } catch (Exception e) { throw StandardException.plainWrapException(e); } }

Target:
private void fixInvalidIndexes(ArrayListMultimap<String, byte[]> result) throws StandardException { try { WriteCoordinator writeCoordinator = PipelineDriver.driver().writeCoordinator(); WriteConfiguration writeConfiguration = writeCoordinator.defaultWriteConfiguration(); Partition indexPartition = SIDriver.driver().getTableFactory().getTable(Long.toString(conglomerate)); RecordingCallBuffer<KVPair> writeBuffer = writeCoordinator.writeBuffer(indexPartition, txn, null, writeConfiguration); List<String> messages = new LinkedList<>(); for (String baseRowId : result.keySet()) { List<byte[]> keys = result.get(baseRowId); for (byte[] key : keys) { writeBuffer.add(new KVPair(key, new byte[0], KVPair.Type.DELETE)); } } writeBuffer.flushBuffer(); } catch (Exception e) { throw StandardException.plainWrapException(e); } }
Source:
public int fill(FluidStack resource, boolean doFill) { if (resource.amount < Fluid.BUCKET_VOLUME) { return 0; } if (doFill) { Material material = blockLiquid.getDefaultState().getMaterial(); BlockDynamicLiquid block = BlockLiquid.getFlowingBlock(material); world.setBlockState(blockPos, block.getDefaultState().withProperty(BlockLiquid.LEVEL, 0), 11); } return Fluid.BUCKET_VOLUME; }

Target:
public int fill(FluidStack resource, boolean doFill) { if (resource.amount < Fluid.BUCKET_VOLUME) { return 0; } if (doFill) { Material material = blockLiquid.getDefaultState().getMaterial(); BlockLiquid block = BlockLiquid.getFlowingBlock(material); world.setBlockState(blockPos, block.getDefaultState().withProperty(BlockLiquid.LEVEL, 0), 11); } return Fluid.BUCKET_VOLUME; }
Source:
public String batchDurchBenutzerAbschliessen() throws DAOException, DataException, IOException { for (Task s : this.steps) { boolean error = false; if (s.isTypeCloseVerify()) { if (s.isTypeMetadata() && ConfigCore.getBooleanParameter("useMetadatenvalidierung")) { serviceManager.getMetadataValidationService().setAutoSave(true); if (!serviceManager.getMetadataValidationService().validate(s.getProcess())) { error = true; } } if (s.isTypeImagesWrite()) { MetadatenImagesHelper mih = new MetadatenImagesHelper(null, null); try { if (!mih.checkIfImagesValid(s.getProcess().getTitle(), serviceManager.getProcessService().getImagesOrigDirectory(false, s.getProcess()))) { error = true; } } catch (Exception e) { logger.error(e.getMessage(), e); Helper.setFehlerMeldung("Error on image validation: ", e); } } loadProcessProperties(s); for (Property prop : this.properties) { if ((prop.getValue() == null || prop.getValue().equals(""))) { List<String> parameter = new ArrayList<>(); parameter.add(prop.getTitle()); parameter.add(s.getProcess().getTitle()); Helper.setFehlerMeldung(Helper.getTranslation("BatchPropertyEmpty", parameter)); error = true; } } } if (!error) { this.myDav.uploadFromHome(s.getProcess()); TaskDAO taskDAO = new TaskDAO(); Task task = taskDAO.getById(s.getId()); task.setEditTypeEnum(TaskEditType.MANUAL_MULTI); serviceManager.getWorkflowService().close(s); } } AktuelleSchritteForm asf = (AktuelleSchritteForm) Helper.getManagedBeanValue("#{AktuelleSchritteForm}"); return asf.filterAll(); }

Target:
public String batchDurchBenutzerAbschliessen() throws DAOException, DataException, IOException { for (Task s : this.steps) { boolean error = false; if (s.isTypeCloseVerify()) { if (s.isTypeMetadata() && ConfigCore.getBooleanParameter("useMetadatenvalidierung")) { serviceManager.getMetadataValidationService().setAutoSave(true); if (!serviceManager.getMetadataValidationService().validate(s.getProcess())) { error = true; } } if (s.isTypeImagesWrite()) { MetadatenImagesHelper mih = new MetadatenImagesHelper(null, null); try { if (!mih.checkIfImagesValid(s.getProcess().getTitle(), serviceManager.getProcessService().getImagesOrigDirectory(false, s.getProcess()))) { error = true; } } catch (RuntimeException e) { Helper.setErrorMessage("Error on image validation: ", logger, e); } } loadProcessProperties(s); for (Property prop : this.properties) { if ((prop.getValue() == null || prop.getValue().equals(""))) { List<String> parameter = new ArrayList<>(); parameter.add(prop.getTitle()); parameter.add(s.getProcess().getTitle()); Helper.setFehlerMeldung(Helper.getTranslation("BatchPropertyEmpty", parameter)); error = true; } } } if (!error) { this.myDav.uploadFromHome(s.getProcess()); TaskDAO taskDAO = new TaskDAO(); Task task = taskDAO.getById(s.getId()); task.setEditTypeEnum(TaskEditType.MANUAL_MULTI); serviceManager.getWorkflowControllerService().close(s); } } AktuelleSchritteForm asf = (AktuelleSchritteForm) Helper.getManagedBeanValue("#{AktuelleSchritteForm}"); return asf.filterAll(); }
Source:
public void assignParameterIndexes() throws SQLException { int paramIndex = 1; if (sqlType == SQL_TYPE_SELECT) { if( whereClause != null && whereClause.getExpressionsCount() > 0) { Iterator<SQLExpression> expressionit = whereClause.getExpressions(); while (expressionit.hasNext()) { SQLExpression exp = expressionit.next(); if (exp.getExpressionType() == ExpressionType.LOGICAL_EXPRESSION_TYPE) { paramIndex = exp.setParametrizedNames(paramIndex); } } } parametrizedCount = paramIndex - 1; } }

Target:
public void assignParameterIndexes() throws SQLException { int paramIndex = 1; if (sqlType == SQL_TYPE_SELECT) { if( whereClause != null && whereClause.getExpressionsCount() > 0) { Iterator<SQLExpression> expressionit = whereClause.getExpressions(); while (expressionit.hasNext()) { SQLExpression exp = expressionit.next(); if (exp.getExpressionType() == ExpressionType.LOGICAL_EXPRESSION_TYPE) { paramIndex = exp.setParameterizedNames(paramIndex); } } } parameterizedCount = paramIndex - 1; } }
Source:
public int compareTo(FileEntry fe) { int diff = size - fe.size; return (diff != 0) ? diff : (int) (offset - fe.offset); }

Target:
public int compareTo(FileEntry fe) { int diff = size - fe.size; if (diff != 0) return diff; return (offset < fe.offset) ? -1 : ((offset == fe.offset) ? 0 : 1); }
Source:
public void accumulate(View found) { try { setLayout(found); } catch (CantVisitException e) { cleanup(); mOnEditErrorListener.onError(e); } }

Target:
public void accumulate(View found) { ViewGroup parent = (ViewGroup) found; SparseArray<View> idToChild = new SparseArray<View>(); int count = parent.getChildCount(); for (int i = 0; i < count; i++) { View child = parent.getChildAt(i); int childId = child.getId(); if (childId > 0) { idToChild.put(childId, child); } } int size = mArgs.size(); for (int i = 0; i < size; i++) { LayoutRule layoutRule = mArgs.get(i); final View currentChild = idToChild.get(layoutRule.viewId); RelativeLayout.LayoutParams currentParams = (RelativeLayout.LayoutParams) currentChild.getLayoutParams(); final int[] currentRules = currentParams.getRules().clone(); if (currentRules[layoutRule.verb] == layoutRule.anchor) { continue; } if (mOriginalValues.containsKey(currentChild)) { ; } else { mOriginalValues.put(currentChild, currentRules); } currentParams.addRule(layoutRule.verb, layoutRule.anchor); final Set<Integer> rules; if (mHorizontalRules.contains(layoutRule.verb)) { rules = mHorizontalRules; } else if (mVerticalRules.contains(layoutRule.verb)) { rules = mVerticalRules; } else { rules = null; } if (rules != null && !verifyLayout(rules, idToChild)) { cleanup(); mOnLayoutErrorListener.onLayoutError(new LayoutErrorMessage("circular_dependency", mName)); return; } currentChild.setLayoutParams(currentParams); } }
Source:
private long initialDelay(Config rc, String section, long interval) { long delay = -1L; String start = rc.getString(section, null, KEY_STARTTIME); try { if (start != null) { DateTimeFormatter formatter = ISODateTimeFormat.hourMinute(); DateTime now = DateTime.now(); MutableDateTime startTime = now.toMutableDateTime(); LocalTime firstStartTime = null; LocalDateTime firstStartDateTime = null; try { firstStartTime = formatter.parseLocalTime(start); startTime.hourOfDay().set(firstStartTime.getHourOfDay()); startTime.minuteOfHour().set(firstStartTime.getMinuteOfHour()); } catch (IllegalArgumentException e1) { formatter = DateTimeFormat.forPattern("E HH:mm"); firstStartDateTime = formatter.parseLocalDateTime(start); startTime.dayOfWeek().set(firstStartDateTime.getDayOfWeek()); startTime.hourOfDay().set(firstStartDateTime.getHourOfDay()); startTime.minuteOfHour().set(firstStartDateTime.getMinuteOfHour()); } startTime.secondOfMinute().set(0); startTime.millisOfSecond().set(0); while (startTime.isBefore(now)) { startTime.add(interval); } while (startTime.getMillis() - now.getMillis() > interval) { startTime.add(-interval); } delay = startTime.getMillis() - now.getMillis(); } else { log.info(MessageFormat.format("{0} schedule parameter \"{0}.{1}\" is not configured", section, KEY_STARTTIME)); } } catch (IllegalArgumentException e2) { log.error(MessageFormat.format("Invalid {0} schedule parameter \"{0}.{1}\"", section, KEY_STARTTIME), e2); } return delay; }

Target:
private static long initialDelay(Config rc, String section, long interval) { long delay = -1L; String start = rc.getString(section, null, KEY_STARTTIME); try { if (start != null) { DateTimeFormatter formatter = ISODateTimeFormat.hourMinute(); DateTime now = DateTime.now(); MutableDateTime startTime = now.toMutableDateTime(); LocalTime firstStartTime = null; LocalDateTime firstStartDateTime = null; try { firstStartTime = formatter.parseLocalTime(start); startTime.hourOfDay().set(firstStartTime.getHourOfDay()); startTime.minuteOfHour().set(firstStartTime.getMinuteOfHour()); } catch (IllegalArgumentException e1) { formatter = DateTimeFormat.forPattern("E HH:mm"); firstStartDateTime = formatter.parseLocalDateTime(start); startTime.dayOfWeek().set(firstStartDateTime.getDayOfWeek()); startTime.hourOfDay().set(firstStartDateTime.getHourOfDay()); startTime.minuteOfHour().set(firstStartDateTime.getMinuteOfHour()); } startTime.secondOfMinute().set(0); startTime.millisOfSecond().set(0); while (startTime.isBefore(now)) { startTime.add(interval); } while (startTime.getMillis() - now.getMillis() > interval) { startTime.add(-interval); } delay = startTime.getMillis() - now.getMillis(); } else { log.info(MessageFormat.format("{0} schedule parameter \"{0}.{1}\" is not configured", section, KEY_STARTTIME)); } } catch (IllegalArgumentException e2) { log.error(MessageFormat.format("Invalid {0} schedule parameter \"{0}.{1}\"", section, KEY_STARTTIME), e2); } return delay; }
Source:
public static TokenResponse getTokenResponse(String googleClientID, String googleClientSecret, String code, String redirectUri) { final AuthorizationCodeFlow flow = new AuthorizationCodeFlow.Builder(BearerToken.authorizationHeaderAccessMethod(), TokenResource.HTTP_TRANSPORT, TokenResource.JSON_FACTORY, new GenericUrl(GoogleHelper.GOOGLE_ENCODED_URL), new ClientParametersAuthentication(googleClientID, googleClientSecret), googleClientID, GoogleHelper.GOOGLE_AUTHORIZATION_SERVICE_ENCODED_URL).build(); try { return flow.newTokenRequest(code).setRedirectUri(redirectUri) .setRequestInitializer(request -> request.getHeaders().setAccept("application/json")).execute(); } catch (IOException e) { LOG.error("Retrieving accessToken was unsuccessful"); throw new CustomWebApplicationException("Could not retrieve google.com token based on code", HttpStatus.SC_BAD_REQUEST); } }

Target:
public static TokenResponse getTokenResponse(String googleClientID, String googleClientSecret, String code, String redirectUri) { final AuthorizationCodeFlow flow = new AuthorizationCodeFlow.Builder(BearerToken.authorizationHeaderAccessMethod(), TokenResource.HTTP_TRANSPORT, TokenResource.JSON_FACTORY, new GenericUrl(GoogleHelper.GOOGLE_ENCODED_URL), new ClientParametersAuthentication(googleClientID, googleClientSecret), googleClientID, GoogleHelper.GOOGLE_AUTHORIZATION_SERVICE_ENCODED_URL).build(); try { return flow.newTokenRequest(code).setRedirectUri(redirectUri) .setRequestInitializer(request -> request.getHeaders().setAccept("application/json")).execute(); } catch (IOException e) { LOG.error("Retrieving accessToken was unsuccessful"); throw new CustomWebApplicationException("Could not retrieve google token based on code", HttpStatus.SC_BAD_REQUEST); } }
Source:
private void onRemove() { ConfirmationModel model = (ConfirmationModel) getWindow(); if (model.getProgress() != null) { return; } model.startProgress(); AsyncDataProvider.getInstance().getDataCentersByStorageDomain(new AsyncQuery<>(storagePools -> { if (storagePools != null && !storagePools.isEmpty()) { StoragePool storagePool = storagePools.get(0); List<ActionParametersBase> prms = getSelectedItems() .stream() .map(item -> new VmTemplateImportExportParameters(item.getId(), getEntity().getId(), storagePool.getId())) .collect(Collectors.toList()); Frontend.getInstance().runMultipleAction(ActionType.RemoveUnregisteredVmTemplate, prms, result -> { ConfirmationModel localModel = (ConfirmationModel) result.getState(); localModel.stopProgress(); cancel(); }, model); } }), getEntity().getId()); }

Target:
private void onRemove() { if (getWindow() != null) { return; } ConfirmationModel model = (ConfirmationModel) getWindow(); if (model.getProgress() != null) { return; } model.startProgress(); AsyncDataProvider.getInstance().getDataCentersByStorageDomain(new AsyncQuery<>(storagePools -> { if (storagePools != null && !storagePools.isEmpty()) { StoragePool storagePool = storagePools.get(0); List<ActionParametersBase> vmTemplateImportExportParams = getSelectedItems() .stream() .map(item -> new VmTemplateImportExportParameters(item.getId(), getEntity().getId(), storagePool.getId())) .collect(Collectors.toList()); Frontend.getInstance().runMultipleAction( ActionType.RemoveUnregisteredVmTemplate, vmTemplateImportExportParams, result -> { ConfirmationModel localModel = (ConfirmationModel) result.getState(); localModel.stopProgress(); cancel(); }, model); } }), getEntity().getId()); }
Source:
public void testCheckContainerSizeValid() throws TException { TTransport transport; ThriftBinaryProtocol protocol; transport = getMockTransport(3); replay(transport); protocol = new ThriftBinaryProtocol(transport); protocol.readListBegin(); transport = getMockTransport(3); replay(transport); protocol = new ThriftBinaryProtocol(transport); protocol.readSetBegin(); transport = getMockMapTransport(3); replay(transport); protocol = new ThriftBinaryProtocol(transport); protocol.readMapBegin(); }

Target:
public void testCheckContainerSizeValid() throws TException { TTransport transport; ThriftBinaryProtocol protocol; transport = getMockTransport(3); replay(transport); protocol = new ThriftBinaryProtocol(transport); protocol.readListBegin(); verify(transport); transport = getMockTransport(3); replay(transport); protocol = new ThriftBinaryProtocol(transport); protocol.readSetBegin(); verify(transport); transport = getMockMapTransport(3); replay(transport); protocol = new ThriftBinaryProtocol(transport); protocol.readMapBegin(); verify(transport); }
Source:
public void afterPropertiesSet() { Assert.notNull(codeListTable, "codeListTable is not initialized!"); if (fallbackTo == null) { fallbackTo = resolveLocale(Locale.getDefault()); Assert.notNull(fallbackTo, "No codelist found for fallback default locale '" + Locale .getDefault().getLanguage() + "', it must be defined."); } else { Assert.isTrue(codeListTable.containsRow(fallbackTo), "No codelist found for fallback locale '" + fallbackTo + "', it must be defined."); } }

Target:
public void afterPropertiesSet() { Assert.notNull(codeListTable, "codeListTable is not initialized!"); if (fallbackTo == null) { Locale defaultLocale = Locale.getDefault(); fallbackTo = resolveLocale(defaultLocale); Assert.notNull(fallbackTo, "No codelist for default locale ('" + defaultLocale + "' and '" + defaultLocale.getLanguage() + "'). Please define codelist for default locale or set locale already defined in codelist to fallbackTo."); } else { Assert.isTrue(codeListTable.containsRow(fallbackTo), "No codelist found for fallback locale '" + fallbackTo + "', it must be defined."); } }
Source:
private <R> void checkMatchesIdType(R result) { Class routingResultType = null; if(result instanceof Collection) { Collection asCollection = (Collection) result; Iterator iterator = asCollection.iterator(); if(iterator.hasNext()) { Object element = iterator.next(); routingResultType = element.getClass(); } } else { routingResultType = result.getClass(); } if (routingResultType != null) { Class<I> idClass = idClass(); boolean corresponds = idClass.isAssignableFrom(routingResultType); checkArgument(corresponds, "Message routing failed in `%s` due to the type mismatch. " + "Expected ID type is `%s`, but was `%s`.", getClass().getName(), idClass.getName(), routingResultType.getName()); } }

Target:
private <R> void checkMatchesIdType(R result) { Class routingResultType = null; if (result instanceof Collection) { Collection asCollection = (Collection) result; Object element = getFirst(asCollection, null); if (element != null) { routingResultType = element.getClass(); } } else { routingResultType = result.getClass(); } if (routingResultType != null) { Class<I> idClass = idClass(); boolean corresponds = idClass.isAssignableFrom(routingResultType); checkArgument(corresponds, "Message routing failed in `%s` due to the type mismatch. " + "Expected ID type is `%s`, but was `%s`.", getClass().getName(), idClass.getName(), routingResultType.getName()); } }
Source:
public EntityType(String aName, String aLabel, String aType) { this(aName , aType , true , "" , null , null , null , Collections.singletonList(aLabel) , null , null , null ); }

Target:
public EntityType(String aName, String aLabel, String aType) { this(aName , aType , true , "" , null , null , null , Arrays.asList(aLabel) , null , null , null ); }
Source:
public SexGenotypeDataCollection(@Nonnull final String sexGenotypeDataSourceName, @Nonnull final Reader sexGenotypeDataReader) throws IOException { try (final SexGenotypeTableReader reader = new SexGenotypeTableReader(sexGenotypeDataSourceName, sexGenotypeDataReader)) { sexGenotypeDataList = reader.stream().collect(Collectors.toList()); } catch (final IOException ex) { throw new UserException.CouldNotReadInputFile("Could not reader sex genotype data from " + sexGenotypeDataSourceName); } }

Target:
public SexGenotypeDataCollection(@Nonnull final String sexGenotypeDataSourceName, @Nonnull final Reader sexGenotypeDataReader) throws IOException { try (final SexGenotypeTableReader reader = new SexGenotypeTableReader(sexGenotypeDataSourceName, sexGenotypeDataReader)) { sexGenotypeDataList = reader.stream().collect(Collectors.toList()); } catch (final IOException ex) { throw new UserException.CouldNotReadInputFile("Could not read sex genotype data from " + sexGenotypeDataSourceName); } }
Source:
public Role getRole() { try { return Role.valueOf(roleCombo.get()); } catch (Exception ex) { } return null; }

Target:
public Role getRole() { Role role = null; try { role = Role.valueOf(roleCombo.get()); } catch (Exception ex) { } return role; }
Source:
private void initialize() { if (isInitialized()) { return; } m_maxThreads = getMaxThreads(); if (m_maxThreads < 1) { exportLog.warn("Parameter \"" + MAX_EXPORT_THREADS + "\" should have a positive value, forcing to default value of 1"); m_maxThreads = 1; } else { int localSitesCount = getLocalSitesCount(); if (localSitesCount == 0) { exportLog.warn("Parameter \"" + MAX_EXPORT_THREADS + "\" cannot be checked, forcing to default value of 1"); m_maxThreads = 1; } else if (m_maxThreads > localSitesCount) { exportLog.warn("Parameter \"" + MAX_EXPORT_THREADS + "\" exceeds local sites count, forcing to default value of 1"); m_maxThreads = 1; } } trace("Export Data Sources running with %d executor threads", m_maxThreads); m_nextAlloc = 0; m_executors = new ArrayList<>(m_maxThreads); m_refCounts = new IdentityHashMap<>(); m_pid2execMap = new HashMap<>(); }

Target:
private void initialize() { if (isInitialized()) { return; } m_maxThreads = getConfigMaxThreads(); int minThreads = getMinThreads(); if (m_maxThreads < 1) { exportLog.warn("Parameter \"" + MAX_EXPORT_THREADS + "\" should have a positive value, forcing to default value of " + minThreads); m_maxThreads = minThreads; } else { int localSitesCount = getLocalSitesCount(); if (localSitesCount == 0) { exportLog.warn("Parameter \"" + MAX_EXPORT_THREADS + "\" cannot be checked, forcing to default value of " + minThreads); m_maxThreads = minThreads; } else if (m_maxThreads > localSitesCount) { exportLog.warn("Parameter \"" + MAX_EXPORT_THREADS + "\" exceeds local sites count, forcing to " + localSitesCount); m_maxThreads = localSitesCount; } } exportLog.info("Export Data Sources running with " + m_maxThreads + " executor threads"); m_nextAlloc = 0; m_executors = new ArrayList<>(m_maxThreads); m_refCounts = new IdentityHashMap<>(); m_pid2execMap = new HashMap<>(); }
Source:
public void stop() { log.debug( "Stopping VM pause monitor" ); worker.interrupt(); try { worker.join(); } catch ( InterruptedException ignore ) { currentThread().interrupt(); } }

Target:
public void stop() { log.debug( "Stopping VM pause monitor" ); checkState( job != null, "VM pause monitor is not started" ); job.cancel( true ); job = null; }
Source:
static void verifyNoAsyncRestTemplateAttributes(Element element, ParserContext parserContext) { for (String attributeName : ASYNC_REST_TEMPLATE_REFERENCE_ATTRIBUTES) { if (element.hasAttribute(attributeName)) { parserContext.getReaderContext().error("When providing a 'rest-template' reference, the '" + attributeName + "' attribute is not allowed.", parserContext.extractSource(element)); } } }

Target:
static void verifyNoAsyncRestTemplateAttributes(Element element, ParserContext parserContext) { for (String attributeName : ASYNC_REST_TEMPLATE_REFERENCE_ATTRIBUTES) { if (element.hasAttribute(attributeName)) { parserContext.getReaderContext().error("When providing an 'async-rest-template' reference, the '" + attributeName + "' attribute is not allowed.", parserContext.extractSource(element)); } } }
Source:
protected void acquireDiskLocks() { if (isImageLockNeeded()) { final DiskImage diskImage = (DiskImage) getDisk(); final ImageStatus imgStatus = diskImage.getImageStatus(); TransactionSupport.executeInNewTransaction(new TransactionMethod<Void>() { @Override public Void runInTransaction() { getCompensationContext().snapshotEntityStatus(diskImage.getImage(), imgStatus); getCompensationContext().stateChanged(); diskImage.setImageStatus(ImageStatus.LOCKED); ImagesHandler.updateImageStatus(diskImage.getImage().getId(), ImageStatus.LOCKED); return null; }}); } }

Target:
protected void acquireDiskLocks() { if (isImageLockNeeded()) { final DiskImage diskImage = (DiskImage) getDisk(); final ImageStatus imgStatus = diskImage.getImageStatus(); TransactionSupport.executeInNewTransaction(new TransactionMethod<Void>() { @Override public Void runInTransaction() { getCompensationContext().snapshotEntityStatus(diskImage.getImage(), imgStatus); getCompensationContext().stateChanged(); diskImage.setImageStatus(ImageStatus.LOCKED); ImagesHandler.updateImageStatus(diskImage.getImageId(), ImageStatus.LOCKED); return null; }}); } }
Source:
public String getTournament(Model model, HttpSession session) { Member member = (Member) session.getAttribute("member"); MemberDao memberDao = new MemberDao(); member = memberDao.getMemberById(member.getId()); if (member == null || member.getContext() != UserType.OFFICIAL) { return "redirect/:denied"; } Set<Team> teams = member.getTeams(); model.addAttribute("teams", teams); TournamentDao tournamentDao = new TournamentDao(); List<Tournament> tournaments = tournamentDao.getLastXTournaments(5); model.addAttribute("tournaments", tournaments); return "official"; }

Target:
public String getTournament(Model model, HttpSession session) { Member member = (Member) session.getAttribute("member"); MemberDao memberDao = new MemberDao(); member = memberDao.getMemberById(member.getId()); if (member == null || member.getContext() != UserType.OFFICIAL) { return "redirect:/denied"; } Set<Team> teams = member.getTeams(); model.addAttribute("teams", teams); TournamentDao tournamentDao = new TournamentDao(); List<Tournament> tournaments = tournamentDao.getLastXTournaments(5); model.addAttribute("tournaments", tournaments); return "official"; }
Source:
public void verifyPostedReplyWithMessage(String message, int replyNumber) { new WebDriverWait(driver, 30).until(ExpectedConditions.textToBePresentInElement( By.cssSelector("ul.replies li.message[id=\""+replyNumber+"\"] div.msg-body p"), message) ); PageObjectLogging.log("verifyPostedReplyWithMessage", "message with title verified", true); }

Target:
public void verifyPostedReplyWithMessage(String message, int replyNumber) { waitForTextToBePresentInElementByBy(By.cssSelector("ul.replies li.message[id=\""+replyNumber+"\"] div.msg-body p") , message); PageObjectLogging.log("verifyPostedReplyWithMessage", "message with title verified", true); }
Source:
private boolean isClusterLevelChange() { Version newVersion = getParameters().getClusterLevelChangeToVersion(); return newVersion != null && getVm().isRunningOrPaused() && (getVm().getCustomCompatibilityVersion() == null || !newVersion.equals(getVm().getCustomCompatibilityVersion())); }

Target:
private boolean isClusterLevelChange() { Version newVersion = getParameters().getClusterLevelChangeToVersion(); return newVersion != null && getVm().isRunningOrPaused() && getVm().getCustomCompatibilityVersion() == null; }
Source:
public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } Clip clip = (Clip) o; return getClipID().equals(clip.getClipID()) && uri.equals(clip.uri); }

Target:
public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } Clip clip = (Clip) o; return getClipID().equals(clip.getClipID()) && getURI().equals(clip.getURI()); }
Source:
private DetailAST findChildWithIdent(DetailAST root) { DetailAST curNode = root; while (curNode.findFirstToken(TokenTypes.IDENT) == null) { DetailAST toVisit = curNode.getFirstChild(); while (toVisit == null) { toVisit = curNode.getNextSibling(); if (toVisit == null) { curNode = curNode.getParent(); } } if (curNode == root.getParent()) { curNode = null; break; } curNode = toVisit; } return curNode; }

Target:
private static DetailAST findChildWithIdent(DetailAST root) { return TokenUtils.findFirstTokenByPredicate(root, cur -> { return cur.findFirstToken(TokenTypes.IDENT) != null; }).orElse(null); }
Source:
public String[] getActiveApnTypes() { if (mTransportManager == null || mDcTrackers == null) { Rlog.e(LOG_TAG, "Invalid state for Transport/DcTrackers"); return new String[0]; } Set<String> activeApnTypes = new HashSet<String>(); for (int i = 0; i < mDcTrackers.size(); i++) { activeApnTypes.addAll(Arrays.asList(mDcTrackers.valueAt(i).getActiveApnTypes())); } return activeApnTypes.toArray(new String[activeApnTypes.size()]); }

Target:
public String[] getActiveApnTypes() { if (mTransportManager == null || mDcTrackers == null) { Rlog.e(LOG_TAG, "Invalid state for Transport/DcTrackers"); return new String[0]; } Set<String> activeApnTypes = new HashSet<String>(); for (int transportType : mTransportManager.getAvailableTransports()) { DcTracker dct = getDcTracker(transportType); if (dct == null) continue; activeApnTypes.addAll(Arrays.asList(dct.getActiveApnTypes())); } return activeApnTypes.toArray(new String[activeApnTypes.size()]); }
Source:
public void verifyOpeningArticleInNav(int anchorIndex) { waitForElementVisibleByElement(noChevrons.get(anchorIndex)); if (noChevrons.size() != 0) { noChevrons.get(anchorIndex).click(); PageObjectLogging.log("verifyOpeningArticleInNav", "New article opened", true, driver); } }

Target:
public void verifyOpeningArticleInNav(int anchorIndex) { waitForElementVisibleByElement(noChevrons.get(anchorIndex)); noChevrons.get(anchorIndex).click(); PageObjectLogging.log("verifyOpeningArticleInNav", "New article opened", true, driver); }
Source:
@Override public void onReceive(Context context, Intent intent) { if (intent == null) { return; } final String action = intent.getAction(); if (ACTION_AIRPLANE_MODE_CHANGED.equals(action)) { dispatchAirplaneModeChange(intent.getBooleanExtra(EXTRA_AIRPLANE_STATE, false)); } else if (CONNECTIVITY_ACTION.equals(action)) { dispatchNetworkStateChange(connectivityManager.getActiveNetworkInfo()); } }

Target:
@Override public void onReceive(Context context, Intent intent) { if (intent == null) { return; } final String action = intent.getAction(); if (ACTION_AIRPLANE_MODE_CHANGED.equals(action)) { if (!intent.hasExtra(EXTRA_AIRPLANE_STATE)) { return; } dispatcher.dispatchAirplaneModeChange(intent.getBooleanExtra(EXTRA_AIRPLANE_STATE, false)); } else if (CONNECTIVITY_ACTION.equals(action)) { ConnectivityManager connectivityManager = getService(context, CONNECTIVITY_SERVICE); dispatcher.dispatchNetworkStateChange(connectivityManager.getActiveNetworkInfo()); } }
Source:
private boolean stopTransferIfNecessary(ImageTransfer entity, long ts) { if (entity.getClientInactivityTimeout() > 0 && (entity.getPhase() == ImageTransferPhase.INITIALIZING || entity.getPhase() == ImageTransferPhase.TRANSFERRING) && (entity.getLastUpdated().getTime() / 1000) + entity.getClientInactivityTimeout() < ts) { if (getParameters().getTransferType() == TransferType.Download) { auditLog(this, AuditLogType.DOWNLOAD_IMAGE_CANCELED_TIMEOUT); updateEntityPhase(ImageTransferPhase.CANCELLED); } else { updateEntityPhaseToPausedBySystem( AuditLogType.UPLOAD_IMAGE_PAUSED_BY_SYSTEM_TIMEOUT); } return true; } return false; }

Target:
private boolean stopTransferIfNecessary(ImageTransfer entity, long ts) { if (shouldAbortOnClientInactivityTimeout(entity, ts)) { if (getParameters().getTransferType() == TransferType.Download) { auditLog(this, AuditLogType.DOWNLOAD_IMAGE_CANCELED_TIMEOUT); updateEntityPhase(ImageTransferPhase.CANCELLED); } else { updateEntityPhaseToPausedBySystem( AuditLogType.UPLOAD_IMAGE_PAUSED_BY_SYSTEM_TIMEOUT); } return true; } return false; }
Source:
public boolean equals(Object obj) { if (this == obj) return true; if (obj == null || getClass() != obj.getClass()) return false; SurveyAnswer other = (SurveyAnswer) obj; return (Objects.equals(answeredOn, other.answeredOn) && Objects.equals(answers, other.answers) && Objects.equals(client, other.client) && declined == other.declined); }

Target:
public boolean equals(Object obj) { if (this == obj) return true; if (obj == null || getClass() != obj.getClass()) return false; SurveyAnswer other = (SurveyAnswer) obj; return (Objects.equals(answeredOn, other.answeredOn) && Objects.equals(answers, other.answers) && Objects.equals(questionGuid, other.questionGuid) && Objects.equals(client, other.client) && declined == other.declined); }