auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public StepExecutionResult execute(ExecutionContext context) { if (skeletonManifestPath.getNameCount() == 0) { throw new HumanReadableException("Skeleton manifest filepath is missing"); } if (outManifestPath.getNameCount() == 0) { throw new HumanReadableException("Output Manifest filepath is missing"); } outManifestPath = filesystem.resolve(outManifestPath); try { Files.createParentDirs(outManifestPath.toFile()); } catch (IOException e) { e.printStackTrace(context.getStdErr()); return StepExecutionResult.ERROR; } List<File> libraryManifestFiles = Lists.newArrayList(); for (Path path : libraryManifestPaths) { Path manifestPath = filesystem.getPathForRelativeExistingPath(path).toAbsolutePath(); libraryManifestFiles.add(manifestPath.toFile()); } File skeletonManifestFile = filesystem.getPathForRelativeExistingPath(skeletonManifestPath).toAbsolutePath().toFile(); BuckEventAndroidLogger logger = new ManifestMergerLogger(context.getBuckEventBus()); MergingReport mergingReport = mergeManifests(skeletonManifestFile, libraryManifestFiles, logger); String xmlText = mergingReport.getMergedDocument(MergingReport.MergedManifestKind.MERGED); if (context.getPlatform() == Platform.WINDOWS) { xmlText = xmlText.replace("\r\n", "\n"); } try { File outManifestFile = outManifestPath.toFile(); Files.write(xmlText.getBytes(Charsets.UTF_8), outManifestFile); } catch (IOException e) { throw new HumanReadableException("Error converting line endings of manifest file"); } return StepExecutionResult.SUCCESS; }

Target:
public StepExecutionResult execute(ExecutionContext context) { if (skeletonManifestPath.getNameCount() == 0) { throw new HumanReadableException("Skeleton manifest filepath is missing"); } if (outManifestPath.getNameCount() == 0) { throw new HumanReadableException("Output Manifest filepath is missing"); } outManifestPath = filesystem.resolve(outManifestPath); try { Files.createParentDirs(outManifestPath.toFile()); } catch (IOException e) { e.printStackTrace(context.getStdErr()); return StepExecutionResult.ERROR; } List<File> libraryManifestFiles = Lists.newArrayList(); for (Path path : libraryManifestPaths) { Path manifestPath = filesystem.getPathForRelativeExistingPath(path).toAbsolutePath(); libraryManifestFiles.add(manifestPath.toFile()); } File skeletonManifestFile = filesystem.getPathForRelativeExistingPath(skeletonManifestPath).toAbsolutePath().toFile(); BuckEventAndroidLogger logger = new ManifestMergerLogger(context.getBuckEventBus()); MergingReport mergingReport = mergeManifests(skeletonManifestFile, libraryManifestFiles, logger); String xmlText = mergingReport.getMergedDocument(MergingReport.MergedManifestKind.MERGED); if (context.getPlatform() == Platform.WINDOWS) { xmlText = xmlText.replace("\r\n", "\n"); } try { filesystem.writeContentsToPath(xmlText, outManifestPath); } catch (IOException e) { throw new HumanReadableException(e, "Error writing manifest file"); } return StepExecutionResult.SUCCESS; }
Source:
public MethodOutcome updateLocationByName(@ResourceParam Location theLocation, @IdParam IdDt theId, @ConditionalUrlParam String theConditional) { MethodOutcome outcome = new MethodOutcome(); OperationOutcome operationoutcome = null; if (theConditional != null) { List<Location> locationList = null; String locationName = null; try { int startIndex = theConditional.lastIndexOf('='); locationName = theConditional.substring(startIndex + 1); } catch (Exception e) { operationoutcome = new OperationOutcome(); operationoutcome.addIssue().setDetails("Please check Condition URL format"); outcome.setOperationOutcome(operationoutcome); return outcome; } StringParam nameParam = new StringParam(); nameParam.setValue(locationName); locationList = locationResource.searchLocationsByName(nameParam); if (locationList.size() == 0) { outcome = updateLocation(theLocation, null); } else if (locationList.size() == 1) { outcome = updateLocation(theLocation, locationList.get(0).getId()); } else { throw new PreconditionFailedException("There are more than one Location for the given condition"); } } else { outcome = updateLocation(theLocation, theId); } return outcome; }

Target:
public MethodOutcome updateLocationByName(@ResourceParam Location theLocation, @IdParam IdDt theId, @ConditionalUrlParam String theConditional) { MethodOutcome outcome = new MethodOutcome(); OperationOutcome operationoutcome = null; if (theConditional != null) { List<Location> locationList = null; int startIndex = theConditional.lastIndexOf('='); String locationName = theConditional.substring(startIndex + 1); if (locationName == null) { operationoutcome = new OperationOutcome(); operationoutcome.addIssue().setDetails("Please check Condition URL format"); outcome.setOperationOutcome(operationoutcome); return outcome; } StringParam nameParam = new StringParam(); nameParam.setValue(locationName); locationList = locationResource.searchLocationsByName(nameParam); if (locationList.size() == 0) { outcome = updateLocation(theLocation, null); } else if (locationList.size() == 1) { outcome = updateLocation(theLocation, locationList.get(0).getId()); } else { throw new PreconditionFailedException("There are more than one Location for the given condition"); } } else { outcome = updateLocation(theLocation, theId); } return outcome; }
Source:
public void tagAllBodyMassIndexAttributesManually() throws InterruptedException { openTagWizard(driver); selectEntityName(driver); clealAllTagsConfirmationModalAndOK(driver); assertEquals(getSelectedEntityName(driver), AbstractMappingServiceAppModel.TARGET_ENTITY_NAME); clickAutomaticTaggingButton(driver); checkGenderTagContent(); checkHeightTagContent(); checkWeightTagContentAfterRemovingOneTag(); clealAllTagsConfirmationModalAndCancel(driver); clealAllTagsConfirmationModalAndOK(driver); addTagsForBodyMadIndexAttributes(9); addTagsForBodyMadIndexAttributes(10); addTagsForBodyMadIndexAttributes(11); }

Target:
public void tagAllBodyMassIndexAttributesManually() throws InterruptedException { openTagWizard(driver); selectEntityName(driver); clearAllTagsConfirmationModalAndOK(driver); assertEquals(getSelectedEntityName(driver), AbstractMappingServiceAppModel.TARGET_ENTITY_NAME); clickAutomaticTaggingButton(driver); checkGenderTagContent(); checkHeightTagContent(); checkWeightTagContentAfterRemovingOneTag(); clearAllTagsConfirmationModalAndCancel(driver); clearAllTagsConfirmationModalAndOK(driver); addTagsForBodyMadIndexAttributes(9); addTagsForBodyMadIndexAttributes(10); addTagsForBodyMadIndexAttributes(11); }
Source:
public boolean onOptionsItemSelected(MenuItem item) { int id = item.getItemId(); if (id == R.id.action_save) { oAuthBrowser(); } if (mDrawerToggle.onOptionsItemSelected(item)) { return true; } return super.onOptionsItemSelected(item); }

Target:
public boolean onOptionsItemSelected(MenuItem item) { int id = item.getItemId(); if (id == R.id.action_save) { oAuthBrowser(); } return mDrawerToggle.onOptionsItemSelected(item) || super.onOptionsItemSelected(item); }
Source:
public long recreateAndLoadConglomerate(boolean isExternal, String implementation, boolean recreate_ifempty, DataValueDescriptor[] template, ColumnOrdering[] columnOrder, int[] collationIds, Properties properties, int temporaryFlag, long orig_conglomId, RowLocationRetRowSource rowSource, long[] rowCount) throws StandardException { long conglomId = createConglomerate(isExternal,implementation, template, columnOrder, collationIds, properties, temporaryFlag, 0); long rows_loaded = loadConglomerate(conglomId, true, rowSource); if (rowCount != null) rowCount[0] = rows_loaded; if (!recreate_ifempty && (rows_loaded == 0)) { dropConglomerate(conglomId); conglomId = orig_conglomId; } return conglomId; }

Target:
public long recreateAndLoadConglomerate(boolean isExternal, String implementation, boolean recreate_ifempty, DataValueDescriptor[] template, ColumnOrdering[] columnOrder, int[] collationIds, Properties properties, int temporaryFlag, long orig_conglomId, RowLocationRetRowSource rowSource, long[] rowCount) throws StandardException { long conglomId = createConglomerate(isExternal,implementation, template, columnOrder, collationIds, properties, temporaryFlag, Conglomerate.Priority.NORMAL); long rows_loaded = loadConglomerate(conglomId, true, rowSource); if (rowCount != null) rowCount[0] = rows_loaded; if (!recreate_ifempty && (rows_loaded == 0)) { dropConglomerate(conglomId); conglomId = orig_conglomId; } return conglomId; }
Source:
public void testNotEliminateSorts() { @Language("SQL") String sql = "SELECT quantity, row_number() OVER (ORDER BY quantity) FROM lineitem ORDER BY tax"; PlanMatchPattern pattern = anyTree( sort( window(windowMatcherBuilder -> windowMatcherBuilder .specification(windowSpec) .addFunction(functionCall("row_number", Optional.empty(), ImmutableList.of())), anyTree(LINEITEM_TABLESCAN_Q)))); assertUnitPlan(sql, pattern); }

Target:
public void testNotEliminateSorts() { @Language("SQL") String sql = "SELECT quantity, row_number() OVER (ORDER BY quantity) FROM lineitem ORDER BY tax"; PlanMatchPattern pattern = anyTree( sort( anyTree( window(windowMatcherBuilder -> windowMatcherBuilder .specification(windowSpec) .addFunction(functionCall("row_number", Optional.empty(), ImmutableList.of())), anyTree(LINEITEM_TABLESCAN_Q))))); assertUnitPlan(sql, pattern); }
Source:
private boolean executeSshSoftFencingCommand(String version) { boolean result = true; EngineSSHClient sshClient = null; ByteArrayOutputStream cmdOut = null, cmdErr = null; try { sshClient = new EngineSSHClient(); sshClient.setVds(getVds()); sshClient.useDefaultKeyPair(); sshClient.connect(); sshClient.authenticate(); cmdOut = new ByteArrayOutputStream(); cmdErr = new ByteArrayOutputStream(); sshClient.executeCommand(Config.<String> GetValue(ConfigValues.SshSoftFencingCommand, version), null, cmdOut, cmdErr); log.infoFormat("SSH Soft Fencing command executed on host {0}", getVds().getHostName()); } catch (Exception ex) { log.errorFormat("SSH Soft Fencing command failed on host {0}: {1}\nStdout: {2}\nStderr: {3}\nStacktrace: {4}", getVds().getHostName(), ex.getMessage(), getCommandOutput(cmdOut), getCommandOutput(cmdErr), ex); result = false; } finally { closeSshConnection(sshClient); } return result; }

Target:
private boolean executeSshSoftFencingCommand(String version) { boolean result = true; EngineSSHClient sshClient = null; ByteArrayOutputStream cmdOut = null, cmdErr = null; try { sshClient = new EngineSSHClient(); sshClient.setVds(getVds()); sshClient.useDefaultKeyPair(); sshClient.connect(); sshClient.authenticate(); cmdOut = new ByteArrayOutputStream(); cmdErr = new ByteArrayOutputStream(); sshClient.executeCommand(Config.<String> GetValue(ConfigValues.SshSoftFencingCommand, version), null, cmdOut, cmdErr); log.infoFormat("SSH Soft Fencing command executed on host {0}", getVds().getHostName()); } catch (Exception ex) { log.errorFormat("SSH Soft Fencing command failed on host {0}: {1}", getVds().getHostName(), ex); logCommandOutput(cmdOut, "SSH Soft Fencing command standard output: {0}"); logCommandOutput(cmdErr, "SSH Soft Fencing command error output: {0}"); result = false; } finally { closeSshConnection(sshClient); } return result; }
Source:
public void testSimpleScan() { DefaultPlatformConfiguration defaultPlatformConfiguration = ConfigurationFileLoader.loadConfiguration(); final DefaultClasspathScanner scanner = new DefaultClasspathScanner(defaultPlatformConfiguration.getListProperty(ROOT_PACKAGE_FOR_CLASSPATH_SCAN)); Set<Class<?>> classes = scanner.getTypesAnnotatedWith(Resources.class); assertNotNull(classes); assertEquals(classes.size(), 0); classes = scanner.getTypesAnnotatedWith(AnnotationForClasspathScanTest.class); assertNotNull(classes); assertEquals(classes.size(), 1); assertTrue(classes.contains(AnnotatedClassForClasspathScan.class)); }

Target:
public void testSimpleScan() { final DefaultPlatformConfiguration defaultPlatformConfiguration = ConfigurationFileLoader.loadConfiguration(); final DefaultClasspathScanner scanner = new DefaultClasspathScanner(defaultPlatformConfiguration.getListProperty(ROOT_PACKAGE_FOR_CLASSPATH_SCAN)); Set<Class<?>> classes = scanner.getTypesAnnotatedWith(Resources.class); assertNotNull(classes); assertEquals(classes.size(), 0); classes = scanner.getTypesAnnotatedWith(AnnotationForClasspathScanTest.class); assertNotNull(classes); assertEquals(classes.size(), 1); assertTrue(classes.contains(AnnotatedClassForClasspathScan.class)); }
Source:
protected List<Member> addIndirectMembers(PerunSession sess, Group group, List<Member> members, int sourceGroupId) throws InternalErrorException, AlreadyMemberException, WrongAttributeValueException, WrongReferenceAttributeValueException { List<Member> oldMembers = this.getGroupMembers(sess, group); for (Member member : members) { groupsManagerImpl.addMember(sess, group, member, MembershipType.INDIRECT, sourceGroupId); setRequiredAttributes(sess, member, group); } List<Member> newMembers = this.getGroupMembers(sess, group); newMembers.removeAll(oldMembers); for (Member member : newMembers) { getPerunBl().getAuditer().log(sess, "{} added to {}.", member, group); } return newMembers; }

Target:
protected List<Member> addIndirectMembers(PerunSession sess, Group group, List<Member> members, int sourceGroupId) throws InternalErrorException, AlreadyMemberException, WrongAttributeValueException, WrongReferenceAttributeValueException { List<Member> oldMembers = this.getGroupMembers(sess, group); for (Member member : members) { groupsManagerImpl.addMember(sess, group, member, MembershipType.INDIRECT, sourceGroupId); } List<Member> newMembers = this.getGroupMembers(sess, group); newMembers.removeAll(oldMembers); for (Member member : newMembers) { setRequiredAttributes(sess, member, group); getPerunBl().getAuditer().log(sess, "{} added to {}.", member, group); } return newMembers; }
Source:
protected BrokerService createBroker() throws Exception, URISyntaxException { System.setProperty("org.apache.activemq.SERIALIZABLE_PACKAGES", "java.lang,javax.security,java.util,org.apache.activemq,org.fusesource.hawtbuf,com.thoughtworks.xstream.mapper"); return BrokerFactory.createBroker(new URI("broker://()/localhost?persistent=false")); }

Target:
protected BrokerService createBroker() throws Exception, URISyntaxException { System.setProperty("org.apache.activemq.SERIALIZABLE_PACKAGES", "java.util"); return BrokerFactory.createBroker(new URI("broker://()/localhost?persistent=false")); }
Source:
public Table execute() { if (_columnFamilies == null || _columnFamilies.isEmpty()) { throw new MetaModelException("Creating a table without columnFamilies"); } final Table table = getTable(); ((HBaseDataContext) getUpdateCallback().getDataContext()).getHBaseClient().createTable(table.getName(), _columnFamilies); addNewTableToSchema(table); return getSchema().getTableByName(table.getName()); }

Target:
public Table execute() { Set<String> columnFamilies = getColumnFamilies(); if (columnFamilies == null || columnFamilies.isEmpty()) { throw new MetaModelException("Can't create a table without column families."); } final Table table = getTable(); ((HBaseDataContext) getUpdateCallback().getDataContext()).getHBaseClient().createTable(table.getName(), columnFamilies); addNewTableToSchema(table); return getSchema().getTableByName(table.getName()); }
Source:
public DruidStatement prepare( final String query, final long maxRowCount, final AuthenticationResult authenticationResult ) { synchronized (lock) { try { ensure(State.NEW); sqlLifecycle.initialize(query, queryContext); this.authenticationResult = authenticationResult; PrepareResult prepareResult = sqlLifecycle.prepare(authenticationResult); this.maxRowCount = maxRowCount; this.query = query; ArrayList<AvaticaParameter> params = new ArrayList<>(); final RelDataType parameterRowType = prepareResult.getParameterRowType(); for (RelDataTypeField field : parameterRowType.getFieldList()) { RelDataType type = field.getType(); params.add( new AvaticaParameter( false, type.getPrecision(), type.getScale(), type.getSqlTypeName().getJdbcOrdinal(), type.getSqlTypeName().getName(), Object.class.getName(), field.getName())); } this.signature = Meta.Signature.create( createColumnMetaData(sqlLifecycle.rowType()), query, params, Meta.CursorFactory.ARRAY, Meta.StatementType.SELECT ); this.state = State.PREPARED; } catch (Throwable t) { return closeAndPropagateThrowable(t); } return this; } }

Target:
public DruidStatement prepare( final String query, final long maxRowCount, final AuthenticationResult authenticationResult ) { synchronized (lock) { try { ensure(State.NEW); sqlLifecycle.initialize(query, queryContext); this.authenticationResult = authenticationResult; PrepareResult prepareResult = sqlLifecycle.prepare(authenticationResult); this.maxRowCount = maxRowCount; this.query = query; List<AvaticaParameter> params = new ArrayList<>(); final RelDataType parameterRowType = prepareResult.getParameterRowType(); for (RelDataTypeField field : parameterRowType.getFieldList()) { RelDataType type = field.getType(); params.add(createParameter(field, type)); } this.signature = Meta.Signature.create( createColumnMetaData(prepareResult.getRowType()), query, params, Meta.CursorFactory.ARRAY, Meta.StatementType.SELECT ); this.state = State.PREPARED; } catch (Throwable t) { return closeAndPropagateThrowable(t); } return this; } }
Source:
public void experimentRangeUpdated(TmfExperimentRangeUpdatedSignal signal) { TmfExperiment experiment = signal.getExperiment(); if (!experiment.equals(TmfExperiment.getCurrentExperiment())) { return; } long startTime = signal.getRange().getStartTime().normalize(0, TIME_SCALE).getValue(); TmfTimestamp startTS = new TmfTimestamp(startTime, TIME_SCALE); TmfTimestamp endTS = new TmfTimestamp(startTime + INITIAL_WINDOW_SPAN, TIME_SCALE); TmfTimeRange timeRange = new TmfTimeRange(startTS, endTS); requestTimeRangeData(experiment, timeRange); requestData(experiment, signal.getRange()); }

Target:
public void experimentRangeUpdated(TmfExperimentRangeUpdatedSignal signal) { TmfExperiment experiment = signal.getExperiment(); if (!experiment.equals(TmfExperiment.getCurrentExperiment())) { return; } if (fSendRangeRequest) { fSendRangeRequest = false; long startTime = signal.getRange().getStartTime().normalize(0, TIME_SCALE).getValue(); TmfTimestamp startTS = new TmfTimestamp(startTime, TIME_SCALE); TmfTimestamp endTS = new TmfTimestamp(startTime + INITIAL_WINDOW_SPAN, TIME_SCALE); TmfTimeRange timeRange = new TmfTimeRange(startTS, endTS); requestTimeRangeData(experiment, timeRange); } requestData(experiment, signal.getRange()); }
Source:
public ProgramState checkPostStatement(CheckerContext context, Tree syntaxNode) { final PostStatementVisitor visitor = new PostStatementVisitor(context); syntaxNode.accept(visitor); return visitor.programState; }

Target:
public ProgramState checkPostStatement(CheckerContext context, Tree syntaxNode) { AbstractStatementVisitor visitor = new PostStatementVisitor(context); syntaxNode.accept(visitor); return visitor.programState; }
Source:
public RowFilter adapt(FilterAdapterContext context, ColumnPrefixFilter filter) throws IOException { byte[] prefix = filter.getPrefix(); ByteArrayOutputStream outputStream = new ByteArrayOutputStream(prefix.length * 2); readerExpressionHelper.writeQuotedExpression(prefix, outputStream); outputStream.write(ReaderExpressionHelper.ALL_QUALIFIERS_BYTES); return RowFilter.newBuilder() .setColumnQualifierRegexFilter( ByteString.copyFrom( outputStream.toByteArray())) .build(); }

Target:
public RowFilter adapt(FilterAdapterContext context, ColumnPrefixFilter filter) throws IOException { byte[] prefix = filter.getPrefix(); ByteArrayOutputStream outputStream = new ByteArrayOutputStream(prefix.length * 2); readerExpressionHelper.writeQuotedRegularExpression(prefix, outputStream); outputStream.write(ReaderExpressionHelper.ALL_QUALIFIERS_BYTES); return RowFilter.newBuilder() .setColumnQualifierRegexFilter( ByteString.copyFrom( outputStream.toByteArray())) .build(); }
Source:
public void validate(final Integer studyId, final Boolean shouldBeUnlocked) { this.errors = new MapBindingResult(new HashMap<String, String>(), Integer.class.getName()); if (studyId == null) { this.errors.reject("study.required", ""); throw new ApiRequestValidationException(this.errors.getAllErrors()); } final Study study = this.studyDataManager.getStudy(studyId); if (study == null) { this.errors.reject("study.not.exist", ""); throw new ResourceNotFoundException(this.errors.getAllErrors().get(0)); } if (shouldBeUnlocked) { this.checkIfStudyIsUnlocked(study); } final String programUUID = ContextHolder.getCurrentProgram(); if (programUUID == null) { this.errors.reject("study.required", ""); throw new ApiRequestValidationException(this.errors.getAllErrors()); } if (!programUUID.equals(study.getProgramUUID())) { this.errors.reject("invalid.program.uuid.study", ""); throw new ApiRequestValidationException(this.errors.getAllErrors()); } }

Target:
public void validate(final Integer studyId, final Boolean shouldBeUnlocked) { this.errors = new MapBindingResult(new HashMap<String, String>(), Integer.class.getName()); if (studyId == null) { this.errors.reject("study.required", ""); throw new ApiRequestValidationException(this.errors.getAllErrors()); } final Study study = this.studyDataManager.getStudy(studyId); if (study == null) { this.errors.reject("study.not.exist", ""); throw new ResourceNotFoundException(this.errors.getAllErrors().get(0)); } if (shouldBeUnlocked) { this.checkIfStudyIsLockedForCurrentUser(study); } final String programUUID = ContextHolder.getCurrentProgram(); if (programUUID == null) { this.errors.reject("study.required", ""); throw new ApiRequestValidationException(this.errors.getAllErrors()); } if (!programUUID.equals(study.getProgramUUID())) { this.errors.reject("invalid.program.uuid.study", ""); throw new ApiRequestValidationException(this.errors.getAllErrors()); } }
Source:
protected Notifier getNotifierFromEditorInput(Object editorInput) { Object input = editorInput; if (input instanceof RootObject) { final EObject root = ((RootObject) input).getRoot(); if (root.eResource() != null) { input = root.eResource(); } else { input = root; } } if (!Notifier.class.isInstance(input)) { throw new IllegalStateException("The editor input is not a Notifier!"); } return (Notifier) input; }

Target:
protected Notifier getNotifierFromEditorInput(Object editorInput) { Object input = editorInput; if (input instanceof RootObject) { input = ((RootObject) input).getRoot(); } if (!Notifier.class.isInstance(input)) { throw new IllegalStateException("The editor input is not a Notifier!"); } return (Notifier) input; }
Source:
private ArrayList<ArrayList<Integer>> readEvents(String filename) { ArrayList<ArrayList<Integer>> events = new ArrayList<ArrayList<Integer>>(); String str = ""; try{ InputStream in = this.getClass().getClassLoader().getResourceAsStream(TEST_PATH + filename + ".txt"); BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(in)); if (in!=null) { if((str = bufferedReader.readLine()) != null) { String[] temp = str.split("="); int players = Integer.parseInt(temp[1].trim()); for(int i = 0 ; i != players ; i++){ events.add(new ArrayList<Integer>()); } } while ((str = bufferedReader.readLine()) != null) { int player = Integer.parseInt(str.substring(0, 2).trim()); String newString = str.substring(2).trim(); switch(newString){ case "UP": events.get(player-1).add(VK_UP); break; case "DOWN": events.get(player-1).add(VK_DOWN); break; case "LEFT": events.get(player-1).add(VK_LEFT); break; case "RIGHT": events.get(player-1).add(VK_RIGHT); break; default: break; } } } } catch (NumberFormatException | IOException e) { e.printStackTrace(); } return events; }

Target:
private ArrayList<ArrayList<Integer>> readEvents(String filename) { ArrayList<ArrayList<Integer>> events = new ArrayList<ArrayList<Integer>>(); String str = ""; try{ InputStream in = this.getClass().getClassLoader().getResourceAsStream(TEST_PATH + filename + ".txt"); BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(in)); if (in!=null) { if((str = bufferedReader.readLine()) != null) { String[] temp = str.split("="); int players = Integer.parseInt(temp[1].trim()); for(int i = 0 ; i != players ; i++){ events.add(new ArrayList<Integer>()); } } while ((str = bufferedReader.readLine()) != null) { int player = Integer.parseInt(str.substring(0, 2).trim()); String newString = str.substring(2).trim(); switch(newString){ case UP: events.get(player-1).add(VK_UP); break; case DOWN: events.get(player-1).add(VK_DOWN); break; case LEFT: events.get(player-1).add(VK_LEFT); break; case RIGHT: events.get(player-1).add(VK_RIGHT); break; default: break; } } } } catch (NumberFormatException | IOException e) { e.printStackTrace(); } return events; }
Source:
public void deleteRange(TableReference tableRef, RangeRequest range) { maybeLog(() -> delegate.deleteRange(tableRef, range), logTimeAndTableRangeOfIterator("deleteRange", tableRef, range)); }

Target:
public void deleteRange(TableReference tableRef, RangeRequest range) { maybeLog(() -> delegate.deleteRange(tableRef, range), logTimeAndTableRange("deleteRange", tableRef, range)); }
Source:
public static int parseGravity(String attributeValue) { String[] gravities = attributeValue.split("\\|"); int returnGravity = Gravity.NO_GRAVITY; for (String gravity : gravities) { gravity = gravity.trim().toLowerCase(); int gravityValue = Gravity.NO_GRAVITY; if ("center".equals(gravity)) { gravityValue = Gravity.CENTER; } else if ("center_horizontal".equals(gravity)) { gravityValue = Gravity.CENTER_HORIZONTAL; } else if ("center_vertical".equals(gravity)) { gravityValue = Gravity.CENTER_VERTICAL; } else if ("left".equals(gravity)) { gravityValue = Gravity.LEFT; } else if ("right".equals(gravity)) { gravityValue = Gravity.RIGHT; } else if ("top".equals(gravity)) { gravityValue = Gravity.TOP; } else if ("bottom".equals(gravity)) { gravityValue = Gravity.BOTTOM; } returnGravity |= gravityValue; } return returnGravity; }

Target:
public static int parseGravity(String attributeValue) { String[] gravities = attributeValue.split("\\|"); int returnGravity = Gravity.NO_GRAVITY; for (String gravity : gravities) { gravity = gravity.trim().toLowerCase(); int gravityValue = Gravity.NO_GRAVITY; if ("center".equals(gravity)) { gravityValue = Gravity.CENTER; } else if ("center_horizontal".equals(gravity)) { gravityValue = Gravity.CENTER_HORIZONTAL; } else if ("center_vertical".equals(gravity)) { gravityValue = Gravity.CENTER_VERTICAL; } else if ("left".equals(gravity)) { gravityValue = Gravity.LEFT; } else if ("right".equals(gravity)) { gravityValue = Gravity.RIGHT; } else if ("top".equals(gravity)) { gravityValue = Gravity.TOP; } else if ("bottom".equals(gravity)) { gravityValue = Gravity.BOTTOM; }else if ("start".equals(gravity)) { gravityValue = Gravity.START; }else if ("end".equals(gravity)) { gravityValue = Gravity.END; } returnGravity |= gravityValue; } return returnGravity; }
Source:
public void afterTaskStartedEvent(TaskEvent event) { String userId = event.getTaskContext().getUserId(); Task ti = event.getTask(); TaskPersistenceContext persistenceContext = getPersistenceContext(((TaskContext)event.getTaskContext()).getPersistenceContext()); try { persistenceContext.persist(new TaskEventImpl(ti.getId(), org.kie.internal.task.api.model.TaskEvent.TaskEventType.STARTED, ti.getTaskData().getProcessInstanceId(), ti.getTaskData().getWorkItemId(), userId )); AuditTaskImpl auditTaskImpl = getAuditTask(event, persistenceContext, ti); if (auditTaskImpl == null) { logger.warn("Unable find audit task entry for task id '{}', skipping audit task update", ti.getId(), ti.getName()); return; } auditTaskImpl.setStatus(ti.getTaskData().getStatus().name()); auditTaskImpl.setActualOwner(getActualOnwer(ti)); updateLastModifiedDate(auditTaskImpl); persistenceContext.merge(auditTaskImpl); } finally { cleanup(persistenceContext); } }

Target:
public void afterTaskStartedEvent(TaskEvent event) { String userId = event.getTaskContext().getUserId(); Task ti = event.getTask(); TaskPersistenceContext persistenceContext = getPersistenceContext(((TaskContext)event.getTaskContext()).getPersistenceContext()); try { persistenceContext.persist(new TaskEventImpl(ti.getId(), org.kie.internal.task.api.model.TaskEvent.TaskEventType.STARTED, ti.getTaskData().getProcessInstanceId(), ti.getTaskData().getWorkItemId(), userId )); AuditTaskImpl auditTaskImpl = getAuditTask(event, persistenceContext, ti); if (auditTaskImpl == null) { logger.warn("Unable find audit task entry for task id '{}', skipping audit task update", ti.getId(), ti.getName()); return; } auditTaskImpl.setStatus(ti.getTaskData().getStatus().name()); auditTaskImpl.setActualOwner(getActualOwner(ti)); updateLastModifiedDate(auditTaskImpl); persistenceContext.merge(auditTaskImpl); } finally { cleanup(persistenceContext); } }
Source:
public Amount unmarshal(Amount amount) throws Exception { if (amount == null || amount.getValue() == null) { return amount; } return amount.setValue(round(amount)); }

Target:
public Amount unmarshal(Amount amount) throws Exception { return amount; }
Source:
public Optional<String> getExportFileName() { return exportFileName.map(filename -> filename.endsWith(".csv") ? filename : filename + ".csv"); }

Target:
public Optional<String> getExportFileName() { return exportFileName.map(filename -> filename.toLowerCase().endsWith(".csv") ? filename : filename + ".csv"); }
Source:
public HiveMetastoreClient createMetastoreClient() { List<HostAndPort> metastores = new ArrayList<>(addresses); Collections.shuffle(metastores.subList(1, metastores.size())); TException lastException = null; for (HostAndPort metastore : metastores) { try { HiveMetastoreClient hiveMetastoreClient = clientFactory.create(metastore); if (!com.google.common.base.Strings.isNullOrEmpty(hiveUserName)) { hiveMetastoreClient.setUGI(hiveUserName, new ArrayList<String>()); } return hiveMetastoreClient; } catch (TException e) { lastException = e; } } throw new PrestoException(HIVE_METASTORE_ERROR, format("Failed connecting to Hive metastore: %s use %s ", addresses, hiveUserName), lastException); }

Target:
public HiveMetastoreClient createMetastoreClient() { List<HostAndPort> metastores = new ArrayList<>(addresses); Collections.shuffle(metastores.subList(1, metastores.size())); TException lastException = null; for (HostAndPort metastore : metastores) { try { HiveMetastoreClient hiveMetastoreClient = clientFactory.create(metastore); if (!isNullOrEmpty(hiveUserName)) { hiveMetastoreClient.setUGI(hiveUserName, new ArrayList<String>()); } return hiveMetastoreClient; } catch (TException e) { lastException = e; } } if (!isNullOrEmpty(hiveUserName)) { throw new PrestoException(HIVE_METASTORE_ERROR, format("Failed connecting to Hive metastore: %s , HiveUserName is %s ", addresses, hiveUserName), lastException); } throw new PrestoException(HIVE_METASTORE_ERROR, "Failed connecting to Hive metastore: " + addresses, lastException); }
Source:
private HttpURLConnection openHttpURLConnection(URI uri, MantaClient client) throws IOException { boolean tlsInsecure = client.getContext().tlsInsecure(); HttpURLConnection connection = (HttpsURLConnection)uri.toURL().openConnection(); if (tlsInsecure && connection instanceof HttpsURLConnection) { HttpsURLConnection sConn = (HttpsURLConnection)connection; TrustManager[] trustAllCerts = new TrustManager[] {new X509TrustManager() { @Override public X509Certificate[] getAcceptedIssuers() { return null; } @Override public void checkClientTrusted(X509Certificate[] certs, String authType) { } @Override public void checkServerTrusted(X509Certificate[] certs, String authType) { } } }; HostnameVerifier hostnameVerifier = new HostnameVerifier() { @Override public boolean verify(String hostname, SSLSession session) { return true; } }; try { SSLContext sc = SSLContext.getInstance("SSL"); sc.init(null, trustAllCerts, new SecureRandom()); sConn.setSSLSocketFactory(sc.getSocketFactory()); sConn.setHostnameVerifier(hostnameVerifier); } catch (Exception e) { throw new RuntimeException(e); } } return connection; }

Target:
private HttpURLConnection openHttpURLConnection(URI uri, MantaClient client) throws IOException { boolean tlsInsecure = client.getContext().tlsInsecure(); HttpURLConnection connection = (HttpsURLConnection)uri.toURL().openConnection(); if (tlsInsecure && connection instanceof HttpsURLConnection) { HttpsURLConnection secureConn = (HttpsURLConnection)connection; TrustManager[] trustAllCerts = new TrustManager[] {new X509TrustManager() { @Override public X509Certificate[] getAcceptedIssuers() { return null; } @Override public void checkClientTrusted(X509Certificate[] certs, String authType) { } @Override public void checkServerTrusted(X509Certificate[] certs, String authType) { } } }; HostnameVerifier hostnameVerifier = (hostname, session) -> true; try { SSLContext sslContext = SSLContext.getInstance("SSL"); sslContext.init(null, trustAllCerts, new SecureRandom()); secureConn.setSSLSocketFactory(sslContext.getSocketFactory()); secureConn.setHostnameVerifier(hostnameVerifier); } catch (Exception e) { throw new RuntimeException(e); } } return connection; }
Source:
public String getCustomAuthorizerName() { return customAuthorizerName; }

Target:
String getCustomAuthorizerName() { return customAuthorizerName; }
Source:
public String getSamlKeystoreUrl() { if (keystore == null) { String ks = overlordConfig.getString(SAML_KEYSTORE); if (ks == null) { throw new RuntimeException("Overlord configuration missing: " + SAML_KEYSTORE); } if (!ks.startsWith("profile:")) { try { File ksFile = new File(ks); if (ksFile.isFile()) { ks = ksFile.toURI().toURL().toString(); } else { throw new FileNotFoundException(ks); } } catch (Exception e) { throw new RuntimeException(e); } keystore = ks; } else { keystore = ks.substring("profile:".length()); StringBuilder builder = new StringBuilder(); String userHome = builder.append(System.getProperty("user.home")).append(File.separator).append("jbid-keystore").toString(); File f = new File(userHome); if (!f.exists()) { f.mkdir(); } builder = new StringBuilder(); String tempFile = builder.append(userHome).append(File.separator).append(keystore).toString(); File temp = new File(tempFile); if (!temp.exists()) { try { temp.createNewFile(); } catch (IOException e) { e.printStackTrace(); return ""; } } OutputStream os = null; try { os = new FileOutputStream(temp); byte[] keystoreContent = null; if (fabricService != null && fabricService.getCurrentContainer() != null && fabricService.getCurrentContainer().getOverlayProfile() != null) { Profile profile = fabricService.getCurrentContainer().getOverlayProfile(); keystoreContent = profile.getFileConfiguration(keystore); } if (keystoreContent != null) { os.write(keystoreContent); } } catch (Exception e) { e.printStackTrace(); return ""; } finally { if (os != null) { try { os.close(); } catch (IOException e) { e.printStackTrace(); } } } } } return keystore; }

Target:
public String getSamlKeystoreUrl() { if (keystore == null) { String ks = overlordConfig.getString(SAML_KEYSTORE); if (ks == null) { throw new RuntimeException("Overlord configuration missing: " + SAML_KEYSTORE); } if (!ks.startsWith("profile:")) { try { File ksFile = new File(ks); if (ksFile.isFile()) { ks = ksFile.toURI().toURL().toString(); } else { throw new FileNotFoundException(ks); } } catch (Exception e) { throw new RuntimeException(e); } keystore = ks; } else { keystore = ks.substring("profile:".length()); StringBuilder builder = new StringBuilder(); File temp = null; try { temp = File.createTempFile(keystore, null); temp.deleteOnExit(); } catch (IOException e1) { throw new RuntimeException(e1); } OutputStream os = null; try { os = new FileOutputStream(temp); byte[] keystoreContent = null; if (fabricService != null && fabricService.getCurrentContainer() != null && fabricService.getCurrentContainer().getOverlayProfile() != null) { Profile profile = fabricService.getCurrentContainer().getOverlayProfile(); keystoreContent = profile.getFileConfiguration(keystore); } if (keystoreContent != null) { os.write(keystoreContent); } keystore = temp.toURI().toURL().toString(); } catch (Exception e) { throw new RuntimeException(e); } finally { if (os != null) { try { os.close(); } catch (IOException e) { throw new RuntimeException(e); } } } } } return keystore; }
Source:
private void executeNextOperation() { switch (getParameters().getVmBackup().getPhase()) { case STARTING: lockDisks(); VmBackup vmBackup = getParameters().getVmBackup(); vmBackup.setToCheckpointId(getParameters().getToCheckpointId()); Map<String, Object> disks = startVmBackup(vmBackup); if (disks != null) { TransactionSupport.executeInNewTransaction(() -> { vmBackupDao.update(vmBackup); return null; }); storeBackupsUrls(disks); } else { setCommandStatus(CommandStatus.FAILED); } break; case READY: log.info("Ready to start image transfers using backup URLs"); break; case FINALIZING: finalizeVmBackup(); setCommandStatus(CommandStatus.SUCCEEDED); break; } }

Target:
private void executeNextOperation() { switch (getParameters().getVmBackup().getPhase()) { case STARTING: lockDisks(); VmBackup vmBackup = getParameters().getVmBackup(); vmBackup.setToCheckpointId(getParameters().getToCheckpointId()); Map<String, Object> disks = startVmBackup(); if (disks != null) { TransactionSupport.executeInNewTransaction(() -> { vmBackupDao.update(vmBackup); return null; }); storeBackupsUrls(disks); } else { setCommandStatus(CommandStatus.FAILED); } break; case READY: log.info("Ready to start image transfers using backup URLs"); break; case FINALIZING: finalizeVmBackup(); setCommandStatus(CommandStatus.SUCCEEDED); break; } }
Source:
public void updateWifiSsid() { mWifiSsid = null; WifiManager wifiManager = (WifiManager) mContext.getSystemService(Context.WIFI_SERVICE); if (wifiManager != null) { WifiInfo wifiInfo = wifiManager.getConnectionInfo(); if (wifiInfo != null) { mWifiSsid = wifiInfo.getSSID(); } } }

Target:
public void updateWifiSsid() { mWifiSsid = null; WifiManager wifiManager = (WifiManager) mContext.getSystemService(Context.WIFI_SERVICE); WifiInfo wifiInfo = wifiManager.getConnectionInfo(); if (wifiInfo != null) { mWifiSsid = wifiInfo.getSSID(); } }
Source:
protected RestResponse handleRequest(RestRequest req) throws Exception { ReportTaskRequest stReq = (ReportTaskRequest) req; String action = stReq.getAction(); Long id = stReq.getId(); log.info("action: " + action + " id: " + id); if (action == null) { return null; } switch (action) { case ReportTaskRequest.START_ACTION: Report r = rDao.getByKey(id); if (r != null) { if (!r.getState().equals(Report.QUEUED)) { log.warning("Cannot start report that is " + r.getState()); return null; } log.info(" ====Starting========"); try { final int sts = engage(r); log.info(" got " + sts); if (sts == 200) { return null; } else if ((sts % 100) == 4) { r.setState(Report.FINISHED_ERROR); r.setMessage("Unexpected result when starting report: " + sts); rDao.save(r); } else { requeueStart(r); } } catch (MalformedURLException e) { Log.error("Bad URL"); } catch (IOException e) { log.warning("====IOerror: " + e); requeueStart(r); } } break; case ReportTaskRequest.PROGRESS_ACTION: Report r2 = rDao.getByKey(id); if (r2 != null) { if (!r2.getState().equals(Report.QUEUED) && !r2.getState().equals(Report.IN_PROGRESS)) { log.warning("Cannot set progress on report that is " + r2.getState()); return null; } r2.setState(stReq.getState()); r2.setMessage(stReq.getMessage()); rDao.save(r2); } break; default: log.warning("Unknown action."); break; } return null; }

Target:
protected RestResponse handleRequest(RestRequest req) throws Exception { ReportTaskRequest stReq = (ReportTaskRequest) req; String action = stReq.getAction(); Long id = stReq.getId(); log.log(Level.FINE, "action: " + action + " id: " + id); Report r = rDao.getByKey(id); switch (action) { case ReportTaskRequest.START_ACTION: if (r != null) { if (!r.getState().equals(Report.QUEUED)) { log.warning("Cannot start report " + id + " that is " + r.getState()); return null; } log.log(Level.FINE, " ====Starting========"); try { final int sts = startReportEngine(r); log.log(Level.FINE, " got " + sts); if (sts == 200) { return null; } else if ((sts % 100) == 4) { r.setState(Report.FINISHED_ERROR); r.setMessage("Unexpected result when starting report \" + id + \" : " + sts); rDao.save(r); } else { requeueStart(r); } } catch (MalformedURLException e) { log.log(Level.SEVERE, "Bad URL"); } catch (IOException e) { log.warning("====IOerror: " + e); requeueStart(r); } } break; case ReportTaskRequest.PROGRESS_ACTION: if (r != null) { if (!r.getState().equals(Report.QUEUED) && !r.getState().equals(Report.IN_PROGRESS)) { log.warning("Cannot set progress on report " + id + " that is " + r.getState()); return null; } r.setState(stReq.getState()); r.setMessage(stReq.getMessage()); rDao.save(r); } break; default: log.warning("Unknown action."); break; } return null; }
Source:
private void open() throws IOException { RepositoryStreamContext ctx = getContext(); if (ctx.isOpened()) { return; } RepositoryPath path = (RepositoryPath) ctx.getPath(); logger.info(String.format("Locking [%s]", path)); ReadWriteLock lockSource = repositoryPathLock.lock(path); Lock lock; if (ctx instanceof RepositoryStreamWriteContext) { lock = lockSource.writeLock(); } else { lock = lockSource.readLock(); } ctx.setLock(lock); lock.lock(); logger.info(String.format("Locked [%s]", path)); doOpen(ctx); }

Target:
private void open() throws IOException { RepositoryStreamContext ctx = getContext(); if (ctx.isOpened()) { return; } RepositoryPath path = (RepositoryPath) ctx.getPath(); logger.debug(String.format("Locking [%s]", path)); ReadWriteLock lockSource = repositoryPathLock.lock(path); Lock lock; if (ctx instanceof RepositoryStreamWriteContext) { lock = lockSource.writeLock(); } else { lock = lockSource.readLock(); } ctx.setLock(lock); lock.lock(); logger.debug(String.format("Locked [%s]", path)); doOpen(ctx); }
Source:
public SWTGridDescription getGridDescription(SWTGridDescription gridDescription) { if (rendererGridDescription == null) { if (getTableStyleProperty().getRenderMode() == RenderMode.COMPACT_VERTICALLY) { final boolean includeLabel = getVElement().getLabelAlignment() != LabelAlignment.NONE; rendererGridDescription = GridDescriptionFactory.INSTANCE.createCompactGrid(includeLabel, true, this); } else { rendererGridDescription = GridDescriptionFactory.INSTANCE.createSimpleGrid(1, 1, this); } } return rendererGridDescription; }

Target:
public SWTGridDescription getGridDescription(SWTGridDescription gridDescription) { if (rendererGridDescription == null) { if (getTableStyleProperty().getRenderMode() == RenderMode.COMPACT_VERTICALLY) { final boolean includeLabel = getVElement().getLabelAlignment() != LabelAlignment.NONE; if (getVElement().getLabelAlignment() == LabelAlignment.TOP) { Activator.getInstance().log(IStatus.WARNING, MessageFormat.format( Messages.TableControlSWTRenderer_LabelAlignmentTopNotSupportForRenderModeCompactVertically, getVElement().getName())); } rendererGridDescription = GridDescriptionFactory.INSTANCE.createCompactGrid(includeLabel, true, this); } else { rendererGridDescription = GridDescriptionFactory.INSTANCE.createSimpleGrid(1, 1, this); } } return rendererGridDescription; }
Source:
public String getQualifiedClusterName() { return clusterName + dc; }

Target:
public String getQualifiedClusterName() { return clusterName + "-" + datacenter; }
Source:
public Oscore(int instanceId, String masterSecret, String senderId, String recipientId, int aeadAlgorithm, int hkdfAlgorithm, String masterSalt) { this.setId(instanceId); this.masterSecret = masterSecret; this.senderId = senderId; this.recipientId = recipientId; this.aeadAlgorithm = aeadAlgorithm; this.hkdfAlgorithm = hkdfAlgorithm; this.masterSalt = masterSalt; this.idContext = ""; }

Target:
public Oscore(int instanceId, String masterSecret, String senderId, String recipientId, int aeadAlgorithm, int hkdfAlgorithm, String masterSalt) { super(instanceId); this.masterSecret = masterSecret; this.senderId = senderId; this.recipientId = recipientId; this.aeadAlgorithm = aeadAlgorithm; this.hkdfAlgorithm = hkdfAlgorithm; this.masterSalt = masterSalt; this.idContext = ""; }
Source:
public void handleEvent(ITmfStateSystemBuilder ss, ITmfEvent event) throws AttributeNotFoundException { Integer cpu = KernelEventHandlerUtils.getCpu(event); if (cpu == null) { return; } Integer softIrqId = ((Long) event.getContent().getField(getLayout().fieldVec()).getValue()).intValue(); int currentThreadNode = KernelEventHandlerUtils.getCurrentThreadNode(cpu, ss); int quark = ss.getQuarkRelativeAndAdd(KernelEventHandlerUtils.getNodeSoftIRQs(cpu, ss), softIrqId.toString()); long timestamp = KernelEventHandlerUtils.getTimestamp(event); if (isSoftIrqRaised(ss.queryOngoingState(quark))) { ss.modifyAttribute(timestamp, StateValues.SOFT_IRQ_RAISED_VALUE, quark); } else { ss.modifyAttribute(timestamp, TmfStateValue.nullValue(), quark); } List<Integer> softIrqs = ss.getSubAttributes(ss.getParentAttributeQuark(quark), false); KernelEventHandlerUtils.cpuExitInterrupt(timestamp, cpu, ss); for (Integer softIrq : softIrqs) { if (!ss.queryOngoingState(softIrq).isNull()) { return; } } KernelEventHandlerUtils.setProcessToRunning(timestamp, currentThreadNode, ss); }

Target:
public void handleEvent(ITmfStateSystemBuilder ss, ITmfEvent event) throws AttributeNotFoundException { Integer cpu = KernelEventHandlerUtils.getCpu(event); if (cpu == null) { return; } Integer softIrqId = ((Long) event.getContent().getField(getLayout().fieldVec()).getValue()).intValue(); int currentThreadNode = KernelEventHandlerUtils.getCurrentThreadNode(cpu, ss); int quark = ss.getQuarkRelativeAndAdd(KernelEventHandlerUtils.getNodeSoftIRQs(cpu, ss), softIrqId.toString()); long timestamp = KernelEventHandlerUtils.getTimestamp(event); if (isSoftIrqRaised(ss.queryOngoingState(quark))) { ss.modifyAttribute(timestamp, StateValues.SOFT_IRQ_RAISED_VALUE, quark); } else { ss.modifyAttribute(timestamp, TmfStateValue.nullValue(), quark); } KernelEventHandlerUtils.cpuExitInterrupt(timestamp, cpu, ss); List<Integer> softIrqs = ss.getSubAttributes(ss.getParentAttributeQuark(quark), false); for (Integer softIrq : softIrqs) { final @NonNull ITmfStateValue ongoingState = ss.queryOngoingState(softIrq); if (ongoingState.equals(StateValues.CPU_STATUS_SOFTIRQ_VALUE)) { return; } } KernelEventHandlerUtils.setProcessToRunning(timestamp, currentThreadNode, ss); }
Source:
protected ConsoleQueryBlockedException(ActionRequest actionRequest) { super(ErrorCode.CONSOLE_QUERY_BLOCKED, "Console Query blocked due to high load. Kindly run after sometime"); this.actionRequest = actionRequest; }

Target:
public ConsoleQueryBlockedException(ActionRequest actionRequest) { super(ErrorCode.CONSOLE_QUERY_BLOCKED, "Console Query blocked due to high load. Kindly run after sometime"); this.actionRequest = actionRequest; }
Source:
public IdToken(String tokenValue, JsonWebSignature jsonWebSignature) { super(tokenValue, new Date(jsonWebSignature.getPayload().getExpirationTimeSeconds() * 1000)); this.jsonWebSignature = jsonWebSignature; }

Target:
private IdToken(String tokenValue, JsonWebSignature jsonWebSignature) { super(tokenValue, new Date(jsonWebSignature.getPayload().getExpirationTimeSeconds() * 1000)); this.jsonWebSignature = jsonWebSignature; }
Source:
public void testResolution() { builder = RandomDistributedScalarEncoder.builder() .name("enc") .resolution(1); rdse = builder.build(); int[] e23 = rdse.encode(23.0); int[] e23_1 = rdse.encode(23.1); int[] e22_9 = rdse.encode(22.9); int[] e24 = rdse.encode(24.0); assertEquals(rdse.getW(), getOnBits(e23)); assertArrayEquals("Numbers within resolution don't have the same encoding", e23_1, e23); assertArrayEquals("Numbers within resolution don't have the same encoding", e22_9, e23); assertFalse("Numbers outside resolution have the same encoding", Arrays.equals(e23, e24)); int[] e22_5 = rdse.encode(22.5); assertFalse("Numbers outside resolution have the same encoding", Arrays.equals(e23, e22_5)); }

Target:
public void testResolution() { builder = RandomDistributedScalarEncoder.builder() .name("enc") .resolution(1); rdse = builder.build(); int[] e23 = rdse.encode(23.0); int[] e23_1 = rdse.encode(23.1); int[] e22_9 = rdse.encode(22.9); int[] e24 = rdse.encode(24.0); assertEquals(rdse.getW(), getOnBits(e23)); assertThat("Numbers within resolution don't have the same encoding", e23_1, is(equalTo(e23))); assertThat("Numbers within resolution don't have the same encoding", e22_9, is(equalTo(e23))); assertThat("Numbers outside resolution have the same encoding", e23, is(not(equalTo(e24)))); int[] e22_5 = rdse.encode(22.5); assertThat("Numbers outside resolution have the same encoding", e23, is(not(equalTo(e22_5)))); }