auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void setup(TaskConfig config, String taskName, Collector<OT> outputCollector, AbstractInvokable parent, UserCodeClassLoader userCodeClassLoader, ExecutionConfig executionConfig, Map<String, Accumulator<?,?>> accumulatorMap) { this.config = config; this.taskName = taskName; this.userCodeClassLoader = userCodeClassLoader; this.metrics = parent.getEnvironment().getMetricGroup().getOrAddOperator(taskName); this.numRecordsIn = this.metrics.getIOMetricGroup().getNumRecordsInCounter(); this.numRecordsOut = this.metrics.getIOMetricGroup().getNumRecordsOutCounter(); this.outputCollector = new CountingCollector<>(outputCollector, numRecordsOut); Environment env = parent.getEnvironment(); if (parent instanceof BatchTask) { this.udfContext = ((BatchTask<?, ?>) parent).createRuntimeContext(metrics); } else { this.udfContext = new DistributedRuntimeUDFContext(env.getTaskInfo(), userCodeClassLoader, parent.getExecutionConfig(), env.getDistributedCacheEntries(), accumulatorMap, metrics, env.getExternalResourceInfoProvider() ); } this.executionConfig = executionConfig; this.objectReuseEnabled = executionConfig.isObjectReuseEnabled(); setup(parent); }

Target:
public void setup(TaskConfig config, String taskName, Collector<OT> outputCollector, AbstractInvokable parent, UserCodeClassLoader userCodeClassLoader, ExecutionConfig executionConfig, Map<String, Accumulator<?,?>> accumulatorMap) { this.config = config; this.taskName = taskName; this.userCodeClassLoader = userCodeClassLoader.asClassLoader(); this.metrics = parent.getEnvironment().getMetricGroup().getOrAddOperator(taskName); this.numRecordsIn = this.metrics.getIOMetricGroup().getNumRecordsInCounter(); this.numRecordsOut = this.metrics.getIOMetricGroup().getNumRecordsOutCounter(); this.outputCollector = new CountingCollector<>(outputCollector, numRecordsOut); Environment env = parent.getEnvironment(); if (parent instanceof BatchTask) { this.udfContext = ((BatchTask<?, ?>) parent).createRuntimeContext(metrics); } else { this.udfContext = new DistributedRuntimeUDFContext(env.getTaskInfo(), userCodeClassLoader, parent.getExecutionConfig(), env.getDistributedCacheEntries(), accumulatorMap, metrics, env.getExternalResourceInfoProvider() ); } this.executionConfig = executionConfig; this.objectReuseEnabled = executionConfig.isObjectReuseEnabled(); setup(parent); }
Source:
private void stopConnector(String connName) { try (LoggingContext loggingContext = LoggingContext.forConnector(connName)) { WorkerConnector workerConnector = connectors.get(connName); if (workerConnector == null) { log.warn("Ignoring stop request for unowned connector {}", connName); return; } log.info("Stopping connector {}", connName); ClassLoader savedLoader = plugins.currentThreadLoader(); try { savedLoader = Plugins.compareAndSwapLoaders(workerConnector.loader()); workerConnector.shutdown(); } finally { Plugins.compareAndSwapLoaders(savedLoader); } } }

Target:
private void stopConnector(String connName) { try (LoggingContext loggingContext = LoggingContext.forConnector(connName)) { WorkerConnector workerConnector = connectors.get(connName); log.info("Stopping connector {}", connName); if (workerConnector == null) { log.warn("Ignoring stop request for unowned connector {}", connName); return; } ClassLoader savedLoader = plugins.currentThreadLoader(); try { savedLoader = Plugins.compareAndSwapLoaders(workerConnector.loader()); workerConnector.shutdown(); } finally { Plugins.compareAndSwapLoaders(savedLoader); } } }
Source:
public IStaticContentProvider getContentProvider(String propertyPath) { IStaticContentProvider provider = null; ResourceSet resourceSet= getRoot(getEditedTable().getContext()).eResource().getResourceSet(); if (MatrixPropertyConstants.MATRIX_ROW_SOURCES.equals(propertyPath)) { provider = ProviderHelper.encapsulateProvider(ProviderHelper.getContentProvider(resourceSet), resourceSet, "rowSources"); } else if (MatrixPropertyConstants.MATRIX_COLUMN_SOURCES.equals(propertyPath)) { provider = ProviderHelper.encapsulateProvider(ProviderHelper.getContentProvider(resourceSet), resourceSet, "columnSources"); } else if (MatrixPropertyConstants.MATRIX_CELL_TYPE.equals(propertyPath)) { provider = new GenericRelationshipMatrixElementTypeContentProvider(getRoot(getEditedTable().getContext())); } else if (MatrixPropertyConstants.MATRIX_RELATIONSHIP_DIRECTION.equals(propertyPath)) { provider = new MatrixDirectionContentProvider(); } else if (MatrixPropertyConstants.MATRIX_RELATIONSHIP_OWNER_STRATEGY.equals(propertyPath)) { provider = new MatrixRelationshipOwnerStrategyContentProvider(); } else if (MatrixPropertyConstants.MATRIX_RELATIONSHIP_OWNER.equals(propertyPath)) { provider = new MatrixSourcesContentProvider(getRoot(getEditedTable().getContext())); } else { provider = super.getContentProvider(propertyPath); } return provider; }

Target:
public IStaticContentProvider getContentProvider(String propertyPath) { IStaticContentProvider provider = null; ResourceSet resourceSet= getRoot(getEditedTable().getContext()).eResource().getResourceSet(); if (MatrixPropertyConstants.MATRIX_ROW_SOURCES.equals(propertyPath)) { provider = ProviderHelper.encapsulateProvider(ProviderHelper.getContentProvider(resourceSet), resourceSet, "rowSources"); } else if (MatrixPropertyConstants.MATRIX_COLUMN_SOURCES.equals(propertyPath)) { provider = ProviderHelper.encapsulateProvider(ProviderHelper.getContentProvider(resourceSet), resourceSet, "columnSources"); } else if (MatrixPropertyConstants.MATRIX_CELL_TYPE.equals(propertyPath)) { provider = new GenericRelationshipMatrixElementTypeContentProvider(getRoot(getEditedTable().getContext())); } else if (MatrixPropertyConstants.MATRIX_RELATIONSHIP_DIRECTION.equals(propertyPath)) { provider = new MatrixDirectionContentProvider(); } else if (MatrixPropertyConstants.MATRIX_RELATIONSHIP_OWNER_STRATEGY.equals(propertyPath)) { provider = new MatrixRelationshipOwnerStrategyContentProvider(); } else if (MatrixPropertyConstants.MATRIX_RELATIONSHIP_OWNER.equals(propertyPath)) { provider = ProviderHelper.encapsulateProvider(ProviderHelper.getContentProvider(resourceSet), resourceSet, "relationshipOwner"); } else { provider = super.getContentProvider(propertyPath); } return provider; }
Source:
public static Map<String, Object> getMapFrom( @Nullable Map<String, Object> map, @Nullable String key, boolean required) { final Map<String, Object> m = JsonUtils.getObjectFrom(Map.class, map, key, false); return (m != null) ? m : Collections.emptyMap(); }

Target:
public static Map<String, Object> getMapFrom( @Nullable Map<String, Object> map, @Nullable String key, boolean required) { final Map<String, Object> m = JsonUtils.getObjectFrom(Map.class, map, key, required); return (m != null) ? m : Collections.emptyMap(); }
Source:
private void UpdateActionAvailability() { List<PairQueryable<VdsNetworkInterface, VDS>> selectedItems = getSelectedItems() != null ? getSelectedItems() : new ArrayList(); Version v31 = new Version(3, 1); getSetupNetworksCommand().setIsExecutionAllowed(selectedItems.size() == 1 && selectedItems.get(0).getSecond().getvds_group_compatibility_version().compareTo(v31) < 0); }

Target:
private void UpdateActionAvailability() { List<PairQueryable<VdsNetworkInterface, VDS>> selectedItems = getSelectedItems() != null ? getSelectedItems() : new ArrayList(); getSetupNetworksCommand().setIsExecutionAllowed(selectedItems.size() == 1 && selectedItems.get(0).getSecond().getvds_group_compatibility_version().compareTo(Version.v3_1) >= 0); }
Source:
public MarketDataBox<FxOptionVolatilities> build( FxOptionVolatilitiesId id, MarketDataConfig marketDataConfig, ScenarioMarketData marketData, ReferenceData refData) { FxOptionVolatilitiesDefinition volatilitiesDefinition = marketDataConfig.get(FxOptionVolatilitiesDefinition.class, id.getName().getName()); ValuationZoneTimeDefinition zoneTimeDefinition = marketDataConfig.get(ValuationZoneTimeDefinition.class); int nScenarios = marketData.getScenarioCount(); MarketDataBox<LocalDate> valuationDates = marketData.getValuationDate(); MarketDataBox<ZonedDateTime> valuationDateTimes = zoneTimeDefinition.toZonedDateTime(valuationDates); int nParameters = volatilitiesDefinition.getParameterCount(); ImmutableList<MarketDataBox<Double>> inputs = volatilitiesDefinition.volatilitiesInputs().stream() .map(q -> marketData.getValue(q)) .collect(toImmutableList()); ImmutableList<FxOptionVolatilities> vols = IntStream.range(0, nScenarios) .mapToObj(i -> volatilitiesDefinition.volatilities( valuationDateTimes.getValue(i), DoubleArray.of(nParameters, n -> inputs.get(n).getValue(i)), refData)) .collect(toImmutableList()); return nScenarios > 1 ? MarketDataBox.ofScenarioValues(vols) : MarketDataBox.ofSingleValue(vols.get(0)); }

Target:
public MarketDataBox<FxOptionVolatilities> build( FxOptionVolatilitiesId id, MarketDataConfig marketDataConfig, ScenarioMarketData marketData, ReferenceData refData) { FxOptionVolatilitiesDefinition volatilitiesDefinition = marketDataConfig.get(FxOptionVolatilitiesDefinition.class, id.getName().getName()); ValuationZoneTimeDefinition zoneTimeDefinition = marketDataConfig.get(ValuationZoneTimeDefinition.class); int nScenarios = marketData.getScenarioCount(); MarketDataBox<LocalDate> valuationDates = marketData.getValuationDate(); MarketDataBox<ZonedDateTime> valuationDateTimes = zoneTimeDefinition.toZonedDateTime(valuationDates); int nParameters = volatilitiesDefinition.getParameterCount(); ImmutableList<MarketDataBox<Double>> inputs = volatilitiesDefinition.volatilitiesInputs().stream() .map(q -> marketData.getValue(q)) .collect(toImmutableList()); ImmutableList<FxOptionVolatilities> vols = IntStream.range(0, nScenarios) .mapToObj(scenarioIndex -> volatilitiesDefinition.volatilities( valuationDateTimes.getValue(scenarioIndex), DoubleArray.of(nParameters, paramIndex -> inputs.get(paramIndex).getValue(scenarioIndex)), refData)) .collect(toImmutableList()); return nScenarios > 1 ? MarketDataBox.ofScenarioValues(vols) : MarketDataBox.ofSingleValue(vols.get(0)); }
Source:
private void handleAssignmentChange() { List<String> assignment = _adapter.getInstanceAssignment(_adapter.getInstanceName()); LOG.info("START: Coordinator::handleAssignmentChange. Instance: " + _adapter.getInstanceName() + ", assignment: " + assignment); Map<String, List<DatastreamTask>> currentAssignment = new HashMap<>(); assignment.forEach(ds -> { DatastreamTask task = _adapter.getAssignedDatastreamTask(_adapter.getInstanceName(), ds); if (!currentAssignment.containsKey(task.getConnectorType())) { currentAssignment.put(task.getConnectorType(), new ArrayList<>()); } currentAssignment.get(task.getConnectorType()).add(task); }); LOG.info(printAssignmentByType(currentAssignment)); DatastreamContext context = new DatastreamContextImpl(_adapter); List<String> oldConnectorList = new ArrayList<>(); oldConnectorList.addAll(_allStreamsByConnectorType.keySet()); List<String> newConnectorList = new ArrayList<>(); newConnectorList.addAll(currentAssignment.keySet()); List<String> deactivated = new ArrayList<>(oldConnectorList); deactivated.removeAll(newConnectorList); deactivated.forEach(connectorType -> _connectors.get(connectorType).onAssignmentChange(context, new ArrayList<>())); newConnectorList.forEach(connectorType -> dispatchAssignmentChangeIfNeeded(connectorType, context, currentAssignment)); _allStreamsByConnectorType = currentAssignment; LOG.info("END: Coordinator::handleAssignmentChange"); }

Target:
private void handleAssignmentChange() { long startAt = System.currentTimeMillis(); List<String> assignment = _adapter.getInstanceAssignment(_adapter.getInstanceName()); LOG.info("START: Coordinator::handleAssignmentChange. Instance: " + _adapter.getInstanceName() + ", assignment: " + assignment); Map<String, List<DatastreamTask>> currentAssignment = new HashMap<>(); assignment.forEach(ds -> { DatastreamTask task = _adapter.getAssignedDatastreamTask(_adapter.getInstanceName(), ds); if (!currentAssignment.containsKey(task.getConnectorType())) { currentAssignment.put(task.getConnectorType(), new ArrayList<>()); } currentAssignment.get(task.getConnectorType()).add(task); }); LOG.info(printAssignmentByType(currentAssignment)); DatastreamContext context = new DatastreamContextImpl(_adapter); List<String> oldConnectorList = new ArrayList<>(); oldConnectorList.addAll(_allStreamsByConnectorType.keySet()); List<String> newConnectorList = new ArrayList<>(); newConnectorList.addAll(currentAssignment.keySet()); List<String> deactivated = new ArrayList<>(oldConnectorList); deactivated.removeAll(newConnectorList); deactivated.forEach(connectorType -> _connectors.get(connectorType).onAssignmentChange(context, new ArrayList<>())); newConnectorList.forEach(connectorType -> dispatchAssignmentChangeIfNeeded(connectorType, context, currentAssignment)); _allStreamsByConnectorType = currentAssignment; long endAt = System.currentTimeMillis(); LOG.info(String.format("END: Coordinator::handleAssignmentChange, Duration: %d milliseconds", endAt - startAt)); }
Source:
public void shouldCreateCorrectTokenForWorldpay3dsFlexDdc() { var validCredentials = Map.of( "issuer", "me", "organisational_unit_id", "myOrg", "jwt_mac_id", "fa2daee2-1fbb-45ff-4444-52805d5cd9e0" ); var gatewayAccount = new GatewayAccount(1L, WORLDPAY.toString(), validCredentials); var paymentCreationTime = ZonedDateTime.now(); String token = worldpay3dsFlexJwtService.generateDdcToken(gatewayAccount, paymentCreationTime); Jws<Claims> jws = Jwts.parser() .setSigningKey(new SecretKeySpec(validCredentials.get("jwt_mac_id").getBytes(), "HmacSHA256")) .parseClaimsJws(token); assertThat(jws.getHeader().getAlgorithm(), is("HS256")); assertThat(jws.getHeader().get("typ"), is("JWT")); assertThat(jws.getBody().get("jti"), is (notNullValue())); assertThat(jws.getBody().get("iat"), is (notNullValue())); assertThat(jws.getBody().get("exp"), is (paymentCreationTime.plusSeconds(tokenExpiryDurationSeconds).toInstant().toEpochMilli())); assertThat(jws.getBody().get("iss"), is(validCredentials.get("issuer"))); assertThat(jws.getBody().get("OrgUnitId"), is(validCredentials.get("organisational_unit_id"))); }

Target:
public void shouldCreateCorrectTokenForWorldpay3dsFlexDdc() { var validCredentials = Map.of( "issuer", "me", "organisational_unit_id", "myOrg", "jwt_mac_id", "fa2daee2-1fbb-45ff-4444-52805d5cd9e0" ); var gatewayAccount = new GatewayAccount(1L, WORLDPAY.toString(), validCredentials); int paymentCreationTimeEpochSeconds19August2029 = 1881821916; int expectedTokenExpirationTimeEpochSeconds = paymentCreationTimeEpochSeconds19August2029 + tokenExpiryDurationSeconds; var paymentCreationZonedDateTime = ZonedDateTime.ofInstant(Instant.ofEpochSecond((long) paymentCreationTimeEpochSeconds19August2029), UTC); String token = worldpay3dsFlexJwtService.generateDdcToken(gatewayAccount, paymentCreationZonedDateTime); Jws<Claims> jws = Jwts.parser() .setSigningKey(new SecretKeySpec(validCredentials.get("jwt_mac_id").getBytes(), "HmacSHA256")) .parseClaimsJws(token); assertThat(jws.getHeader().getAlgorithm(), is("HS256")); assertThat(jws.getHeader().get("typ"), is("JWT")); assertThat(jws.getBody().get("jti"), is(notNullValue())); assertThat(jws.getBody().get("iat"), is(notNullValue())); assertThat(jws.getBody().get("exp"), is(expectedTokenExpirationTimeEpochSeconds)); assertThat(jws.getBody().get("iss"), is(validCredentials.get("issuer"))); assertThat(jws.getBody().get("OrgUnitId"), is(validCredentials.get("organisational_unit_id"))); }
Source:
private static void updateDistinctCountHllExpr(Expression expr, int hllLog2mOverride) { if (expr == null || expr.getFunctionCall() == null) { return; } Function functionCall = expr.getFunctionCall(); try { switch (AggregationFunctionType.getAggregationFunctionType(functionCall.getOperator())) { case DISTINCTCOUNTHLL: case DISTINCTCOUNTHLLMV: case DISTINCTCOUNTRAWHLL: case DISTINCTCOUNTRAWHLLMV: if (functionCall.getOperandsSize() == 1) { functionCall.addToOperands(RequestUtils.getLiteralExpression(hllLog2mOverride)); } return; } } catch (Exception e) { } if (functionCall.getOperandsSize() > 0) { for (Expression operand : functionCall.getOperands()) { updateDistinctCountHllExpr(operand, hllLog2mOverride); } } }

Target:
private static void updateDistinctCountHllExpr(Expression expr, int hllLog2mOverride) { Function functionCall = expr.getFunctionCall(); if (functionCall == null) { return; } switch (functionCall.getOperator()) { case "DISTINCTCOUNTHLL": case "DISTINCTCOUNTHLLMV": case "DISTINCTCOUNTRAWHLL": case "DISTINCTCOUNTRAWHLLMV": if (functionCall.getOperandsSize() == 1) { functionCall.addToOperands(RequestUtils.getLiteralExpression(hllLog2mOverride)); } return; } if (functionCall.getOperandsSize() > 0) { for (Expression operand : functionCall.getOperands()) { updateDistinctCountHllExpr(operand, hllLog2mOverride); } } }
Source:
protected void startCacheCreationThread(final T artifactLocation) { boolean inserted = pendingCacheFiles.add(artifactLocation); if (inserted) { Thread cacheCreatorThread = new Thread("cache-creator-thread-" + UUID.randomUUID().toString()) { public void run() { try { createCachedFile(artifactLocation); } catch (Exception e) { LOG.error(String.format("An error occurred while trying to create the artifact zip file of directory '%s'", artifactLocation), e); pendingExceptions.putIfAbsent(artifactLocation, e); } finally { pendingCacheFiles.remove(artifactLocation); } } }; cacheCreatorThread.start(); } }

Target:
protected long startCacheCreationThread(final T artifactLocation) throws InterruptedException { boolean inserted = pendingCacheFiles.add(artifactLocation); Thread cacheCreatorThread = new Thread("cache-creator-thread-" + UUID.randomUUID().toString()) { public void run() { try { createCachedFile(artifactLocation); } catch (Exception e) { LOG.error("An error occurred while trying to create the artifact zip file of directory {}", artifactLocation, e); pendingExceptions.putIfAbsent(artifactLocation, e); } finally { pendingCacheFiles.remove(artifactLocation); } } }; if (inserted) { cacheCreatorThread.start(); } return cacheCreatorThread.getId(); }
Source:
private Mono<HermesResponse> publishWithRetries(HermesMessage message) { currentlySending.incrementAndGet(); Retry retry = prepareRetry(message); return sendOnce(message) .flatMap(response -> getNextAttempt() .map(attempt -> { if (retryCondition.test(response)) { return Result.failure(new ShouldRetryException(response), attempt); } else { return Result.attempt(response, attempt); } }) ) .onErrorResume(throwable -> getNextAttempt().map(attempt -> Result.failure(throwable, attempt))) .subscribeOn(scheduler) .flatMap(result -> { if (result instanceof Failed) { Failed failed = (Failed) result; return Mono.error(new RetryFailedException(failed.attempt, failed.cause)); } else { return Mono.just((Attempt) result); } }) .retryWhen(retry) .subscriberContext(ctx -> ctx.put(RETRY_CONTEXT_KEY, HermesRetryContext.emptyRetryContext())) .onErrorResume(Exception.class, exception -> { if (isRetryExhausted(exception)) { RetryFailedException rfe = (RetryFailedException) (exception.getCause()); handleMaxRetriesExceeded(message, rfe.attempt); Throwable cause = rfe.getCause(); if (cause instanceof ShouldRetryException) { ShouldRetryException sre = (ShouldRetryException) cause; return Mono.just((Attempt) Result.attempt(sre.hermesResponse, rfe.attempt)); } handleFailure(message, rfe.getAttempt()); } return Mono.error(exception); }) .doOnSuccess(hr -> { if (hr.response.isSuccess()) { handleSuccessfulRetry(message, hr.getAttempt()); } else { handleFailure(message, hr.getAttempt()); } }) .map(result -> result.response) .doFinally(s -> currentlySending.decrementAndGet()); }

Target:
private Mono<HermesResponse> publishWithRetries(HermesMessage message) { currentlySending.incrementAndGet(); Mono<Result> sendOnceResult = sendOnce(message) .flatMap(this::testRetryCondition) .onErrorResume(exception -> mapExceptionToFailedAttempt(exception, message)) .subscribeOn(scheduler); return retry(sendOnceResult) .doOnSuccess(hr -> { if (hr.response.isSuccess() || !hr.matchesRetryPolicy) { handleSuccessfulRetry(hr.response, hr.attempt); } else { handleFailure(hr.response, hr.attempt); } }) .map(result -> result.response) .doFinally(s -> currentlySending.decrementAndGet()); }
Source:
public void rotate(int degree) { Validate.isTrue(degree % 90 == 0 && degree > 0 && degree < 360, "Only rotations by 90, 180 and 270 degree are supported"); ArrayList<Entry> newIDFData = new ArrayList<>(); Iterator<Entry> it = IFD.iterator(); while (it.hasNext()) { newIDFData.add(it.next()); } short orientation = TIFFBaseline.ORIENTATION_TOPLEFT; Entry orientationEntry = IFD.getEntryById(TIFF.TAG_ORIENTATION); if (orientationEntry != null) { orientation = ((Number) orientationEntry.getValue()).shortValue(); newIDFData.remove(orientationEntry); } int steps = degree / 90; for (int i = 0; i < steps; i++) { switch (orientation) { case TIFFBaseline.ORIENTATION_TOPLEFT: orientation = TIFFExtension.ORIENTATION_RIGHTTOP; break; case TIFFExtension.ORIENTATION_TOPRIGHT: orientation = TIFFExtension.ORIENTATION_RIGHTBOT; break; case TIFFExtension.ORIENTATION_BOTRIGHT: orientation = TIFFExtension.ORIENTATION_LEFTBOT; break; case TIFFExtension.ORIENTATION_BOTLEFT: orientation = TIFFExtension.ORIENTATION_LEFTTOP; break; case TIFFExtension.ORIENTATION_LEFTTOP: orientation = TIFFExtension.ORIENTATION_TOPRIGHT; break; case TIFFExtension.ORIENTATION_RIGHTTOP: orientation = TIFFExtension.ORIENTATION_BOTRIGHT; break; case TIFFExtension.ORIENTATION_RIGHTBOT: orientation = TIFFExtension.ORIENTATION_BOTLEFT; break; case TIFFExtension.ORIENTATION_LEFTBOT: orientation = TIFFBaseline.ORIENTATION_TOPLEFT; break; } } newIDFData.add(new TIFFEntry(TIFF.TAG_ORIENTATION, (short) orientation)); IFD = new AbstractDirectory(newIDFData) { }; }

Target:
public void rotate(int degree) { Validate.isTrue(degree % 90 == 0 && degree > 0 && degree < 360, "Only rotations by 90, 180 and 270 degree are supported"); ArrayList<Entry> newIDFData = new ArrayList<>(); Iterator<Entry> it = IFD.iterator(); while (it.hasNext()) { newIDFData.add(it.next()); } short orientation = TIFFBaseline.ORIENTATION_TOPLEFT; Entry orientationEntry = IFD.getEntryById(TIFF.TAG_ORIENTATION); if (orientationEntry != null) { orientation = ((Number) orientationEntry.getValue()).shortValue(); newIDFData.remove(orientationEntry); } int steps = degree / 90; for (int i = 0; i < steps; i++) { switch (orientation) { case TIFFBaseline.ORIENTATION_TOPLEFT: orientation = TIFFExtension.ORIENTATION_RIGHTTOP; break; case TIFFExtension.ORIENTATION_TOPRIGHT: orientation = TIFFExtension.ORIENTATION_RIGHTBOT; break; case TIFFExtension.ORIENTATION_BOTRIGHT: orientation = TIFFExtension.ORIENTATION_LEFTBOT; break; case TIFFExtension.ORIENTATION_BOTLEFT: orientation = TIFFExtension.ORIENTATION_LEFTTOP; break; case TIFFExtension.ORIENTATION_LEFTTOP: orientation = TIFFExtension.ORIENTATION_TOPRIGHT; break; case TIFFExtension.ORIENTATION_RIGHTTOP: orientation = TIFFExtension.ORIENTATION_BOTRIGHT; break; case TIFFExtension.ORIENTATION_RIGHTBOT: orientation = TIFFExtension.ORIENTATION_BOTLEFT; break; case TIFFExtension.ORIENTATION_LEFTBOT: orientation = TIFFBaseline.ORIENTATION_TOPLEFT; break; } } newIDFData.add(new TIFFEntry(TIFF.TAG_ORIENTATION, (short) orientation)); IFD = new IFD(newIDFData); }
Source:
public void setModelRepository(ModelRepository modelRepo) { this.modelRepo = modelRepo; modelRepo.addModelRepositoryChangeListener(this); refreshSitemapModels(); }

Target:
public void setModelRepository(ModelRepository modelRepo) { this.modelRepo = modelRepo; }
Source:
public void testMultipleScalingUnit() throws Exception { final int SCALING_UNITS = 3; Properties props = getNonBlockingRouterProperties(); props.setProperty("router.scaling.unit.count", Integer.toString(SCALING_UNITS)); VerifiableProperties verifiableProperties = new VerifiableProperties((props)); MockClusterMap mockClusterMap = new MockClusterMap(); MockTime mockTime = new MockTime(); router = new NonBlockingRouter(new RouterConfig(verifiableProperties), new NonBlockingRouterMetrics(new MetricRegistry()), new MockNetworkClientFactory(verifiableProperties, null, MAX_PORTS_PLAIN_TEXT, MAX_PORTS_SSL, CHECKOUT_TIMEOUT_MS, new MockServerLayout(mockClusterMap), mockTime), new LoggingNotificationSystem(), mockClusterMap, mockTime); assertExpectedThreadCounts(SCALING_UNITS); for (int i = 0; i < SCALING_UNITS * 10; i++) { BlobProperties putBlobProperties = new BlobProperties(100, "serviceId", "memberId", "contentType", false, Utils.Infinite_Time); byte[] putUserMetadata = new byte[10]; random.nextBytes(putUserMetadata); byte[] putContent = new byte[100]; random.nextBytes(putContent); ReadableStreamChannel putChannel = new ByteBufferReadableStreamChannel(ByteBuffer.wrap(putContent)); router.putBlob(putBlobProperties, putUserMetadata, putChannel).get(); } router.close(); assertExpectedThreadCounts(0); BlobProperties putBlobProperties = new BlobProperties(100, "serviceId", "memberId", "contentType", false, Utils.Infinite_Time); byte[] putUserMetadata = new byte[10]; random.nextBytes(putUserMetadata); byte[] putContent = new byte[100]; random.nextBytes(putContent); ReadableStreamChannel putChannel = new ByteBufferReadableStreamChannel(ByteBuffer.wrap(putContent)); Future<String> future = router.putBlob(putBlobProperties, putUserMetadata, putChannel); Assert.assertTrue(future.isDone()); RouterException e = (RouterException) ((FutureResult<String>) future).error(); Assert.assertEquals(e.getErrorCode(), RouterErrorCode.RouterClosed); }

Target:
public void testMultipleScalingUnit() throws Exception { final int SCALING_UNITS = 3; Properties props = getNonBlockingRouterProperties(); props.setProperty("router.scaling.unit.count", Integer.toString(SCALING_UNITS)); VerifiableProperties verifiableProperties = new VerifiableProperties((props)); MockClusterMap mockClusterMap = new MockClusterMap(); MockTime mockTime = new MockTime(); router = new NonBlockingRouter(new RouterConfig(verifiableProperties), new NonBlockingRouterMetrics(new MetricRegistry()), new MockNetworkClientFactory(verifiableProperties, null, MAX_PORTS_PLAIN_TEXT, MAX_PORTS_SSL, CHECKOUT_TIMEOUT_MS, new MockServerLayout(mockClusterMap), mockTime), new LoggingNotificationSystem(), mockClusterMap, mockTime); assertExpectedThreadCounts(SCALING_UNITS); for (int i = 0; i < SCALING_UNITS * 10; i++) { setOperationParams(); router.putBlob(putBlobProperties, putUserMetadata, putChannel).get(); } router.close(); assertExpectedThreadCounts(0); setOperationParams(); assertClosed(); }
Source:
public void advanceMapScrollSpeed() { mapScrollSpeed++; if(mapScrollSpeed > 10) { mapScrollSpeed = 1; } }

Target:
public void advanceMapScrollSpeed() { mapScrollSpeed++; if (mapScrollSpeed > 15) { mapScrollSpeed = 1; } }
Source:
public ModelAndView getQuestionsByCategory(@PathVariable String urlTag, @RequestParam(value = "index", defaultValue = "1", required = false) int index) { Tag tag; try { tag = Tag.valueOf(urlTag.toUpperCase()); } catch (Exception e) { ModelAndView modelAndView = new ModelAndView("error/404"); modelAndView.addObject("errorPage","true"); return modelAndView; } ModelAndView modelAndView = new ModelAndView("/question-category"); modelAndView.addObject("questions", questionService.findByTag(LoginUserInfo.getLoginName(), tag, index, 10)); modelAndView.addObject("tag", tag); return modelAndView; }

Target:
public ModelAndView getQuestionsByCategory(@PathVariable String urlTag, @RequestParam(value = "index", defaultValue = "1", required = false) int index) { Tag tag; try { tag = Tag.valueOf(urlTag.toUpperCase()); } catch (Exception e) { ModelAndView modelAndView = new ModelAndView("/error/404"); modelAndView.addObject("errorPage","true"); return modelAndView; } ModelAndView modelAndView = new ModelAndView("/question-category"); modelAndView.addObject("questions", questionService.findByTag(LoginUserInfo.getLoginName(), tag, index, 10)); modelAndView.addObject("tag", tag); return modelAndView; }
Source:
public void addGroupMember(String groupName, String member) { List<IPersonAttributesGroupDefinition> groups = personAttributesGroupDefinitionDao.getPersonAttributesGroupDefinitionByName(groupName); List<IPersonAttributesGroupDefinition> attemptingToAddMembers = personAttributesGroupDefinitionDao.getPersonAttributesGroupDefinitionByName(member); if (groups.isEmpty() || attemptingToAddMembers.isEmpty()) { throw new RuntimeException("Group: " + groupName + " or member: " + member + " does not exist"); } else { IPersonAttributesGroupDefinition group = groups.get(0); IPersonAttributesGroupDefinition attemptingToAddMember = attemptingToAddMembers.get(0); List<IPersonAttributesGroupDefinition> groupMembers = group.getMembers(); for (IPersonAttributesGroupDefinition groupMember : groupMembers) { if (groupMember.getName().equalsIgnoreCase(attemptingToAddMember.getName())) { return; } } groupMembers.add(attemptingToAddMember); group.setMembers(groupMembers); personAttributesGroupDefinitionDao.updatePersonAttributesGroupDefinition(group); } }

Target:
public void addGroupMember(String groupName, String member) { Set<IPersonAttributesGroupDefinition> groups = personAttributesGroupDefinitionDao.getPersonAttributesGroupDefinitionByName(groupName); Set<IPersonAttributesGroupDefinition> attemptingToAddMembers = personAttributesGroupDefinitionDao.getPersonAttributesGroupDefinitionByName(member); if (groups.isEmpty() || attemptingToAddMembers.isEmpty()) { throw new RuntimeException("Group: " + groupName + " or member: " + member + " does not exist"); } else { IPersonAttributesGroupDefinition group = groups.iterator().next(); IPersonAttributesGroupDefinition attemptingToAddMember = attemptingToAddMembers.iterator().next(); Set<IPersonAttributesGroupDefinition> groupMembers = group.getMembers(); for (IPersonAttributesGroupDefinition groupMember : groupMembers) { if (groupMember.getName().equalsIgnoreCase(attemptingToAddMember.getName())) { return; } } groupMembers.add(attemptingToAddMember); group.setMembers(groupMembers); personAttributesGroupDefinitionDao.updatePersonAttributesGroupDefinition(group); } }
Source:
private void parseFeed(Repository repository, PackageFeed packageFeed) throws IOException { String repositoryId = repository.getId(); String storageId = repository.getStorage().getId(); ArtifactTag lastVersionTag = artifactTagService.findOneOrCreate(ArtifactTagEntry.LAST_VERSION); Set<ArtifactEntry> artifactToSaveSet = new HashSet<>(); for (PackageVersion packageVersion : packageFeed.getVersions().getAdditionalProperties().values()) { RemoteArtifactEntry remoteArtifactEntry = parseVersion(storageId, repositoryId, packageVersion); if (remoteArtifactEntry == null) { continue; } if (packageVersion.getVersion().equals(packageFeed.getDistTags().getLatest())) { remoteArtifactEntry.getTagSet().add(lastVersionTag); } artifactToSaveSet.add(remoteArtifactEntry); } for (ArtifactEntry e : artifactToSaveSet) { RepositoryPath repositoryPath = repositoryPathResolver.resolve(repository).resolve(e); saveAritafctEntry(repositoryPath); } }

Target:
private void parseFeed(Repository repository, PackageFeed packageFeed) { try { parseFeedTransactional(repository, packageFeed); } catch (Exception e) { logger.error(String.format("Failed to parse NPM feed [%s/%s]", repository.getRemoteRepository().getUrl(), packageFeed.getName()), e); } }
Source:
@NotNull @Override public Iterator<Integer> iterator() { return new Iterator<Integer>() { private int idx = -1; @Override public boolean hasNext() { return bitSet.nextSetBit(idx + 1) != -1; } @Override public Integer next() { int nextIdx = bitSet.nextSetBit(idx + 1); if (nextIdx == -1) throw new NoSuchElementException(); idx = nextIdx; return idx; } }; }

Target:
@NotNull @Override public Iterator<Integer> iterator() { return new Iterator<Integer>() { private int idx = -1; private int nextIdx = -1; @Override public boolean hasNext() { return nextIdx == idx ? (nextIdx = bitSet.nextSetBit(idx + 1)) != -1 : nextIdx != -1; } @Override public Integer next() { if (nextIdx == idx) nextIdx = bitSet.nextSetBit(idx + 1); if (nextIdx == -1) throw new NoSuchElementException(); idx = nextIdx; return idx; } }; }
Source:
private void createConnectionPool(String url, String user, String propertyKey, Properties properties) throws SQLException, ClassNotFoundException, IOException { String driverClass = properties.getProperty(DRIVER_KEY); if (driverClass != null && (driverClass.equals("com.facebook.presto.jdbc.PrestoDriver") || driverClass.equals("io.prestosql.jdbc.PrestoDriver"))) { Properties newProperties = new Properties(); try { Class clazz = null; try { clazz = Class.forName("com.facebook.presto.jdbc.ConnectionProperties"); } catch (ClassNotFoundException e) { clazz = Class.forName("io.prestosql.jdbc.ConnectionProperties"); } Method lookUpKeyMethod = clazz.getMethod("forKey", String.class); lookUpKeyMethod.setAccessible(true); for (Object key : properties.keySet()) { if (lookUpKeyMethod.invoke(null, key.toString()) != null) { newProperties.put(key, properties.get(key)); } } properties = newProperties; } catch (Throwable e) { throw new IOException("Fail to create properties for presto", e); } } ConnectionFactory connectionFactory = new DriverManagerConnectionFactory(url, properties); PoolableConnectionFactory poolableConnectionFactory = new PoolableConnectionFactory( connectionFactory, null); final String maxConnectionLifetime = StringUtils.defaultIfEmpty(getProperty("zeppelin.jdbc.maxConnLifetime"), "-1"); poolableConnectionFactory.setMaxConnLifetimeMillis(Long.parseLong(maxConnectionLifetime)); poolableConnectionFactory.setValidationQuery("show databases"); ObjectPool connectionPool = new GenericObjectPool(poolableConnectionFactory); poolableConnectionFactory.setPool(connectionPool); Class.forName(driverClass); PoolingDriver driver = new PoolingDriver(); driver.registerPool(propertyKey + user, connectionPool); getJDBCConfiguration(user).saveDBDriverPool(propertyKey, driver); }

Target:
private void createConnectionPool(String url, String user, String propertyKey, Properties properties) throws SQLException, ClassNotFoundException, IOException { String driverClass = properties.getProperty(DRIVER_KEY); if (driverClass != null && (driverClass.equals("com.facebook.presto.jdbc.PrestoDriver") || driverClass.equals("io.prestosql.jdbc.PrestoDriver"))) { for (Object key : properties.keySet()) { if (!PRESTO_PROPERTIES.contains(key.toString())) { properties.remove(key); } } } ConnectionFactory connectionFactory = new DriverManagerConnectionFactory(url, properties); PoolableConnectionFactory poolableConnectionFactory = new PoolableConnectionFactory( connectionFactory, null); final String maxConnectionLifetime = StringUtils.defaultIfEmpty(getProperty("zeppelin.jdbc.maxConnLifetime"), "-1"); poolableConnectionFactory.setMaxConnLifetimeMillis(Long.parseLong(maxConnectionLifetime)); poolableConnectionFactory.setValidationQuery("show databases"); ObjectPool connectionPool = new GenericObjectPool(poolableConnectionFactory); poolableConnectionFactory.setPool(connectionPool); Class.forName(driverClass); PoolingDriver driver = new PoolingDriver(); driver.registerPool(propertyKey + user, connectionPool); getJDBCConfiguration(user).saveDBDriverPool(propertyKey, driver); }
Source:
public Client(Context androidContext, String apiKey, boolean enableExceptionHandler) { if(androidContext == null) { throw new NullPointerException("You must provide a non-null android Context"); } appContext = androidContext.getApplicationContext(); try { ApplicationInfo ai = appContext.getPackageManager().getApplicationInfo(appContext.getPackageName(), PackageManager.GET_META_DATA); String manifestApiKey = ai.metaData.getString("com.bugsnag.android.API_KEY"); if(!TextUtils.isEmpty(manifestApiKey)) { apiKey = manifestApiKey; } } catch (Exception e) { } if(apiKey == null) { throw new NullPointerException("You must provide a Bugsnag API key"); } config = new Configuration(apiKey); appData = new AppData(appContext, config); deviceData = new DeviceData(appContext); AppState.init(); breadcrumbs = new Breadcrumbs(); setProjectPackages(appContext.getPackageName()); setUserId(deviceData.getUserId()); errorStore = new ErrorStore(config, appContext); if(enableExceptionHandler) { enableExceptionHandler(); } errorStore.flush(); }

Target:
public Client(Context androidContext, String apiKey, boolean enableExceptionHandler) { if(androidContext == null) { throw new NullPointerException("You must provide a non-null android Context"); } appContext = androidContext.getApplicationContext(); if (TextUtils.isEmpty(apiKey)) { try { ApplicationInfo ai = appContext.getPackageManager().getApplicationInfo(appContext.getPackageName(), PackageManager.GET_META_DATA); apiKey = ai.metaData.getString("com.bugsnag.android.API_KEY"); } catch (Exception e) { } } if(apiKey == null) { throw new NullPointerException("You must provide a Bugsnag API key"); } config = new Configuration(apiKey); appData = new AppData(appContext, config); deviceData = new DeviceData(appContext); AppState.init(); breadcrumbs = new Breadcrumbs(); setProjectPackages(appContext.getPackageName()); setUserId(deviceData.getUserId()); errorStore = new ErrorStore(config, appContext); if(enableExceptionHandler) { enableExceptionHandler(); } errorStore.flush(); }
Source:
private static RexNode isDistinctFromInternal( RexBuilder rexBuilder, RexNode x, RexNode y, boolean neg) { SqlOperator nullOp; SqlOperator eqOp; if (neg) { nullOp = SqlStdOperatorTable.IS_NULL; eqOp = SqlStdOperatorTable.EQUALS; } else { nullOp = SqlStdOperatorTable.IS_NOT_NULL; eqOp = SqlStdOperatorTable.NOT_EQUALS; } RexNode[] whenThenElse = { rexBuilder.makeCall(SqlStdOperatorTable.IS_NULL, x), rexBuilder.makeCall(nullOp, y), rexBuilder.makeCall(SqlStdOperatorTable.IS_NULL, y), rexBuilder.makeCall(nullOp, x), rexBuilder.makeCall(SqlStdOperatorTable.IS_TRUE, rexBuilder.makeCall(eqOp, x, y)) }; return rexBuilder.makeCall( SqlStdOperatorTable.CASE, whenThenElse); }

Target:
private static RexNode isDistinctFromInternal( RexBuilder rexBuilder, RexNode x, RexNode y, boolean neg) { if (neg) { return rexBuilder.makeCall(SqlStdOperatorTable.OR, rexBuilder.makeCall(SqlStdOperatorTable.AND, rexBuilder.makeCall(SqlStdOperatorTable.IS_NULL, x), rexBuilder.makeCall(SqlStdOperatorTable.IS_NULL, y)), rexBuilder.makeCall(SqlStdOperatorTable.IS_TRUE, rexBuilder.makeCall(SqlStdOperatorTable.EQUALS, x, y))); } else { return rexBuilder.makeCall(SqlStdOperatorTable.AND, rexBuilder.makeCall(SqlStdOperatorTable.OR, rexBuilder.makeCall(SqlStdOperatorTable.IS_NOT_NULL, x), rexBuilder.makeCall(SqlStdOperatorTable.IS_NOT_NULL, y)), rexBuilder.makeCall(SqlStdOperatorTable.IS_NOT_TRUE, rexBuilder.makeCall(SqlStdOperatorTable.EQUALS, x, y))); } }
Source:
public PushPartitionIntoTableSourceScanRule() { super(operand(Filter.class, operand(LogicalTableScan.class, none())), "PushPartitionTableSourceScanRule"); }

Target:
public PushPartitionIntoTableSourceScanRule() { super(operand(Filter.class, operand(LogicalTableScan.class, none())), "PushPartitionIntoTableSourceScanRule"); }
Source:
protected Sku determineSku(Product product, Long skuId, Map<String, String> attributeValues, ActivityMessages messages) throws InventoryUnavailableException { Sku sku = null; if (!useSku) { sku = findMatchingSku(product, attributeValues, messages); } if (sku == null && skuId != null) { sku = catalogService.findSkuById(skuId); } if (sku == null && product != null) { if (cannotSellDefaultSku(product)) { throw new InventoryUnavailableException("Sku is not Available"); } else { sku = product.getDefaultSku(); } } return sku; }

Target:
protected Sku determineSku(Product product, Long skuId, Map<String, String> attributeValues, ActivityMessages messages) { Sku sku = null; if (!useSku) { sku = findMatchingSku(product, attributeValues, messages); } if (sku == null && skuId != null) { sku = catalogService.findSkuById(skuId); } if (sku == null && product != null) { if (cannotSellDefaultSku(product)) { throw new SkuNotAvailableException("Sku is not Available"); } else { sku = product.getDefaultSku(); } } return sku; }
Source:
public void create(final String identifier, final ServerSideConfiguration config) throws EntityAlreadyExistsException, ClusterTierManagerCreationException, EntityBusyException, TimeoutException { Hold existingMaintenance = maintenanceHolds.get(identifier); Hold localMaintenance = null; if (existingMaintenance == null) { localMaintenance = createAccessLockFor(identifier).tryWriteLock(); } if (existingMaintenance == null && localMaintenance == null) { throw new EntityBusyException("Unable to create cluster tier manager for id " + identifier + ": another client owns the maintenance lease"); } boolean finished = false; try { EntityRef<ClusterTierManagerClientEntity, ClusterTierManagerConfiguration, Void> ref = getEntityRef(identifier); try { while (true) { ref.create(new ClusterTierManagerConfiguration(identifier, config)); try { ClusterTierManagerClientEntity entity = ref.fetchEntity(null); try { finished = true; return; } finally { if (finished) { entity.close(); } else { silentlyClose(entity, identifier); } } } catch (EntityNotFoundException e) { } } } catch (EntityConfigurationException e) { throw new ClusterTierManagerCreationException("Unable to configure cluster tier manager for id " + identifier, e); } catch (EntityNotProvidedException | EntityVersionMismatchException e) { LOGGER.error("Unable to create cluster tier manager for id {}", identifier, e); throw new AssertionError(e); } } finally { if (localMaintenance != null) { if (finished) { localMaintenance.unlock(); } else { silentlyUnlock(localMaintenance, identifier); } } } }

Target:
public void create(final String identifier, final ServerSideConfiguration config) throws EntityAlreadyExistsException, ClusterTierManagerCreationException, EntityBusyException { Hold existingMaintenance = maintenanceHolds.get(identifier); try(Hold localMaintenance = (existingMaintenance == null ? createAccessLockFor(identifier).tryWriteLock() : null)) { if (localMaintenance == null && existingMaintenance == null) { throw new EntityBusyException("Unable to obtain maintenance lease for " + identifier); } EntityRef<ClusterTierManagerClientEntity, ClusterTierManagerConfiguration, Void> ref = getEntityRef(identifier); try { ref.create(new ClusterTierManagerConfiguration(identifier, config)); } catch (EntityConfigurationException e) { throw new ClusterTierManagerCreationException("Unable to configure cluster tier manager for id " + identifier, e); } catch (EntityNotProvidedException | EntityVersionMismatchException e) { LOGGER.error("Unable to create cluster tier manager for id {}", identifier, e); throw new AssertionError(e); } } }
Source:
private void assertCloudVersionRevisionResponseListWithExpectedValues(List<CloudVersionRevisionResponse> cloudVersionRevisionResponseList) throws MCSException { assertNotNull(cloudVersionRevisionResponseList); assertEquals(cloudVersionRevisionResponseList.size(), RECORDS_NUMBERS * 2); int sourceVersionsCount = 0; int destinationVersionCount = 0; String sourceRevisionId = RevisionUtils.getRevisionKey(SOURCE_PROVIDER_ID, SOURCE_REVISION_NAME); String destinationRevisionId = RevisionUtils.getRevisionKey(DESTINATION_PROVIDER_ID, DESTINATION_REVISION_NAME); for (CloudVersionRevisionResponse cloudVersionRevisionResponse : cloudVersionRevisionResponseList) { if (sourceRevisionId.equals(cloudVersionRevisionResponse.getRevisionId())) sourceVersionsCount++; if (destinationRevisionId.equals(cloudVersionRevisionResponse.getRevisionId())) destinationVersionCount++; } assertEquals(sourceVersionsCount, 3); assertEquals(destinationVersionCount, 3); }

Target:
private void assertCloudVersionRevisionResponseListWithExpectedValues(List<CloudVersionRevisionResponse> cloudVersionRevisionResponseList) throws MCSException { assertNotNull(cloudVersionRevisionResponseList); assertEquals(cloudVersionRevisionResponseList.size(), RECORDS_NUMBERS * 2); int sourceVersionsCount = 0; int destinationVersionCount = 0; String sourceRevisionId = RevisionUtils.getRevisionKey(SOURCE_PROVIDER_ID, SOURCE_REVISION_NAME); String destinationRevisionId = RevisionUtils.getRevisionKey(DESTINATION_PROVIDER_ID, DESTINATION_REVISION_NAME); for (CloudVersionRevisionResponse cloudVersionRevisionResponse : cloudVersionRevisionResponseList) { if (sourceRevisionId.equals(cloudVersionRevisionResponse.getRevisionId())) sourceVersionsCount++; else if (destinationRevisionId.equals(cloudVersionRevisionResponse.getRevisionId())) destinationVersionCount++; } assertEquals(sourceVersionsCount, 3); assertEquals(destinationVersionCount, 3); }
Source:
public void bufferReceived(Object connectionID, ActiveMQBuffer buffer) { super.bufferReceived(connectionID, buffer); try { Command command = (Command) inWireFormat.unmarshal(buffer); if (logger.isTraceEnabled()) { traceBufferReceived(connectionID, command); } if (AuditLogger.isAnyLoggingEnabled()) { AuditLogger.setRemoteAddress(getRemoteAddress()); } if (openWireActor != null) { openWireActor.act(command); } else { act(command); } } catch (Exception e) { ActiveMQServerLogger.LOGGER.debug(e); sendException(e); } }

Target:
public void bufferReceived(Object connectionID, ActiveMQBuffer buffer) { super.bufferReceived(connectionID, buffer); try { Command command = (Command) inWireFormat.unmarshal(buffer); if (logger.isTraceEnabled()) { traceBufferReceived(connectionID, command); } if (openWireActor != null) { openWireActor.act(command); } else { act(command); } } catch (Exception e) { ActiveMQServerLogger.LOGGER.debug(e); sendException(e); } }
Source:
public void deleteRelationFromCatalog(final RelationKey relationKey) throws CatalogException { if (isClosed) { throw new CatalogException("Catalog is closed."); } try { queue.execute(new SQLiteJob<Void>() { @Override protected Void job(final SQLiteConnection sqliteConnection) throws CatalogException, SQLiteException { sqliteConnection.exec("BEGIN TRANSACTION;"); try { deleteRelationIfExists(sqliteConnection, relationKey); sqliteConnection.exec("COMMIT TRANSACTION;"); } catch (SQLiteException e) { try { sqliteConnection.exec("ROLLBACK TRANSACTION;"); } catch (SQLiteException e2) { assert true; } throw e; } return null; } }).get(); } catch (InterruptedException | ExecutionException e) { throw new CatalogException(e); } }

Target:
public void deleteRelationFromCatalog(final RelationKey relationKey) throws CatalogException { if (isClosed) { throw new CatalogException("Catalog is closed."); } try { queue.execute(new SQLiteJob<Void>() { @Override protected Void job(final SQLiteConnection sqliteConnection) throws CatalogException, SQLiteException { sqliteConnection.exec("BEGIN TRANSACTION;"); try { deleteRelationIfExists(sqliteConnection, relationKey); sqliteConnection.exec("COMMIT TRANSACTION;"); } catch (SQLiteException e) { try { sqliteConnection.exec("ROLLBACK TRANSACTION;"); } catch (SQLiteException e2) { LOGGER.error("exception was thrown during transaction rollback ", e2); assert true; } throw e; } return null; } }).get(); } catch (InterruptedException | ExecutionException e) { throw new CatalogException(e); } }