auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public CouchConfig getCouchConfig(String db) { if(TEST_WITH_CLOUDANT) { CouchConfig config = CloudantConfig.defaultConfig(db); if(Strings.isNullOrEmpty(config.getRootUri().getUserInfo())) { throw new IllegalStateException("Cloudant account info" + " is required to run tests with Cloudant."); } return config; } else if (SPECIFIED_COUCH) { return SpecifiedCouch.defaultConfig(db); } else { String host; if(Misc.isRunningOnAndroid()){ host = "10.0.2.2"; } else { host = "127.0.0.1"; } return this.defaultConfig(host, db); } }

Target:
public CouchConfig getCouchConfig(String db) { if (SPECIFIED_COUCH) { return SpecifiedCouch.defaultConfig(db); } else { String host; if(Misc.isRunningOnAndroid()){ host = "10.0.2.2"; } else { host = "127.0.0.1"; } return this.defaultConfig(host, db); } }
Source:
public boolean verifyServerKey(ClientSession clientSession, SocketAddress remoteAddress, PublicKey serverKey) { try { if (checkReloadRequired()) { Path file = getPath(); if (exists()) { updateReloadAttributes(); keysSupplier = GenericUtils.memoizeLock(getKnownHostSupplier(clientSession, file)); } else { if (log.isDebugEnabled()) { log.debug("verifyServerKey({})[{}] missing known hosts file {}", clientSession, remoteAddress, file); } keysSupplier = GenericUtils.memoizeLock(Collections::emptyList); } } } catch (Throwable t) { return acceptIncompleteHostKeys(clientSession, remoteAddress, serverKey, t); } Collection<HostEntryPair> knownHosts = keysSupplier.get(); return acceptKnownHostEntries(clientSession, remoteAddress, serverKey, knownHosts); }

Target:
public boolean verifyServerKey(ClientSession clientSession, SocketAddress remoteAddress, PublicKey serverKey) { try { if (checkReloadRequired()) { Path file = getPath(); if (exists()) { updateReloadAttributes(); keysSupplier.set(GenericUtils.memoizeLock(getKnownHostSupplier(clientSession, file))); } else { if (log.isDebugEnabled()) { log.debug("verifyServerKey({})[{}] missing known hosts file {}", clientSession, remoteAddress, file); } keysSupplier.set(GenericUtils.memoizeLock(Collections::emptyList)); } } } catch (Throwable t) { return acceptIncompleteHostKeys(clientSession, remoteAddress, serverKey, t); } Collection<HostEntryPair> knownHosts = keysSupplier.get().get(); return acceptKnownHostEntries(clientSession, remoteAddress, serverKey, knownHosts); }
Source:
public void visitNode(Tree tree) { if (!hasSemantic()) { return; } SwitchStatementTree switchStatementTree = (SwitchStatementTree) tree; Optional<CaseLabelTree> defaultLabel = getDefaultLabel(switchStatementTree); if (!defaultLabel.isPresent()) { if (!isSwitchOnEnum(switchStatementTree)) { reportIssue(switchStatementTree.switchKeyword(), "Add a default case to this switch."); } else if (missingCasesOfEnum(switchStatementTree)) { reportIssue(switchStatementTree.switchKeyword(), "Complete cases by adding the missing enum constants or add a default case to this switch."); } } else if (!defaultLabel.get().equals(getLastLabel(switchStatementTree))) { reportIssue(defaultLabel.get(), "Move this default to the end of the switch."); } }

Target:
public void visitNode(Tree tree) { if (!hasSemantic()) { return; } SwitchStatementTree switchStatementTree = (SwitchStatementTree) tree; Optional<CaseLabelTree> defaultLabel = getDefaultLabel(switchStatementTree); if (defaultLabel.isPresent()) { CaseLabelTree defaultLabelTree = defaultLabel.get(); if (!defaultLabelTree.equals(getLastLabel(switchStatementTree))) { reportIssue(defaultLabelTree, "Move this default to the end of the switch."); } } else { if (!isSwitchOnEnum(switchStatementTree)) { reportIssue(switchStatementTree.switchKeyword(), "Add a default case to this switch."); } else if (missingCasesOfEnum(switchStatementTree)) { reportIssue(switchStatementTree.switchKeyword(), "Complete cases by adding the missing enum constants or add a default case to this switch."); } } }
Source:
KeyspaceMetadata(String name, boolean durableWrites, Map<String, String> replication) { this.name = name; this.durableWrites = durableWrites; this.replication = replication; this.strategy = ReplicationStrategy.create(replication); this.isVirtual=false; }

Target:
KeyspaceMetadata(String name, boolean durableWrites, Map<String, String> replication) { this(name, durableWrites, replication, false); }
Source:
protected void eventHandle(ITmfEvent event) { final String eventName = event.getType().getName(); if (eventName.equals(fLayout.eventSchedSwitch())) { TmfCpuAspect cpuAspect = null; for (TmfCpuAspect aspect : TmfTraceUtils.getEventAspectsOfClass(event.getTrace(), TmfCpuAspect.class)) { cpuAspect = aspect; } if (cpuAspect == null) { return; } Integer cpu = cpuAspect.resolve(event); ITmfEventField content = event.getContent(); long ts = event.getTimestamp().getValue(); Long prevTid = (Long) content.getField(fLayout.fieldPrevTid()).getValue(); try { Integer currentCPUNode = ss.getQuarkRelativeAndAdd(getNodeCPUs(), cpu.toString()); Integer cumulativeTimeQuark = ss.getQuarkRelativeAndAdd(currentCPUNode, prevTid.toString()); Long startTime = fLastStartTimes.get(cpu); if (startTime == null) { startTime = fTraceStart; } if (startTime != null) { ITmfStateValue value = ss.queryOngoingState(cumulativeTimeQuark); long prevCumulativeTime = value.unboxLong(); long newCumulativeTime = prevCumulativeTime + (ts - startTime); value = TmfStateValue.newValueLong(newCumulativeTime); ss.modifyAttribute(ts, value, cumulativeTimeQuark); fLastStartTimes.put(cpu, ts); } } catch (AttributeNotFoundException e) { Activator.getDefault().logError("Attribute not found in LttngKernelCpuStateProvider", e); } } }

Target:
protected void eventHandle(ITmfEvent event) { final String eventName = event.getType().getName(); if (eventName.equals(fLayout.eventSchedSwitch())) { Integer cpu = null; Iterable<TmfCpuAspect> aspects = TmfTraceUtils.getEventAspectsOfClass(event.getTrace(), TmfCpuAspect.class); for (TmfCpuAspect aspect : aspects) { if (!aspect.resolve(event).equals(TmfCpuAspect.CPU_UNAVAILABLE)) { cpu = aspect.resolve(event); break; } } if (cpu == null) { return; } ITmfEventField content = event.getContent(); long ts = event.getTimestamp().getValue(); Long prevTid = (Long) content.getField(fLayout.fieldPrevTid()).getValue(); try { Integer currentCPUNode = ss.getQuarkRelativeAndAdd(getNodeCPUs(), cpu.toString()); Integer cumulativeTimeQuark = ss.getQuarkRelativeAndAdd(currentCPUNode, prevTid.toString()); Long startTime = fLastStartTimes.get(cpu); if (startTime == null) { startTime = fTraceStart; } if (startTime != null) { ITmfStateValue value = ss.queryOngoingState(cumulativeTimeQuark); long prevCumulativeTime = value.unboxLong(); long newCumulativeTime = prevCumulativeTime + (ts - startTime); value = TmfStateValue.newValueLong(newCumulativeTime); ss.modifyAttribute(ts, value, cumulativeTimeQuark); fLastStartTimes.put(cpu, ts); } } catch (AttributeNotFoundException e) { Activator.getDefault().logError("Attribute not found in LttngKernelCpuStateProvider", e); } } }
Source:
public boolean setMinPasscodeLength(Context ctx, int minPasscodeLength) { if (minPasscodeLength > this.minPasscodeLength) { this.minPasscodeLength = minPasscodeLength; if (hasStoredPasscode(SalesforceSDKManager.getInstance().getAppContext())) { setEnabled(true); showLockActivity(ctx, true); return true; } } this.minPasscodeLength = minPasscodeLength; storeMobilePolicy(SalesforceSDKManager.getInstance().getAppContext()); return false; }

Target:
public boolean setMinPasscodeLength(Context ctx, int minPasscodeLength) { boolean passcodeChangeRequired = false; if (minPasscodeLength > this.minPasscodeLength) { this.minPasscodeLength = minPasscodeLength; if (hasStoredPasscode(ctx)) { showLockActivity(ctx, true); passcodeChangeRequired = true; } } this.minPasscodeLength = minPasscodeLength; storeMobilePolicy(ctx); return passcodeChangeRequired; }
Source:
private void addScript() throws IOException { ExtensionScript extScript = Control.getSingleton().getExtensionLoader().getExtension(ExtensionScript.class); if (extScript != null) { ScriptType variantType = extScript.getScriptType(ExtensionActiveScan.SCRIPT_TYPE_VARIANT); ScriptEngineWrapper engine = extScript.getEngineWrapper( Constant.messages.getString("graphql.script.engine")); if (variantType != null && engine != null) { String scriptName = Constant.messages.getString("graphql.script.name"); File scriptPath = new File(Constant.getZapHome(), "scripts/scripts/variant/" + scriptName); ScriptWrapper script = new ScriptWrapper( scriptName, Constant.messages.getString("graphql.script.description"), engine, variantType, true, scriptPath); script.reloadScript(); extScript.addScript(script); } } }

Target:
private void addScript() throws IOException { ExtensionScript extScript = Control.getSingleton().getExtensionLoader().getExtension(ExtensionScript.class); String scriptName = "GraphQL Support.js"; if (extScript != null && extScript.getScript(scriptName) == null) { ScriptType variantType = extScript.getScriptType(ExtensionActiveScan.SCRIPT_TYPE_VARIANT); ScriptEngineWrapper engine = extScript.getEngineWrapper("Oracle Nashorn"); if (variantType != null && engine != null) { File scriptPath = Paths.get( Constant.getZapHome(), ExtensionScript.SCRIPTS_DIR, ExtensionScript.SCRIPTS_DIR, ExtensionActiveScan.SCRIPT_TYPE_VARIANT, scriptName) .toFile(); ScriptWrapper script = new ScriptWrapper( scriptName, Constant.messages.getString("graphql.script.description"), engine, variantType, true, scriptPath); script.reloadScript(); extScript.addScript(script); } } }
Source:
protected Response createPaymentResponse(final UriInfo uriInfo, final Payment payment, final TransactionType transactionType, @Nullable final String transactionExternalKey) { final PaymentTransaction createdTransaction = findCreatedTransaction(payment, transactionType, transactionExternalKey); Preconditions.checkNotNull(createdTransaction, "No transaction of type '%s' found", transactionType); switch (createdTransaction.getTransactionStatus()) { case PENDING: case SUCCESS: return uriBuilder.buildResponse(uriInfo, PaymentResource.class, "getPayment", payment.getId()); case PAYMENT_FAILURE: return Response.status(402).build(); case PAYMENT_SYSTEM_OFF: case UNKNOWN: return Response.status(Status.SERVICE_UNAVAILABLE).build(); case PLUGIN_FAILURE: return Response.status(502).build(); } return Response.serverError().build(); }

Target:
protected Response createPaymentResponse(final UriInfo uriInfo, final Payment payment, final TransactionType transactionType, @Nullable final String transactionExternalKey) { final PaymentTransaction createdTransaction = findCreatedTransaction(payment, transactionType, transactionExternalKey); Preconditions.checkNotNull(createdTransaction, "No transaction of type '%s' found", transactionType); final ResponseBuilder responseBuilder; final BillingExceptionJson exception; switch (createdTransaction.getTransactionStatus()) { case PENDING: case SUCCESS: return uriBuilder.buildResponse(uriInfo, PaymentResource.class, "getPayment", payment.getId()); case PAYMENT_FAILURE: responseBuilder = Response.status(402); exception = createBillingException(String.format("Payment decline by gateway. Error message: %s", createdTransaction.getGatewayErrorMsg())); break; case PAYMENT_SYSTEM_OFF: responseBuilder = Response.status(Status.SERVICE_UNAVAILABLE); exception = createBillingException("Payment system is off."); break; case UNKNOWN: responseBuilder = Response.status(Status.SERVICE_UNAVAILABLE); exception = createBillingException("Payment in unknown status, failed to receive gateway response."); break; case PLUGIN_FAILURE: responseBuilder = Response.status(502); exception = createBillingException("Failed to submit payment transaction"); break; default: responseBuilder = Response.serverError(); exception = createBillingException("This should never have happened!!!"); } addExceptionToResponse(responseBuilder, exception); return responseBuilder.location(getPaymentLocation(uriInfo, payment)).build(); }
Source:
protected <T> T execute(HttpRequestBase request, ResponseHandler<T> responseHandler) throws IOException { try { return super.execute(request, responseHandler); } finally { request.releaseConnection(); } }

Target:
protected <T> T execute(HttpRequestBase request, ResponseHandler<T> responseHandler) throws IOException { try { notNull(request,"request must not be null!"); return super.execute(request, responseHandler); } finally { request.releaseConnection(); } }
Source:
private boolean hasTrivialCoordinator(AbstractPlanNode planNode) { PlanNodeType planNodeType = planNode.getPlanNodeType(); if (PlanNodeType.RECEIVE == planNodeType || PlanNodeType.MERGERECEIVE == planNodeType) { return true; } else if (PlanNodeType.PROJECTION == planNodeType) { assert(planNode.getChildCount() == 1); return hasTrivialCoordinator(planNode.getChild(0)); } return false; }

Target:
private boolean hasTrivialCoordinator(AbstractPlanNode planNode) { PlanNodeType planNodeType = planNode.getPlanNodeType(); if (PlanNodeType.RECEIVE == planNodeType || PlanNodeType.MERGERECEIVE == planNodeType) { return true; } if (PlanNodeType.PROJECTION == planNodeType) { assert(planNode.getChildCount() == 1); return hasTrivialCoordinator(planNode.getChild(0)); } return false; }
Source:
public static List<Event> dispatch(ProcessManager<?, ?, ?> pm, EventEnvelope event) { checkNotNull(pm); checkNotNull(event); final PmTransaction<?, ?, ?> tx = PmTransaction.start(pm); List<Event> eventMessages = pm.dispatchEvent(event); tx.commit(); return eventMessages; }

Target:
public static List<Event> dispatch(ProcessManager<?, ?, ?> pm, EventEnvelope event) { checkNotNull(pm); checkNotNull(event); final PmTransaction<?, ?, ?> tx = PmTransaction.start(pm); final List<Event> eventMessages = pm.dispatchEvent(event); tx.commit(); return eventMessages; }
Source:
public BoardPanel(BoardSize boardSize, int boardIndex, GlassPane globalGlassPane, DropManager dropManager, Function<Pair<Integer, BoardCoordinate>, Set<BoardCoordinate>> getMovesCallback) { mSquareLabels = new SquareJLabel[boardSize.width][boardSize.height]; mGlassPane = globalGlassPane; mDropManager = dropManager; mBoardIndex = boardIndex; mGetMovesCallback = getMovesCallback; mBoardSize = boardSize; mHighlightCallback = coordinate -> { Set<BoardCoordinate> coordinates = mGetMovesCallback.apply(Pair.create(mBoardIndex, coordinate)); if (!coordinates.isEmpty()) { List<SquareJLabel> labels = highlightSquares(coordinates); repaint(); return labels; } else { return Collections.emptyList(); } }; setOpaque(false); setLayout(new GridLayout(mBoardSize.width + 1, mBoardSize.height)); setPreferredSize(new Dimension((mBoardSize.width + 1) * 48, (mBoardSize.height + 1) * 48)); createGrid(); }

Target:
public BoardPanel(BoardSize boardSize, int boardIndex, GlassPane globalGlassPane, DropManager dropManager, Function<Pair<Integer, BoardCoordinate>, Set<BoardCoordinate>> getMovesCallback) { mSquareLabels = new SquareJLabel[boardSize.width][boardSize.height]; mGlassPane = globalGlassPane; mDropManager = dropManager; mBoardIndex = boardIndex; mGetMovesCallback = getMovesCallback; mBoardSize = boardSize; mHighlightCallback = coordinate -> { Set<BoardCoordinate> coordinates = mGetMovesCallback.apply(Pair.create(mBoardIndex, coordinate)); if (!coordinates.isEmpty()) { List<SquareJLabel> labels = highlightSquares(coordinates); repaint(); return labels; } else { return Collections.emptyList(); } }; setOpaque(false); setLayout(new GridLayout(mBoardSize.width + 1, mBoardSize.height + 1)); setPreferredSize(new Dimension((mBoardSize.width + 1) * 48, (mBoardSize.height + 1) * 48)); createGrid(); }
Source:
public void save() { Preconditions.checkState(isInitialized(), "SpongeUser is not initialized", this.profile.getId()); SaveHandler saveHandler = (SaveHandler) WorldManager.getWorldByDimensionId(0).get().getSaveHandler(); File dataFile = new File(saveHandler.playersDirectory, getUniqueId() + ".dat"); NBTTagCompound tag; try { tag = CompressedStreamTools.readCompressed(new FileInputStream(dataFile)); } catch (IOException ignored) { tag = new NBTTagCompound(); } writeToNbt(tag); try (FileOutputStream out = new FileOutputStream(dataFile)) { CompressedStreamTools.writeCompressed(tag, out); dirtyUsers.remove(this); invalidate(); } catch (IOException e) { SpongeImpl.getLogger().warn("Failed to save user file [{}]!", dataFile, e); } }

Target:
public void save() { Preconditions.checkState(isInitialized(), "User is not initialized", this.profile.getId()); final SaveHandlerAccessor saveHandler = (SaveHandlerAccessor) WorldManager.getWorldByDimensionId(0).get().getSaveHandler(); final File dataFile = new File(saveHandler.accessor$getPlayersDirectory(), getUniqueId() + ".dat"); NBTTagCompound tag; try { tag = CompressedStreamTools.readCompressed(new FileInputStream(dataFile)); } catch (IOException ignored) { tag = new NBTTagCompound(); } writeToNbt(tag); try (final FileOutputStream out = new FileOutputStream(dataFile)) { CompressedStreamTools.writeCompressed(tag, out); dirtyUsers.remove(this); invalidate(); } catch (IOException e) { SpongeImpl.getLogger().warn("Failed to save user file [{}]!", dataFile, e); } }
Source:
public void prepareRun(StageSubmitterContext context) throws Exception { super.prepareRun(context); Schema schema = context.getInputSchema(); if (schema == null || schema.getFields() == null) { return; } List<String> input = schema.getFields().stream() .map(Schema.Field::getName).collect(Collectors.toList()); context.record(Collections.singletonList( new FieldTransformOperation("csvFormat", "CSV formatter", input, fields.stream().map(Schema.Field::getName) .collect(Collectors.toList())))); config.validate(context.getFailureCollector()); }

Target:
public void prepareRun(StageSubmitterContext context) throws Exception { super.prepareRun(context); List<String> outputFields = TransformLineageRecorderUtils.getFields(context.getOutputSchema()); if (!outputFields.isEmpty()) { context.record( TransformLineageRecorderUtils .generateManyToOne(TransformLineageRecorderUtils.getFields(context.getInputSchema()), outputFields.get(0), "csvFormat", "Formatted the input data as CSV.")); } config.validate(context.getFailureCollector()); }
Source:
public void stop() { log.info( "Redis stopping ..." ); entityKeys.clear(); associationKeys.clear(); pool.destroy(); }

Target:
public void stop() { log.redisStopping(); entityKeys.clear(); associationKeys.clear(); if ( pool != null ) { pool.destroy(); } }
Source:
public void uploadFile(WebContext ctx, JSONStructuredOutput out, String bucket, InputStreamHandler input) { try { String name = ctx.get("filename").asString(ctx.get("qqfile").asString()); Bucket storageBucket = storage.getBucket(bucket); StoredObject object = storageBucket.getObject(name); try (FileOutputStream fos = new FileOutputStream(object.getFile())) { ByteStreams.copy(input, fos); } Map<String, String> properties = Maps.newTreeMap(); properties.put(HttpHeaderNames.CONTENT_TYPE.toString(), ctx.getHeaderValue(HttpHeaderNames.CONTENT_TYPE).asString(MimeHelper.guessMimeType(name))); HashCode hash = Files.asByteSource(object.getFile()).hash(Hashing.md5()); String md5 = BaseEncoding.base64().encode(hash.asBytes()); properties.put("Content-MD5", md5); object.storeProperties(properties); out.property("message", "File successfully uploaded."); out.property("action", "/ui/" + bucket); out.property("actionLabel", NLS.get("NLS.refresh")); out.property("refresh", "true"); } catch (IOException e) { UserContext.handle(e); ctx.respondWith().direct(HttpResponseStatus.OK, "{ success: false }"); } }

Target:
public void uploadFile(WebContext ctx, JSONStructuredOutput out, String bucket, InputStreamHandler input) { try { String name = ctx.get("filename").asString(ctx.get("qqfile").asString()); Bucket storageBucket = storage.getBucket(bucket); StoredObject object = storageBucket.getObject(name); try (FileOutputStream fos = new FileOutputStream(object.getFile())) { ByteStreams.copy(input, fos); } Map<String, String> properties = Maps.newTreeMap(); properties.put(HttpHeaderNames.CONTENT_TYPE.toString(), ctx.getHeaderValue(HttpHeaderNames.CONTENT_TYPE).asString(MimeHelper.guessMimeType(name))); String md5 = Hasher.md5().hashFile(object.getFile()).toBase64String(); properties.put("Content-MD5", md5); object.storeProperties(properties); out.property("message", "File successfully uploaded."); out.property("action", "/ui/" + bucket); out.property("actionLabel", NLS.get("NLS.refresh")); out.property("refresh", "true"); } catch (IOException e) { UserContext.handle(e); ctx.respondWith().direct(HttpResponseStatus.OK, "{ success: false }"); } }
Source:
public static void editArtifacts(final String name, final Collection<? extends Artifact> artifacts, TableLoadOption... tableLoadOptions) { for (Artifact art : artifacts) { if (ChangeUiUtil.permissionsDeniedWithDialog(art.getBranch())) { return; } } Set<TableLoadOption> options = new HashSet<>(); options.addAll(Arrays.asList(tableLoadOptions)); Displays.ensureInDisplayThread(new Runnable() { @Override public void run() { boolean accessControlFilteredResults = false; try { Set<Artifact> accessibleArts = new HashSet<>(); for (Artifact artifact : artifacts) { if (!AccessControlManager.hasPermission(artifact, PermissionEnum.READ)) { OseeLog.log(Activator.class, Level.INFO, "The user " + UserManager.getUser() + " does not have read access to " + artifact); accessControlFilteredResults = true; } else { accessibleArts.add(artifact); } } if (accessibleArts.isEmpty()) { AWorkbench.popup("ERROR", "No Artifacts to edit"); } else { AWorkbench.getActivePage().openEditor( new MassArtifactEditorInput(name, accessibleArts, new MassXViewerFactory(accessibleArts)), EDITOR_ID); } if (accessControlFilteredResults) { AWorkbench.popup("ERROR", "Some Artifacts not loaded due to access control limitations."); } } catch (Exception ex) { OseeLog.log(Activator.class, OseeLevel.SEVERE_POPUP, ex); } } }, options.contains(TableLoadOption.ForcePend)); }

Target:
public static void editArtifacts(final String name, final Collection<? extends Artifact> artifacts, TableLoadOption... tableLoadOptions) { Set<TableLoadOption> options = new HashSet<>(); options.addAll(Arrays.asList(tableLoadOptions)); Displays.ensureInDisplayThread(new Runnable() { @Override public void run() { boolean accessControlFilteredResults = false; try { Set<Artifact> accessibleArts = new HashSet<>(); for (Artifact artifact : artifacts) { if (!AccessControlManager.hasPermission(artifact, PermissionEnum.READ)) { OseeLog.log(Activator.class, Level.INFO, "The user " + UserManager.getUser() + " does not have read access to " + artifact); accessControlFilteredResults = true; } else { accessibleArts.add(artifact); } } if (accessibleArts.isEmpty()) { AWorkbench.popup("ERROR", "No Artifacts to edit"); } else { AWorkbench.getActivePage().openEditor( new MassArtifactEditorInput(name, accessibleArts, new MassXViewerFactory(accessibleArts)), EDITOR_ID); } if (accessControlFilteredResults) { AWorkbench.popup("ERROR", "Some Artifacts not loaded due to access control limitations."); } } catch (Exception ex) { OseeLog.log(Activator.class, OseeLevel.SEVERE_POPUP, ex); } } }, options.contains(TableLoadOption.ForcePend)); }
Source:
public FlashScope getFlashCookie() { return wrapped.getFlashScope(); }

Target:
public FlashScope getFlashCookie() { return wrapped.getFlashCookie(); }
Source:
void shouldUpdateChargeToSystemCancel_IfEpdqStatusIs6WithRelevantChargeStatus(String status) { final String payload = notificationPayloadForTransaction(payId, EPDQ_AUTHORISED_CANCELLED); charge = Charge.from(ChargeEntityFixture.aValidChargeEntity() .withStatus(ChargeStatus.fromString(status)) .withGatewayTransactionId(payId) .build()); setUpGatewayAccountToReturnGatewayAccountEntity(Optional.of(gatewayAccountEntity)); setUpChargeServiceToReturnCharge(Optional.of(charge)); final boolean result = notificationService.handleNotificationFor(payload, FORWARDED_IP_ADDRESSES); assertTrue(result); verify(mockChargeNotificationProcessor).invoke(payId, charge, SYSTEM_CANCELLATION_FLOW.getSuccessTerminalState(), null); }

Target:
void shouldUpdateChargeToSystemCancel_IfEpdqStatusIs6WithRelevantChargeStatus(String status) { final String payload = notificationPayloadForTransaction(payId, EPDQ_AUTHORISED_CANCELLED); charge = Charge.from(ChargeEntityFixture.aValidChargeEntity() .withStatus(ChargeStatus.fromString(status)) .withGatewayTransactionId(payId) .build()); setUpGatewayAccountToReturnGatewayAccountEntity(Optional.of(gatewayAccountEntity)); setUpChargeServiceToReturnCharge(Optional.of(charge)); assertTrue(notificationService.handleNotificationFor(payload, FORWARDED_IP_ADDRESSES)); verify(mockChargeNotificationProcessor).invoke(payId, charge, SYSTEM_CANCELLATION_FLOW.getSuccessTerminalState(), null); }
Source:
private void checkResources() { File validatorDir = new File(validatorDirPath); List<URL> resources = new ArrayList<URL>(); boolean reloadResources = false; try { if (validatorDir.canRead() && validatorDir.isDirectory()) { for (File f : validatorDir.listFiles()) { if (f.getName().endsWith(".jar")) { resources.add(f.toURI().toURL()); if (resourceTimestamps.get(f.getName()) == null || resourceTimestamps.get(f.getName()) != f.lastModified()) { reloadResources = true; logger.info("Resource " + f.getName() + " is updated. Reload the classloader."); resourceTimestamps.put(f.getName(), f.lastModified()); } } } } } catch (MalformedURLException e) { throw new ValidatorManagerException(e); } if (reloadResources) { if (validatorLoader != null) { validatorLoader.close(); } validatorLoader = new ValidatorClassLoader(resources.toArray(new URL[resources.size()])); } }

Target:
private void checkResources() { File validatorDir = new File(validatorDirPath); List<URL> resources = new ArrayList<URL>(); boolean reloadResources = false; try { if (validatorDir.canRead() && validatorDir.isDirectory()) { for (File f : validatorDir.listFiles()) { if (f.getName().endsWith(".jar")) { resources.add(f.toURI().toURL()); if (resourceTimestamps.get(f.getName()) == null || resourceTimestamps.get(f.getName()) != f.lastModified()) { reloadResources = true; logger.info("Resource " + f.getName() + " is updated. Reload the classloader."); resourceTimestamps.put(f.getName(), f.lastModified()); } } } } } catch (MalformedURLException e) { throw new ValidatorManagerException(e); } if (reloadResources) { if (validatorLoader != null) { try { validatorLoader.close(); } catch (ValidatorManagerException e) { logger.error("Cannot reload validator classloader because failure " + "to close the validator classloader.", e); } } validatorLoader = new ValidatorClassLoader(resources.toArray(new URL[resources.size()])); } }
Source:
public void visitConditionalExpression(ConditionalExpressionTree tree) { TernaryVisitor visitor = new TernaryVisitor(); tree.condition().accept(visitor); ExpressionTree trueExpression = tree.trueExpression(); if (trueExpression != null) { trueExpression.accept(visitor); } tree.falseExpression().accept(visitor); if (visitor.childTernary != null) { context() .newIssue(this, visitor.childTernary, "Extract this nested ternary operation into an independent statement.") .secondary(tree.queryToken(), "Parent ternary operator"); } }

Target:
public void visitConditionalExpression(ConditionalExpressionTree tree) { TernaryVisitor visitor = new TernaryVisitor(); tree.falseExpression().accept(visitor); ExpressionTree trueExpression = tree.trueExpression(); if (trueExpression != null) { trueExpression.accept(visitor); } tree.condition().accept(visitor); if (!visitor.descendantTernaries.isEmpty()) { ConditionalExpressionTree first = visitor.descendantTernaries.get(0); PreciseIssue issue = context().newIssue(this, first, "Extract this nested ternary operation into an independent statement."); visitor.descendantTernaries.stream().skip(1).forEach(ternary -> issue.secondary(ternary, "Other nested ternary")); issue.secondary(tree.queryToken(), "Parent ternary operator"); } }
Source:
public Meta create(List<String> args) { Configuration conf = Preconditions.checkNotNull(getConf(), "Configuration must not be null."); Properties info = new Properties(); info.putAll(conf.getValByRegex("avatica.*")); try { final String url; if (args.size() == 0) { url = QueryUtil.getConnectionUrl(info, conf); } else if (args.size() == 1) { url = args.get(0); } else { throw new RuntimeException( "0 or 1 argument expected. Received " + Arrays.toString(args.toArray())); } if (PqsConfiguration.isMetricsTurnedOn()) { info.put(QueryServices.COLLECT_REQUEST_LEVEL_METRICS, "true"); } return new PQSMetricsMeta(url, info); } catch (SQLException | ClassNotFoundException e) { throw new RuntimeException(e); } }

Target:
public Meta create(List<String> args) { Configuration conf = Preconditions.checkNotNull(getConf(), "Configuration must not be null."); Properties info = new Properties(); info.putAll(conf.getValByRegex("avatica.*")); try { final String url; if (args.size() == 0) { url = QueryUtil.getConnectionUrl(info, conf); } else if (args.size() == 1) { url = args.get(0); } else { throw new RuntimeException( "0 or 1 argument expected. Received " + Arrays.toString(args.toArray())); } boolean isMetricOn = conf.getBoolean(PHOENIX_QUERY_SERVER_METRICS, DEFAULT_PHOENIX_QUERY_SERVER_METRICS); if (isMetricOn) { info.put("pqs_reporting_interval", PqsMetricsSystem.getReportingInterval(conf)); info.put("pqs_filename",PqsMetricsSystem.getSinkFileName(conf)); info.put("pqs_sinktype",PqsMetricsSystem.getTypeOfSink(conf)); info.put(QueryServices.COLLECT_REQUEST_LEVEL_METRICS, "true"); return new PQSMetricsMeta(url, info); } else { return new JdbcMeta(url, info); } } catch (SQLException | ClassNotFoundException e) { throw new RuntimeException(e); } }
Source:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); mMapView = findViewById(R.id.mapView); ArcGISMap map = new ArcGISMap(Basemap.createStreets()); mMapView.setMap(map); AuthenticationManager.setAuthenticationChallengeHandler(this); mRecyclerView = findViewById(R.id.recyclerView); mRecyclerView.setLayoutManager(new LinearLayoutManager(this)); Button searchPublicButton = findViewById(R.id.searchPublicButton); searchPublicButton.setOnClickListener(v -> { searchPortal(new Portal(getString(R.string.arcgis_url))); }); mPortalLoadStateView = findViewById(R.id.portalLoadState); mPortalLoadStateView.setVisibility(View.GONE); mLoadStateTextView = findViewById(R.id.loadStateTextView); Button searchSecureButton = findViewById(R.id.searchSecureButton); EditText portalUrlEditText = findViewById(R.id.portalUrlEditText); searchSecureButton.setOnClickListener(v -> { String securedPortalUrl = portalUrlEditText.getText().toString(); if (!securedPortalUrl.isEmpty()) { searchPortal(new Portal(securedPortalUrl, true)); } else { String error = "Portal URL is empty. Please enter a portal URL."; Toast.makeText(this, error, Toast.LENGTH_LONG).show(); Log.e(TAG, error); } }); mLoadWebMapTextView = findViewById(R.id.loadedWebMapTextView); }

Target:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); mMapView = findViewById(R.id.mapView); ArcGISMap map = new ArcGISMap(Basemap.createStreets()); mMapView.setMap(map); AuthenticationManager.setAuthenticationChallengeHandler(this); mRecyclerView = findViewById(R.id.recyclerView); mRecyclerView.setLayoutManager(new LinearLayoutManager(this)); Button searchPublicButton = findViewById(R.id.searchPublicButton); searchPublicButton.setOnClickListener(v -> { searchPortal(new Portal(getString(R.string.arcgis_url))); }); mPortalLoadStateView = findViewById(R.id.portalLoadState); mPortalLoadStateView.setVisibility(View.GONE); mLoadStateTextView = findViewById(R.id.loadStateTextView); mLoadWebMapTextView = findViewById(R.id.loadedWebMapTextView); Button searchSecureButton = findViewById(R.id.searchSecureButton); EditText portalUrlEditText = findViewById(R.id.portalUrlEditText); searchSecureButton.setOnClickListener(v -> { String securedPortalUrl = portalUrlEditText.getText().toString(); if (!securedPortalUrl.isEmpty()) { searchPortal(new Portal(securedPortalUrl, true)); } else { String error = "Portal URL is empty. Please enter a portal URL."; Toast.makeText(this, error, Toast.LENGTH_LONG).show(); Log.e(TAG, error); } }); }
Source:
public void onActivityResult(int requestCode, int resultCode, Intent data) { switch (requestCode) { case CAMERA_REQUEST: case REQUEST_CHOOSER: if (resultCode == Activity.RESULT_OK && requestCode == CAMERA_REQUEST) { if(mTempImageFile == null || !mTempImageFile.exists()) return; IndexedFolder dir = mContentManager.getCurrentFolder(); mContentManager.addFile(dir, mTempImageFile, new IOnResult<IndexedFile>() { @Override public void onResult(IndexedFile result) { if (result != null) { ArrayList<IndexedItem> itemList = new ArrayList<IndexedItem>(); itemList.add(result); actionLock(itemList); Utils.toast(R.string.content_success_add); } else { Utils.toast(R.string.content_fail_add); } } }); } break; } }

Target:
public void onActivityResult(int requestCode, int resultCode, Intent data) { switch (requestCode) { case CAMERA_REQUEST: case REQUEST_CHOOSER: if (resultCode == Activity.RESULT_OK) { File dataFile = null; if (data == null) { Utils.d("Oops... Result was OK, but intent was null. That's just great."); dataFile = mTempImageFile; } else { dataFile = FileUtils.getFile(getActivity(), data.getData()); } if (dataFile == null || !dataFile.exists()) { Utils.d("Empty result was found!"); return; } IndexedFolder dir = mContentManager.getCurrentFolder(); mContentManager.addFile(dir, dataFile, new IOnResult<IndexedFile>() { @Override public void onResult(IndexedFile result) { if (result != null) { ArrayList<IndexedItem> itemList = new ArrayList<IndexedItem>(); itemList.add(result); actionLock(itemList, mMode); Utils.toast(R.string.content_success_add); } else { Utils.toast(R.string.content_fail_add); } } }); } break; } }
Source:
public void logsSlowestOperationIfMultipleOperationsExceedTheSlowThresholdIfFirst() { accumulateLogsWithCall(TWO_CENTURIES, profilingTimelockService::getFreshTimestamp); flushLogsWithCall(TWO_CENTURIES, profilingTimelockService::startIdentifiedAtlasDbTransaction); verifyLoggerInvokedOnceWithSpecificProfile("getFreshTimestamp", TWO_CENTURIES); }

Target:
public void logsSlowestOperationIfMultipleOperationsExceedTheSlowThresholdIfFirst() { accumulateLogsWithCall(TWO_CENTURIES, profilingTimelockService::getFreshTimestamp); flushLogsWithCall(LONG_DURATION, profilingTimelockService::startIdentifiedAtlasDbTransaction); verifyLoggerInvokedOnceWithSpecificProfile("getFreshTimestamp", TWO_CENTURIES); }
Source:
public boolean isHttpsAllowAnyCertificate() { return WebProperties.WEB_HTTPS_ALLOW_ANY_CERTIFICATE.getValueAsBoolean(); }

Target:
public boolean isHttpsAllowAnyCertificate() { return getBooleanValue(HTTPS_ALLOW_ANY_CERTIFICATE, false); }
Source:
public Page<TaskId> getTaskIds(String taskTag, long from, long to, boolean mytasks, boolean running, boolean pending, boolean finished, int offset, int limit) throws NotConnectedException, PermissionException { RestPageParameters params = new RestPageParameters(frontendState, "getTaskIds", from, to, mytasks, running, pending, finished, offset, limit, taskTag, null); Page<TaskInfo> pTaskInfo; pTaskInfo = dbManager.getTasks(params.getFrom(), params.getTo(), params.getTag(), params.getOffset(), params.getLimit(), params.getUserName(), params.isPending(), params.isRunning(), params.isFinished()); List<TaskId> lTaskId = new ArrayList<TaskId>(pTaskInfo.getList().size()); for (TaskInfo taskInfo : pTaskInfo.getList()) { lTaskId.add(taskInfo.getTaskId()); } return new Page<TaskId>(lTaskId, pTaskInfo.getSize()); }

Target:
public Page<TaskId> getTaskIds(String taskTag, long from, long to, boolean mytasks, boolean running, boolean pending, boolean finished, int offset, int limit) throws NotConnectedException, PermissionException { RestPageParameters params = new RestPageParameters(frontendState, "getTaskIds", from, to, mytasks, running, pending, finished, offset, limit, taskTag, SortSpecifierContainer.EMPTY_CONTAINER); Page<TaskInfo> pTaskInfo; pTaskInfo = dbManager.getTasks(params.getFrom(), params.getTo(), params.getTag(), params.getOffset(), params.getLimit(), params.getUserName(), params.isPending(), params.isRunning(), params.isFinished()); List<TaskId> lTaskId = new ArrayList<TaskId>(pTaskInfo.getList().size()); for (TaskInfo taskInfo : pTaskInfo.getList()) { lTaskId.add(taskInfo.getTaskId()); } return new Page<TaskId>(lTaskId, pTaskInfo.getSize()); }
Source:
public void start() throws Exception { Preconditions.checkState(state.compareAndSet(State.LATENT, State.STARTED), "Cannot be started more than once"); final ExecutorService executor = ThreadUtils.newSingleThreadExecutor(""); executor.submit(new Runnable() { @Override public void run() { try { client.blockUntilConnected(); client.getConnectionStateListenable().addListener(listener); reset(); } catch(Exception ex) { log.error("An error occurred checking resetting leadership.", ex); } finally { executor.shutdown(); } } }); }

Target:
public void start() throws Exception { Preconditions.checkState(state.compareAndSet(State.LATENT, State.STARTED), "Cannot be started more than once"); ExecuteAfterConnectionEstablished.executeAfterConnectionEstablishedInBackground(LeaderLatch.class.getName(), client, new Runnable() { @Override public void run() { try { client.getConnectionStateListenable().addListener(listener); reset(); } catch(Exception ex) { log.error("An error occurred checking resetting leadership.", ex); } } }); }
Source:
private void processResources(File destDir) throws IOException { for (Resource res : config.getResources()) { res.walk(new Walker() { @Override public boolean processDir(Resource resource, File dir, File destDir) throws IOException { return true; } @Override public void processFile(Resource resource, File file, File destDir) throws IOException { String filename = file.getName().toLowerCase(); if (filename.endsWith(".storyboard") || filename.endsWith(".xib")) { try { List<String> customClasses = findCustomClassesInIBFile(file); config.addCustomIBClasses(customClasses); } catch (XMLStreamException | IOException e) { e.printStackTrace(); } } } }, destDir); } }

Target:
private void processResources(File destDir) throws IOException { for (Resource res : config.getResources()) { res.walk(new Walker() { @Override public boolean processDir(Resource resource, File dir, File destDir) throws IOException { return true; } @Override public void processFile(Resource resource, File file, File destDir) throws IOException { String filename = file.getName().toLowerCase(); if (filename.endsWith(".storyboard") || filename.endsWith(".xib")) { try { List<String> customClasses = findCustomClassesInIBFile(file); config.addCustomIBClasses(customClasses); } catch (XMLStreamException | IOException e) { if (config.getHome().isDev()) { e.printStackTrace(); } } } } }, destDir); } }
Source:
public ComplexMetricExtractor getExtractor() { return new ComplexMetricExtractor() { @Override public Class<?> extractedClass() { return MomentSketchWrapper.class; } @Override public Object extractValue(final InputRow inputRow, final String metricName) { Object rawValue = inputRow.getRaw(metricName); if (rawValue instanceof MomentSketchWrapper) { return (MomentSketchWrapper) rawValue; } else { throw new IAE("Not a momentSketch"); } } }; }

Target:
public ComplexMetricExtractor getExtractor() { return new ComplexMetricExtractor() { @Override public Class<?> extractedClass() { return MomentSketchWrapper.class; } @Override public Object extractValue(final InputRow inputRow, final String metricName) { return (MomentSketchWrapper) inputRow.getRaw(metricName); } }; }
Source:
public void testCreateFromConfigLoader() throws Exception { PowerMockito.spy(ClusterBasedJobCoordinator.class); Map<String, String> config = new HashMap<>(); config.put(ApplicationConfig.APP_CLASS, MockStreamApplication.class.getCanonicalName()); config.put(JobConfig.CONFIG_LOADER_FACTORY, PropertiesConfigLoaderFactory.class.getCanonicalName()); config.put(PropertiesConfigLoaderFactory.CONFIG_LOADER_PROPERTIES_PREFIX + "path", getClass().getResource("/test.properties").getPath()); PowerMockito.doAnswer(invocation -> invocation.getArgumentAt(0, Config.class)) .when(ClusterBasedJobCoordinator.class, "prepareJob", any()); PowerMockito.whenNew(ClusterBasedJobCoordinator.class).withAnyArguments().thenReturn(mock(ClusterBasedJobCoordinator.class)); PowerMockito.whenNew(CoordinatorStreamStore.class).withAnyArguments().thenReturn(mock(CoordinatorStreamStore.class)); ClusterBasedJobCoordinator.createFromConfigLoader(new MapConfig(config)); verifyPrivate(ClusterBasedJobCoordinator.class).invoke("prepareJob", any()); verifyNew(ClusterBasedJobCoordinator.class).withArguments(any(), any(), any()); }

Target:
public void testCreateFromConfigLoader() throws Exception { Map<String, String> config = new HashMap<>(); config.put(ApplicationConfig.APP_CLASS, MockStreamApplication.class.getCanonicalName()); config.put(JobConfig.CONFIG_LOADER_FACTORY, PropertiesConfigLoaderFactory.class.getCanonicalName()); config.put(PropertiesConfigLoaderFactory.CONFIG_LOADER_PROPERTIES_PREFIX + "path", getClass().getResource("/test.properties").getPath()); Config submissionConfig = new MapConfig(config); JobConfig fullJobConfig = new JobConfig(ConfigUtil.loadConfig(submissionConfig)); RemoteJobPlanner mockJobPlanner = mock(RemoteJobPlanner.class); CoordinatorStreamStore mockCoordinatorStreamStore = mock(CoordinatorStreamStore.class); PowerMockito.whenNew(ClusterBasedJobCoordinator.class).withAnyArguments().thenReturn(mock(ClusterBasedJobCoordinator.class)); PowerMockito.doReturn(new MapConfig()).when(CoordinatorStreamUtil.class, "buildCoordinatorStreamConfig", any()); PowerMockito.whenNew(CoordinatorStreamStore.class).withAnyArguments().thenReturn(mockCoordinatorStreamStore); PowerMockito.whenNew(RemoteJobPlanner.class).withAnyArguments().thenReturn(mockJobPlanner); when(mockJobPlanner.prepareJobs()).thenReturn(Collections.singletonList(fullJobConfig)); ClusterBasedJobCoordinator.createFromConfigLoader(submissionConfig); verifyNew(ClusterBasedJobCoordinator.class).withArguments(any(MetricsRegistryMap.class), eq(mockCoordinatorStreamStore), eq(fullJobConfig)); }
Source:
private static boolean isInCorrectPackage(@NotNull GoFunctionOrMethodDeclaration element) { GoFile containingFile = element.getContainingFile(); GoPackageClause filePackage = containingFile.getPackage(); if (filePackage == null || filePackage.getIdentifier() == null || containingFile.getImportPath() == null) { return false; } String packageName = filePackage.getIdentifier().getText(); String packageImportPath = containingFile.getImportPath(); return (packageName.equals("fmt") && packageImportPath.equals("fmt")) || (packageName.equals("log") && packageImportPath.equals("log")); }

Target:
private static boolean isInCorrectPackage(@NotNull GoFunctionOrMethodDeclaration element) { GoFile containingFile = element.getContainingFile(); return FORMATTING_FUNCTIONS.containsKey(getName(element)) && ("fmt".equals(containingFile.getImportPath()) || "log".equals(containingFile.getImportPath())); }
Source:
public static Properties defaultProperties() { Properties properties = BaseHttpApiMetadata.defaultProperties(); properties.setProperty(PROPERTY_AUTH_TAG, "AWS"); properties.setProperty(PROPERTY_HEADER_TAG, S3Headers.DEFAULT_AMAZON_HEADERTAG); properties.setProperty(PROPERTY_S3_SERVICE_PATH, "/"); properties.setProperty(PROPERTY_S3_VIRTUAL_HOST_BUCKETS, "false"); properties.setProperty(PROPERTY_RELAX_HOSTNAME, "true"); properties.setProperty(PROPERTY_BLOBSTORE_DIRECTORY_SUFFIX, "/"); properties.setProperty(PROPERTY_V4_REQUEST_SIGNATURES, "false"); properties.setProperty(PROPERTY_USER_METADATA_PREFIX, String.format("x-${%s}-meta-", PROPERTY_HEADER_TAG)); properties.setProperty(PROPERTY_IDEMPOTENT_METHODS, "DELETE,GET,HEAD,OPTIONS,POST,PUT"); properties.setProperty(PROPERTY_JCLOUDS_S3_CHUNKED_SIZE, String.valueOf(64 * 1024)); return properties; }

Target:
public static Properties defaultProperties() { Properties properties = BaseHttpApiMetadata.defaultProperties(); properties.setProperty(PROPERTY_AUTH_TAG, "AWS"); properties.setProperty(PROPERTY_HEADER_TAG, S3Headers.DEFAULT_AMAZON_HEADERTAG); properties.setProperty(PROPERTY_S3_SERVICE_PATH, "/"); properties.setProperty(PROPERTY_S3_VIRTUAL_HOST_BUCKETS, "false"); properties.setProperty(PROPERTY_RELAX_HOSTNAME, "true"); properties.setProperty(PROPERTY_BLOBSTORE_DIRECTORY_SUFFIX, "/"); properties.setProperty(PROPERTY_S3_V4_REQUEST_SIGNATURES, "false"); properties.setProperty(PROPERTY_USER_METADATA_PREFIX, String.format("x-${%s}-meta-", PROPERTY_HEADER_TAG)); properties.setProperty(PROPERTY_IDEMPOTENT_METHODS, "DELETE,GET,HEAD,OPTIONS,POST,PUT"); properties.setProperty(PROPERTY_JCLOUDS_S3_CHUNKED_SIZE, String.valueOf(64 * 1024)); return properties; }
Source:
public static void pushExportBuffer( int partitionId, String signature, long startSequenceNumber, long committedSequenceNumber, long tupleCount, long uniqueId, long genId, long bufferPtr, ByteBuffer buffer, boolean sync) { if (bufferPtr != 0) DBBPool.registerUnsafeMemory(bufferPtr); ExportManager instance = instance(); try { long lastSeqNo = startSequenceNumber + tupleCount - 1; ExportGeneration generation = instance.m_generation.get(); if (generation == null) { if (buffer != null) { DBBPool.wrapBB(buffer).discard(); } return; } generation.pushExportBuffer(partitionId, signature, startSequenceNumber, committedSequenceNumber, (int)tupleCount, uniqueId, genId, buffer, sync); } catch (Exception e) { exportLog.error("Error pushing export buffer", e); } }

Target:
public static void pushExportBuffer( int partitionId, String signature, long startSequenceNumber, long committedSequenceNumber, long tupleCount, long uniqueId, long genId, long bufferPtr, ByteBuffer buffer, boolean sync) { if (bufferPtr != 0) DBBPool.registerUnsafeMemory(bufferPtr); ExportManager instance = instance(); try { ExportGeneration generation = instance.m_generation.get(); if (generation == null) { if (buffer != null) { DBBPool.wrapBB(buffer).discard(); } return; } generation.pushExportBuffer(partitionId, signature, startSequenceNumber, committedSequenceNumber, (int)tupleCount, uniqueId, genId, buffer, sync); } catch (Exception e) { exportLog.error("Error pushing export buffer", e); } }
Source:
public static Job createSystem(final ICoreRunnable runnable) { Job job = create("", runnable); job.setSystem(true); return job; }

Target:
public static Job createSystem(final ICoreRunnable runnable) { return create("", runnable); }
Source:
private void startSiteIconUpload(final String filePath) { if (TextUtils.isEmpty(filePath)) { ToastUtils.showToast(getActivity(), R.string.error_locating_image, ToastUtils.Duration.SHORT); return; } File file = new File(filePath); if (!file.exists()) { ToastUtils.showToast(getActivity(), R.string.error_locating_image, ToastUtils.Duration.SHORT); return; } SiteModel site = getSelectedSite(); if (site != null) { MediaModel media = buildMediaModel(file, site); UploadService.uploadMedia(getActivity(), media); } }

Target:
private void startSiteIconUpload(final String filePath) { if (TextUtils.isEmpty(filePath)) { ToastUtils.showToast(getActivity(), R.string.error_locating_image, ToastUtils.Duration.SHORT); return; } File file = new File(filePath); if (!file.exists()) { ToastUtils.showToast(getActivity(), R.string.file_error_create, ToastUtils.Duration.SHORT); return; } SiteModel site = getSelectedSite(); if (site != null) { MediaModel media = buildMediaModel(file, site); UploadService.uploadMedia(getActivity(), media); } else { ToastUtils.showToast(getActivity(), R.string.error_generic, ToastUtils.Duration.SHORT); AppLog.e(T.MAIN, "Unexpected error - Site icon upload failed, because there wasn't any site selected."); } }
Source:
public void addHeaders(ServiceHeaderContext<?> context) { String auth = context.getConfig().getChildValue(ServiceConfig.KEY_SEGMENT_AUTH); if (!ServiceConfig.VALUE_AUTH_FORWARD.equals(auth)) { return; } SecurityContext securityContext = SecurityContextHolder.getContext(); if (securityContext == null) { return; } String authorizationHeader = context.getConfig().getChildValue(AUTHORIZATION); context.setHeader(AUTHORIZATION, authorizationHeader + ""); }

Target:
public void addHeaders(ServiceHeaderContext<?> context) { String auth = context.getConfig().getChildValue(ServiceConfig.KEY_SEGMENT_AUTH); if (!ServiceConfig.VALUE_AUTH_FORWARD.equals(auth)) { return; } SecurityContext securityContext = SecurityContextHolder.getContext(); if (securityContext == null) { return; } String authorizationHeader = context.getConfig().getChildValue(AUTHORIZATION); context.setHeader(AUTHORIZATION, authorizationHeader); }