auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public <T> T newProxy(String name, Class<T> type) { lock.lock(); try { connect(); return JMX.newMBeanProxy(mbeanServerConn, new ObjectName(name), type); } catch (Exception e) { throw new RuntimeException(e); } finally { lock.unlock(); } }

Target:
private <T> T newProxy(String name, Class<T> type) { lock.lock(); try { connect(); return JMX.newMBeanProxy(mbeanServerConn, new ObjectName(name), type); } catch (Exception e) { throw new JmxRuntimeException("Failed to create proxy for " + name, e); } finally { lock.unlock(); } }
Source:
public BalanWanderingKnight(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{W}{W}"); this.addSuperType(SuperType.LEGENDARY); this.subtype.add("Cat"); this.subtype.add("Knight"); this.power = new MageInt(3); this.toughness = new MageInt(3); this.addAbility(FirstStrikeAbility.getInstance()); ConditionalContinuousEffect effect = new ConditionalContinuousEffect(new GainAbilitySourceEffect(DoubleStrikeAbility.getInstance()), EquippedMultipleSourceCondition.instance, rule); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect)); this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BalanWanderingKnightEffect(), new ManaCostsImpl("{1}{W}"))); }

Target:
public BalanWanderingKnight(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{W}{W}"); this.addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.CAT, SubType.KNIGHT); this.power = new MageInt(3); this.toughness = new MageInt(3); this.addAbility(FirstStrikeAbility.getInstance()); ConditionalContinuousEffect effect = new ConditionalContinuousEffect(new GainAbilitySourceEffect(DoubleStrikeAbility.getInstance()), EquippedMultipleSourceCondition.instance, rule); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect)); this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BalanWanderingKnightEffect(), new ManaCostsImpl("{1}{W}"))); }
Source:
public Event deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException { if (!json.isJsonObject()) { throw new JsonParseException("Not an object"); } JsonElement typeJson = json.getAsJsonObject().get("type"); if (typeJson == null || !typeJson.isJsonPrimitive() || !typeJson.getAsJsonPrimitive().isString()) { throw new JsonParseException("Type is not a string: " + typeJson); } String type = typeJson.getAsJsonPrimitive().getAsString(); Class cls = EventTypes.getClass(type); if (cls == null) { throw new JsonParseException("unknown event type: " + type); } return context.deserialize(json, cls); }

Target:
public Event deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException { if (!json.isJsonObject()) { throw new JsonParseException("Not an object"); } JsonElement typeJson = json.getAsJsonObject().get("type"); if (typeJson == null || !typeJson.isJsonPrimitive() || !typeJson.getAsJsonPrimitive().isString()) { throw new JsonParseException("Type is not a string: " + typeJson); } String type = typeJson.getAsJsonPrimitive().getAsString(); Class<?> cls = EventTypes.getClass(type); if (cls == null) { throw new JsonParseException("unknown event type: " + type); } return context.deserialize(json, cls); }
Source:
public void createNullName() { thrown.expect(NullPointerException.class); new HtmlSubsetLanguage(null, null, 6, ImmutableSet.of(BlockType.PARAGRAPH), ImmutableSet.of(SpanType.BOLD), ImmutableMap.of(SpanType.ITALIC, "italic"), Collections.<SpanHtmlElementStrategy> emptyList()); }

Target:
public void createNullName() { thrown.expect(NullPointerException.class); new HtmlSubsetLanguage(null, null, 6, ImmutableSet.of(BlockType.PARAGRAPH), ImmutableSet.of(SpanType.BOLD), ImmutableMap.<SpanType, String> of(), Collections.<SpanHtmlElementStrategy> emptyList()); }
Source:
public RepoObjectMetadata getObjectVersion(AssetIdentity assetIdentity, String repr, int revisionNumber) { String parentArticleDoi = getParentDoi(assetIdentity.getIdentifier()); if (parentArticleDoi == null) throw entityNotFound("Unrecognized asset DOI"); String parentArticleUuid = findRevisionUuid(parentArticleDoi, revisionNumber); if (parentArticleUuid == null) throw entityNotFound("Revision not found"); RepoObjectMetadata repoObjectMetadata = null; try { RepoCollectionMetadata articleCollection = contentRepoService.getCollection(RepoVersion.create(parentArticleDoi, parentArticleUuid)); Map<String, ?> articleMetadata = (Map<String, ?>) articleCollection.getJsonUserMetadata().get(); Collection<Map<String, ?>> assets = (Collection<Map<String, ?>>) articleMetadata.get("assets"); RepoVersion assetVersion = findAssetVersion(repr, assets, assetIdentity); repoObjectMetadata = contentRepoService.getRepoObjectMetadata(assetVersion); } catch(NotFoundException nfe) { entityNotFound(nfe.getMessage()); } return repoObjectMetadata; }

Target:
public RepoObjectMetadata getObjectVersion(AssetIdentity assetIdentity, String repr, int revisionNumber) { String parentArticleDoi = getParentDoi(assetIdentity.getIdentifier()); if (parentArticleDoi == null) { throw reportNotFound(assetIdentity, " parent article DOI"); } String parentArticleUuid = findRevisionUuid(parentArticleDoi, revisionNumber); if (parentArticleUuid == null) { throw reportNotFound(assetIdentity, "parent article UUID"); } try { RepoCollectionMetadata articleCollection = contentRepoService.getCollection(RepoVersion.create(parentArticleDoi, parentArticleUuid)); Map<String, ?> articleMetadata = (Map<String, ?>) articleCollection.getJsonUserMetadata().get(); Collection<Map<String, ?>> assets = (Collection<Map<String, ?>>) articleMetadata.get("assets"); RepoVersion assetVersion = findAssetVersion(repr, assets, assetIdentity); return contentRepoService.getRepoObjectMetadata(assetVersion); } catch(NotFoundException nfe) { throw reportNotFound(assetIdentity, "object metadata", nfe); } }
Source:
public void sendVerificationmail(User user, String url) { String message = "Please click on the following link to complete your registration: <a href=\"" + url + "\">" + url + "</a><br><br>If the link does not work, please copy the link and" + " paste it in your browser."; sendMail(user.getEmail(), user.getUsername(), "Confirm your registration", message); }

Target:
public void sendVerificationmail(User user, String url) { String message = "Please click on the following link to complete your registration: <a href=\"" + url + "\">" + url + "</a><br /><br />If the link does not work, please copy the link and" + " paste it into your browser."; sendMail(user.getEmail(), user.getUsername(), "Confirm your registration", message); }
Source:
public int find(Text name, MgcpEndpoint[] endpoints) { if (name.equals(ALL)) { k = 0; for(int i=0;i<completeList.size();i++) { endpoints[k++] = completeList.get(i).endpoint; } return completeList.size(); } if (name.equals(ANY)) { MgcpEndpoint endp=queue.poll(); while(endp==null && installer!=null && installer.canExpand()) { if(logger.isDebugEnabled()) logger.debug("No free endpoints,expanding"); synchronized(installer) { installer.newEndpoint(); } endp=queue.poll(); } if(endp!=null) { endp.lock(); endpoints[0] = endp; if(logger.isDebugEnabled()) { logger.debug("Endpoint " + endp.getName() + " taken"); logger.debug("Free " + endp.getEndpoint().toString() + " endpoints " + queue.size()); } return 1; } return 0; } int value=name.toInteger(); if(value>0 && value<=completeList.size()) { endpoints[0] = completeList.get(value-1).endpoint; return 1; } return 0; }

Target:
public int find(Text name, MgcpEndpoint[] endpoints) { if (name.equals(ALL)) { k = 0; for(int i=0;i<completeList.size();i++) { endpoints[k++] = completeList.get(i).endpoint; } return completeList.size(); } if (name.equals(ANY)) { MgcpEndpoint endp=queue.poll(); while(endp==null && installer!=null && installer.canExpand()) { if(logger.isDebugEnabled()) logger.debug("No free endpoints,expanding"); synchronized(installer) { installer.newEndpoint(); } endp=queue.poll(); } if(endp!=null) { endp.lock(); endpoints[0] = endp; if(logger.isDebugEnabled()) { logger.debug("Endpoint " + endp.getName() + " taken (free="+queue.size()+")"); } return 1; } return 0; } int value=name.toInteger(); if(value>0 && value<=completeList.size()) { endpoints[0] = completeList.get(value-1).endpoint; return 1; } return 0; }
Source:
public void testValidationFail() throws IOException { final String json = TestingResources.get("org/kiji/mapreduce/mapping/foo-test-invalid.json"); TableImportDescriptorDesc mappingDesc = (TableImportDescriptorDesc) FromJson.fromJsonString(json, TableImportDescriptorDesc.SCHEMA$); KijiTableImportDescriptor mapping = new KijiTableImportDescriptor(mappingDesc); final KijiTableLayout fooLayout = new KijiTableLayout(KijiTableLayouts.getLayout(KijiTableLayouts.FOO_TEST), null); mapping.validateDestination(fooLayout); }

Target:
public void testValidationFail() throws IOException { final String json = TestingResources.get(FOO_INVALID_DESCRIPTOR); TableImportDescriptorDesc mappingDesc = (TableImportDescriptorDesc) FromJson.fromJsonString(json, TableImportDescriptorDesc.SCHEMA$); KijiTableImportDescriptor mapping = new KijiTableImportDescriptor(mappingDesc); final KijiTableLayout fooLayout = new KijiTableLayout(KijiMRTestLayouts.getTestLayout(), null); try { mapping.validateDestination(fooLayout); fail("Should've gotten an InvalidTableImportDescription by here."); } catch (InvalidTableImportDescriptorException ie) { assertEquals("Table 'test' does not contain column 'info:first_name_nonexistant'.", ie.getMessage()); } }
Source:
public static Envelope deserializeEnvelope(Slice shape) { if (shape == null) { return null; } BasicSliceInput input = shape.getInput(); input.readInt(); Envelope overallEnvelope = null; while (input.available() > 0) { int length = input.readInt(); ByteBuffer buffer = input.readSlice(length).toByteBuffer().slice().order(LITTLE_ENDIAN); int type = buffer.getInt(); Envelope envelope; if (type == 1) { double x = buffer.getDouble(); double y = buffer.getDouble(); envelope = new Envelope(x, y, x, y); } else { double xmin = buffer.getDouble(); double ymin = buffer.getDouble(); double xmax = buffer.getDouble(); double ymax = buffer.getDouble(); envelope = new Envelope(xmin, ymin, xmax, ymax); } if (overallEnvelope == null) { overallEnvelope = envelope; } else { overallEnvelope.merge(envelope); } } return overallEnvelope; }

Target:
public static Envelope deserializeEnvelope(Slice shape) { if (shape == null) { return null; } BasicSliceInput input = shape.getInput(); input.readInt(); Envelope overallEnvelope = null; while (input.available() > 0) { int length = input.readInt(); ByteBuffer buffer = input.readSlice(length).toByteBuffer().order(LITTLE_ENDIAN); int type = buffer.getInt(); Envelope envelope = null; if (type == POINT_TYPE) { double x = buffer.getDouble(); double y = buffer.getDouble(); if (!isEsriNaN(x)) { Verify.verify(!isEsriNaN(y)); envelope = new Envelope(x, y, x, y); } } else { double xMin = buffer.getDouble(); double yMin = buffer.getDouble(); double xMax = buffer.getDouble(); double yMax = buffer.getDouble(); if (!isEsriNaN(xMin)) { Verify.verify(!isEsriNaN(xMax)); Verify.verify(!isEsriNaN(yMin)); Verify.verify(!isEsriNaN(yMax)); envelope = new Envelope(xMin, yMin, xMax, yMax); } } if (envelope != null) { if (overallEnvelope == null) { overallEnvelope = envelope; } else { overallEnvelope.merge(envelope); } } } return overallEnvelope; }
Source:
private AboutInfo promptForFeature() throws WorkbenchException { ArrayList welcomeFeatures = new ArrayList(); URL productUrl = null; IProduct product = Platform.getProduct(); if (product != null) { productUrl = ProductProperties.getWelcomePageUrl(product); welcomeFeatures.add(new AboutInfo(product)); } AboutInfo[] features = IDEWorkbenchPlugin.getDefault() .getFeatureInfos(); for (int i = 0; i < features.length; i++) { URL url = features[i].getWelcomePageURL(); if (url != null && productUrl != null && !url.toString().equals(productUrl.toString())) { welcomeFeatures.add(features[i]); } } Shell shell = workbenchWindow.getShell(); if (welcomeFeatures.size() == 0) { MessageDialog.openInformation(shell, IDEWorkbenchMessages.QuickStartMessageDialog_title, IDEWorkbenchMessages.QuickStartMessageDialog_message); return null; } features = new AboutInfo[welcomeFeatures.size()]; welcomeFeatures.toArray(features); FeatureSelectionDialog d = new FeatureSelectionDialog(shell, features, product == null ? null : product.getId(), IDEWorkbenchMessages.WelcomePageSelectionDialog_title, IDEWorkbenchMessages.WelcomePageSelectionDialog_message, IIDEHelpContextIds.WELCOME_PAGE_SELECTION_DIALOG); if (d.open() != Window.OK || d.getResult().length != 1) { return null; } return (AboutInfo) d.getResult()[0]; }

Target:
private AboutInfo promptForFeature() throws WorkbenchException { ArrayList welcomeFeatures = new ArrayList(); URL productUrl = null; IProduct product = Platform.getProduct(); if (product != null) { productUrl = ProductProperties.getWelcomePageUrl(product); welcomeFeatures.add(new AboutInfo(product)); } AboutInfo[] features = IDEWorkbenchPlugin.getDefault() .getFeatureInfos(); for (int i = 0; i < features.length; i++) { URL url = features[i].getWelcomePageURL(); if (url != null && (productUrl == null || !url.toString().equals(productUrl.toString())) { welcomeFeatures.add(features[i]); } } Shell shell = workbenchWindow.getShell(); if (welcomeFeatures.size() == 0) { MessageDialog.openInformation(shell, IDEWorkbenchMessages.QuickStartMessageDialog_title, IDEWorkbenchMessages.QuickStartMessageDialog_message); return null; } features = new AboutInfo[welcomeFeatures.size()]; welcomeFeatures.toArray(features); FeatureSelectionDialog d = new FeatureSelectionDialog(shell, features, product == null ? null : product.getId(), IDEWorkbenchMessages.WelcomePageSelectionDialog_title, IDEWorkbenchMessages.WelcomePageSelectionDialog_message, IIDEHelpContextIds.WELCOME_PAGE_SELECTION_DIALOG); if (d.open() != Window.OK || d.getResult().length != 1) { return null; } return (AboutInfo) d.getResult()[0]; }
Source:
protected void testAccessControl() throws Exception { dataBundle = getTypicalDataBundle(); removeAndRestoreTypicalDataBundle(); String[] submissionParams = new String[]{}; verifyOnlyAdminsCanAccess(submissionParams); }

Target:
protected void testAccessControl() throws Exception { String[] submissionParams = new String[]{}; verifyOnlyAdminsCanAccess(submissionParams); }
Source:
private void validateEventSize(final BatchItem item) throws EventValidationException { if (item.getEvent().toString().getBytes().length > nakadiSettings.getEventMaxBytes()) throw new EventValidationException("Event too large"); }

Target:
private void validateEventSize(final BatchItem item) throws EventValidationException { if (item.getEventSize() > nakadiSettings.getEventMaxBytes()) { throw new EventValidationException("Event too large: " + item.getEventSize() + " bytes, max size is " + nakadiSettings.getEventMaxBytes() + " bytes"); } }
Source:
public List<AddOn> getUpdatedAddOns() { return getLocalVersionInfo().getUpdatedAddOns(this.getLatestVersionInfo()); }

Target:
protected List<AddOn> getUpdatedAddOns() { return getLocalVersionInfo().getUpdatedAddOns(this.getLatestVersionInfo()); }
Source:
private static final ModelUtils getModelUtils() { return Utils.getComponent(ModelUtils.class); }

Target:
private final ModelUtils getModelUtils() { return Utils.getComponent(ModelUtils.class); }
Source:
private void preRenderSetupLightGeometry() { READ_ONLY_GBUFFER.setRenderBufferMask(false, false, true); glStencilFunc(GL_NOTEQUAL, 0, 0xFF); glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_COLOR); }

Target:
private void preRenderSetupLightGeometry() { READ_ONLY_GBUFFER.bind(); READ_ONLY_GBUFFER.setRenderBufferMask(false, false, true); glStencilFunc(GL_NOTEQUAL, 0, 0xFF); glDepthMask(true); glDisable(GL_DEPTH_TEST); glEnable(GL_BLEND); glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_COLOR); glEnable(GL_CULL_FACE); glCullFace(GL_FRONT); }
Source:
private void testBound(final int maxThreads, int totalTasks) { BoundedExecutor boundedExecutor = new BoundedExecutor(executorService, maxThreads); final AtomicInteger activeThreadCount = new AtomicInteger(); final CountDownLatch startLatch = new CountDownLatch(1); final CountDownLatch completeLatch = new CountDownLatch(totalTasks); final AtomicBoolean failed = new AtomicBoolean(); for (int i = 0; i < totalTasks; i++) { boundedExecutor.execute(new Runnable() { @Override public void run() { try { Uninterruptibles.awaitUninterruptibly(startLatch); int count = activeThreadCount.incrementAndGet(); if (count < 1 || count > maxThreads) { failed.set(true); } activeThreadCount.decrementAndGet(); } finally { completeLatch.countDown(); } } }); } startLatch.countDown(); Uninterruptibles.awaitUninterruptibly(completeLatch); Assert.assertFalse(failed.get()); }

Target:
private void testBound(final int maxThreads, int totalTasks) { BoundedExecutor boundedExecutor = new BoundedExecutor(executorService, maxThreads); final AtomicInteger activeThreadCount = new AtomicInteger(); final CountDownLatch startLatch = new CountDownLatch(1); final CountDownLatch completeLatch = new CountDownLatch(totalTasks); final AtomicBoolean failed = new AtomicBoolean(); for (int i = 0; i < totalTasks; i++) { boundedExecutor.execute(new Runnable() { @Override public void run() { try { Uninterruptibles.awaitUninterruptibly(startLatch); int count = activeThreadCount.incrementAndGet(); if (count < 1 || count > maxThreads) { failed.set(true); } activeThreadCount.decrementAndGet(); } finally { completeLatch.countDown(); } } }); } startLatch.countDown(); Uninterruptibles.awaitUninterruptibly(completeLatch, 1, TimeUnit.MINUTES); Assert.assertFalse(failed.get()); }
Source:
private String calculateEtag(List<EnvironmentConfig> environmentConfigs) { final String environmentConfigSegment = environmentConfigs .stream() .map(this::etagFor) .collect(Collectors.joining(SEP_CHAR)); return DigestUtils.sha256Hex(StringUtils.joinWith(SEP_CHAR, currentUsername().getUsername(), environmentConfigSegment)); }

Target:
private String calculateEtag(List<EnvironmentConfig> environmentConfigs) { final String environmentConfigSegment = environmentConfigs .stream() .map(this::etagFor) .collect(Collectors.joining(SEP_CHAR)); return DigestUtils.sha256Hex(environmentConfigSegment); }
Source:
public void endMeasuringLatency() { if (_endTime != 0L) { throw new HelixException( String.format("Needs to call startMeasuringLatency first! Metric name: %s", _metricName)); } _endTime = System.currentTimeMillis(); _lastEmittedMetricValue = _endTime - _startTime; updateValue(_lastEmittedMetricValue); }

Target:
public void endMeasuringLatency() { if (_startTime == VALUE_NOT_SET || _endTime != VALUE_NOT_SET) { LOG.error( "Needs to call startMeasuringLatency first! Ignoring and resetting the metric. Metric name: {}", _metricName); reset(); return; } _endTime = System.currentTimeMillis(); _lastEmittedMetricValue = _endTime - _startTime; updateValue(_lastEmittedMetricValue); reset(); }
Source:
public static Set<TransformExpressionTree> collectExpressionsToTransform(BrokerRequest brokerRequest, AggregationFunctionContext[] functionContexts) { Set<TransformExpressionTree> expressionTrees = new LinkedHashSet<>(); for (AggregationFunctionContext functionContext : functionContexts) { AggregationFunction function = functionContext.getAggregationFunction(); if (!function.getType().equals(AggregationFunctionType.COUNT)) { expressionTrees.addAll(function.getInputExpressions()); } } if (brokerRequest.isSetGroupBy()) { for (String expression : brokerRequest.getGroupBy().getExpressions()) { expressionTrees.add(TransformExpressionTree.compileToExpressionTree(expression)); } } return expressionTrees; }

Target:
public static Set<TransformExpressionTree> collectExpressionsToTransform(BrokerRequest brokerRequest, AggregationFunctionContext[] functionContexts) { Set<TransformExpressionTree> expressionTrees = new LinkedHashSet<>(); for (AggregationFunctionContext functionContext : functionContexts) { AggregationFunction function = functionContext.getAggregationFunction(); expressionTrees.addAll(function.getInputExpressions()); } if (brokerRequest.isSetGroupBy()) { for (String expression : brokerRequest.getGroupBy().getExpressions()) { expressionTrees.add(TransformExpressionTree.compileToExpressionTree(expression)); } } return expressionTrees; }
Source:
Swift2ThriftGenerator(final Swift2ThriftGeneratorConfig config) throws FileNotFoundException { this.verbose = config.isVerbose(); String defaultPackage = config.getDefaultPackage(); if (defaultPackage.isEmpty()) this.defaultPackage = ""; else this.defaultPackage = defaultPackage + "."; OutputStream os = config.getOutputFile() != null ? new FileOutputStream(config.getOutputFile()) : System.out; this.outputStreamWriter = new OutputStreamWriter(os, Charsets.UTF_8); Map<String, String> paramIncludeMap = config.getIncludeMap(); this.thriftTypeRenderer = new ThriftTypeRenderer(ImmutableMap.<ThriftType,String>of()); for (Map.Entry<String, String> entry: paramIncludeMap.entrySet()) { Class<?> cls = load(entry.getKey()); if (cls == null) continue; Object result = convertToThrift(cls); if (result != null) this.includeMap.put(result, entry.getValue()); } }

Target:
Swift2ThriftGenerator(final Swift2ThriftGeneratorConfig config) throws FileNotFoundException { this.verbose = config.isVerbose(); String defaultPackage = config.getDefaultPackage(); if (defaultPackage.isEmpty()) { this.defaultPackage = ""; } else { this.defaultPackage = defaultPackage + "."; } OutputStream os = config.getOutputFile() != null ? new FileOutputStream(config.getOutputFile()) : System.out; this.outputStreamWriter = new OutputStreamWriter(os, Charsets.UTF_8); Map<String, String> paramIncludeMap = config.getIncludeMap(); this.thriftTypeRenderer = new ThriftTypeRenderer(ImmutableMap.<ThriftType,String>of()); for (Map.Entry<String, String> entry: paramIncludeMap.entrySet()) { Class<?> cls = load(entry.getKey()); if (cls == null) { continue; } Object result = convertToThrift(cls); if (result != null) { this.includeMap.put(result, entry.getValue()); } } }
Source:
public static Status parseStatusMessage(String statusMessage, Throwable error) { String message = null; if (error != null) { message = error.getMessage(); if (message == null) { message = error.getClass().getSimpleName(); return Status.UNKNOWN.withDescription(message); } } if (error == null && statusMessage.equalsIgnoreCase("success")) { return Status.OK; } return Status.UNKNOWN.withDescription(statusMessage); }

Target:
public static Status parseStatusMessage(String statusMessage, Throwable error) { if (error != null) { final String message = error.getMessage(); return message != null ? Status.UNKNOWN.withDescription(message) : Status.UNKNOWN.withDescription(error.getClass().getSimpleName()); } else if (statusMessage.equalsIgnoreCase("success")) { return Status.OK; } else { return Status.UNKNOWN.withDescription(statusMessage); } }
Source:
public void draw(SpriteBatch batch, float dt) { currnetAnim.update(dt, true, facing); shieldAnim.update(dt, true, facing); currnetAnim.draw(batch, dt, unit.getX(), unit.getY()); batch.draw(hpBar, unit.getX() + UnitHelper.HP_BAR_X, unit.getY() + UnitHelper.HP_BAR_Y, hpWidth, UnitHelper.HP_BAR_HEIGHT); if(unit.isInDefensePosition()) shieldAnim.draw(batch, dt, unit.getX(), unit.getY()); }

Target:
public void draw(SpriteBatch batch, float dt) { currnetAnim.update(dt, true, facing); currnetAnim.draw(batch, dt, unit.getX(), unit.getY()); batch.draw(hpBar, unit.getX() + UnitHelper.HP_BAR_X, unit.getY() + UnitHelper.HP_BAR_Y, hpWidth, UnitHelper.HP_BAR_HEIGHT); if(unit.isInDefensePosition()){ shieldAnim.update(dt, true, facing); shieldAnim.draw(batch, dt, unit.getX(), unit.getY()); } }
Source:
public UseStatementTree GROUP_USE_STATEMENT() { return b.<UseStatementTree>nonterminal(Kind.GROUP_USE_STATEMENT).is( f.groupUseStatement( b.token(PHPKeyword.USE), b.optional( b.firstOf( b.token(PHPKeyword.CONST), b.token(PHPKeyword.FUNCTION))), NAMESPACE_NAME(), b.token(NS_SEPARATOR), b.token(LCURLYBRACE), GROUP_USE_CLAUSE(), b.zeroOrMore(f.newTuple89(b.token(PHPPunctuator.COMMA), GROUP_USE_CLAUSE())), b.token(RCURLYBRACE), EOS())); }

Target:
public UseStatementTree GROUP_USE_STATEMENT() { return b.<UseStatementTree>nonterminal(Kind.GROUP_USE_STATEMENT).is( f.groupUseStatement( b.token(PHPKeyword.USE), b.optional(USE_TYPE()), NAMESPACE_NAME(), b.token(NS_SEPARATOR), b.token(LCURLYBRACE), GROUP_USE_CLAUSE(), b.zeroOrMore(f.newTuple89(b.token(PHPPunctuator.COMMA), GROUP_USE_CLAUSE())), b.token(RCURLYBRACE), EOS())); }
Source:
protected void initUnregisteredEntity(Guid entityId, Guid storageDomainId) { if (!isUnregisteredEntityExists()) { List<OvfEntityData> ovfEntityList = unregisteredOVFDataDao.getByEntityIdAndStorageDomain(entityId, storageDomainId); if (!ovfEntityList.isEmpty()) { ovfEntityData = ovfEntityList.get(0); try { setUnregisteredEntityAndImages(ovfEntityData.getOvfData()); } catch (OvfReaderException e) { log.error("Failed to parse a given ovf configuration: {}:\n{}", e.getMessage(), ovfEntityData.getOvfData()); log.debug("Exception", e); } } } }

Target:
protected void initUnregisteredEntity(Guid entityId, Guid storageDomainId) { if (!isUnregisteredEntityExists()) { List<OvfEntityData> ovfEntityList = unregisteredOVFDataDao.getByEntityIdAndStorageDomain(entityId, storageDomainId); if (!ovfEntityList.isEmpty()) { ovfEntityData = ovfEntityList.get(0); try { setUnregisteredEntityAndImages(ovfEntityData.getOvfData()); } catch (OvfReaderException e) { log.error("Failed to parse a given ovf configuration: {}:\n{}", e.getMessage(), ovfEntityData.getOvfData()); log.debug("Exception: ", e); } } } }
Source:
public void remove() { throw new RuntimeException("Method remove() is not implemented."); }

Target:
public void remove() { throw new UnsupportedOperationException("Method remove() is not implemented."); }
Source:
private ArrayList<ExecutorDetails> getSortedExecs(Map<String, Integer> spreadCompCnts, Map<String, Set<String>> constraintMatrix, Map<String, Set<ExecutorDetails>> compToExecs) { ArrayList<ExecutorDetails> retList = new ArrayList<>(); Map<String, Double> compConstraintCountMap = new HashMap<>(); constraintMatrix.forEach((comp, subMatrix) -> { double count = subMatrix.size(); if (spreadCompCnts.containsKey(comp)) { count += (1_000.0 / spreadCompCnts.get(comp)); } compConstraintCountMap.put(comp, count); }); NavigableMap<String, Double> sortedCompConstraintCountMap = sortByValues(compConstraintCountMap); for (String comp : sortedCompConstraintCountMap.keySet()) { retList.addAll(compToExecs.get(comp)); } return retList; }

Target:
private ArrayList<ExecutorDetails> getSortedExecs(Map<String, Integer> spreadCompCnts, Map<String, Set<String>> constraintMatrix, Map<String, Set<ExecutorDetails>> compToExecs) { ArrayList<ExecutorDetails> retList = new ArrayList<>(); Map<String, Double> compConstraintCountMap = new HashMap<>(); constraintMatrix.forEach((comp, subMatrix) -> { double count = subMatrix.size(); if (spreadCompCnts.containsKey(comp)) { count += (compToExecs.size() / spreadCompCnts.get(comp)); } compConstraintCountMap.put(comp, count); }); NavigableMap<String, Double> sortedCompConstraintCountMap = sortByValues(compConstraintCountMap); for (String comp : sortedCompConstraintCountMap.keySet()) { retList.addAll(compToExecs.get(comp)); } return retList; }
Source:
public void updateEnhanced(final EnhancedDependency enhancedDependency) { if (this.enhancedDependencies.contains(enhancedDependency)) { this.enhancedDependencies.update(enhancedDependency); } else { this.enhancedDependencies.add(enhancedDependency); } }

Target:
private void updateEnhanced(final EnhancedDependency enhancedDependency) { if (this.enhancedDependencies.contains(enhancedDependency)) { this.enhancedDependencies.update(enhancedDependency); } else { this.enhancedDependencies.add(enhancedDependency); } }
Source:
public void testPushPrivateRepo() throws Exception { final File pom = getTestFile("src/test/resources/pom-push-private-repo.xml"); assertNotNull("Null pom.xml", pom); assertTrue("pom.xml does not exist", pom.exists()); final PushMojo mojo = (PushMojo) lookupMojo("push", pom); assertNotNull(mojo); mojo.execute(); }

Target:
public void testPushPrivateRepo() throws Exception { final File pom = getTestFile("src/test/resources/pom-push-private-repo.xml"); assertNotNull("Null pom.xml", pom); assertTrue("pom.xml does not exist", pom.exists()); final PushMojo mojo = (PushMojo) lookupMojo("push", pom); assertNotNull(mojo); final DockerClient docker = mock(DockerClient.class); }
Source:
protected String getIndent(IDocument document, int line) throws BadLocationException { String definitionLine = document.get(document.getLineOffset(line - 1), document.getLineLength(line - 1)); Matcher m = WHITESPACE_PATTERN.matcher(definitionLine); final String definitionIndent = m.matches() ? m.group(1) : ""; return definitionIndent + " "; }

Target:
protected String getIndent(IDocument document, int line) throws BadLocationException { String definitionLine = document.get(document.getLineOffset(line - 1), document.getLineLength(line - 1)); Matcher m = WHITESPACE_PATTERN.matcher(definitionLine); final String definitionIndent = m.matches() ? m.group(1) : ""; return definitionIndent + Strings.repeat(" ", getTabWidth()); }
Source:
final public void addBinary(Binary value) { if (primitiveType != null) { int precision = primitiveType.asPrimitiveType().getDecimalMetadata().getPrecision(); int scale = primitiveType.asPrimitiveType().getDecimalMetadata().getScale(); BigDecimal finaldecimal = DecimalUtils.binaryToDecimal(value, precision, scale); parent.add(finaldecimal); } else { parent.add("Broken DecimalType"); } }

Target:
final public void addBinary(Binary value) { int precision = primitiveType.asPrimitiveType().getDecimalMetadata().getPrecision(); int scale = primitiveType.asPrimitiveType().getDecimalMetadata().getScale(); BigDecimal finaldecimal = DecimalUtils.binaryToDecimal(value, precision, scale); parent.add(finaldecimal); }
Source:
public boolean isRepresentationsResource() { boolean isRepresentationsResource = false; try { isRepresentationsResource = resource.getURI() != null; } catch (IllegalStateException e) { } isRepresentationsResource = isRepresentationsResource && new FileQuery(resource.getURI().fileExtension()).isSessionResourceFile(); isRepresentationsResource = isRepresentationsResource || resource instanceof AirdResource; if (!isRepresentationsResource && !resource.getContents().isEmpty()) { for (EObject contentEObject : resource.getContents()) { if (contentEObject != null && contentEObject.eClass().equals(ViewpointPackage.eINSTANCE.getDAnalysis())) { isRepresentationsResource = true; break; } } } return isRepresentationsResource; }

Target:
public boolean isRepresentationsResource() { boolean isRepresentationsResource = false; try { isRepresentationsResource = resource.getURI() != null; } catch (IllegalStateException e) { } isRepresentationsResource = isRepresentationsResource && new FileQuery(resource.getURI().fileExtension()).isSessionResourceFile(); isRepresentationsResource = isRepresentationsResource || resource instanceof AirdResource; if (!isRepresentationsResource && !resource.getContents().isEmpty()) { for (EObject contentEObject : resource.getContents()) { if (contentEObject != null && contentEObject.eClass().equals(ViewpointPackage.Literals.DANALYSIS)) { isRepresentationsResource = true; break; } } } return isRepresentationsResource; }
Source:
public <I, E extends Entity<I, ?>> void register(Repository<I, E> repository) { checkNotNull(repository); Security.allowOnlyFrameworkServer(); initialize(repository); guard.register(repository); repository.onRegistered(); registerEventDispatcher(stand()); }

Target:
public <I, E extends Entity<I, ?>> void register(Repository<I, E> repository) { checkNotNull(repository); Security.allowOnlyFrameworkServer(); registerIfAware(repository); guard.register(repository); repository.onRegistered(); registerEventDispatcher(stand()); }
Source:
public boolean isEqualTo(String channel, Client client) { return channel.equals(this.channel) && client.equals(this.client); }

Target:
public boolean isEqualTo(String channel, Client client) { if (channel == null || client == null) { return false; } return channel.equals(this.channel) && client.equals(this.client); }
Source:
public void start() throws Exception { MqttClientOptions options = new MqttClientOptions() .setPort(1883) .setHost("0.0.0.0") .setKeepAliveTimeSeconds(2); MqttClient client = MqttClient.create(Vertx.vertx(), options); client.publishHandler(publish -> { System.out.println("Just received message on [" + publish.topicName() + "] payload [" + publish.payload().toString(Charset.defaultCharset()) + "] with QoS [" + publish.qosLevel() + "]"); }); client.subscribeCompleteHandler(h -> { System.out.println("Receive SUBACK from server"); System.out.print("Granted QoS levels: "); h.grantedQoSLevels().forEach(System.out::print); System.out.println(); client.publish( MQTT_TOPIC, Buffer.buffer(MQTT_MESSAGE.getBytes()), MqttQoS.AT_MOST_ONCE, false, false, s -> System.out.println("Publish sent to a server")); vertx.setTimer(5000, l -> client.unsubscribe(MQTT_TOPIC)); }); client.unsubscribeCompleteHandler(h -> { System.out.println("Receive UNSUBACK from server"); vertx.setTimer(5000, l -> client.disconnect(d -> System.out.println("Disconnected form server")) ); }); client.connect(ch -> { if (ch.succeeded()) { System.out.println("Connected to a server"); client.subscribe(MQTT_TOPIC, 0); } else { System.out.println("Failed to connect to a server"); System.out.println(ch.cause()); } }); }

Target:
public void start() throws Exception { MqttClientOptions options = new MqttClientOptions() .setPort(SERVER_PORT) .setHost(SERVER_HOST) .setKeepAliveTimeSeconds(2); MqttClient client = MqttClient.create(Vertx.vertx(), options); client.publishHandler(publish -> { System.out.println("Just received message on [" + publish.topicName() + "] payload [" + publish.payload().toString(Charset.defaultCharset()) + "] with QoS [" + publish.qosLevel() + "]"); }); client.subscribeCompleteHandler(h -> { System.out.println("Receive SUBACK from server with granted QoS : " + h.grantedQoSLevels()); client.publish( MQTT_TOPIC, Buffer.buffer(MQTT_MESSAGE), MqttQoS.AT_MOST_ONCE, false, false, s -> System.out.println("Publish sent to a server")); vertx.setTimer(5000, l -> client.unsubscribe(MQTT_TOPIC)); }); client.unsubscribeCompleteHandler(h -> { System.out.println("Receive UNSUBACK from server"); vertx.setTimer(5000, l -> client.disconnect(d -> System.out.println("Disconnected form server")) ); }); client.connect(ch -> { if (ch.succeeded()) { System.out.println("Connected to a server"); client.subscribe(MQTT_TOPIC, 0); } else { System.out.println("Failed to connect to a server"); System.out.println(ch.cause()); } }); }
Source:
public void onSelectDataSource() { dataSourceSelector.setGlobal(); dataSourceSelector.show( new ParameterizedCommand<DataSourceDefInfo>() { @Override public void execute( DataSourceDefInfo defInfo ) { ensurePersistenceUnit(); if ( defInfo.isDeployed() ) { getContent().getDescriptorModel().getPersistenceUnit().setJtaDataSource( defInfo.getDeploymentInfo().getJndi() ); view.setJTADataSource( defInfo.getDeploymentInfo().getJndi() ); } } }, new Command() { @Override public void execute() { } } ); }

Target:
public void onSelectDataSource() { dataSourceSelector.setGlobalSelection(); dataSourceSelector.show( new ParameterizedCommand<DataSourceInfo>() { @Override public void execute( DataSourceInfo dataSourceInfo ) { ensurePersistenceUnit(); if ( dataSourceInfo.isDeployed() ) { getContent().getDescriptorModel().getPersistenceUnit().setJtaDataSource( dataSourceInfo.getJndi() ); view.setJTADataSource( dataSourceInfo.getJndi() ); } } }, new Command() { @Override public void execute() { } } ); }
Source:
public CostEstimate estimateCost( OptimizablePredicateList predList, ConglomerateDescriptor cd, CostEstimate outerCost, Optimizer optimizer, RowOrdering rowOrdering) throws StandardException { costEstimate = getScratchCostEstimate(optimizer); if (implementsVTICosting) { try { VTICosting vtic = getVTICosting(); estimatedCost = vtic.getEstimatedCostPerInstantiation(this); estimatedRowCount = vtic.getEstimatedRowCount(this); supportsMultipleInstantiations = vtic.supportsMultipleInstantiations(this); costEstimate.setEstimatedCost(estimatedCost); costEstimate.setRowCount(estimatedRowCount); costEstimate.setSingleScanRowCount(estimatedRowCount); costEstimate.setLocalCost(estimatedCost); costEstimate.setRemoteCost(estimatedCost); int numPartitions = costEstimate.partitionCount(); if (numPartitions <= 0) numPartitions = 1; costEstimate.setLocalCostPerPartition(estimatedCost/numPartitions); costEstimate.setRemoteCostPerPartition(estimatedCost/numPartitions); } catch (SQLException sqle) { throw StandardException.unexpectedUserException(sqle); } vtiCosted = true; } AccessPath currentAccessPath=getCurrentAccessPath(); JoinStrategy currentJoinStrategy=currentAccessPath.getJoinStrategy(); OptimizerTrace tracer =optimizer.tracer(); boolean oldIsAntiJoin = outerCost.isAntiJoin(); currentJoinStrategy.estimateCost(this,predList,cd,outerCost,optimizer,costEstimate); outerCost.setAntiJoin(oldIsAntiJoin); tracer.trace(OptimizerFlag.COST_OF_N_SCANS,tableNumber,0,outerCost.rowCount(),costEstimate, correlationName); return costEstimate; }

Target:
public CostEstimate estimateCost( OptimizablePredicateList predList, ConglomerateDescriptor cd, CostEstimate outerCost, Optimizer optimizer, RowOrdering rowOrdering) throws StandardException { costEstimate = getScratchCostEstimate(optimizer); if (implementsVTICosting) { try { VTICosting vtic = getVTICosting(); estimatedCost = vtic.getEstimatedCostPerInstantiation(this); estimatedRowCount = vtic.getEstimatedRowCount(this); supportsMultipleInstantiations = vtic.supportsMultipleInstantiations(this); costEstimate.setEstimatedCost(estimatedCost); costEstimate.setRowCount(estimatedRowCount); costEstimate.setSingleScanRowCount(estimatedRowCount); costEstimate.setLocalCost(estimatedCost); costEstimate.setRemoteCost(estimatedCost); costEstimate.setLocalCostPerPartition(estimatedCost, costEstimate.partitionCount()); costEstimate.setRemoteCostPerPartition(estimatedCost, costEstimate.partitionCount()); } catch (SQLException sqle) { throw StandardException.unexpectedUserException(sqle); } vtiCosted = true; } AccessPath currentAccessPath=getCurrentAccessPath(); JoinStrategy currentJoinStrategy=currentAccessPath.getJoinStrategy(); OptimizerTrace tracer =optimizer.tracer(); boolean oldIsAntiJoin = outerCost.isAntiJoin(); currentJoinStrategy.estimateCost(this,predList,cd,outerCost,optimizer,costEstimate); outerCost.setAntiJoin(oldIsAntiJoin); tracer.trace(OptimizerFlag.COST_OF_N_SCANS,tableNumber,0,outerCost.rowCount(),costEstimate, correlationName); return costEstimate; }
Source:
public void setTasks(List<TaskDetails> newTasks) { if ((newTasks != null) && (newTasks.size() > 0)) { throw new NotImplementedException("Expected to be invoked only during deserialization for empty/null TaskDetails. Deserialization of non-empty TaskDetails should not be done in this setter but by implementing a TaskDetails Custom Deserializer in ClientObjectMapper."); } this.tasks.clear(); }

Target:
public void setTasks(List<TaskDetails> newTasks) { if ((newTasks != null) && (newTasks.size() > 0)) { throw new NotImplementedException("Expected to be invoked only during deserialization " + "for empty/null TaskDetails. Deserialization of non-empty TaskDetails should not be done " + "in this setter but by implementing a TaskDetails Custom Deserializer in ClientObjectMapper."); } this.tasks.clear(); }
Source:
public Message receive(final String queueName) { return execute(new ChannelCallback<Message>() { @Override public Message doInRabbit(Channel channel) throws IOException { GetResponse response = channel.basicGet(queueName, !isChannelTransacted()); if (response != null) { long deliveryTag = response.getEnvelope().getDeliveryTag(); if (isChannelLocallyTransacted(channel)) { channel.basicAck(deliveryTag, false); channel.txCommit(); } else if (isChannelTransacted()) { ConnectionFactoryUtils.registerDeliveryTag(getConnectionFactory(), channel, deliveryTag); } return RabbitTemplate.this.buildMessageFromResponse(response); } return null; } }, obtainTargetConnectionFactoryIfNecessary(null)); }

Target:
public Message receive(final String queueName) { return execute(new ChannelCallback<Message>() { @Override public Message doInRabbit(Channel channel) throws IOException { GetResponse response = channel.basicGet(queueName, !isChannelTransacted()); if (response != null) { long deliveryTag = response.getEnvelope().getDeliveryTag(); if (isChannelLocallyTransacted(channel)) { channel.basicAck(deliveryTag, false); channel.txCommit(); } else if (isChannelTransacted()) { ConnectionFactoryUtils.registerDeliveryTag(getConnectionFactory(), channel, deliveryTag); } return RabbitTemplate.this.buildMessageFromResponse(response); } return null; } }, obtainTargetConnectionFactoryIfNecessary(this.receiveConnectionFactorySelectorExpression, queueName)); }
Source:
public AuthConfig lookupAuthConfig(DockerImageName dockerImageName, AuthConfig defaultAuthConfig) { log.debug("Looking up auth config for image: {}", dockerImageName); log.debug("RegistryAuthLocator has configFile: ({}) and commandPathPrefix: {}", configFile, configFile.exists() ? "exists" : "does not exist", commandPathPrefix); try { final JsonNode config = OBJECT_MAPPER.readTree(configFile); final String registryName = effectiveRegistryName(dockerImageName); log.debug("registryName for dockerImageName [{}]", registryName, dockerImageName); final AuthConfig helperAuthConfig = authConfigUsingHelper(config, registryName); if (helperAuthConfig != null) { log.debug("found helper auth config [{}]", toSafeString(helperAuthConfig)); return helperAuthConfig; } final AuthConfig storeAuthConfig = authConfigUsingStore(config, registryName); if (storeAuthConfig != null) { log.debug("found creds store auth config [{}]", toSafeString(storeAuthConfig)); return storeAuthConfig; } final AuthConfig existingAuthConfig = findExistingAuthConfig(config, registryName); if (existingAuthConfig != null) { log.debug("found existing auth config [{}]", toSafeString(existingAuthConfig)); return existingAuthConfig; } log.debug("no matching Auth Configs - falling back to defaultAuthConfig [{}]", toSafeString(defaultAuthConfig)); } catch (Exception e) { log.debug("Failure when attempting to lookup auth config (dockerImageName: {}, configFile: {}. Falling back to docker-java default behaviour. Exception message: {}", dockerImageName, configFile, e.getMessage()); } return defaultAuthConfig; }

Target:
public AuthConfig lookupAuthConfig(DockerImageName dockerImageName, AuthConfig defaultAuthConfig) { log.debug("Looking up auth config for image: {}", dockerImageName); log.debug("RegistryAuthLocator has configFile: ({}) and commandPathPrefix: {}", configFile, configFile.exists() ? "exists" : "does not exist", commandPathPrefix); try { final JsonNode config = OBJECT_MAPPER.readTree(configFile); final String registryName = effectiveRegistryName(dockerImageName); log.debug("registryName for dockerImageName [{}]", registryName, dockerImageName); final AuthConfig helperAuthConfig = authConfigUsingHelper(config, registryName); if (helperAuthConfig != null) { log.debug("found helper auth config [{}]", toSafeString(helperAuthConfig)); return helperAuthConfig; } final AuthConfig storeAuthConfig = authConfigUsingStore(config, registryName); if (storeAuthConfig != null) { log.debug("found creds store auth config [{}]", toSafeString(storeAuthConfig)); return storeAuthConfig; } final AuthConfig existingAuthConfig = findExistingAuthConfig(config, registryName); if (existingAuthConfig != null) { log.debug("found existing auth config [{}]", toSafeString(existingAuthConfig)); return existingAuthConfig; } log.debug("no matching Auth Configs - falling back to defaultAuthConfig [{}]", toSafeString(defaultAuthConfig)); } catch (Exception e) { log.warn("Failure when attempting to lookup auth config (dockerImageName: {}, configFile: {}. Falling back to docker-java default behaviour. Exception message: {}", dockerImageName, configFile, e.getMessage()); } return defaultAuthConfig; }
Source:
public Response revokeSingleToken(@PathParam("accountId") String accountId, JsonNode payload) throws ValidationException, TokenNotFoundException { validatePayloadHasFields(payload, Collections.emptyList(), asList(TOKEN_LINK_FIELD, TOKEN_FIELD)); if (payload.hasNonNull(TOKEN_FIELD)) { return tokenService.extractEncryptedTokenFrom(payload.get(TOKEN_FIELD).asText()) .map(token -> authDao.revokeSingleToken(accountId, TokenHash.of(token.getName())) .map(this::buildRevokedTokenResponse)) .orElseThrow(() -> new TokenNotFoundException("Could not revoke token")) .orElseThrow(() -> new TokenNotFoundException("Could not retrieve token_hash from token")); } else { TokenLink tokenLink = TokenLink.of(payload.get(TOKEN_LINK_FIELD).asText()); return authDao.revokeSingleToken(accountId, tokenLink) .map(this::buildRevokedTokenResponse) .orElseThrow(() -> new TokenNotFoundException("Could not revoke token with " + tokenLink)); } }

Target:
public Response revokeSingleToken(@PathParam("accountId") String accountId, JsonNode payload) throws ValidationException, TokenNotFoundException { validatePayloadHasFields(payload, Collections.emptyList(), asList(TOKEN_LINK_FIELD, TOKEN_FIELD)); if (payload.hasNonNull(TOKEN_FIELD)) { return tokenService.extractEncryptedTokenFrom(payload.get(TOKEN_FIELD).asText()) .map(token -> authDao.revokeSingleToken(accountId, TokenHash.of(token.getName())) .map(this::buildRevokedTokenResponse)) .orElseThrow(() -> new TokenNotFoundException("Could not revoke token")) .orElseThrow(() -> new TokenNotFoundException("Could not extract encrypted token while revoking token")); } else { TokenLink tokenLink = TokenLink.of(payload.get(TOKEN_LINK_FIELD).asText()); return authDao.revokeSingleToken(accountId, tokenLink) .map(this::buildRevokedTokenResponse) .orElseThrow(() -> new TokenNotFoundException("Could not revoke token with " + tokenLink)); } }
Source:
public void visit(Constructor<?> constructor) { assert constructor.getDeclaringClass().equals(classType.getRuntimeClass()) : "classType " + classType + " and declaring class " + constructor.getDeclaringClass().getName() + " should be same"; if (!reflectionPredicate.test(constructor)) { return; } TypedClassOperation operation = instantiateTypes(TypedOperation.forConstructor(constructor)); checkSubTypes(operation); if (!omitPredicate.shouldOmit(operation)) { if (operationSpecifications != null) { OperationConditions conditions = operationSpecifications.getOperationConditions(constructor); if (!conditions.isEmpty()) { operation.addConditions(conditions); } } operations.add(operation); } }

Target:
public void visit(Constructor<?> constructor) { if (debug) { System.out.println("OperationExtractor.visit: constructor=" + constructor); } assert constructor.getDeclaringClass().equals(classType.getRuntimeClass()) : "classType " + classType + " and declaring class " + constructor.getDeclaringClass().getName() + " should be same"; if (!reflectionPredicate.test(constructor)) { return; } TypedClassOperation operation = instantiateTypes(TypedOperation.forConstructor(constructor)); if (debug) { System.out.println("OperationExtractor.visit: operation=" + operation); } checkSubTypes(operation); if (!omitPredicate.shouldOmit(operation)) { if (operationSpecifications != null) { ExecutableSpecification execSpec = operationSpecifications.getExecutableSpecification(constructor); if (!execSpec.isEmpty()) { operation.addExecutableSpecification(execSpec); } } if (debug) { System.out.println("OperationExtractor.visit: add operation " + operation); } operations.add(operation); } }