auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public static HTable getTable(UserProvider provider, Configuration config, String tableName) throws IOException, InterruptedException { UserGroupInformation ugi; if (provider != null) { ugi = provider.getCurrent().getUGI(); LOG.debug("Current USER for provider: {}", ugi.getUserName()); } else { ugi = UserGroupInformation.getCurrentUser(); LOG.debug("UGI for current USER : {}", ugi.getUserName()); boolean foundHBaseAuthToken = false; for (Token<? extends TokenIdentifier> token : ugi.getTokens()) { LOG.debug("Token in UGI (delegation token): / {}", token.toString(), token.decodeIdentifier().getUser()); if (token.getKind().toString().equals(TOKEN_KIND_HBASE_AUTH_TOKEN)) { LOG.debug("Found HBASE_AUTH_TOKEN - using the token to replace current user."); ugi = token.decodeIdentifier().getUser(); ugi.addToken(token); foundHBaseAuthToken = true; } } if (!foundHBaseAuthToken) { LOG.warn("Can't find HBase auth token in delegation tokens."); } } return ugi.doAs(new PrivilegedExceptionAction<HTable>() { @Override public HTable run() throws IOException { return new HTable(config, tableName); } }); }

Target:
public static HTable getTable(UserProvider provider, Configuration config, String tableName) throws IOException, InterruptedException { UserGroupInformation ugi; if (provider != null) { ugi = provider.getCurrent().getUGI(); LOG.debug("Current USER for provider: {}", ugi.getUserName()); } else { ugi = UserGroupInformation.getCurrentUser(); LOG.debug("UGI for current USER : {}", ugi.getUserName()); boolean foundHBaseAuthToken = false; for (Token<? extends TokenIdentifier> token : ugi.getTokens()) { LOG.debug("Token in UGI (delegation token): / {}", token.toString(), token.decodeIdentifier().getUser()); if (token.getKind().toString().equals(TOKEN_KIND_HBASE_AUTH_TOKEN)) { if (!foundHBaseAuthToken) { LOG.debug("Found HBASE_AUTH_TOKEN - using the token to replace current user."); ugi = token.decodeIdentifier().getUser(); ugi.addToken(token); foundHBaseAuthToken = true; } else { LOG.warn("Found multiple HBASE_AUTH_TOKEN - will use already found token. " + "Please enable DEBUG log level to track delegation tokens."); } } } if (!foundHBaseAuthToken) { LOG.warn("Can't find HBase auth token in delegation tokens."); } } return ugi.doAs(new PrivilegedExceptionAction<HTable>() { @Override public HTable run() throws IOException { return new HTable(config, tableName); } }); }
Source:
public boolean isOnSameDayAs(Timeslot other) { return startDateTime.getYear() == other.startDateTime.getYear() && startDateTime.getDayOfYear() == other.startDateTime.getDayOfYear() && endDateTime.getYear() == other.endDateTime.getYear() && endDateTime.getDayOfYear() == other.endDateTime.getDayOfYear(); }

Target:
public boolean isOnSameDayAs(Timeslot other) { return startDateTime.toLocalDate().equals(other.getStartDateTime().toLocalDate()); }
Source:
public boolean areHubsLinksVisible() { for (WebElement hubLink : hubLinks) { if (!hubLink.isDisplayed()) { return false; } } return true; }

Target:
public boolean areHubsLinksVisible() { for (WebElement hubLink : hubsLinks) { if (!hubLink.isDisplayed()) { return false; } } return true; }
Source:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); RxPermissions rxPermissions = new RxPermissions(this); rxPermissions.setLogging(true); setContentView(R.layout.activity_main); surfaceView = (SurfaceView) findViewById(R.id.surfaceView); RxView.clicks(findViewById(R.id.enableCamera)) .compose(rxPermissions.ensureEach(Manifest.permission.CAMERA)) .subscribe(new Action1<Permission>() { @Override public void call(Permission permission) { Log.i(TAG, "Permission result " + permission); if (permission.granted) { releaseCamera(); camera = Camera.open(0); try { camera.setPreviewDisplay(surfaceView.getHolder()); camera.startPreview(); } catch (IOException e) { Log.e(TAG, "Error while trying to display the camera preview", e); } } else if (permission.shouldShowRequestPermissionRationale) { Toast.makeText(MainActivity.this, "Denied permission without ask never again", Toast.LENGTH_SHORT).show(); } else { Toast.makeText(MainActivity.this, "Permission denied, can't enable the camera", Toast.LENGTH_SHORT).show(); } } }, new Action1<Throwable>() { @Override public void call(Throwable t) { Log.e(TAG, "onError", t); } }, new Action0() { @Override public void call() { Log.i(TAG, "OnComplete"); } }); }

Target:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); RxPermissions rxPermissions = new RxPermissions(this); rxPermissions.setLogging(true); setContentView(R.layout.act_main); surfaceView = (SurfaceView) findViewById(R.id.surfaceView); RxView.clicks(findViewById(R.id.enableCamera)) .compose(rxPermissions.ensureEach(Manifest.permission.CAMERA)) .subscribe(new Action1<Permission>() { @Override public void call(Permission permission) { Log.i(TAG, "Permission result " + permission); if (permission.granted) { releaseCamera(); camera = Camera.open(0); try { camera.setPreviewDisplay(surfaceView.getHolder()); camera.startPreview(); } catch (IOException e) { Log.e(TAG, "Error while trying to display the camera preview", e); } } else if (permission.shouldShowRequestPermissionRationale) { Toast.makeText(MainActivity.this, "Denied permission without ask never again", Toast.LENGTH_SHORT).show(); } else { Toast.makeText(MainActivity.this, "Permission denied, can't enable the camera", Toast.LENGTH_SHORT).show(); } } }, new Action1<Throwable>() { @Override public void call(Throwable t) { Log.e(TAG, "onError", t); } }, new Action0() { @Override public void call() { Log.i(TAG, "OnComplete"); } }); }
Source:
public void run() { try { JsonNode node = JsonUtil.JSON_SERDE.valueToTree( new StatusData( SustainedConnectionWorker.this.totalProducerConnections.get(), SustainedConnectionWorker.this.totalProducerFailedConnections.get(), SustainedConnectionWorker.this.totalConsumerConnections.get(), SustainedConnectionWorker.this.totalConsumerFailedConnections.get(), SustainedConnectionWorker.this.totalMetadataConnections.get(), SustainedConnectionWorker.this.totalMetadataFailedConnections.get(), SustainedConnectionWorker.this.totalAborts.get(), System.currentTimeMillis())); status.update(node); } catch (Exception e) { SustainedConnectionWorker.log.error("Abort while running StatusUpdater", e.getMessage()); WorkerUtils.abort(log, "StatusUpdater", e, doneFuture); } }

Target:
public void run() { try { JsonNode node = JsonUtil.JSON_SERDE.valueToTree( new StatusData( SustainedConnectionWorker.this.totalProducerConnections.get(), SustainedConnectionWorker.this.totalProducerFailedConnections.get(), SustainedConnectionWorker.this.totalConsumerConnections.get(), SustainedConnectionWorker.this.totalConsumerFailedConnections.get(), SustainedConnectionWorker.this.totalMetadataConnections.get(), SustainedConnectionWorker.this.totalMetadataFailedConnections.get(), SustainedConnectionWorker.this.totalAbortedThreads.get(), SustainedConnectionWorker.SYSTEM_TIME.milliseconds())); status.update(node); } catch (Exception e) { SustainedConnectionWorker.log.error("Aborted test while running StatusUpdater", e); WorkerUtils.abort(log, "StatusUpdater", e, doneFuture); } }
Source:
MasterAddressRefresher(Configuration conf, MasterRegistry registry) { pool = Executors.newSingleThreadExecutor(new ThreadFactoryBuilder() .setNameFormat("master-registry-refresh-end-points").setDaemon(true).build()); periodicRefreshMs = 1000 * conf.getLong(PERIODIC_REFRESH_INTERVAL_SECS, PERIODIC_REFRESH_INTERVAL_SECS_DEFAULT); timeBetweenRefreshesMs = 1000 * conf.getLong(MIN_SECS_BETWEEN_REFRESHES, MIN_SECS_BETWEEN_REFRESHES_DEFAULT); Preconditions.checkArgument(periodicRefreshMs > 0); Preconditions.checkArgument(timeBetweenRefreshesMs < periodicRefreshMs); this.registry = registry; pool.submit(new RefreshThread()); }

Target:
MasterAddressRefresher(Configuration conf, MasterRegistry registry) { pool = Executors.newSingleThreadExecutor(new ThreadFactoryBuilder() .setNameFormat("master-registry-refresh-end-points").setDaemon(true).build()); periodicRefreshMs = TimeUnit.SECONDS.toMillis(conf.getLong(PERIODIC_REFRESH_INTERVAL_SECS, PERIODIC_REFRESH_INTERVAL_SECS_DEFAULT)); timeBetweenRefreshesMs = TimeUnit.SECONDS.toMillis(conf.getLong(MIN_SECS_BETWEEN_REFRESHES, MIN_SECS_BETWEEN_REFRESHES_DEFAULT)); Preconditions.checkArgument(periodicRefreshMs > 0); Preconditions.checkArgument(timeBetweenRefreshesMs < periodicRefreshMs); this.registry = registry; pool.submit(new RefreshThread()); }
Source:
public void unavailable() { JobScheduler.JobHandle handle = profileHandle; if ( handle != null ) { handle.cancel( false ); profileHandle = null; } }

Target:
public synchronized void unavailable() { available = false; if ( jobHandle != null ) { jobHandle.cancel( false ); jobHandle = null; } }
Source:
private void addAndroidCompilerOutputPath( Map<String, Object> androidProperties, IjModule module, Path moduleBasePath) { Optional<Path> compilerOutputPath = module.getCompilerOutputPath(); if (compilerOutputPath.isPresent()) { String fullCompilerOutputPath; String relativeOutputPath = MODULE_DIR + MorePaths.pathWithUnixSeparators( moduleBasePath.relativize(compilerOutputPath.get())); if (compilerOutputPath.get().toString().endsWith(JAR_FILE_EXTENSION)) { fullCompilerOutputPath = JAR_PREFIX + relativeOutputPath + JAR_SUFFIX; } else { fullCompilerOutputPath = FILE_PREFIX + relativeOutputPath; } androidProperties.put("compiler_output_path", fullCompilerOutputPath); } }

Target:
private void addAndroidCompilerOutputPath( Map<String, Object> androidProperties, IjModule module, Path moduleBasePath) { Optional<Path> compilerOutputPath = module.getCompilerOutputPath(); if (compilerOutputPath.isPresent()) { androidProperties.put( "compiler_output_path", IjProjectPaths.toModuleDirRelativeString(compilerOutputPath.get(), moduleBasePath)); } }
Source:
private void initialize() { contentResolver.registerContentObserver(getContentUri(), true, getContentObserver()); Observable<CoreOperation> operationObservable = operationSubject .onBackpressureBuffer() .observeOn(Schedulers.io()) .flatMap(this::createCoreOperation); updateSubscription = groupOperations(operationObservable) .observeOn(Schedulers.computation()) .doOnNext(operations -> Log.v(TAG, "Grouped list of " + operations.size())) .flatMap(this::applyOperations) .subscribe(this::release, error -> Log.e(TAG, "Error while handling data operations!", error)); }

Target:
private void initialize() { contentResolver.registerContentObserver(getContentUri(), true, getContentObserver()); Observable<CoreOperation> operationObservable = operationSubject .onBackpressureBuffer() .observeOn(Schedulers.io()) .flatMap(this::createCoreOperation); updateSubscription = groupOperations(operationObservable) .observeOn(Schedulers.computation()) .doOnNext(operations -> Log.v(TAG, "Grouped list of " + operations.size())) .concatMap(this::applyOperations) .subscribe(this::release, error -> Log.e(TAG, "Error while handling data operations!", error)); }
Source:
private void registerDeleteAction() { registerAction(KEY_DELETE, KeyStroke.getKeyStroke(KEY_DELETE), new JobGraphBindingAction() { @Override public void actionPerformed(final ActionEvent e) { final Set<Object> vertices = _graphContext.getSelectedVertices(); if ((vertices == null) || vertices.isEmpty()) { return; } for (Object vertex : vertices) { final AnalysisJobBuilder analysisJobBuilder = _graphContext.getAnalysisJobBuilder(vertex); if (vertex instanceof TransformerComponentBuilder) { final TransformerComponentBuilder<?> tjb = (TransformerComponentBuilder<?>) vertex; analysisJobBuilder.removeTransformer(tjb); } else if (vertex instanceof AnalyzerComponentBuilder) { final AnalyzerComponentBuilder<?> ajb = (AnalyzerComponentBuilder<?>) vertex; analysisJobBuilder.removeAnalyzer(ajb); } else if (vertex instanceof FilterComponentBuilder) { final FilterComponentBuilder<?, ?> fjb = (FilterComponentBuilder<?, ?>) vertex; analysisJobBuilder.removeFilter(fjb); } else if (vertex instanceof Table) { final Table table = (Table) vertex; analysisJobBuilder.removeSourceTable(table); } else if (vertex instanceof Column) { final Column column = (Column) vertex; analysisJobBuilder.removeSourceColumn(column); } } } }); _component.getInputMap(INPUT_MAP_CONDITION).put(KeyStroke.getKeyStroke(KEY_BACKSPACE), KEY_BACKSPACE); }

Target:
private void registerDeleteAction() { registerAction(KEY_DELETE, KeyStroke.getKeyStroke(KEY_DELETE), new JobGraphBindingAction() { @Override public void actionPerformed(final ActionEvent e) { final Set<Object> vertices = _graphContext.getSelectedVertices(); if ((vertices == null) || vertices.isEmpty()) { return; } for (Object vertex : vertices) { final AnalysisJobBuilder analysisJobBuilder = _graphContext.getAnalysisJobBuilder(vertex); if (vertex instanceof TransformerComponentBuilder) { final TransformerComponentBuilder<?> tjb = (TransformerComponentBuilder<?>) vertex; analysisJobBuilder.removeTransformer(tjb); } else if (vertex instanceof AnalyzerComponentBuilder) { final AnalyzerComponentBuilder<?> ajb = (AnalyzerComponentBuilder<?>) vertex; analysisJobBuilder.removeAnalyzer(ajb); } else if (vertex instanceof FilterComponentBuilder) { final FilterComponentBuilder<?, ?> fjb = (FilterComponentBuilder<?, ?>) vertex; analysisJobBuilder.removeFilter(fjb); } else if (vertex instanceof Table) { final Table table = (Table) vertex; analysisJobBuilder.removeSourceTable(table); } else if (vertex instanceof Column) { final Column column = (Column) vertex; analysisJobBuilder.removeSourceColumn(column); } } } }); _component.getInputMap(INPUT_MAP_CONDITION).put(KeyStroke.getKeyStroke(KEY_BACKSPACE), KEY_DELETE); }
Source:
public static void sortByCreatedDate(List<CourseAttributes> courses) { Collections.sort(courses, new Comparator<CourseAttributes>() { public int compare(CourseAttributes course1, CourseAttributes course2) { if (course1.createdAt.compareTo(course2.createdAt) == 0) { return course1.id.compareTo(course2.id); } return -1 * course1.createdAt.compareTo(course2.createdAt); } }); }

Target:
public static void sortByCreatedDate(List<CourseAttributes> courses) { Collections.sort(courses, createdDateComparator); }
Source:
public void reset() { size = 0; growthCount = 0; for (int i = 0; i < maxBuckets; i++) { subHashTableBuffers[0].put(i * bucketSizeWithHash, (byte) 0); subHashTableBuffers[1].put(i * bucketSizeWithHash, (byte) 0); } tableBuffer = subHashTableBuffers[0]; }

Target:
public void reset() { size = 0; growthCount = 0; for (int i = 0; i < maxBuckets; i++) { subHashTableBuffers[0].put(i * bucketSizeWithHash, (byte) 0); } tableBuffer = subHashTableBuffers[0]; }
Source:
private void mergeBranches(ImFunction func) { ControlFlowGraph cfg = new ControlFlowGraph(func.getBody()); for (Node n : cfg.getNodes()) { @Nullable ImStmt stmt = n.getStmt(); if (stmt != null && stmt.getParent() != null && stmt.getParent() instanceof ImIf) { ImIf imIf = (ImIf) stmt.getParent(); if (n.getPredecessors().size() <= 1 && n.getSuccessors().size() == 2) { Node leftStmt = n.getSuccessors().get(0); Node rightStmt = n.getSuccessors().get(1); if (leftStmt.toString().equals(rightStmt.toString())) { if (n.getPredecessors().size() == 1) { if (hasNoSideEffects(n, leftStmt)) { ImStmt mergedStmt = leftStmt.getStmt().copy(); ImIf oldIf = imIf.copy(); oldIf.getThenBlock().get(0).replaceBy(JassIm.ImNull()); oldIf.getElseBlock().get(0).replaceBy(JassIm.ImNull()); imIf.replaceBy(JassIm.ImStatementExpr(JassIm.ImStmts(mergedStmt, oldIf), JassIm.ImNull())); } } } } } } }

Target:
private void mergeBranches(ImFunction func) { func.getBody().accept(new Element.DefaultVisitor() { @Override public void visit(ImStmts stmts) { ListIterator<ImStmt> it = stmts.listIterator(); while (it.hasNext()) { ImStmt s = it.next(); if (s instanceof ImIf) { ImIf ifStmt = (ImIf) s; ifStmt.getThenBlock().accept(this); ifStmt.getElseBlock().accept(this); while (!ifStmt.getThenBlock().isEmpty() && !ifStmt.getElseBlock().isEmpty()) { ImStmt firstStmtThen = ifStmt.getThenBlock().get(0); ImStmt firstStmtElse = ifStmt.getElseBlock().get(0); if (firstStmtThen.structuralEquals(firstStmtElse) && !sideEffectAnalyzer.mightAffect(firstStmtThen, ifStmt.getCondition())) { ifStmt.getThenBlock().remove(0); ifStmt.getElseBlock().remove(0); it.previous(); it.add(firstStmtThen); it.next(); branchesMerged++; } else { break; } } } else { s.accept(this); } } } }); }
Source:
private Map<String, Object> resolveArguments(Argument[] arguments) { Map<String, Object> map = new HashMap<String, Object>(); for (Argument arg : arguments) { String key = resolve(arg.name()); if (StringUtils.hasText(key)) { Object value = resolve(arg.value()); Object type = resolve(arg.type()); Class<?> typeClass; String typeName; if (type instanceof Class) { typeClass = (Class<?>) type; typeName = typeClass.getName(); } else { Assert.isTrue(type instanceof String, "type must resolve to a Class or String"); typeName = (String) type; try { typeClass = ClassUtils.forName(typeName, this.beanClassLoader); } catch (Exception e) { throw new IllegalStateException("Could not load class", e); } } if (value.getClass().getName().equals(typeName)) { if (typeClass.equals(String.class) && !StringUtils.hasText((String) value)) { map.put(key, null); } else { map.put(key, value); } } else { Assert.isTrue(value instanceof String, "value must resolve to a String for type conversion"); String valueString = (String) value; if (StringUtils.hasText(valueString)) { map.put(key, PARSER.parseExpression(valueString).getValue(typeClass)); } else { map.put(key, null); } } } } return map.size() < 1 ? null : map; }

Target:
private Map<String, Object> resolveArguments(Argument[] arguments) { Map<String, Object> map = new HashMap<String, Object>(); for (Argument arg : arguments) { String key = resolveExpressionAsString(arg.name(), "@Argument.name"); if (StringUtils.hasText(key)) { Object value = resolveExpression(arg.value()); Object type = resolveExpression(arg.type()); Class<?> typeClass; String typeName; if (type instanceof Class) { typeClass = (Class<?>) type; typeName = typeClass.getName(); } else { Assert.isTrue(type instanceof String, "Type must resolve to a Class or String, but resolved to [" + type.getClass().getName() + "]"); typeName = (String) type; try { typeClass = ClassUtils.forName(typeName, this.beanClassLoader); } catch (Exception e) { throw new IllegalStateException("Could not load class", e); } } if (value.getClass().getName().equals(typeName)) { if (typeClass.equals(String.class) && !StringUtils.hasText((String) value)) { map.put(key, null); } else { map.put(key, value); } } else { if (value instanceof String && !StringUtils.hasText((String) value)) { map.put(key, null); } else { if (CONVERSION_SERVICE.canConvert(value.getClass(), typeClass)) { map.put(key, CONVERSION_SERVICE.convert(value, typeClass)); } else { throw new IllegalStateException("Cannot convert from " + value.getClass().getName() + " to " + typeClass); } } } } else { if (this.logger.isDebugEnabled()) { this.logger.debug("@Argument ignored because the name resolved to an empty String"); } } } return map.size() < 1 ? null : map; }
Source:
public void testUnhandledCaughtExceptionSentOnCrashReportEnabled() { Gson gson = new Gson(); String json = gson.toJson(exception); editor.putString(CrashReporter.EXCEPTION_FOR_REPORT, json); editor.commit(); CrashReporter.sendUnhandledCaughtException(); verify(reporter, times(1)).logException(any(Exception.class)); }

Target:
public void testUnhandledCaughtExceptionSentOnCrashReportEnabled() { CrashReporter.storeUnhandledException(exception); CrashReporter.sendUnhandledCaughtException(); verify(reporter, times(1)).logException(any(Exception.class)); }
Source:
public void shouldThrowOnSendOffsetsToTransactionIfTransactionsNotInitialized() { buildMockProducer(true); producer.sendOffsetsToTransaction(null, ""); }

Target:
public void shouldThrowOnSendOffsetsToTransactionIfTransactionsNotInitialized() { buildMockProducer(true); producer.sendOffsetsToTransaction(null, groupId); }
Source:
public boolean isSamePartType(Part part) { return (part instanceof BaArmor) && (isClanTechBase() == part.isClanTechBase()) && (getRefitUnit() == part.getRefitUnit()) && (((BaArmor)part).getType() == getType()); }

Target:
public boolean isSamePartType(Part part) { return (part instanceof BaArmor) && (isClanTechBase() == part.isClanTechBase()) && Objects.equals(getRefitUnit(), part.getRefitUnit()) && (((BaArmor) part).getType() == getType()); }
Source:
private void execute(BlockExecution blockExecution) { CfgBlock block = blockExecution.block(); ProgramState currentState = blockExecution.state(); for (Tree element : block.elements()) { if (element.is(Kind.ASSIGNMENT)) { AssignmentExpressionTree assignment = (AssignmentExpressionTree) element; currentState = store(currentState, assignment.variable(), assignment.expression()); } else if (element.is( Kind.EXPONENT_ASSIGNMENT, Kind.MULTIPLY_ASSIGNMENT, Kind.DIVIDE_ASSIGNMENT, Kind.REMAINDER_ASSIGNMENT, Kind.PLUS_ASSIGNMENT, Kind.MINUS_ASSIGNMENT, Kind.LEFT_SHIFT_ASSIGNMENT, Kind.RIGHT_SHIFT_ASSIGNMENT, Kind.UNSIGNED_RIGHT_SHIFT_ASSIGNMENT, Kind.AND_ASSIGNMENT, Kind.XOR_ASSIGNMENT, Kind.OR_ASSIGNMENT)) { AssignmentExpressionTree assignment = (AssignmentExpressionTree) element; currentState = store(currentState, assignment.variable(), SymbolicValue.UNKNOWN); } else if (element.is( Kind.POSTFIX_DECREMENT, Kind.POSTFIX_INCREMENT, Kind.PREFIX_DECREMENT, Kind.PREFIX_INCREMENT)) { UnaryExpressionTree unary = (UnaryExpressionTree) element; currentState = store(currentState, unary.expression(), SymbolicValue.UNKNOWN); } else if (element.is(Kind.INITIALIZED_BINDING_ELEMENT)) { InitializedBindingElementTree initialized = (InitializedBindingElementTree) element; currentState = store(currentState, initialized.left(), initialized.right()); } } handleSuccessors(block, currentState); }

Target:
private void execute(BlockExecution blockExecution) { CfgBlock block = blockExecution.block(); ProgramState currentState = blockExecution.state(); for (Tree element : block.elements()) { if (element.is(Kind.ASSIGNMENT)) { AssignmentExpressionTree assignment = (AssignmentExpressionTree) element; currentState = store(currentState, assignment.variable(), assignment.expression()); } else if (TreeKinds.isAssignment(element)) { AssignmentExpressionTree assignment = (AssignmentExpressionTree) element; currentState = store(currentState, assignment.variable(), SymbolicValue.UNKNOWN); } else if (element.is( Kind.POSTFIX_DECREMENT, Kind.POSTFIX_INCREMENT, Kind.PREFIX_DECREMENT, Kind.PREFIX_INCREMENT)) { UnaryExpressionTree unary = (UnaryExpressionTree) element; currentState = store(currentState, unary.expression(), SymbolicValue.UNKNOWN); } else if (element.is(Kind.INITIALIZED_BINDING_ELEMENT)) { InitializedBindingElementTree initialized = (InitializedBindingElementTree) element; currentState = store(currentState, initialized.left(), initialized.right()); } } handleSuccessors(block, currentState); }
Source:
public static RGB getRGBFromCssString(String cssValue) { try { if (cssValue.startsWith("rgb(") && cssValue.endsWith(")")) { String[] rgbValues = cssValue.substring(4, cssValue.length() - 1).split(","); if (rgbValues.length == 3) { return new RGB(Integer.parseInt(rgbValues[0].trim()), Integer.parseInt(rgbValues[1].trim()), Integer.parseInt(rgbValues[2].trim())); } } throw new E4CssParseException("RGB", cssValue); } catch (NumberFormatException | E4CssParseException e) { if (!loggedError) { StatusHandler.log(new Status(IStatus.ERROR, CommonsUiConstants.ID_PLUGIN, e.getMessage(), e)); loggedError = true; } return null; } }

Target:
public static RGB getRGBFromCssString(String cssValue) { try { if (cssValue.startsWith("rgb(") && cssValue.endsWith(")")) { String[] rgbValues = cssValue.substring(4, cssValue.length() - 1).split(","); if (rgbValues.length == 3) { return new RGB(Integer.parseInt(rgbValues[0].trim()), Integer.parseInt(rgbValues[1].trim()), Integer.parseInt(rgbValues[2].trim())); } } throw new E4CssParseException("RGB", cssValue); } catch (NumberFormatException | E4CssParseException e) { logOnce(e); return null; } }
Source:
public void start() { if (memoryConfiguration.storageType() == StorageType.OFF_HEAP) { minSize = UnpooledOffHeapMemoryAllocator.estimateSizeOverhead(ExpandingOffHeapConcurrentMap.INITIAL_SIZE << 3); currentSize.set(minSize); } listener = this::entriesRemoved; container.addRemovalListener(listener); if (!cacheConfiguration.clustering().cacheMode().isClustered()) { cacheNotifier.addListener(this); } }

Target:
public void start() { if (memoryConfiguration.storageType() == StorageType.OFF_HEAP && memoryConfiguration.evictionType() == EvictionType.MEMORY) { minSize = UnpooledOffHeapMemoryAllocator.estimateSizeOverhead(OffHeapConcurrentMap.INITIAL_SIZE << 3); currentSize.set(minSize); } listener = this::entriesRemoved; container.addRemovalListener(listener); if (!cacheConfiguration.clustering().cacheMode().isClustered()) { cacheNotifier.addListener(this); } }
Source:
abstract JsonNode visitInnerNode(final ObjectNode parent, final Path.Element element) throws ScimException; abstract void visitLeafNode(final ObjectNode parent, final Path.Element element) throws ScimException; ArrayNode filterArray(final ArrayNode array, final Filter valueFilter, final boolean removeMatching) throws ScimException { ArrayNode matchingArray = JsonUtils.getJsonNodeFactory().arrayNode(); Iterator<JsonNode> i = array.elements(); while(i.hasNext()) { JsonNode node = i.next(); if(FilterEvaluator.evaluate(valueFilter, node)) { matchingArray.add(node); if(removeMatching) { i.remove(); } } } return matchingArray; }

Target:
abstract JsonNode visitInnerNode(final ObjectNode parent, final Path.Element element) throws ScimException; abstract void visitLeafNode(final ObjectNode parent, final Path.Element element) throws ScimException; ArrayNode filterArray(final ArrayNode array, final Filter valueFilter, final boolean removeMatching) throws ScimException { ArrayNode matchingArray = getJsonNodeFactory().arrayNode(); Iterator<JsonNode> i = array.elements(); while(i.hasNext()) { JsonNode node = i.next(); if(FilterEvaluator.evaluate(valueFilter, node)) { matchingArray.add(node); if(removeMatching) { i.remove(); } } } return matchingArray; }
Source:
public Mono<String> updateCheckpoint(Checkpoint checkpoint) { if (checkpoint.sequenceNumber() == null && checkpoint.offset() == null) { throw logger.logExceptionAsWarning(Exceptions .propagate(new IllegalStateException( "Both sequence number and offset cannot be null when updating a checkpoint"))); } String partitionId = checkpoint.partitionId(); String blobName = getBlobName(checkpoint.eventHubName(), checkpoint.consumerGroupName(), partitionId); if (!blobClients.containsKey(blobName)) { blobClients.put(blobName, containerAsyncClient.getBlobAsyncClient(blobName)); } Metadata metadata = new Metadata(); String sequenceNumber = checkpoint.sequenceNumber() == null ? null : String.valueOf(checkpoint.sequenceNumber()); metadata.put(SEQUENCE_NUMBER, sequenceNumber); metadata.put(OFFSET, checkpoint.offset()); metadata.put(OWNER_ID, checkpoint.ownerId()); BlobAsyncClient blobAsyncClient = blobClients.get(blobName); BlobAccessConditions blobAccessConditions = new BlobAccessConditions() .modifiedAccessConditions(new ModifiedAccessConditions().ifMatch(checkpoint.eTag())); return blobAsyncClient.setMetadataWithResponse(metadata, blobAccessConditions) .map(response -> response.headers().get(ETAG).value()); }

Target:
public Mono<String> updateCheckpoint(Checkpoint checkpoint) { if (checkpoint.sequenceNumber() == null && checkpoint.offset() == null) { throw logger.logExceptionAsWarning(Exceptions .propagate(new IllegalStateException( "Both sequence number and offset cannot be null when updating a checkpoint"))); } String partitionId = checkpoint.partitionId(); String blobName = getBlobName(checkpoint.eventHubName(), checkpoint.consumerGroupName(), partitionId); if (!blobClients.containsKey(blobName)) { blobClients.put(blobName, containerAsyncClient.getBlobAsyncClient(blobName)); } Metadata metadata = new Metadata(); String sequenceNumber = checkpoint.sequenceNumber() == null ? null : String.valueOf(checkpoint.sequenceNumber()); String offset = checkpoint.offset() == null ? null : String.valueOf(checkpoint.offset()); metadata.put(SEQUENCE_NUMBER, sequenceNumber); metadata.put(OFFSET, offset); metadata.put(OWNER_ID, checkpoint.ownerId()); BlobAsyncClient blobAsyncClient = blobClients.get(blobName); BlobAccessConditions blobAccessConditions = new BlobAccessConditions() .modifiedAccessConditions(new ModifiedAccessConditions().ifMatch(checkpoint.eTag())); return blobAsyncClient.setMetadataWithResponse(metadata, blobAccessConditions) .map(response -> response.headers().get(ETAG).value()); }
Source:
public Set<T> getSet() { return set; }

Target:
Set<T> getSet() { return set; }
Source:
public void approveSourceRequest(Id id) throws NotFoundException { Optional<SourceRequest> sourceRequest = sourceRequestStore.sourceRequestFor(id); if (sourceRequest.isPresent()) { Application existing = applicationStore.applicationFor(sourceRequest.get().getAppId()).get(); applicationStore.updateApplication( existing.copyWithReadSourceState(sourceRequest.get().getSource(), SourceState.AVAILABLE)); SourceRequest approved = sourceRequest.get().copy().withApproved(true).build(); sourceRequestStore.store(approved); } else { throw new NotFoundException(id); } }

Target:
public void approveSourceRequest(Id id) throws NotFoundException { Optional<SourceRequest> sourceRequest = sourceRequestStore.sourceRequestFor(id); if (!sourceRequest.isPresent()) { throw new NotFoundException(id); } Application existing = applicationStore.applicationFor(sourceRequest.get().getAppId()).get(); applicationStore.updateApplication( existing.copyWithReadSourceState(sourceRequest.get().getSource(), SourceState.AVAILABLE)); SourceRequest approved = sourceRequest.get().copy().withApproved(true).build(); sourceRequestStore.store(approved); }
Source:
@Override public Observable<Connectivity> observeNetworkConnectivity(final Context context) { final IntentFilter filter = new IntentFilter(); filter.addAction(ConnectivityManager.CONNECTIVITY_ACTION); return Observable.create(new ObservableOnSubscribe<Connectivity>() { @Override public void subscribe(final ObservableEmitter<Connectivity> subscriber) throws Exception { final BroadcastReceiver receiver = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { subscriber.onNext(Connectivity.create(context)); } }; context.registerReceiver(receiver, filter); unsubscribeInUiThread(new Action() { @Override public void run() { tryToUnregisterReceiver(context, receiver); } }); } }).defaultIfEmpty(Connectivity.create()); }

Target:
@Override public Observable<Connectivity> observeNetworkConnectivity(final Context context) { final IntentFilter filter = new IntentFilter(); filter.addAction(ConnectivityManager.CONNECTIVITY_ACTION); return Observable.create(new ObservableOnSubscribe<Connectivity>() { @Override public void subscribe(final ObservableEmitter<Connectivity> emitter) throws Exception { final BroadcastReceiver receiver = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { emitter.onNext(Connectivity.create(context)); } }; context.registerReceiver(receiver, filter); unsubscribeInUiThread(new Action() { @Override public void run() { tryToUnregisterReceiver(context, receiver); } }); } }).defaultIfEmpty(Connectivity.create()); }
Source:
public void onResume() { if (DEBUG) { Log.d(TAG, "onResume() called"); } super.onResume(); try { service = NewPipe.getService(serviceId); } catch (Exception e) { ErrorActivity.reportError(getActivity(), e, getActivity().getClass(), getActivity().findViewById(android.R.id.content), ErrorActivity.ErrorInfo.make(UserAction.UI_ERROR, "", "", R.string.general_error)); } if (!TextUtils.isEmpty(searchString)) { if (wasLoading.getAndSet(false)) { search(searchString, contentFilter, sortFilter); } else if (infoListAdapter.getItemsList().size() == 0) { if (savedState == null) { search(searchString, contentFilter, sortFilter); } else if (!isLoading.get() && !wasSearchFocused) { infoListAdapter.clearStreamItemList(); showEmptyState(); } } } if (!TextUtils.isEmpty(searchSuggestionString)) { handleSearchSuggestion(searchSuggestionString, isCorrectedSearch); } if (suggestionDisposable == null || suggestionDisposable.isDisposed()) { initSuggestionObserver(); } if (TextUtils.isEmpty(searchString) || wasSearchFocused) { showKeyboardSearch(); showSuggestionsPanel(); } else { hideKeyboardSearch(); hideSuggestionsPanel(); } wasSearchFocused = false; }

Target:
public void onResume() { if (DEBUG) { Log.d(TAG, "onResume() called"); } super.onResume(); try { service = NewPipe.getService(serviceId); } catch (Exception e) { ErrorActivity.reportError(getActivity(), e, getActivity().getClass(), getActivity().findViewById(android.R.id.content), ErrorActivity.ErrorInfo.make(UserAction.UI_ERROR, "", "", R.string.general_error)); } if (!TextUtils.isEmpty(searchString)) { if (wasLoading.getAndSet(false)) { search(searchString, contentFilter, sortFilter); } else if (infoListAdapter.getItemsList().size() == 0) { if (savedState == null) { search(searchString, contentFilter, sortFilter); } else if (!isLoading.get() && !wasSearchFocused) { infoListAdapter.clearStreamItemList(); showEmptyState(); } } } handleSearchSuggestion(); if (suggestionDisposable == null || suggestionDisposable.isDisposed()) { initSuggestionObserver(); } if (TextUtils.isEmpty(searchString) || wasSearchFocused) { showKeyboardSearch(); showSuggestionsPanel(); } else { hideKeyboardSearch(); hideSuggestionsPanel(); } wasSearchFocused = false; }
Source:
public InboundSseEvent build() { byte[] result = dataStream.toByteArray(); if (result.length > 0 && '\n' == result[result.length-1]) { result = Arrays.copyOfRange(result, 0, result.length-1); } return new InboundSseEventImpl(name, id, commentBuilder.length() > 0 ? commentBuilder.substring(0, commentBuilder.length() - 1) : null, reconnectDelay, result, annotations, mediaType, headers); }

Target:
public InboundSseEvent build() { return new InboundSseEventImpl(name, id, commentBuilder.length() > 0 ? commentBuilder.substring(0, commentBuilder.length() - 1) : null, reconnectDelay, dataStream.getEventData(), annotations, mediaType, headers); }
Source:
public KasperResponse(final KasperResponse response) { this.status = response.status; this.reason = response.reason; }

Target:
public KasperResponse(final KasperResponse response) { this(response.status, response.reason); }
Source:
public Group updateGroup(PerunSession sess, Group group) throws GroupNotExistsException, GroupExistsException, InternalErrorException, PrivilegeException { Utils.checkPerunSession(sess); getGroupsManagerBl().checkGroupExists(sess, group); Utils.notNull(group, "group"); Utils.notNull(group.getName(), "group.name"); if (!group.getShortName().matches(GroupsManager.GROUP_SHORT_NAME_REGEXP)) { throw new IllegalArgumentException("Wrong group shortName, group shortName must matches " + GroupsManager.GROUP_SHORT_NAME_REGEXP); } Vo groupVo = getGroupsManagerBl().getVo(sess, group); try { Group groupWithSameName = getGroupsManagerBl().getGroupByName(sess, groupVo, group.getName()); if(groupWithSameName.getId() != group.getId()) { throw new GroupExistsException("Name is already used by other Group in this Vo."); } } catch (GroupNotExistsException ex) { } if (!AuthzResolver.isAuthorized(sess, Role.VOADMIN, group) && !AuthzResolver.isAuthorized(sess, Role.GROUPADMIN, group)) { throw new PrivilegeException(sess, "updateGroup"); } return getGroupsManagerBl().updateGroup(sess, group); }

Target:
public Group updateGroup(PerunSession sess, Group group) throws GroupNotExistsException, GroupExistsException, InternalErrorException, PrivilegeException { Utils.checkPerunSession(sess); getGroupsManagerBl().checkGroupExists(sess, group); Utils.notNull(group, "group"); Utils.notNull(group.getName(), "group.name"); if (!group.getShortName().matches(GroupsManager.GROUP_SHORT_NAME_REGEXP)) { throw new IllegalArgumentException("Wrong group shortName, group shortName must matches " + GroupsManager.GROUP_SHORT_NAME_REGEXP); } if (!AuthzResolver.isAuthorized(sess, Role.VOADMIN, group) && !AuthzResolver.isAuthorized(sess, Role.GROUPADMIN, group)) { throw new PrivilegeException(sess, "updateGroup"); } return getGroupsManagerBl().updateGroup(sess, group); }
Source:
private void display(final ChangeDetail detail) { displayTitle(detail.getChange().getKey(), detail.getChange().getSubject()); if (starChange != null) { setStarred(detail.isStarred()); } if (Status.MERGED == detail.getChange().getStatus()) { includedInPanel.setVisible(true); includedInPanel.addOpenHandler(includedInTable); } else { includedInPanel.setVisible(false); } dependencies.setAccountInfoCache(detail.getAccounts()); approvals.setAccountInfoCache(detail.getAccounts()); descriptionBlock.display(detail.getChange(), detail .getCurrentPatchSetDetail().getInfo(), detail.getAccounts()); dependsOn.display(detail.getDependsOn()); neededBy.display(detail.getNeededBy()); approvals.display(detail.getChange(), detail.getMissingApprovals(), detail .getApprovals()); for (PatchSet pId : detail.getPatchSets()) { if (patchesList != null) { patchesList.addItem(Util.M.patchSetHeader(pId.getPatchSetId()), pId .getId().toString()); } } if (diffBaseId != null) { if (patchesList != null) { int index = -1; for (int i = 0; i < patchesList.getItemCount(); i++) { if (!patchesList.getValue(i).equals("Base")) { if (diffBaseId.equals(PatchSet.Id.parse(patchesList.getValue(i)))) { index = i; break; } } } patchesList.setSelectedIndex(index); } } patchSetsBlock.display(detail, diffBaseId); if (openPatchSetId != null) { patchSetsBlock.activate(openPatchSetId); } addComments(detail); boolean depsOpen = false; if (!detail.getChange().getStatus().isClosed() && detail.getDependsOn() != null) { for (final ChangeInfo ci : detail.getDependsOn()) { if (ci.getStatus() != Change.Status.MERGED) { depsOpen = true; break; } } } dependenciesPanel.setOpen(depsOpen); }

Target:
private void display(final ChangeDetail detail) { displayTitle(detail.getChange().getKey(), detail.getChange().getSubject()); if (starChange != null) { setStarred(detail.isStarred()); } if (Status.MERGED == detail.getChange().getStatus()) { includedInPanel.setVisible(true); includedInPanel.addOpenHandler(includedInTable); } else { includedInPanel.setVisible(false); } dependencies.setAccountInfoCache(detail.getAccounts()); approvals.setAccountInfoCache(detail.getAccounts()); descriptionBlock.display(detail.getChange(), detail .getCurrentPatchSetDetail().getInfo(), detail.getAccounts()); dependsOn.display(detail.getDependsOn()); neededBy.display(detail.getNeededBy()); approvals.display(detail.getChange(), detail.getMissingApprovals(), detail .getApprovals()); for (PatchSet pId : detail.getPatchSets()) { if (patchesList != null) { patchesList.addItem(Util.M.patchSetHeader(pId.getPatchSetId()), pId .getId().toString()); } } if (diffBaseId != null && patchesList != null) { patchesList.setSelectedIndex(diffBaseId.get()); } patchSetsBlock.display(detail, diffBaseId); if (openPatchSetId != null) { patchSetsBlock.activate(openPatchSetId); } addComments(detail); boolean depsOpen = false; if (!detail.getChange().getStatus().isClosed() && detail.getDependsOn() != null) { for (final ChangeInfo ci : detail.getDependsOn()) { if (ci.getStatus() != Change.Status.MERGED) { depsOpen = true; break; } } } dependenciesPanel.setOpen(depsOpen); }
Source:
private void attemptRecovery() { appManagerBt.setVisibility(View.INVISIBLE); loadingIndicator.setVisibility(View.VISIBLE); AndroidCommCarePlatform platform = CommCareApplication.instance().getCommCarePlatform(); ResourceTable global = platform.getGlobalResourceTable(); if (!global.getMissingResources().isEmpty()) { int total = global.getMissingResources().size(); ResourceRecoveryTask<RecoveryActivity> task = new ResourceRecoveryTask<RecoveryActivity>(RECOVERY_TASK) { @Override protected void deliverResult(RecoveryActivity recoveryActivity, Boolean success) { if (success) { CommCareApplication.instance().initializeAppResources(CommCareApplication.instance().getCurrentApp()); attemptRecovery(); loadingIndicator.setVisibility(View.INVISIBLE); } else { onRecoveryFailure(); } } @Override protected void deliverUpdate(RecoveryActivity recoveryActivity, Integer... update) { int done = update[0]; updateStatus( StringUtils.getStringRobust(recoveryActivity, R.string.recovery_resource_progress, new String[]{String.valueOf(done), String.valueOf(total)})); } @Override protected void deliverError(RecoveryActivity recoveryActivity, Exception e) { Logger.exception("Error while recovering missing resources " + ForceCloseLogger.getStackTrace(e), e); onRecoveryFailure(); } }; task.connect(this); task.executeParallel(); } else { if (isAppCorrupt()) { onRecoveryFailure(); } else { updateStatus(R.string.recovery_success); loadingIndicator.setVisibility(View.INVISIBLE); } } }

Target:
public void attemptRecovery() { appManagerBt.setVisibility(View.INVISIBLE); loadingIndicator.setVisibility(View.VISIBLE); CommCareApplication commCareApplication = CommCareApplication.instance(); commCareApplication.initializeAppResources(commCareApplication.getCurrentApp()); AndroidCommCarePlatform platform = commCareApplication.getCommCarePlatform(); ResourceTable global = platform.getGlobalResourceTable(); if (!global.getMissingResources().isEmpty()) { startRecoveryTask(); } else { if (isAppCorrupt()) { onRecoveryFailure(getLocalizedString(R.string.recovery_error_unknown)); } else { updateStatus(R.string.recovery_success); loadingIndicator.setVisibility(View.INVISIBLE); } } }
Source:
private static Result addPublicationType(Result result, String publicationType) { if (result.getInstance()==null) { result.setInstance(new ArrayList<>()); } Instance instance = new Instance(); Qualifier instancetype = new Qualifier(); instancetype.setClassid(publicationType); instance.setInstancetype(instancetype); result.getInstance().add(instance); return result; }

Target:
private static void addPublicationType(Result result, String publicationType) { if (result.getInstance()==null) { result.setInstance(new ArrayList<>()); } Instance instance = new Instance(); Qualifier instancetype = new Qualifier(); instancetype.setClassid(publicationType); instance.setInstancetype(instancetype); result.getInstance().add(instance); }
Source:
protected AbstractRngDeviceCommand(T parameters) { super(parameters); if (parameters.getRngDevice() == null) { throw new IllegalArgumentException("RNG Device must be specified."); } Guid vmId = parameters.getRngDevice().getVmId(); setVmId(vmId); cachedEntity = getParameters().isVm() ? getVmStaticDAO().get(vmId) : getVmTemplateDAO().get(vmId); if (cachedEntity != null) { setVdsGroupId(cachedEntity.getVdsGroupId()); } cachedRngDevices = new ArrayList<>(); List<VmDevice> rngDevs = getVmDeviceDao().getVmDeviceByVmIdAndType(vmId, VmDeviceGeneralType.RNG); if (rngDevs != null) { cachedRngDevices.addAll(rngDevs); } }

Target:
protected AbstractRngDeviceCommand(T parameters) { super(parameters); if (parameters.getRngDevice() == null) { cachedEntity = null; cachedRngDevices = null; return; } Guid vmId = parameters.getRngDevice().getVmId(); setVmId(vmId); cachedEntity = getParameters().isVm() ? getVmStaticDAO().get(vmId) : getVmTemplateDAO().get(vmId); if (cachedEntity != null) { setVdsGroupId(cachedEntity.getVdsGroupId()); } cachedRngDevices = new ArrayList<>(); List<VmDevice> rngDevs = getVmDeviceDao().getVmDeviceByVmIdAndType(vmId, VmDeviceGeneralType.RNG); if (rngDevs != null) { cachedRngDevices.addAll(rngDevs); } }
Source:
public String getOriginalFileName() { String idArray[] = this.id.split("/"); int idLen = idArray.length; String originalFileName = ""; if(idArray != null && idArray.length>0) { originalFileName = idArray[idLen-1]; } return originalFileName; }

Target:
public String getOriginalFileName() { String idArray[] = this.id.split("/"); String originalFileName = ""; if(idArray != null && idArray.length>0) { originalFileName = idArray[idArray.length-1]; } return originalFileName; }
Source:
public Map<String, IndicatorValue> get(StatisticalIndicatorDataModel selectors, String indicator, String regionCategoryId) { Map<Integer, IndicatorValue> allValues = fetchData(selectors, indicator); Map<String, IndicatorValue> filteredValues = new HashMap<>(); for (Entry<Integer, IndicatorValue> entry : allValues.entrySet()) { Integer regionId = entry.getKey(); if (regionId == null) { continue; } IndicatorValue value = entry.getValue(); String category = regionParser.getCategoryById(regionId); if (category != null && category.equalsIgnoreCase(regionCategoryId)) { String code = regionParser.getCode(regionId); if (code != null) { filteredValues.put(code, value); } } } return filteredValues; }

Target:
public Map<String, IndicatorValue> get(StatisticalIndicatorDataModel selectors, String indicator, String regionCategoryId) { if(regionCategoryId == null) { throw new ServiceRuntimeException("Unknown regionset"); } Map<Integer, IndicatorValue> allValues = fetchDataForAllRegionsets(selectors, indicator); Map<String, IndicatorValue> filteredValues = new HashMap<>(); for (Entry<Integer, IndicatorValue> entry : allValues.entrySet()) { Integer sotkaRegionId = entry.getKey(); String category = regionParser.getCategoryById(sotkaRegionId); if (!regionCategoryId.equalsIgnoreCase(category)) { continue; } String oskariRegionId = regionParser.getCode(sotkaRegionId); if (oskariRegionId != null) { filteredValues.put(oskariRegionId, entry.getValue()); } } return filteredValues; }
Source:
private void handleHttpHeaders(AssertionType assertion, WebServiceContext context) { try { if (getPropertyAccessor().getPropertyBoolean(NhincConstants.GATEWAY_PROPERTY_FILE, NhincConstants.READ_HTTP_HEADERS)) { MessageContext messageContext = getMessageContext(context); if (messageContext != null && (messageContext instanceof WrappedMessageContext)) { readHttpHeaders(messageContext, assertion); } } } catch (PropertyAccessException ex) { LOG.warn("Unable to access property for reading HTTP headers.", ex); } }

Target:
private void handleHttpHeaders(AssertionType assertion, WebServiceContext context) { try { if (getPropertyAccessor().getPropertyBoolean(NhincConstants.GATEWAY_PROPERTY_FILE, NhincConstants.READ_HTTP_HEADERS)) { MessageContext messageContext = getMessageContext(context); if (messageContext instanceof WrappedMessageContext) { readHttpHeaders(messageContext, assertion); } } } catch (PropertyAccessException ex) { LOG.warn("Unable to access property for reading HTTP headers.", ex); } }
Source:
public ActionResponse execute() throws QueryStoreException { final String cacheKeyValue = cacheKey(); if (isCacheable()) { if (cache.has(cacheKeyValue)) { logger.info("Cache hit for key: " + cacheKeyValue); return cache.get(cacheKey()); } } logger.info("Cache miss for key: " + cacheKeyValue); parameter.setFilters(checkAndAddTemporalBoundary(parameter.getFilters())); if (!parameterTableExists(parameter)) { throw new QueryStoreException(QueryStoreException.ErrorCode.NO_SUCH_TABLE, "Table/s not found"); } ActionResponse result = execute(parameter); if (isCacheable()) { logger.info("Cache load for key: " + cacheKeyValue); return cache.put(cacheKey(), result); } return result; }

Target:
public ActionResponse execute() throws QueryStoreException { if (!parameterTableExists(parameter)) { throw new QueryStoreException(QueryStoreException.ErrorCode.NO_SUCH_TABLE, "Table/s not found"); } final String cacheKeyValue = cacheKey(); if (isCacheable()) { if (cache.has(cacheKeyValue)) { logger.info("Cache hit for key: " + cacheKeyValue); return cache.get(cacheKey()); } } logger.info("Cache miss for key: " + cacheKeyValue); parameter.setFilters(checkAndAddTemporalBoundary(parameter.getFilters())); ActionResponse result = execute(parameter); if (isCacheable()) { logger.info("Cache load for key: " + cacheKeyValue); return cache.put(cacheKey(), result); } return result; }
Source:
public static int publish( final byte[] data, final String path, final AuthenticationData loginData ) throws IOException { return publish( data, path, loginData, Optional.empty() ); }

Target:
public static int publish( final byte[] data, final String path, final AuthenticationData loginData ) throws IOException { return publish( data, path, loginData, new Properties() ); }