auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void onClickToken(View v) { Log.v(TAG, "token button is clicked"); mLoginProgressDialog.show(); mAuthContext.acquireToken(MainActivity.this, Constants.RESOURCE_ID, Constants.CLIENT_ID, Constants.REDIRECT_URL, Constants.USER_HINT, new AuthenticationCallback<AuthenticationResult>() { @Override public void onError(Exception exc) { if (mLoginProgressDialog.isShowing()) { mLoginProgressDialog.dismiss(); } Toast.makeText(getApplicationContext(), TAG + "getToken Error:" + exc.getMessage(), Toast.LENGTH_SHORT) .show(); } @Override public void onSuccess(AuthenticationResult result) { if (mLoginProgressDialog.isShowing()) { mLoginProgressDialog.dismiss(); } if (result != null && !result.getAccessToken().isEmpty()) { mResult = result; Toast.makeText(getApplicationContext(), "Token is returned", Toast.LENGTH_SHORT).show(); } else { Toast.makeText(getApplicationContext(), "Token is NOT returned", Toast.LENGTH_SHORT).show(); } } }); }

Target:
public void onClickToken(View v) { Log.v(TAG, "token button is clicked"); mLoginProgressDialog.show(); mAuthContext.acquireToken(MainActivity.this, Constants.RESOURCE_ID, Constants.CLIENT_ID, Constants.REDIRECT_URL, Constants.USER_HINT, new AuthenticationCallback<AuthenticationResult>() { @Override public void onError(Exception exc) { if (mLoginProgressDialog.isShowing()) { mLoginProgressDialog.dismiss(); } Toast.makeText(getApplicationContext(), TAG + "getToken Error:" + exc.getMessage(), Toast.LENGTH_SHORT).show(); } @Override public void onSuccess(AuthenticationResult result) { if (mLoginProgressDialog.isShowing()) { mLoginProgressDialog.dismiss(); } mResult = result; Toast.makeText(getApplicationContext(), "Token is returned", Toast.LENGTH_SHORT) .show(); } }); }
Source:
private void createAssignment() { ResourceAssignment newAssignment = myMutator.addAssignment(myHumanResource); newAssignment.setLoad(100); boolean coord = false; if (myAssignments.isEmpty()) coord = true; newAssignment.setCoordinator(coord); newAssignment.setRoleForAssignment(newAssignment.getResource().getRole()); myAssignments.add(newAssignment); }

Target:
private void createAssignment() { ResourceAssignmentMutator mutator = myTask.getAssignmentCollection().createMutator(); ResourceAssignment newAssignment = mutator.addAssignment(myHumanResource); newAssignment.setLoad(100); newAssignment.setRoleForAssignment(newAssignment.getResource().getRole()); mutator.commit(); }
Source:
protected void handleError(final Exception e, final String correlationUid, final String organisationIdentification, final String deviceIdentification, final String messageType) { LOGGER.info("handeling error: for message type: {}", e.getMessage(), messageType); OsgpException osgpException = null; if (e instanceof OsgpException) { osgpException = (OsgpException) e; } else { osgpException = new TechnicalException(ComponentType.DOMAIN_CORE, "An unknown error occurred", e); } this.webServiceResponseMessageSender.send(ResponseMessage.newResponseMessageBuilder() .withCorrelationUid(correlationUid).withOrganisationIdentification(organisationIdentification) .withDeviceIdentification(deviceIdentification).withResult(ResponseMessageResultType.NOT_OK) .withOsgpException(osgpException).withDataObject(e).build()); }

Target:
protected void handleError(final Exception e, final String correlationUid, final String organisationIdentification, final String deviceIdentification, final String messageType) { LOGGER.info("handeling error: for message type: {}", e.getMessage(), messageType); OsgpException osgpException = null; if (e instanceof OsgpException) { osgpException = (OsgpException) e; } else { osgpException = new TechnicalException(ComponentType.DOMAIN_CORE, "An unknown error occurred", e); } ResponseMessage responseMessage = ResponseMessage.newResponseMessageBuilder() .withCorrelationUid(correlationUid).withOrganisationIdentification(organisationIdentification) .withDeviceIdentification(deviceIdentification).withResult(ResponseMessageResultType.NOT_OK) .withOsgpException(osgpException).withDataObject(e).build(); this.webServiceResponseMessageSender.send(responseMessage); }
Source:
private void initData(Style fullyLoadedStyle, @NonNull FeatureCollection featureCollection) { routeCoordinateList = ((LineString) featureCollection.features().get(0).geometry()).coordinates(); if (mapboxMap != null) { initSources(fullyLoadedStyle, featureCollection); initSymbolLayer(fullyLoadedStyle); initDotLinePath(fullyLoadedStyle); animate(); } }

Target:
private void initData(Style fullyLoadedStyle, @NonNull FeatureCollection featureCollection) { routeCoordinateList = ((LineString) featureCollection.features().get(0).geometry()).coordinates(); initSources(fullyLoadedStyle, featureCollection); initSymbolLayer(fullyLoadedStyle); initDotLinePath(fullyLoadedStyle); animate(); }
Source:
public QueryStringEncoder(String uri, Charset charset) { uriBuilder = new StringBuilder(uri); this.charset = charset; }

Target:
public QueryStringEncoder(String uri, Charset charset) { ObjectUtil.checkNotNull(charset, "charset"); uriBuilder = new StringBuilder(uri); this.charset = CharsetUtil.UTF_8.equals(charset) ? null : charset; }
Source:
public void testScripts() throws Exception { EventService service; URL url = EventListenerTest.class.getClassLoader().getResource("test-listeners.xml"); deployTestContrib("org.nuxeo.ecm.core.event", url); applyInlineDeployments(); service = Framework.getService(EventService.class); assertEquals(0, SCRIPT_CNT); service.fireEvent("test", new EventContextImpl(null, null)); assertEquals(1, SCRIPT_CNT); removeInlineDeployments(); service = Framework.getService(EventService.class); assertEquals(1, SCRIPT_CNT); service.fireEvent("test", new EventContextImpl(null, null)); assertEquals(1, SCRIPT_CNT); deployTestContrib("org.nuxeo.ecm.core.event", url); applyInlineDeployments(); service = Framework.getService(EventService.class); service.fireEvent("test1", new EventContextImpl(null, null)); assertEquals(2, SCRIPT_CNT); service.fireEvent("some-event", new EventContextImpl(null, null)); assertEquals(2, SCRIPT_CNT); }

Target:
public void testScripts() throws Exception { EventService service; pushInlineDeployments("org.nuxeo.ecm.core.event:test-listeners.xml"); service = Framework.getService(EventService.class); assertEquals(0, SCRIPT_CNT); service.fireEvent("test", new EventContextImpl(null, null)); assertEquals(1, SCRIPT_CNT); removeInlineDeployments(); service = Framework.getService(EventService.class); assertEquals(1, SCRIPT_CNT); service.fireEvent("test", new EventContextImpl(null, null)); assertEquals(1, SCRIPT_CNT); pushInlineDeployments("org.nuxeo.ecm.core.event:test-listeners.xml"); service = Framework.getService(EventService.class); service.fireEvent("test1", new EventContextImpl(null, null)); assertEquals(2, SCRIPT_CNT); service.fireEvent("some-event", new EventContextImpl(null, null)); assertEquals(2, SCRIPT_CNT); }
Source:
public Object exec(Tuple input) throws IOException { if (input.size() == 0) { throw new RuntimeException("Expected at least one parameter"); } for (Object o : input) { if (o != null) { return o; } } return null; }

Target:
public Object exec(Tuple input) throws IOException { if (input == null || input.size() == 0) { return null; } for (Object o : input) { if (o != null) { return o; } } return null; }
Source:
private void fillContactDataFromCursor(Cursor cursor, ArrayList<Recipient> recipients, HashMap<String, Recipient> recipientMap) { cursor.moveToFirst(); while (!cursor.isAfterLast()) { String name = cursor.getString(INDEX_NAME); String email = cursor.getString(INDEX_EMAIL); long contactId = cursor.getLong(INDEX_CONTACT_ID); if (recipientMap.containsKey(email)) { cursor.moveToNext(); continue; } Uri photoUri = cursor.isNull(INDEX_PHOTO_URI) ? null : Uri.parse(cursor.getString(INDEX_PHOTO_URI)); Recipient recipient = new Recipient(name, email, contactId); recipient.photoThumbnailUri = photoUri; recipientMap.put(email, recipient); recipients.add(recipient); cursor.moveToNext(); } cursor.close(); }

Target:
private void fillContactDataFromCursor(Cursor cursor, ArrayList<Recipient> recipients, HashMap<String, Recipient> recipientMap) { while (cursor.moveToNext()) { String name = cursor.getString(INDEX_NAME); String email = cursor.getString(INDEX_EMAIL); long contactId = cursor.getLong(INDEX_CONTACT_ID); String lookupKey = cursor.getString(INDEX_LOOKUP_KEY); if (recipientMap.containsKey(email)) { continue; } int addressType = cursor.getInt(INDEX_EMAIL_TYPE); String addressLabel = null; switch (addressType) { case ContactsContract.CommonDataKinds.Email.TYPE_HOME: addressLabel = getContext().getString(R.string.address_type_home); break; case ContactsContract.CommonDataKinds.Email.TYPE_WORK: addressLabel = getContext().getString(R.string.address_type_work); break; case ContactsContract.CommonDataKinds.Email.TYPE_OTHER: addressLabel = getContext().getString(R.string.address_type_other); break; case ContactsContract.CommonDataKinds.Email.TYPE_MOBILE: addressLabel = getContext().getString(R.string.address_type_mobile); break; case ContactsContract.CommonDataKinds.Email.TYPE_CUSTOM: addressLabel = cursor.getString(INDEX_EMAIL_CUSTOM_LABEL); break; } Uri photoUri = cursor.isNull(INDEX_PHOTO_URI) ? null : Uri.parse(cursor.getString(INDEX_PHOTO_URI)); Recipient recipient = new Recipient(name, email, addressLabel, contactId, lookupKey); recipient.photoThumbnailUri = photoUri; recipientMap.put(email, recipient); recipients.add(recipient); } cursor.close(); }
Source:
protected boolean validate() { if (!super.validate()) { return false; } macPool = getMacPool(); Map<Guid, StorageDomain> domainsMap = new HashMap<>(); if (!validateBeforeCloneVm(domainsMap)) { return false; } if (getParameters().isImportAsNewEntity()) { initImportClonedVm(); if (getVm().getInterfaces().size() > macPool.getAvailableMacsCount()) { return failValidation(EngineMessage.MAC_POOL_NOT_ENOUGH_MAC_ADDRESSES); } } if (!validateBallonDevice()) { return false; } if (!validateSoundDevice()) { return false; } if (!validate(VmHandler.validateMaxMemorySize(getVmTemplate(), getEffectiveCompatibilityVersion()))) { return false; } return validateAfterCloneVm(domainsMap); }

Target:
protected boolean validate() { if (!super.validate()) { return false; } macPool = getMacPool(); Map<Guid, StorageDomain> domainsMap = new HashMap<>(); if (!validateBeforeCloneVm(domainsMap)) { return false; } VmHandler.updateMaxMemorySize(getVm().getStaticData(), getEffectiveCompatibilityVersion()); if (getParameters().isImportAsNewEntity()) { initImportClonedVm(); if (getVm().getInterfaces().size() > macPool.getAvailableMacsCount()) { return failValidation(EngineMessage.MAC_POOL_NOT_ENOUGH_MAC_ADDRESSES); } } if (!validateBallonDevice()) { return false; } if (!validateSoundDevice()) { return false; } if (!validate(VmHandler.validateMaxMemorySize(getVm().getStaticData(), getEffectiveCompatibilityVersion()))) { return false; } return validateAfterCloneVm(domainsMap); }
Source:
private static long getRecordRange(String query) throws SQLException { long rowCount = 0; Connection dbConnection = null; PreparedStatement preparedStatement = null; try { dbConnection = getDBConnection(); preparedStatement = dbConnection.prepareStatement(query); ResultSet rs = preparedStatement.executeQuery(); while (rs.next()) { rowCount = Long.parseLong(rs.getString("RowCount")); LOG.info("# Rows - " + rowCount); } } catch (SQLException e) { LOG.error("Exception in retreiving result set", e); } finally { if (preparedStatement != null) { preparedStatement.close(); } if (dbConnection != null) { dbConnection.close(); } } return rowCount; }

Target:
private static long getRecordRange(String query) throws SQLException { long rowCount = 0; Connection dbConnection = null; PreparedStatement preparedStatement = null; try { dbConnection = getDBConnection(); preparedStatement = dbConnection.prepareStatement(query); ResultSet rs = preparedStatement.executeQuery(); while (rs.next()) { rowCount = Long.parseLong(rs.getString(1)); LOG.debug("# Rows - " + rowCount); } } catch (SQLException e) { LOG.error("Exception in retreiving result set", e); throw new RuntimeException(e); } finally { if (preparedStatement != null) { preparedStatement.close(); } if (dbConnection != null) { dbConnection.close(); } } return rowCount; }
Source:
public Serializable parseDate(Serializable value) { if (value == null) { return null; } if (value instanceof Date) { return ((Date) value).toInstant().toString(); } if (value instanceof Long) { return Instant.ofEpochMilli((Long) value); } if (!(value instanceof String)) { return null; } if (StringUtils.isEmpty(value)) { return null; } String string = String.valueOf(value); SimpleDateFormat dateFormat; if (boonDefault.matcher(string).matches()) { dateFormat = new SimpleDateFormat("EEE MMM d HH:mm:ss zzz yyyy"); } else if (iso8601.matcher(string).matches()) { dateFormat = new SimpleDateFormat(ISO_8601_DATE_FORMAT); } else { dateFormat = new SimpleDateFormat(); } dateFormat.setTimeZone(TimeZone.getTimeZone("UTC")); try { return dateFormat.parse(value.toString()); } catch (ParseException e) { throw new IllegalArgumentException(e); } }

Target:
public Serializable parseDate(Serializable value) { if (value == null) { return null; } if (value instanceof Date) { return ((Date) value).toInstant().toString(); } if (value instanceof Long) { return Instant.ofEpochMilli((Long) value); } if (!(value instanceof String)) { return null; } if (StringUtils.isEmpty((String) value)) { return null; } String string = String.valueOf(value); SimpleDateFormat dateFormat; if (boonDefault.matcher(string).matches()) { dateFormat = new SimpleDateFormat("EEE MMM d HH:mm:ss zzz yyyy"); } else if (iso8601.matcher(string).matches()) { dateFormat = new SimpleDateFormat(ISO_8601_DATE_FORMAT); } else { dateFormat = new SimpleDateFormat(); } dateFormat.setTimeZone(TimeZone.getTimeZone("UTC")); try { return dateFormat.parse(value.toString()); } catch (ParseException e) { throw new IllegalArgumentException(e); } }
Source:
void encode(final ByteBuf out) { final int expectedLength = RntbdRequestFrame.LENGTH + this.headers.computeLength(); checkState(out.readerIndex() == out.writerIndex()); final int start = out.writerIndex(); out.writeIntLE(expectedLength); this.frame.encode(out); this.headers.encode(out); checkState(out.writerIndex() - start == expectedLength, "encoding error: {\"expectedLength\": %s, \"observedLength\": %s}", expectedLength, out.writerIndex() - expectedLength); if (this.payload.length > 0) { out.writeIntLE(this.payload.length); out.writeBytes(this.payload); } }

Target:
void encode(final ByteBuf out) { final int expectedLength = RntbdRequestFrame.LENGTH + this.headers.computeLength(); final int start = out.writerIndex(); out.writeIntLE(expectedLength); this.frame.encode(out); this.headers.encode(out); checkState(out.writerIndex() - start == expectedLength, "encoding error: {\"expectedLength\": %s, \"observedLength\": %s}", expectedLength, out.writerIndex() - expectedLength); if (this.payload.length > 0) { out.writeIntLE(this.payload.length); out.writeBytes(this.payload); } }
Source:
public void handleFlush(Object input) { TreeNodeCompareInput treeNodeCompareInput = (TreeNodeCompareInput)input; EObject eobject = treeNodeCompareInput.getComparisonObject(); Comparison comparison; if (eobject instanceof Match) { comparison = ((Match)eobject).getComparison(); } else if (eobject instanceof Diff) { comparison = ((Diff)eobject).getMatch().getComparison(); } else if (eobject instanceof MatchResource) { comparison = ((MatchResource)eobject).getComparison(); } else { return; } boolean unresolved = false; EList<Conflict> conflicts = comparison.getConflicts(); outer: for (Conflict conflict : conflicts) { if (conflict.getKind() != ConflictKind.PSEUDO) { for (Diff diff : conflict.getDifferences()) { if (diff.getState() == DifferenceState.UNRESOLVED) { unresolved = true; break outer; } } } } if (!unresolved) { mergeResolutionListenerRegistry.mergeResolutionCompleted(comparison); } return; }

Target:
public void handleFlush(Object input) { TreeNodeCompareInput treeNodeCompareInput = (TreeNodeCompareInput)input; EObject eobject = treeNodeCompareInput.getComparisonObject(); Comparison comparison; if (eobject instanceof Match) { comparison = ((Match)eobject).getComparison(); } else if (eobject instanceof Diff) { comparison = ((Diff)eobject).getMatch().getComparison(); } else if (eobject instanceof MatchResource) { comparison = ((MatchResource)eobject).getComparison(); } else { return; } Predicate<Conflict> unresolvedConflict = new Predicate<Conflict>() { public boolean apply(Conflict conflict) { return conflict != null && conflict.getKind() != ConflictKind.PSEUDO && Iterables.any(conflict.getDifferences(), EMFComparePredicates .hasState(DifferenceState.UNRESOLVED)); } }; if (Iterables.any(comparison.getConflicts(), unresolvedConflict)) { mergeResolutionListenerRegistry.mergeResolutionCompleted(comparison); } }
Source:
private ArrayList<GenericColumnSerializer> setupMetricsWriters( final SegmentWriteOutMedium segmentWriteOutMedium, final List<String> mergedMetrics, final Map<String, ValueType> metricsValueTypes, final Map<String, String> metricTypeNames, final IndexSpec indexSpec ) throws IOException { ArrayList<GenericColumnSerializer> metWriters = Lists.newArrayListWithCapacity(mergedMetrics.size()); final CompressionStrategy metCompression = indexSpec.getMetricCompression(); final CompressionFactory.LongEncodingStrategy longEncoding = indexSpec.getLongEncoding(); for (String metric : mergedMetrics) { ValueType type = metricsValueTypes.get(metric); GenericColumnSerializer writer; switch (type) { case LONG: writer = createLongColumnSerializer(segmentWriteOutMedium, metric, metCompression, longEncoding, indexSpec); break; case FLOAT: writer = createFloatColumnSerializer(segmentWriteOutMedium, metric, metCompression, indexSpec); break; case DOUBLE: writer = createDoubleColumnSerializer(segmentWriteOutMedium, metric, metCompression, indexSpec); break; case COMPLEX: final String typeName = metricTypeNames.get(metric); ComplexMetricSerde serde = ComplexMetrics.getSerdeForType(typeName); if (serde == null) { throw new ISE("Unknown type[%s]", typeName); } writer = serde.getSerializer(segmentWriteOutMedium, metric); break; default: throw new ISE("Unknown type[%s]", type); } writer.open(); metWriters.add(writer); } return metWriters; }

Target:
private ArrayList<GenericColumnSerializer> setupMetricsWriters( final SegmentWriteOutMedium segmentWriteOutMedium, final List<String> mergedMetrics, final Map<String, ValueType> metricsValueTypes, final Map<String, String> metricTypeNames, final IndexSpec indexSpec ) throws IOException { ArrayList<GenericColumnSerializer> metWriters = Lists.newArrayListWithCapacity(mergedMetrics.size()); for (String metric : mergedMetrics) { ValueType type = metricsValueTypes.get(metric); GenericColumnSerializer writer; switch (type) { case LONG: writer = createLongColumnSerializer(segmentWriteOutMedium, metric, indexSpec); break; case FLOAT: writer = createFloatColumnSerializer(segmentWriteOutMedium, metric, indexSpec); break; case DOUBLE: writer = createDoubleColumnSerializer(segmentWriteOutMedium, metric, indexSpec); break; case COMPLEX: final String typeName = metricTypeNames.get(metric); ComplexMetricSerde serde = ComplexMetrics.getSerdeForType(typeName); if (serde == null) { throw new ISE("Unknown type[%s]", typeName); } writer = serde.getSerializer(segmentWriteOutMedium, metric); break; default: throw new ISE("Unknown type[%s]", type); } writer.open(); metWriters.add(writer); } return metWriters; }
Source:
public static void initializeRankSystems() { final String METHOD_NAME = "initializeRankSystems()"; rankSystems = new Hashtable<>(); MekHQ.getLogger().log(Ranks.class, METHOD_NAME, LogLevel.INFO, "Starting load of Rank Systems from XML..."); Document xmlDoc = null; try { InputStream is = new FileInputStream("data/universe/ranks.xml"); DocumentBuilder db = MekHqXmlUtil.newSafeDocumentBuilder(); xmlDoc = db.parse(is); is.close(); } catch (Exception ex) { MekHQ.getLogger().error(Ranks.class, METHOD_NAME, ex); } Element ranksEle = xmlDoc.getDocumentElement(); NodeList nl = ranksEle.getChildNodes(); ranksEle.normalize(); for (int x = 0; x < nl.getLength(); x++) { Node wn = nl.item(x); Ranks value; if (wn.getParentNode() != ranksEle) continue; int xc = wn.getNodeType(); if (xc == Node.ELEMENT_NODE) { String xn = wn.getNodeName(); if (xn.equalsIgnoreCase("rankSystem")) { value = generateInstanceFromXML(wn, null); rankSystems.put(value.getRankSystem(), value); } } } MekHQ.getLogger().log(Ranks.class, METHOD_NAME, LogLevel.INFO, "Done loading Rank Systems"); }

Target:
public static void initializeRankSystems() { final String METHOD_NAME = "initializeRankSystems()"; rankSystems = new Hashtable<>(); MekHQ.getLogger().log(Ranks.class, METHOD_NAME, LogLevel.INFO, "Starting load of Rank Systems from XML..."); Document xmlDoc = null; try (InputStream is = new FileInputStream("data/universe/ranks.xml")) { DocumentBuilder db = MekHqXmlUtil.newSafeDocumentBuilder(); xmlDoc = db.parse(is); } catch (Exception ex) { MekHQ.getLogger().error(Ranks.class, METHOD_NAME, ex); } Element ranksEle = xmlDoc.getDocumentElement(); NodeList nl = ranksEle.getChildNodes(); ranksEle.normalize(); for (int x = 0; x < nl.getLength(); x++) { Node wn = nl.item(x); Ranks value; if (wn.getParentNode() != ranksEle) continue; int xc = wn.getNodeType(); if (xc == Node.ELEMENT_NODE) { String xn = wn.getNodeName(); if (xn.equalsIgnoreCase("rankSystem")) { value = generateInstanceFromXML(wn, null); rankSystems.put(value.getRankSystem(), value); } } } MekHQ.getLogger().log(Ranks.class, METHOD_NAME, LogLevel.INFO, "Done loading Rank Systems"); }
Source:
public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } JdbcExecutionOptions that = (JdbcExecutionOptions) o; return batchIntervalMs == that.batchIntervalMs && batchSize == that.batchSize && maxRetries == that.maxRetries && parallelism == that.parallelism; }

Target:
public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } JdbcExecutionOptions that = (JdbcExecutionOptions) o; return batchIntervalMs == that.batchIntervalMs && batchSize == that.batchSize && maxRetries == that.maxRetries; }
Source:
public Worker createWorker() { final Worker actualWorker = actualScheduler.createWorker(); ReplaySubject<ScheduledAction> actionSubject = ReplaySubject.create(); final Observer<ScheduledAction> actionObserver = new SerializedObserver<ScheduledAction>(actionSubject); Flowable<Completable> actions = actionSubject.toFlowable(BackpressureStrategy.BUFFER).map(new Function<ScheduledAction, Completable>() { @Override public Completable apply(final ScheduledAction action) { return Completable.unsafeCreate(new CompletableSource() { @Override public void subscribe(CompletableObserver actionCompletable) { actionCompletable.onSubscribe(action); action.call(actualWorker, actionCompletable); } }); } }); Worker worker = new Worker() { private final AtomicBoolean unsubscribed = new AtomicBoolean(); @Override public void dispose() { if (unsubscribed.compareAndSet(false, true)) { actualWorker.dispose(); actionObserver.onComplete(); } } @Override public boolean isDisposed() { return unsubscribed.get(); } @Override public Disposable schedule(final Runnable action, final long delayTime, final TimeUnit unit) { DelayedAction delayedAction = new DelayedAction(action, delayTime, unit); actionObserver.onNext(delayedAction); return delayedAction; } @Override public Disposable schedule(final Runnable action) { ImmediateAction immediateAction = new ImmediateAction(action); actionObserver.onNext(immediateAction); return immediateAction; } }; workerObserver.onNext(actions); return worker; }

Target:
public Worker createWorker() { final Worker actualWorker = actualScheduler.createWorker(); final FlowableProcessor<ScheduledAction> actionProcessor = UnicastProcessor.<ScheduledAction>create().toSerialized(); Flowable<Completable> actions = actionProcessor.map(new Function<ScheduledAction, Completable>() { @Override public Completable apply(final ScheduledAction action) { return new Completable() { @Override protected void subscribeActual(CompletableObserver actionCompletable) { actionCompletable.onSubscribe(action); action.call(actualWorker, actionCompletable); } }; } }); Worker worker = new Worker() { private final AtomicBoolean unsubscribed = new AtomicBoolean(); @Override public void dispose() { if (unsubscribed.compareAndSet(false, true)) { actualWorker.dispose(); actionProcessor.onComplete(); } } @Override public boolean isDisposed() { return unsubscribed.get(); } @Override public Disposable schedule(final Runnable action, final long delayTime, final TimeUnit unit) { DelayedAction delayedAction = new DelayedAction(action, delayTime, unit); actionProcessor.onNext(delayedAction); return delayedAction; } @Override public Disposable schedule(final Runnable action) { ImmediateAction immediateAction = new ImmediateAction(action); actionProcessor.onNext(immediateAction); return immediateAction; } }; workerProcessor.onNext(actions); return worker; }
Source:
public Filter getFilter() { return new Pac4jFilter( name, authorizerName, createPac4jConfig(oidcConfig), oidcConfig.getCookiePassphrase().getPassword() ); }

Target:
public Filter getFilter() { return new Pac4jFilter( name, authorizerName, pac4jConfigSupplier.get(), oidcConfig.getCookiePassphrase().getPassword() ); }
Source:
public static ColumnValueSelector makeColumnValueSelector( ColumnSelectorFactory columnSelectorFactory, Expr expression ) { final ColumnValueSelector<ExprEval> baseSelector = makeExprEvalSelector(columnSelectorFactory, expression); return new ColumnValueSelector() { @Override public double getDouble() { return baseSelector.getDouble(); } @Override public float getFloat() { return baseSelector.getFloat(); } @Override public long getLong() { return baseSelector.getLong(); } @Override public boolean isNull() { return baseSelector.isNull(); } @Nullable @Override public Object getObject() { ExprEval eval = baseSelector.getObject(); if (eval.isArray()) { return Arrays.stream(eval.asArray()).map(String::valueOf).collect(Collectors.toList()); } return eval.value(); } @Override public Class classOfObject() { return Object.class; } @Override public void inspectRuntimeShape(RuntimeShapeInspector inspector) { inspector.visit("baseSelector", baseSelector); } }; }

Target:
public static ColumnValueSelector makeColumnValueSelector( ColumnSelectorFactory columnSelectorFactory, Expr expression ) { final ColumnValueSelector<ExprEval> baseSelector = makeExprEvalSelector(columnSelectorFactory, expression); return new ColumnValueSelector() { @Override public double getDouble() { return baseSelector.getDouble(); } @Override public float getFloat() { return baseSelector.getFloat(); } @Override public long getLong() { return baseSelector.getLong(); } @Override public boolean isNull() { return baseSelector.isNull(); } @Nullable @Override public Object getObject() { ExprEval eval = baseSelector.getObject(); if (eval.isArray()) { return Arrays.stream(eval.asStringArray()) .map(NullHandling::emptyToNullIfNeeded) .collect(Collectors.toList()); } return eval.value(); } @Override public Class classOfObject() { return Object.class; } @Override public void inspectRuntimeShape(RuntimeShapeInspector inspector) { inspector.visit("baseSelector", baseSelector); } }; }
Source:
public List<Expression> rewrite(List<Expression> items, Context<C> context) { ImmutableList.Builder<Expression> builder = ImmutableList.builder(); for (Expression expression : items) { builder.add(rewrite(expression, context.get())); } return builder.build(); }

Target:
private List<Expression> rewrite(List<Expression> items, Context<C> context) { ImmutableList.Builder<Expression> builder = ImmutableList.builder(); for (Expression expression : items) { builder.add(rewrite(expression, context.get())); } return builder.build(); }
Source:
public void doesNotGoBackwardsEvenIfSweepTimestampRegressesWithinBucket() { enqueueWrite(TABLE_CONS, LOW_TS); enqueueWrite(TABLE_CONS, LOW_TS2); enqueueWrite(TABLE_CONS, LOW_TS3); runConservativeSweepAtTimestamp(LOW_TS2 + 5); assertReadAtTimestampReturnsSentinel(TABLE_CONS, LOW_TS2); assertTestValueEnqueuedAtGivenTimestampStillPresent(TABLE_CONS, LOW_TS2); verify(spiedKvs, times(1)).deleteAllTimestamps(any(TableReference.class), anyMap()); runConservativeSweepAtTimestamp(LOW_TS2 - 5); verify(spiedKvs, times(1)).deleteAllTimestamps(any(TableReference.class), anyMap()); }

Target:
public void doesNotGoBackwardsEvenIfSweepTimestampRegressesWithinBucket() { enqueueWrite(TABLE_CONS, LOW_TS); enqueueWrite(TABLE_CONS, LOW_TS2); enqueueWrite(TABLE_CONS, LOW_TS3); runConservativeSweepAtTimestamp(LOW_TS2 + 5); assertReadAtTimestampReturnsSentinel(TABLE_CONS, LOW_TS2); assertTestValueEnqueuedAtGivenTimestampStillPresent(TABLE_CONS, LOW_TS2); verify(spiedKvs, times(1)).deleteAllTimestamps(any(TableReference.class), anyMap()); assertProgressUpdatedToTimestamp(LOW_TS2 + 5 - 1); runConservativeSweepAtTimestamp(LOW_TS2 - 5); verify(spiedKvs, times(1)).deleteAllTimestamps(any(TableReference.class), anyMap()); assertProgressUpdatedToTimestamp(LOW_TS2 + 5 - 1); }
Source:
public CuratorZookeeperClient(URL url) { this(url, null); }

Target:
public CuratorZookeeperClient(URL url) { super(url); try { int timeout = url.getParameter(Constants.TIMEOUT_KEY, 5000); CuratorFrameworkFactory.Builder builder = CuratorFrameworkFactory.builder() .connectString(url.getBackupAddress()) .retryPolicy(new RetryNTimes(1, 1000)) .connectionTimeoutMs(timeout); String authority = url.getAuthority(); if (authority != null && authority.length() > 0) { builder = builder.authorization("digest", authority.getBytes()); } client = builder.build(); client.getConnectionStateListenable().addListener(new ConnectionStateListener() { @Override public void stateChanged(CuratorFramework client, ConnectionState state) { if (state == ConnectionState.LOST) { CuratorZookeeperClient.this.stateChanged(StateListener.DISCONNECTED); } else if (state == ConnectionState.CONNECTED) { CuratorZookeeperClient.this.stateChanged(StateListener.CONNECTED); } else if (state == ConnectionState.RECONNECTED) { CuratorZookeeperClient.this.stateChanged(StateListener.RECONNECTED); } } }); client.start(); } catch (Exception e) { throw new IllegalStateException(e.getMessage(), e); } }
Source:
public void notifyChanged(Notification notification) { if ((notification.getFeatureID(Property.class) == UMLPackage.PORT__IS_CONJUGATED)) { refreshDisplay(); } else { super.notifyChanged(notification); Object object = notification.getNotifier(); Property property = getUMLElement(); if ((object != null) && (property != null)) { if (notification.getFeature() == UMLPackage.Literals.OPAQUE_EXPRESSION__BODY) { refreshDisplay(); } } } }

Target:
public void notifyChanged(Notification notification) { if (notification.getFeature() == UMLPackage.Literals.PORT__IS_CONJUGATED) { refreshDisplay(); } else { super.notifyChanged(notification); Object object = notification.getNotifier(); Property property = getUMLElement(); if ((object != null) && (property != null)) { if (notification.getFeature() == UMLPackage.Literals.OPAQUE_EXPRESSION__BODY) { refreshDisplay(); } } } }
Source:
public void close() { taskContainerMappingMetadataStore.close(); }

Target:
public void close() { taskContainerMappingMetadataStore.close(); taskModeMappingMetadataStore.close(); }
Source:
public void encodeToStream(final ShuffleControlMessage msg, final DataOutputStream stream) { try { if (msg.getShuffleName() == null) { stream.writeUTF(""); } else { stream.writeUTF(msg.getShuffleName()); } stream.writeInt(msg.getCode()); stream.writeInt(msg.size()); final int messageLength = msg.size(); for (int i = 0; i < messageLength; i++) { final byte[] data = msg.get(i); stream.writeInt(data.length); stream.write(data); } } catch(final IOException exception) { throw new RuntimeException(exception); } }

Target:
public void encodeToStream(final ShuffleControlMessage msg, final DataOutputStream stream) { try { if (msg.getShuffleName() == null) { stream.writeUTF(""); } else { stream.writeUTF(msg.getShuffleName()); } stream.writeInt(msg.getCode()); final int messageLength = msg.size(); stream.writeInt(messageLength); for (int i = 0; i < messageLength; i++) { final String endPointId = msg.get(i); stream.writeUTF(endPointId); } } catch (final IOException exception) { throw new RuntimeException(exception); } }
Source:
public void printAsJava(PrintWriter pw) { try { appendAsJava(value, pw, typeName, true, RexDigestIncludeType.NO_TYPE); } catch (IOException e) { throw new IllegalStateException("IOException should not be raised with PrintWriter", e); } }

Target:
public void printAsJava(PrintWriter pw) { appendAsJava(value, pw, typeName, true, RexDigestIncludeType.NO_TYPE); }
Source:
public void shouldEditConceptAttribute() throws Exception { String json = "{ \"attributeType\":\"" + RestTestConstants2_0.CONCEPT_ATTRIBUTE_TYPE_UUID +"\" }"; ConceptAttribute conceptAttribute = service.getConceptAttributeByUuid(getUuid()); Assert.assertEquals("Joining Date", conceptAttribute.getAttributeType().getName()); handle(newPostRequest(getURI() + "/" + getUuid(), json)); conceptAttribute = service.getConceptAttributeByUuid(getUuid()); Assert.assertEquals("Joining Date", conceptAttribute.getAttributeType().getName()); }

Target:
public void shouldEditConceptAttribute() throws Exception { String json = "{ \"attributeType\":\"" + RestTestConstants2_0.CONCEPT_ATTRIBUTE_TYPE_UUID +"\", \"value\": \"2015-04-12\" }"; ConceptAttribute conceptAttribute = service.getConceptAttributeByUuid(getUuid()); Assert.assertEquals("2011-04-25", conceptAttribute.getValueReference()); handle(newPostRequest(getURI() + "/" + getUuid(), json)); conceptAttribute = service.getConceptAttributeByUuid(getUuid()); Assert.assertEquals("2015-04-12", conceptAttribute.getValueReference()); }
Source:
public EntityView(Context context, Detail d, String[] headerText) { super(context); this.context = context; this.views = new View[headerText.length]; this.mHints = d.getHeaderSizeHints(); String[] headerForms = d.getHeaderForms(); int[] colors = AndroidUtil.getThemeColorIDs(context, new int[]{R.attr.entity_view_header_background_color, R.attr.entity_view_header_text_color}); Log.i("DEBUG-i", "Background color is: " + colors[0] + ", text color is: " + colors[1]); if (colors[0] != -1) { this.setBackgroundColor(colors[0]); } for (int i = 0; i < views.length; ++i) { if (mHints[i] == null || !mHints[i].startsWith("0")) { LayoutParams l = new LinearLayout.LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT); ViewId uniqueId = new ViewId(rowId, i, false); views[i] = initView(headerText[i], headerForms[i], uniqueId, null); views[i].setId(i); if (colors[1] != -1) { TextView tv = (TextView) views[i].findViewById(R.id.component_audio_text_txt); if (tv != null) tv.setTextColor(colors[1]); } addView(views[i], l); } } }

Target:
public EntityView(Context context, Detail d, String[] headerText) { super(context); this.context = context; this.views = new View[headerText.length]; this.mHints = d.getHeaderSizeHints(); String[] headerForms = d.getHeaderForms(); int[] colors = AndroidUtil.getThemeColorIDs(context, new int[]{R.attr.entity_view_header_background_color, R.attr.entity_view_header_text_color}); if (colors[0] != -1) { this.setBackgroundColor(colors[0]); } for (int i = 0; i < views.length; ++i) { if (mHints[i] == null || !mHints[i].startsWith("0")) { LayoutParams l = new LinearLayout.LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT); ViewId uniqueId = new ViewId(rowId, i, false); views[i] = initView(headerText[i], headerForms[i], uniqueId, null); views[i].setId(i); if (colors[1] != -1) { TextView tv = (TextView) views[i].findViewById(R.id.component_audio_text_txt); if (tv != null) tv.setTextColor(colors[1]); } addView(views[i], l); } } }
Source:
public static <P extends VdcActionParametersBase> CommandBase<P> createCommand(VdcActionType action, P parameters, CommandContext commandContext) { try { Constructor<CommandBase<? extends VdcActionParametersBase>> commandConstructor = findCommandConstructor(getCommandClass(action.name()), parameters.getClass()); CommandBase<P> command = (CommandBase<P>) commandConstructor.newInstance(parameters); if (commandContext != null) { if (commandContext.getEngineContext().getSessionId() == null) { commandContext.getEngineContext().withSessionId(parameters.getSessionId()); } command.setContext(commandContext); } return Injector.injectMembers(command); } catch (InvocationTargetException ex) { log.error("Error in invocating CTOR of command '{}': {}", action.name(), ex.getMessage()); log.debug("Exception", ex); return null; } catch (Exception ex) { log.error("An exception has occured while trying to create a command object for command '{}': {}", action.name(), ex.getMessage()); log.debug("Exception", ex); return null; } }

Target:
public static <P extends VdcActionParametersBase> CommandBase<P> createCommand(VdcActionType action, P parameters, CommandContext commandContext) { try { Constructor<CommandBase<? extends VdcActionParametersBase>> commandConstructor = findCommandConstructor(getCommandClass(action.name()), parameters.getClass(), CommandContext.class); if (commandContext == null) { commandContext = new CommandContext(parameters.getSessionId()); } else if (commandContext.getEngineContext().getSessionId() == null) { commandContext.getEngineContext().withSessionId(parameters.getSessionId()); } CommandBase<P> command = (CommandBase<P>) commandConstructor.newInstance(parameters, commandContext); return Injector.injectMembers(command); } catch (InvocationTargetException ex) { log.error("Error in invocating CTOR of command '{}': {}", action.name(), ex.getMessage()); log.debug("Exception", ex); return null; } catch (Exception ex) { log.error("An exception has occured while trying to create a command object for command '{}': {}", action.name(), ex.getMessage()); log.debug("Exception", ex); return null; } }
Source:
public void close() { if (closed) { return; } closed = true; block = null; Throwable innerException = null; for (Closer closer : closers) { try { closer.close(); } catch (Throwable t) { if (innerException == null) { innerException = t; } else if (innerException != t) { innerException.addSuppressed(t); } } } if (innerException != null) { throw new RuntimeException(innerException); } }

Target:
public void close() { if (closed) { return; } closed = true; Throwable innerException = null; for (Closer closer : closers) { try { closer.close(); } catch (Throwable t) { if (innerException == null) { innerException = t; } else if (innerException != t) { innerException.addSuppressed(t); } } } if (innerException != null) { throw new RuntimeException(innerException); } }
Source:
public void innerNext(InnerQueuedSubscriber<R> inner, R value) { if (!inner.queue().offer(value)) { inner.cancel(); innerError(inner, new MissingBackpressureException()); } else { drain(); } }

Target:
public void innerNext(InnerQueuedSubscriber<R> inner, R value) { if (inner.queue().offer(value)) { drain(); } else { inner.cancel(); innerError(inner, new MissingBackpressureException()); } }
Source:
public void perform(Value value) { if (value.isEmptyString()) { return; } BigDecimal number = value.getBigDecimal(); if (number == null) { throw new IllegalArgumentException(NLS.fmtr("AmountScaleCheck.errorMsg.notNumeric") .set(PARAM_VALUE, value.toString()) .format()); } BigDecimal rounded = new BigDecimal(number.unscaledValue(), number.scale()).setScale(scale, RoundingMode.FLOOR); if (number.subtract(rounded).compareTo(BigDecimal.valueOf(0.00001)) > 0) { throw new IllegalArgumentException(NLS.fmtr("AmountScaleCheck.errorMsg.scaleExceeded") .set(PARAM_VALUE, value.toString()) .set(PARAM_SCALE, scale) .format()); } if (number.compareTo(BigDecimal.valueOf(Math.pow(10, (precision - scale)))) > -1) { throw new IllegalArgumentException(NLS.fmtr("AmountScaleCheck.errorMsg.precisionExceeded") .set(PARAM_VALUE, value.toString()) .set(PARAM_PRECISION, precision) .format()); } }

Target:
public void perform(Value value) { if (value.isEmptyString()) { return; } BigDecimal number = value.getBigDecimal(); if (number == null) { throw new IllegalArgumentException(NLS.fmtr("AmountScaleCheck.errorMsg.notNumeric") .set(PARAM_VALUE, value.toString()) .format()); } BigDecimal rounded = new BigDecimal(number.unscaledValue(), number.scale()).setScale(scale, RoundingMode.FLOOR); if (number.subtract(rounded).compareTo(BigDecimal.valueOf(Doubles.EPSILON)) > 0) { throw new IllegalArgumentException(NLS.fmtr("AmountScaleCheck.errorMsg.scaleExceeded") .set(PARAM_VALUE, value.toString()) .set(PARAM_SCALE, scale) .format()); } if (number.compareTo(BigDecimal.valueOf(Math.pow(10, (precision - scale)))) > -1) { throw new IllegalArgumentException(NLS.fmtr("AmountScaleCheck.errorMsg.precisionExceeded") .set(PARAM_VALUE, value.toString()) .set(PARAM_PRECISION, precision) .format()); } }
Source:
public BrowserWebDriverContainer() { final WaitStrategy logWaitStrategy = new LogMessageWaitStrategy() .withRegEx(".*(RemoteWebDriver instances should connect to|Selenium Server is up and running).*\n") .withStartupTimeout(Duration.of(15, SECONDS)); this.waitStrategy = new WaitAllStrategy() .withStrategy(logWaitStrategy) .withStrategy(new HostPortWaitStrategy()) .withStartupTimeout(Duration.of(15, SECONDS)); try { vncRecordingDirectory = Files.createTempDirectory(TC_TEMP_DIR_PREFIX).toFile(); } catch (IOException e) { logger().error("Exception while trying to create directory " + vncRecordingDirectory.getAbsolutePath(), e); throw new RuntimeException(e); } this.withRecordingFileFactory(new DefaultRecordingFileFactory()); }

Target:
public BrowserWebDriverContainer() { final WaitStrategy logWaitStrategy = new LogMessageWaitStrategy() .withRegEx(".*(RemoteWebDriver instances should connect to|Selenium Server is up and running).*\n") .withStartupTimeout(Duration.of(15, SECONDS)); this.waitStrategy = new WaitAllStrategy() .withStrategy(logWaitStrategy) .withStrategy(new HostPortWaitStrategy()) .withStartupTimeout(Duration.of(15, SECONDS)); this.withRecordingFileFactory(new DefaultRecordingFileFactory()); }
Source:
public void convertSpecific(SupremeCourtJudgment judgment, SourceScJudgment sourceJudgment) { judgment.setPersonnelType(extractPersonnelType(sourceJudgment)); judgment.setScJudgmentForm(extractSupremeCourtJudgmentForm(sourceJudgment)); extractSupremeCourtChambers(sourceJudgment).stream().forEach(scChamber->addScChamber(judgment, scChamber)); judgment.setScChamberDivision(extractSupremeCourtChamberDivision(sourceJudgment)); }

Target:
public void convertSpecific(SupremeCourtJudgment judgment, SourceScJudgment sourceJudgment) { judgment.setPersonnelType(extractPersonnelType(sourceJudgment)); judgment.setScJudgmentForm(extractSupremeCourtJudgmentForm(sourceJudgment)); extractSupremeCourtChambers(sourceJudgment).stream().filter(scChamber->!judgment.containsScChamber(scChamber)).forEach(scChamber->judgment.addScChamber(scChamber)); judgment.setScChamberDivision(extractSupremeCourtChamberDivision(sourceJudgment)); }
Source:
private void getKeyClient(HttpClient httpClient, KeyServiceVersion serviceVersion) { client = clientSetup(pipeline -> new KeyClientBuilder() .vaultUrl(getEndpoint()) .pipeline(pipeline) .httpClient(httpClient == null ? interceptorManager.getPlaybackClient() : httpClient) .serviceVersion(serviceVersion) .buildClient()); }

Target:
private void getKeyClient(HttpClient httpClient, KeyServiceVersion serviceVersion) { HttpPipeline httpPipeline = getHttpPipeline(httpClient, serviceVersion); client = new KeyClientBuilder() .vaultUrl(getEndpoint()) .pipeline(httpPipeline) .serviceVersion(serviceVersion) .buildClient(); }
Source:
public boolean equals(Object o) { if (this == o) return true; if (!(o instanceof CaseInsensitiveMultiMap)) return false; if (!super.equals(o)) return false; CaseInsensitiveMultiMap that = (CaseInsensitiveMultiMap) o; return optimized == that.optimized; }

Target:
public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof CaseInsensitiveMultiMap)) { return false; } if (!super.equals(o)) { return false; } CaseInsensitiveMultiMap that = (CaseInsensitiveMultiMap) o; return optimized == that.optimized; }
Source:
public SessionEntity getSession(String sessionId) { return getSessions(Arrays.asList(sessionId)).iterator().next(); }

Target:
public SessionEntity getSession(String sessionId) { List<SessionEntity> sessions = getSessions(Arrays.asList(sessionId)); if (!sessions.isEmpty()){ return sessions.iterator().next(); } return null; }
Source:
T build(ServiceLocator serviceLocator) { Store.Provider storeProvider = serviceLocator.findService(Store.Provider.class); return (T) new Ehcache(storeProvider.createStore(new StoreConfigurationImpl(keyType, valueType, capacityConstraint, evictionVeto, evictionPrioritizer)), cacheLoader); }

Target:
T build(ServiceLocator serviceLocator) { Store.Provider storeProvider = serviceLocator.findService(Store.Provider.class); final StoreConfigurationImpl<K, V> storeConfig = new StoreConfigurationImpl<K, V>(keyType, valueType, capacityConstraint, evictionVeto, evictionPrioritizer); final Store<K, V> store = storeProvider.createStore(storeConfig); final Ehcache<K, V> ehcache = new Ehcache<K, V>(store, cacheLoader, (ServiceConfiguration<?>[]) null); return (T) ehcache; }
Source:
public boolean waitForCompletion(long duration, TimeUnit timeUnit) throws InterruptedException { synchronized (lock) { if (!isCompleted()) { lock.wait(timeUnit.toMillis(duration)); } return complete; } }

Target:
public boolean waitForCompletion(long duration, TimeUnit timeUnit) throws InterruptedException { synchronized (lock) { if (!isCompleted()) { lock.wait(timeUnit.toMillis(duration)); } return isCompleted(); } }
Source:
public void purgeDeletedKeyWithResponseSnippets() { KeyClient keyClient = createClient(); Response<Void> purgedResponse = keyClient.purgeDeletedKeyWithResponse("deletedKeyName", new Context(key2, value2)); System.out.printf("Purge Status Code: %rsaPrivateExponent", purgedResponse.getStatusCode()); END: com.azure.keyvault.keys.keyclient.purgeDeletedKeyWithResponse#string-Context }

Target:
public void purgeDeletedKeyWithResponseSnippets() { KeyClient keyClient = createClient(); Response<Void> purgedResponse = keyClient.purgeDeletedKeyWithResponse("deletedKeyName", new Context(key2, value2)); System.out.printf("Purge Status Code: %d %n", purgedResponse.getStatusCode()); END: com.azure.keyvault.keys.keyclient.purgeDeletedKeyWithResponse#string-Context }
Source:
private boolean isDomainXmlEnabledForVds() { return (boolean) Config.getValue( ConfigValues.DomainXML, vmDao.get(getParameters().getVmId()).getCompatibilityVersion().toString()); }

Target:
private boolean isDomainXmlEnabledForVds() { return FeatureSupported.isDomainXMLSupported( resourceManager.getVdsManager(getParameters().getVdsId()).getCompatibilityVersion()); }
Source:
public void close() { checkIfValidThread(); if (openInProgress) { if (managementRealmOpenTask != null) { managementRealmOpenTask.cancel(); managementRealmOpenTask = null; } if (permissionRealmOpenTask != null) { permissionRealmOpenTask.cancel(); permissionRealmOpenTask = null; } } else { if (managementRealm != null) { managementRealm.close(); } if (permissionRealm != null) { permissionRealm.close(); } } closed = true; }

Target:
public void close() { checkIfValidThread(); Integer instanceCount = permissionManagerInstanceCounter.get(); if (instanceCount > 1) { permissionManagerInstanceCounter.set(instanceCount - 1); return; } permissionManagerInstanceCounter.set(0); permissionManager.set(null); delayedTasks.clear(); if (managementRealmOpenTask != null) { managementRealmOpenTask.cancel(); managementRealmOpenTask = null; } if (permissionRealmOpenTask != null) { permissionRealmOpenTask.cancel(); permissionRealmOpenTask = null; } if (managementRealm != null) { managementRealm.close(); } if (permissionRealm != null) { permissionRealm.close(); } closed = true; }
Source:
} catch (Exception e) { e.printStackTrace(); }

Target:
} catch (Exception e) { logger.error("Unable to set up SSLContext with TLS. Https activity will likely fail.", e); }