auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void scaleTo0ShouldWarn() { int pods = PodsAreDeployed.getNumberOfCurrentReplicas(project, OpenShiftResources.EAP_APP_REPLICATION_CONTROLLER); new WaitUntil( new PodsAreDeployed(project, OpenShiftResources.EAP_APP_REPLICATION_CONTROLLER, pods), TimePeriod.LONG); OpenShiftResource replicationController = project.getOpenShiftResource(Resource.DEPLOYMENT, OpenShiftResources.EAP_APP_REPLICATION_CONTROLLER); replicationController.select(); scaleTo(0); Matcher<String> confirmationDialogMatcher = new ShellButtonsMatcher(Arrays.asList("Yes", "No")); new WaitUntil(new ShellMatchingMatcherIsAvailable(confirmationDialogMatcher)); new DefaultShell(confirmationDialogMatcher).setFocus(); new YesButton().click(); assertPodAmountDesiredEqualsCurrent(0, project); }

Target:
public void scaleTo0ShouldWarn() { int pods = requiredService.getReplicationController().getCurrentReplicaCount(); new WaitUntil( new PodsAreDeployed(project, OpenShiftResources.NODEJS_APP_REPLICATION_CONTROLLER, pods), TimePeriod.LONG); OpenShiftResource replicationController = project.getOpenShiftResource(Resource.DEPLOYMENT, OpenShiftResources.NODEJS_APP_REPLICATION_CONTROLLER); replicationController.select(); scaleTo(0); new DefaultShell(OpenShiftLabel.Shell.STOP_ALL_DEPLOYMENTS).setFocus(); new YesButton().click(); assertPodAmountDesiredEqualsCurrent(0, project); }
Source:
public void testClearSpec() throws Exception { Assume.assumeFalse("IBM JDK does not support some of the algorithms used in this test. See ELY-2063.", isIbmJdk()); ClearPasswordSpec clearSpec = new ClearPasswordSpec("myMaskedPassword".toCharArray()); PasswordFactory factory = PasswordFactory.getInstance(algorithm); MaskedPassword masked = (MaskedPassword) factory.generatePassword(clearSpec); ClearPasswordSpec unmasked = factory.getKeySpec(masked, ClearPasswordSpec.class); Assert.assertEquals("myMaskedPassword", new String(unmasked.getEncodedPassword())); KeySpec maskedSpec = new MaskedPasswordSpec(masked.getInitialKeyMaterial(), masked.getIterationCount(), masked.getSalt(), masked.getMaskedPasswordBytes(), masked.getInitializationVector()); MaskedPassword copyOfMasked = (MaskedPassword) factory.generatePassword(maskedSpec); ClearPasswordSpec unmasked2 = factory.getKeySpec(copyOfMasked, ClearPasswordSpec.class); Assert.assertEquals("myMaskedPassword", new String(unmasked2.getEncodedPassword())); }

Target:
public void testClearSpec() throws Exception { ClearPasswordSpec clearSpec = new ClearPasswordSpec("myMaskedPassword".toCharArray()); PasswordFactory factory = PasswordFactory.getInstance(algorithm); MaskedPassword masked = (MaskedPassword) factory.generatePassword(clearSpec); ClearPasswordSpec unmasked = factory.getKeySpec(masked, ClearPasswordSpec.class); Assert.assertEquals("myMaskedPassword", new String(unmasked.getEncodedPassword())); KeySpec maskedSpec = new MaskedPasswordSpec(masked.getInitialKeyMaterial(), masked.getIterationCount(), masked.getSalt(), masked.getMaskedPasswordBytes(), masked.getInitializationVector()); MaskedPassword copyOfMasked = (MaskedPassword) factory.generatePassword(maskedSpec); ClearPasswordSpec unmasked2 = factory.getKeySpec(copyOfMasked, ClearPasswordSpec.class); Assert.assertEquals("myMaskedPassword", new String(unmasked2.getEncodedPassword())); }
Source:
public void testExportWithFilter() throws IOException { SWTBotEditor editorBot = fEditorBot; assertNotNull(editorBot); final SWTBotTable tableBot = editorBot.bot().table(); tableBot.getTableItem(0).click(3); SWTBotText textBot = editorBot.bot().text(); textBot.typeText("LoggerA|LoggerB|LoggerC"); textBot.pressShortcut(Keystrokes.CTRL, Keystrokes.CR); fBot.waitUntil(Conditions.tableHasRows(tableBot, 6), 5000); tableBot.getTableItem(1).contextMenu(EXPORT_TO_TSV).click(); assertTsvContentsEquals(ImmutableList.of(HEADER_TEXT, EVENT1_TEXT, EVENT2_TEXT, EVENT3_TEXT)); fBot.closeAllEditors(); }

Target:
public void testExportWithFilter() throws IOException { SWTBotEditor editorBot = fEditorBot; assertNotNull(editorBot); final SWTBotTable tableBot = editorBot.bot().table(); tableBot.getTableItem(0).click(3); SWTBotText textBot = editorBot.bot().text(); textBot.typeText("LoggerA|LoggerB|LoggerC"); textBot.pressShortcut(Keystrokes.CTRL, Keystrokes.CR); fBot.waitUntil(Conditions.tableHasRows(tableBot, 6), 5000); tableBot.getTableItem(1).contextMenu(EXPORT_TO_TSV).click(); assertTsvContentsEquals(ImmutableList.of(HEADER_TEXT, EVENT1_TEXT, EVENT2_TEXT, EVENT3_TEXT)); }
Source:
public void shouldSetRemovalTime_HistoricProcessInstanceAuthorization() { testRule.getProcessEngineConfiguration() .setEnableHistoricInstancePermissions(true); String processInstanceId = testRule.process().call().userTask().deploy().start(); Authorization authorization = authorizationService.createNewAuthorization(Authorization.AUTH_TYPE_GRANT); authorization.setResource(Resources.HISTORIC_PROCESS_INSTANCE); authorization.setResourceId(processInstanceId); authorization.setUserId("foo"); authorizationService.saveAuthorization(authorization); authorization = authorizationService.createAuthorizationQuery().singleResult(); assertThat(authorization.getRemovalTime()).isNull(); testRule.updateHistoryTimeToLive("rootProcess", 5); HistoricProcessInstanceQuery query = historyService.createHistoricProcessInstanceQuery().rootProcessInstances(); testRule.syncExec( historyService.setRemovalTimeToHistoricProcessInstances() .calculatedRemovalTime() .byQuery(query) .hierarchical() .executeAsync() ); authorization = authorizationService.createAuthorizationQuery() .resourceType(Resources.HISTORIC_PROCESS_INSTANCE) .singleResult(); assertThat(authorization.getRemovalTime()).isEqualTo(addDays(CURRENT_DATE, 5)); testRule.clearAuthorization(); }

Target:
public void shouldSetRemovalTime_HistoricProcessInstanceAuthorization() { testRule.getProcessEngineConfiguration() .setEnableHistoricInstancePermissions(true); String processInstanceId = testRule.process().call().userTask().deploy().start(); Authorization authorization = authorizationService.createNewAuthorization(Authorization.AUTH_TYPE_GRANT); authorization.setResource(Resources.HISTORIC_PROCESS_INSTANCE); authorization.setResourceId(processInstanceId); authorization.setUserId("foo"); authorizationService.saveAuthorization(authorization); authorization = authorizationService.createAuthorizationQuery().singleResult(); assertThat(authorization.getRemovalTime()).isNull(); testRule.updateHistoryTimeToLive("rootProcess", 5); HistoricProcessInstanceQuery query = historyService.createHistoricProcessInstanceQuery().rootProcessInstances(); testRule.syncExec( historyService.setRemovalTimeToHistoricProcessInstances() .calculatedRemovalTime() .byQuery(query) .hierarchical() .executeAsync() ); authorization = authorizationService.createAuthorizationQuery() .resourceType(Resources.HISTORIC_PROCESS_INSTANCE) .singleResult(); assertThat(authorization.getRemovalTime()).isEqualTo(addDays(CURRENT_DATE, 5)); }
Source:
public String apply(@NotNull String key) { CacheRefKeeper cacheRefKeeper = refOfCacheKeeper.get(); if (cacheRefKeeper == null) { throw new ISE("Cache reference is null WTF"); } PollingCache cache = cacheRefKeeper.getAndIncrementRef(); try { if (cache == null) { return this.apply(key); } return Strings.emptyToNull((String) cache.get(key)); } finally { if (cacheRefKeeper != null && cache != null) { cacheRefKeeper.doneWithIt(); } } }

Target:
public String apply(@NotNull String key) { final CacheRefKeeper cacheRefKeeper = refOfCacheKeeper.get(); if (cacheRefKeeper == null) { throw new ISE("Cache reference is null WTF"); } final PollingCache cache = cacheRefKeeper.getAndIncrementRef(); try { if (cache == null) { return this.apply(key); } return Strings.emptyToNull((String) cache.get(key)); } finally { if (cacheRefKeeper != null && cache != null) { cacheRefKeeper.doneWithIt(); } } }
Source:
public TorrentStatistic getStatistics(String dotTorrentFilePath) throws IOException { FileMetadataProvider metadataProvider = new FileMetadataProvider(dotTorrentFilePath); TorrentMetadata metadata = metadataProvider.getTorrentMetadata(); LoadedTorrent loadedTorrent = communicationManager.getTorrentsStorage().getLoadedTorrent(metadata.getHexInfoHash()); if (loadedTorrent != null) { return loadedTorrent.getTorrentStatistic(); } throw new IllegalStateException("Torrent has not been loaded yet"); }

Target:
public TorrentStatistic getStatistics(String dotTorrentFilePath) throws IOException { FileMetadataProvider metadataProvider = new FileMetadataProvider(dotTorrentFilePath); TorrentMetadata metadata = metadataProvider.getTorrentMetadata(); LoadedTorrent loadedTorrent = communicationManager.getTorrentsStorage().getLoadedTorrent(metadata.getHexInfoHash()); if (loadedTorrent != null) { return new TorrentStatistic(loadedTorrent.getTorrentStatistic()); } throw new IllegalStateException("Torrent has not been loaded yet"); }
Source:
public static final byte[] getKeyFingerprintBytes(final PublicKey key) { if (key == null) { log.error("Public key is uninitialized, failed to retreive fingerprint."); return null; } final byte[] keyBytes = getKeyBytes(key); if (keyBytes == null) { log.error("Can't get key bytes, will return null."); return null; } final byte[] fingerprintBytes = DigestUtils.md5(keyBytes); if (log.isDebugEnabled()) { log.debug("Fingerprint bytes are " + Hex.encodeHexString(fingerprintBytes) + "."); } return fingerprintBytes; }

Target:
public static final byte[] getKeyFingerprintBytes(final PublicKey key) { if (key == null) { log.error("Public key is null, failed to retreive fingerprint."); return null; } final byte[] keyBytes = getKeyBytes(key); if (keyBytes == null) { log.error("Can't get key bytes, will return null."); return null; } final byte[] fingerprintBytes = DigestUtils.md5(keyBytes); if (log.isDebugEnabled()) { log.debug("Fingerprint bytes are " + Hex.encodeHexString(fingerprintBytes) + "."); } return fingerprintBytes; }
Source:
public E get() throws InterruptedException, ExecutionException { String name = Thread.currentThread().getName(); System.out.println(">>> FATAL " + name); if (name.contains("client.thread")) { throw new IllegalStateException(">>> FATAL " + name); } return super.get(); }

Target:
public E get() throws InterruptedException, ExecutionException { assert (!Thread.currentThread().getName().contains("client.thread")); return super.get(); }
Source:
public void base_tree_visitor_check() { List<Issue> issues = issueClient.find(IssueQuery.create().rules("javascript-custom-rules:base")).list(); assertThat(issues).hasSize(1); Issue issue = issues.get(0); assertThat(issue.line()).isEqualTo(2); assertThat(issue.message()).isEqualTo("Function expression."); }

Target:
public void base_tree_visitor_check() { List<Issues.Issue> issues = findIssues("deprecated-custom-rules:base"); assertThat(issues).hasSize(1); Issues.Issue issue = issues.get(0); assertThat(issue.getLine()).isEqualTo(2); assertThat(issue.getMessage()).isEqualTo("Function expression."); assertThat(issue.getDebt()).isEqualTo("5min"); }
Source:
public void setStateForDurability(Iv2InitiateTaskMessage initiateTask, Collection<Integer> involvedPartitions) { m_initiateTask = initiateTask; m_involvedPartitions = ImmutableSet.copyOf(involvedPartitions); if (m_initiateTaskBuffer == null) { m_initiateTaskBuffer = ByteBuffer.allocate(initiateTask.getSerializedSize()); } try { initiateTask.flattenToBuffer(m_initiateTaskBuffer); m_initiateTaskBuffer.flip(); } catch (IOException e) { throw new RuntimeException(e); } }

Target:
public void setStateForDurability(Iv2InitiateTaskMessage initiateTask, Collection<Integer> involvedPartitions) { m_initiateTask = initiateTask; m_involvedPartitions = ImmutableSet.copyOf(involvedPartitions); if (m_initiateTaskBuffer == null) { m_initiateTaskBuffer = ByteBuffer.allocate(initiateTask.getSerializedSize()); } else { m_initiateTaskBuffer.position(0); m_initiateTaskBuffer.limit(initiateTask.getSerializedSize()); } try { initiateTask.flattenToBuffer(m_initiateTaskBuffer); m_initiateTaskBuffer.flip(); } catch (IOException e) { throw new RuntimeException(e); } }
Source:
public Builder toBuilder() { return new Builder() .setConfiguration(configuration) .withTableId(tableId) .withScan(serializableScan.scan); }

Target:
public Builder toBuilder() { return new Builder(getConfiguration()) .withTableId(tableId) .withScan(serializableScan.scan); }
Source:
private void processAndVerifySuccess2(final Record input, final boolean isSuccess, boolean isSame, final Integer countryGeoNameId, final Integer cityGeoNameId) { final Record inputCopy = input.copy(); collector.reset(); startSession(); assertEquals(1, collector.getNumStartEvents()); assertEquals(isSuccess, morphline.process(inputCopy)); if (!isSuccess) { assertEquals(0, collector.getRecords().size()); } else { assertEquals(1, collector.getRecords().size()); final Record actual = collector.getFirstRecord(); final Object body = actual.getFirstValue(Fields.ATTACHMENT_BODY); actual.removeAll(Fields.ATTACHMENT_BODY); assertEquals(input, actual); assertTrue(body instanceof JsonNode); final JsonNode jsonNode = (JsonNode)body; assertNotNull(jsonNode); System.out.println("VALUE: " + jsonNode.toString()); final JsonNode countryNode = jsonNode.get("country"); if (countryGeoNameId != null) { assertNotNull(countryNode); assertEquals(countryGeoNameId.intValue(), countryNode.get("geoname_id").asInt()); } else { assertNull(countryNode); } final JsonNode cityNode = jsonNode.get("city"); if (cityGeoNameId != null) { assertNotNull(cityNode); assertEquals(cityGeoNameId.intValue(), cityNode.get("geoname_id").asInt()); } else { assertNull(cityNode); } } }

Target:
private void processAndVerifySuccess2(final Record input, final boolean isSuccess, boolean isSame, final Integer countryGeoNameId, final Integer cityGeoNameId) { final Record inputCopy = input.copy(); collector.reset(); startSession(); assertEquals(1, collector.getNumStartEvents()); assertEquals(isSuccess, morphline.process(inputCopy)); if (!isSuccess) { assertEquals(0, collector.getRecords().size()); } else { assertEquals(1, collector.getRecords().size()); final Record actual = collector.getFirstRecord(); final Object body = actual.getFirstValue(Fields.ATTACHMENT_BODY); actual.removeAll(Fields.ATTACHMENT_BODY); assertEquals(input, actual); assertTrue(body instanceof JsonNode); final JsonNode jsonNode = (JsonNode)body; assertNotNull(jsonNode); final JsonNode countryNode = jsonNode.get("country"); if (countryGeoNameId != null) { assertNotNull(countryNode); assertEquals(countryGeoNameId.intValue(), countryNode.get("geoname_id").asInt()); } else { assertNull(countryNode); } final JsonNode cityNode = jsonNode.get("city"); if (cityGeoNameId != null) { assertNotNull(cityNode); assertEquals(cityGeoNameId.intValue(), cityNode.get("geoname_id").asInt()); } else { assertNull(cityNode); } } }
Source:
public SingleOp(Runnable op) { this.op = op; }

Target:
public SingleOp(Runnable op) { this("SingleOp", op); }
Source:
public static void setCurrent(SiteContext current) { logger.debug("Getting read lock for context {}", current); current.accessLock.lock(); threadLocal.set(current); MDC.put(SITE_NAME_MDC_KEY, current.getSiteName()); }

Target:
public static void setCurrent(SiteContext current) { logger.debug("Getting access lock for context {}", current); current.accessLock.lock(); threadLocal.set(current); MDC.put(SITE_NAME_MDC_KEY, current.getSiteName()); }
Source:
public void assertCaptureTemplate() { PathMatcher pathMatcher = new RegexPathMatcher(); Map<String, String> variables = pathMatcher.captureVariables("/app/{jobName}/disable/{until}/done", "/app/myJob/disable/20201231/done?name=some_name&value=some_value"); assertFalse(variables.isEmpty()); assertEquals(2, variables.size()); assertEquals("myJob", variables.get("jobName")); assertEquals("20201231", variables.get("until")); assertNull(variables.get("app")); }

Target:
public void assertCaptureTemplate() { PathMatcher pathMatcher = new RegexPathMatcher(); Map<String, String> variables = pathMatcher.captureVariables("/app/{jobName}/disable/{until}/done", "/app/myJob/disable/20201231/done?name=some_name&value=some_value"); assertFalse(variables.isEmpty()); assertThat(variables.size(), is(2)); assertThat(variables.get("jobName"), is("myJob")); assertThat(variables.get("until"), is("20201231")); assertNull(variables.get("app")); }
Source:
public DestructionAwareBeanPostProcessor threadPoolShutdownProcessor() { return (Object bean, String beanName) -> { if (beanName.equals("taskExecutor")) { ExecutorService executor = (ExecutorService) bean; executor.shutdownNow(); } if (beanName.equals("taskScheduler")) { ExecutorService executor = ((ThreadPoolTaskScheduler) bean).getScheduledThreadPoolExecutor(); executor.shutdownNow(); } }; }

Target:
public DestructionAwareBeanPostProcessor threadPoolShutdownProcessor() { return (Object bean, String beanName) -> { if ("taskExecutor".equals(beanName)) { log.info("Shutting down ExecutorService '" + beanName + "'"); ExecutorService executor = (ExecutorService) bean; executor.shutdownNow(); } }; }
Source:
public static Observable<Long> rangeLong(long start, long count) { if (count < 0) { throw new IllegalArgumentException("count >= 0 required but it was " + count); } if (count == 0) { return empty(); } if (count == 1) { return just(start); } if (start + (count - 1) > Long.MAX_VALUE) { throw new IllegalArgumentException("Long overflow"); } return RxJavaPlugins.onAssembly(new ObservableRangeLong(start, count)); }

Target:
public static Observable<Long> rangeLong(long start, long count) { if (count < 0) { throw new IllegalArgumentException("count >= 0 required but it was " + count); } if (count == 0) { return empty(); } if (count == 1) { return just(start); } long end = start + (count - 1); if (start > 0 && end < 0) { throw new IllegalArgumentException("Overflow! start + count is bigger than Long.MAX_VALUE"); } return RxJavaPlugins.onAssembly(new ObservableRangeLong(start, count)); }
Source:
public PlanImpl build() { for (final String namespace : evaluatorsToAdd.keySet()) { for (final String evaluator : evaluatorsToAdd.get(namespace)) { if (evaluatorsToDelete.containsKey(namespace) && evaluatorsToDelete.get(namespace).contains(evaluator)) { throw new RuntimeException(evaluator + " is planned for both addition and deletion."); } } } for (final String namespace : allTransferSteps.keySet()) { for (final TransferStep transferStep : allTransferSteps.get(namespace)) { if (evaluatorsToDelete.containsKey(namespace) && evaluatorsToDelete.get(namespace).contains(transferStep.getDstId())) { throw new RuntimeException(transferStep.getDstId() + " is planned for deletion."); } else if (evaluatorsToAdd.containsKey(namespace) && evaluatorsToAdd.get(namespace).contains(transferStep.getSrcId())) { throw new RuntimeException(transferStep.getSrcId() + " is planned for addition."); } } } final DAG<EMOperation> dependencyGraph = constructDAG(evaluatorsToAdd, evaluatorsToDelete, allTransferSteps); int numTotalOps = 0; for (final Set<String> evalsToAdd : evaluatorsToAdd.values()) { numTotalOps += evalsToAdd.size(); } for (final Set<String> evalsToDel : evaluatorsToDelete.values()) { numTotalOps += evalsToDel.size(); } for (final List<TransferStep> transferSteps : allTransferSteps.values()) { numTotalOps += transferSteps.size(); } return new PlanImpl(evaluatorsToAdd, evaluatorsToDelete, allTransferSteps, dependencyGraph, numTotalOps); }

Target:
public PlanImpl build() { for (final String namespace : evaluatorsToAdd.keySet()) { for (final String evaluator : evaluatorsToAdd.get(namespace)) { if (evaluatorsToDelete.containsKey(namespace) && evaluatorsToDelete.get(namespace).contains(evaluator)) { throw new RuntimeException(evaluator + " is planned for both addition and deletion."); } } } for (final String namespace : allTransferSteps.keySet()) { for (final TransferStep transferStep : allTransferSteps.get(namespace)) { if (evaluatorsToDelete.containsKey(namespace) && evaluatorsToDelete.get(namespace).contains(transferStep.getDstId())) { throw new RuntimeException(transferStep.getDstId() + " is planned for deletion."); } else if (evaluatorsToAdd.containsKey(namespace) && evaluatorsToAdd.get(namespace).contains(transferStep.getSrcId())) { throw new RuntimeException(transferStep.getSrcId() + " is planned for addition."); } } } final DAG<EMOperation> dependencyGraph = constructDAG(evaluatorsToAdd, evaluatorsToDelete, allTransferSteps); return new PlanImpl(evaluatorsToAdd, evaluatorsToDelete, allTransferSteps, dependencyGraph); }
Source:
public void onNext(final AggregationMessage message) { LOG.log(Level.INFO, "Received aggregation message {0}", message); final String slaveId = message.getSlaveId().toString(); final String data = codec.decode(message.getData().array()); if (slaveId.substring(AggregationExampleDriver.WORKER_CONTEXT_PREFIX.length()) .equals(data.substring(AggregationExampleDriver.TASK_PREFIX.length()))) { msgCountDown.countDown(); } else { exception = exception == null ? new RuntimeException(String.format("SlaveId %s should not send message with data %s.", slaveId, data)) : exception; } }

Target:
public void onNext(final AggregationMessage message) { LOG.log(Level.INFO, "Received aggregation message {0}", message); final String slaveId = message.getSlaveId().toString(); final String data = codec.decode(message.getData().array()); if (slaveId.startsWith(AggregationExampleDriver.WORKER_CONTEXT_PREFIX) && data.startsWith(AggregationExampleDriver.TASK_PREFIX) && slaveId.substring(AggregationExampleDriver.WORKER_CONTEXT_PREFIX.length()) .equals(data.substring(AggregationExampleDriver.TASK_PREFIX.length()))) { msgCountDown.countDown(); } else { throw new RuntimeException(String.format("SlaveId %s should not send message with data %s.", slaveId, data)); } }
Source:
public PREfastParser() { super(Messages._Warnings_PREfast_ParserName(), Messages._Warnings_PREfast_LinkName(), Messages._Warnings_PREfast_TrendName(), PREFAST_PATTERN_WARNING, true); }

Target:
public PREfastParser() { super(Messages._Warnings_PREfast_ParserName(), Messages._Warnings_PREfast_LinkName(), Messages._Warnings_PREfast_TrendName(), PREFAST_PATTERN_WARNING); }
Source:
public void testSetHeaderStrictInvalidReference() { SAMRecord sam = createTestRecordHelper(); final SAMFileHeader samHeader = sam.getHeader(); sam.setReferenceName("unresolveable"); int originalRefIndex = sam.getReferenceIndex(); Assert.assertEquals(SAMRecord.NO_ALIGNMENT_REFERENCE_INDEX, originalRefIndex); Assert.assertNull(sam.mReferenceIndex); sam.setHeaderStrict(samHeader); }

Target:
public void testSetHeaderStrictInvalidReference() { SAMRecord sam = createTestRecordHelper(); final SAMFileHeader samHeader = sam.getHeader(); sam.setReferenceName("unresolvable"); Assert.assertEquals(new Integer(SAMRecord.NO_ALIGNMENT_REFERENCE_INDEX), sam.getReferenceIndex()); sam.setHeaderStrict(samHeader); }
Source:
public void render(Context context, GlusterVolumeEntity volume, SafeHtmlBuilder sb) { if (volume == null) { return; } GlusterStatus status = volume.getStatus(); ImageResource statusImage = null; String tooltip; Boolean brickWarn = false; for(GlusterBrickEntity brick : volume.getBricks()) { if(brick.getStatus() == GlusterStatus.DOWN) { brickWarn = true; } } if (!brickWarn) { switch (status) { case DOWN: statusImage = resources.downImage(); tooltip = constants.down(); break; case UP: statusImage = resources.upImage(); tooltip = constants.up(); break; default: statusImage = resources.downImage(); tooltip = constants.down(); } } else { statusImage = resources.volumeBrickWarning(); tooltip = constants.brickWarning(); } SafeHtml statusImageHtml = SafeHtmlUtils.fromTrustedString(AbstractImagePrototype.create(statusImage).getHTML()); sb.append(applicationTemplates.statusTemplate(statusImageHtml, tooltip)); }

Target:
public void render(Context context, GlusterVolumeEntity volume, SafeHtmlBuilder sb) { if (volume == null) { return; } GlusterStatus status = volume.getStatus(); ImageResource statusImage = null; String tooltip; Boolean isBrickDown = false; for(GlusterBrickEntity brick : volume.getBricks()) { if(brick.getStatus() == GlusterStatus.DOWN) { isBrickDown = true; break; } } if (!isBrickDown) { switch (status) { case DOWN: statusImage = resources.downImage(); tooltip = constants.down(); break; case UP: statusImage = resources.upImage(); tooltip = constants.up(); break; default: statusImage = resources.downImage(); tooltip = constants.down(); } } else { statusImage = resources.volumeUpWarning(); tooltip = constants.volumeBricksDown(); } SafeHtml statusImageHtml = SafeHtmlUtils.fromTrustedString(AbstractImagePrototype.create(statusImage).getHTML()); sb.append(applicationTemplates.statusTemplate(statusImageHtml, tooltip)); }
Source:
static InputStream createInputStream(String method, String id, String params) throws IOException { @SuppressWarnings("StringBufferMayBeStringBuilder") StringBuffer envelope = new StringBuffer(); envelope.append("{\""); envelope.append(JSONRPC); envelope.append("\":\""); envelope.append(VERSION); envelope.append("\",\""); envelope.append(ID); envelope.append("\":"); if (null!=id && 0!=id.length()) { envelope.append(id); } else { envelope.append("null"); } envelope.append(",\""); envelope.append(METHOD); envelope.append("\":"); if (null!=method && 0!=method.length()) { envelope.append('"'); envelope.append(method); envelope.append('"'); } else { envelope.append("null"); } envelope.append(",\""); envelope.append(PARAMS); envelope.append("\":"); if (null!=params && 0!=params.length()) { String decodedParams; if(BASE64_PATTERN.matcher(params).matches()) { decodedParams = new String(Base64.decode(params), StandardCharsets.UTF_8); } else { switch(params.charAt(0)) { case '[': case '{': decodedParams = params; break; default: throw new IOException("badly formed 'param' parameter starting with; [" + params.charAt(0) + "]"); } } envelope.append(decodedParams); } else { envelope.append("[]"); } envelope.append('}'); return new ByteArrayInputStream(envelope.toString().getBytes(StandardCharsets.UTF_8)); }

Target:
static InputStream createInputStream(String method, String id, String params) throws IOException { StringBuilder envelope = new StringBuilder(); envelope.append("{\""); envelope.append(JSONRPC); envelope.append("\":\""); envelope.append(VERSION); envelope.append("\",\""); envelope.append(ID); envelope.append("\":"); if (null!=id && 0!=id.length()) { envelope.append(id); } else { envelope.append("null"); } envelope.append(",\""); envelope.append(METHOD); envelope.append("\":"); if (null!=method && 0!=method.length()) { envelope.append('"'); envelope.append(method); envelope.append('"'); } else { envelope.append("null"); } envelope.append(",\""); envelope.append(PARAMS); envelope.append("\":"); if (null!=params && 0!=params.length()) { String decodedParams; if(BASE64_PATTERN.matcher(params).matches()) { decodedParams = new String(Base64.decode(params), StandardCharsets.UTF_8); } else { switch(params.charAt(0)) { case '[': case '{': decodedParams = params; break; default: throw new IOException("badly formed 'param' parameter starting with; [" + params.charAt(0) + "]"); } } envelope.append(decodedParams); } else { envelope.append("[]"); } envelope.append('}'); return new ByteArrayInputStream(envelope.toString().getBytes(StandardCharsets.UTF_8)); }
Source:
public Observable<User> update(final UserSpec spec) { Timber.e("Calling update"); Observable<User> me = getMe(); me = me.map(new Func1<User, User>() { @Override public User call(User user) { Timber.e("getMe map"); String firstName = spec.user().getData().attributes().getFirstName(); String lastName = spec.user().getData().attributes().getLastName(); user.getData().attributes() .firstName(firstName) .lastName(lastName); return user; } }); me = me.flatMap(new Func1<User, Observable<User>>() { @Override public Observable<User> call(User user) { Timber.e("getMe flatmap"); CreateUserRequest request = spec.getCreateUserRequest() .withAttributes(user.getData().attributes()); return update(request); } }); Timber.e("Calling update finished"); return me; }

Target:
public Observable<User> update(final UserSpec spec) { Timber.v("Calling update"); Observable<User> me = getMe() .flatMap(new Func1<User, Observable<User>>() { @Override public Observable<User> call(User user) { Timber.v("getMe flatmap"); String firstName = spec.user().getData().attributes().getFirstName(); String lastName = spec.user().getData().attributes().getLastName(); user.getData().attributes() .firstName(firstName) .lastName(lastName); CreateUserRequest request = spec.getCreateUserRequest() .withAttributes(user.getData().attributes()); return update(request); } }); Timber.v("Calling update finished"); return me; }
Source:
public PDataType getDataType() { return PDataType.BINARY; }

Target:
public PDataType getDataType() { return PDataType.VARBINARY; }
Source:
private void handleGetProduct(RoutingContext routingContext) { String productID = routingContext.request().getParam("productID"); HttpServerResponse response = routingContext.response(); if (productID == null) { sendError(400, response); } else { client.getConnection(res -> { if (res.failed()) { sendError(500, response); } else { res.result().queryWithParams("SELECT id, name, price, weight FROM products where id = ?", new JsonArray().add(Integer.parseInt(productID)), query -> { if (query.failed()) { sendError(500, response); } else { if (query.result().getNumRows() == 0) { sendError(404, response); } else { response.putHeader("content-type", "application/json").end(query.result().getRows().get(0).encode()); } } }); } }); } }

Target:
private void handleGetProduct(RoutingContext routingContext) { String productID = routingContext.request().getParam("productID"); HttpServerResponse response = routingContext.response(); if (productID == null) { sendError(400, response); } else { SQLConnection conn = routingContext.get("conn"); conn.queryWithParams("SELECT id, name, price, weight FROM products where id = ?", new JsonArray().add(Integer.parseInt(productID)), query -> { if (query.failed()) { sendError(500, response); } else { if (query.result().getNumRows() == 0) { sendError(404, response); } else { response.putHeader("content-type", "application/json").end(query.result().getRows().get(0).encode()); } } }); } }
Source:
protected void fireHandlerChanged(final HandlerEvent handlerEvent) { if (handlerEvent == null) { throw new NullPointerException(); } final Object[] listeners = getListeners(); for (Object listener2 : listeners) { final IHandlerListener listener = (IHandlerListener) listener2; listener.handlerChanged(handlerEvent); } }

Target:
protected void fireHandlerChanged(final HandlerEvent handlerEvent) { if (handlerEvent == null) { throw new NullPointerException(); } final Object[] listeners = getListeners(); for (Object listener : listeners) { final IHandlerListener handlerListener = (IHandlerListener) listener; handlerListener.handlerChanged(handlerEvent); } }
Source:
public void InteractiveMaps_041_VerifyBlockedUsersCannotCreateCustomMap() { WikiBasePageObject base = new WikiBasePageObject(driver); base.logInCookie(credentials.userNameBlockedAccount, credentials.passwordBlockedAccount, wikiURL); InteractiveMapsPageObject specialMaps = base.openSpecialInteractiveMaps(wikiURL); CreateAMapComponentObject createMap = specialMaps.clickCreateAMap(); CreateACustomMapComponentObject customMap = createMap.clickCustomMap(); String selectedImageName = customMap.getSelectedTemplateImageName(InteractiveMapsContent.selectedTemplateIndex); TemplateComponentObject template = customMap.selectTemplate(InteractiveMapsContent.selectedTemplateIndex); template.verifyTemplateImage(selectedImageName); template.typeMapName(InteractiveMapsContent.mapName); CreatePinTypesComponentObject pinDialog = template.clickNext(); template.verifyErrorExist(); }

Target:
public void InteractiveMaps_041_VerifyBlockedUsersCannotCreateCustomMap() { WikiBasePageObject base = new WikiBasePageObject(driver); base.logInCookie(credentials.userNameBlockedAccount, credentials.passwordBlockedAccount, wikiURL); InteractiveMapsPageObject specialMaps = base.openSpecialInteractiveMaps(wikiURL); CreateAMapComponentObject createMap = specialMaps.clickCreateAMap(); CreateACustomMapComponentObject customMap = createMap.clickCustomMap(); String selectedImageName = customMap.getSelectedTemplateImageName(InteractiveMapsContent.selectedTemplateIndex); TemplateComponentObject template = customMap.selectTemplate(InteractiveMapsContent.selectedTemplateIndex); template.verifyTemplateImage(selectedImageName); template.typeMapName(InteractiveMapsContent.mapName); CreatePinTypesComponentObject pinDialog = template.clickNext(); template.verifyErrorExists(); }
Source:
public LayeredConnectionSocketFactory buildSSLSocketFactory(ConnectorDetails connectorDetails) { if (connectorDetails.isVerifySsl()) { return SSLConnectionSocketFactory.getSocketFactory(); } else { try { SSLContext sslContext = SSLContexts.custom().loadTrustMaterial(null, TRUST_ALL_STRATEGY).build(); return new SSLConnectionSocketFactory(sslContext, NoopHostnameVerifier.INSTANCE); } catch (NoSuchAlgorithmException | KeyManagementException | KeyStoreException e) { log.error("Error building SSL socket factory", e); throw new IllegalStateException(e); } } }

Target:
public LayeredConnectionSocketFactory buildSSLSocketFactory(ConnectorDetails connectorDetails) { if (connectorDetails.isVerifySsl()) { return SSLConnectionSocketFactory.getSocketFactory(); } try { SSLContext sslContext = SSLContexts.custom().loadTrustMaterial(null, TRUST_ALL_STRATEGY).build(); return new SSLConnectionSocketFactory(sslContext, NoopHostnameVerifier.INSTANCE); } catch (NoSuchAlgorithmException | KeyManagementException | KeyStoreException e) { log.error("Error building SSL socket factory", e); throw new IllegalStateException(e); } }
Source:
public void doSetup(ManagementClient managementClient, String containerId) throws Exception { List<ModelNode> operations = new ArrayList<>(); ModelNode addEjbDomain = createOpNode("subsystem=ejb3/application-security-domain=other", ADD); addEjbDomain.get("security-domain").set("ApplicationDomain"); operations.add(addEjbDomain); ModelNode updateRemotingConnector = createOpNode("subsystem=remoting/http-connector=http-remoting-connector", WRITE_ATTRIBUTE_OPERATION); updateRemotingConnector.get(ClientConstants.NAME).set("sasl-authentication-factory"); updateRemotingConnector.get(ClientConstants.VALUE).set("application-sasl-authentication"); operations.add(updateRemotingConnector); ModelNode updateOp = Operations.createCompositeOperation(operations); updateOp.get(OPERATION_HEADERS, ROLLBACK_ON_RUNTIME_FAILURE).set(false); updateOp.get(OPERATION_HEADERS, ALLOW_RESOURCE_SERVICE_RESTART).set(true); CoreUtils.applyUpdate(updateOp, managementClient.getControllerClient()); ServerReload.reloadIfRequired(managementClient.getControllerClient()); }

Target:
public void doSetup(ManagementClient managementClient, String containerId) throws Exception { List<ModelNode> operations = new ArrayList<>(); ModelNode addEjbDomain = createOpNode("subsystem=ejb3/application-security-domain=other", ADD); addEjbDomain.get("security-domain").set("ApplicationDomain"); operations.add(addEjbDomain); ModelNode updateRemotingConnector = createOpNode("subsystem=remoting/http-connector=http-remoting-connector", WRITE_ATTRIBUTE_OPERATION); updateRemotingConnector.get(ClientConstants.NAME).set("sasl-authentication-factory"); updateRemotingConnector.get(ClientConstants.VALUE).set("application-sasl-authentication"); operations.add(updateRemotingConnector); ModelNode updateOp = Operations.createCompositeOperation(operations); updateOp.get(OPERATION_HEADERS, ROLLBACK_ON_RUNTIME_FAILURE).set(false); updateOp.get(OPERATION_HEADERS, ALLOW_RESOURCE_SERVICE_RESTART).set(true); CoreUtils.applyUpdate(updateOp, managementClient.getControllerClient()); ServerReload.reloadIfRequired(managementClient); }
Source:
Mono<Void> send(Flux<EventData> events, SendOptions options) { if (events == null) { return monoError(logger, new NullPointerException("'events' cannot be null.")); } else if (options == null) { return monoError(logger, new NullPointerException("'options' cannot be null.")); } else if (options.getPartitionId() == null && this.isIdempotentPartitionPublishing) { return monoError(logger, new IllegalArgumentException("Please set the partition id in `options` " + "because this producer client is an idempotent producer")); } return sendInternal(events, options).publishOn(scheduler); }

Target:
Mono<Void> send(Flux<EventData> events, SendOptions options) { if (events == null) { return monoError(logger, new NullPointerException("'events' cannot be null.")); } else if (options == null) { return monoError(logger, new NullPointerException("'options' cannot be null.")); } else if (options.getPartitionId() == null && isIdempotentPartitionPublishing) { return monoError(logger, new IllegalArgumentException("Please set the partition id in `options` " + "because this producer client is an idempotent producer")); } return sendInternal(events, options).publishOn(scheduler); }
Source:
public void searchItem(Actor actor, @Switch(name = 'b', desc = "Only search for blocks") boolean blocksOnly, @Switch(name = 'i', desc = "Only search for items") boolean itemsOnly, @ArgFlag(name = 'p', desc = "Page of results to return", def = "1") int page, @Arg(desc = "Search query", variable = true) List<String> query) { String search = String.join(" ", query); if (search.length() <= 2) { actor.printError(TranslatableComponent.of("worldedit.searchitem.too-short")); return; } if (blocksOnly && itemsOnly) { actor.printError(TranslatableComponent.of("worldedit.searchitem.b-and-i")); return; } WorldEditAsyncCommandBuilder.createAndSendMessage(actor, new ItemSearcher(search, blocksOnly, itemsOnly, page), TranslatableComponent.of("worldedit.searchitem.searching")); }

Target:
public void searchItem(Actor actor, @Switch(name = 'b', desc = "Only search for blocks") boolean blocksOnly, @Switch(name = 'i', desc = "Only search for items") boolean itemsOnly, @ArgFlag(name = 'p', desc = "Page of results to return", def = "1") int page, @Arg(desc = "Search query", variable = true) List<String> query) { String search = String.join(" ", query); if (search.length() <= 2) { actor.printError(TranslatableComponent.of("worldedit.searchitem.too-short")); return; } if (blocksOnly && itemsOnly) { actor.printError(TranslatableComponent.of("worldedit.searchitem.either-b-or-i")); return; } WorldEditAsyncCommandBuilder.createAndSendMessage(actor, new ItemSearcher(search, blocksOnly, itemsOnly, page), TranslatableComponent.of("worldedit.searchitem.searching")); }
Source:
public void removeUnusedBackupTables(TransactionController tc) throws StandardException { SchemaDescriptor sd = getSystemSchemaDescriptor(); TableDescriptor td = getTableDescriptor("SYSBACKUPFILESET", sd, tc); if (td != null) { dropTableDescriptor(td, sd, tc); } td = getTableDescriptor("SYSBACKUPJOBS", sd, tc); if (td != null) { dropTableDescriptor(td, sd, tc); } }

Target:
public void removeUnusedBackupTables(TransactionController tc) throws StandardException { dropUnusedBackupTable("SYSBACKUPFILESET", tc); dropUnusedBackupTable("SYSBACKUPJOBS", tc); }
Source:
private int processCurrentGroupStructureSynchronizationThreads() { int timeout = BeansUtils.getCoreConfig().getGroupStructureSynchronizationTimeout(); int numberOfNewlyRemovedThreads = 0; Iterator<GroupStructureSynchronizerThread> threadIterator = groupStructureSynchronizerThreads.iterator(); while(threadIterator.hasNext()) { GroupStructureSynchronizerThread thread = threadIterator.next(); long threadStart = thread.getStartTime(); if(threadStart == 0) continue; long timeDiff = System.currentTimeMillis() - threadStart; if (thread.isInterrupted()) { numberOfNewlyRemovedThreads++; threadIterator.remove(); } else if(timeDiff/1000/60 > timeout) { log.error("One of threads was interrupted because of timeout!"); thread.interrupt(); threadIterator.remove(); numberOfNewlyRemovedThreads++; } } return numberOfNewlyRemovedThreads; }

Target:
private int processCurrentGroupStructureSynchronizationThreads() { int timeoutMinutes = BeansUtils.getCoreConfig().getGroupStructureSynchronizationTimeout(); int numberOfNewlyRemovedThreads = 0; Iterator<GroupStructureSynchronizerThread> threadIterator = groupStructureSynchronizerThreads.iterator(); while(threadIterator.hasNext()) { GroupStructureSynchronizerThread thread = threadIterator.next(); long threadStart = thread.getStartTime(); if (threadStart == 0) continue; long timeDiff = System.currentTimeMillis() - threadStart; if (thread.isInterrupted()) { numberOfNewlyRemovedThreads++; threadIterator.remove(); } else if(timeDiff/1000/60 > timeoutMinutes) { log.error("One of threads was interrupted because of timeout!"); thread.interrupt(); threadIterator.remove(); numberOfNewlyRemovedThreads++; } } return numberOfNewlyRemovedThreads; }
Source:
private boolean containsChangeOrCommit(String newRef, List<String> refs) { String compareStr = newRef.replaceFirst("/heads/", "/for/"); for (String ref : refs) { if(compareStr.equals(ref.replaceFirst("/heads/", "/for/"))) { return true; } } return false; }

Target:
private static boolean containsChangeOrCommit(String newRef, List<String> refs) { String compareStr = newRef.replaceFirst("/heads/", "/for/"); for (String ref : refs) { if (compareStr.equals(ref.replaceFirst("/heads/", "/for/"))) { return true; } } return false; }
Source:
KafkaSpoutConfig<String, String> createSpoutConfig() { return SingleTopicKafkaSpoutConfiguration.setCommonSpoutConfig( KafkaSpoutConfig.builder("127.0.0.1:" + kafkaUnitRule.getKafkaUnit().getKafkaPort(), Pattern.compile(SingleTopicKafkaSpoutConfiguration.TOPIC))) .setOffsetCommitPeriodMs(commitOffsetPeriodMs) .setRetry(new KafkaSpoutRetryExponentialBackoff(KafkaSpoutRetryExponentialBackoff.TimeInterval.seconds(0), KafkaSpoutRetryExponentialBackoff.TimeInterval.seconds(0), maxRetries, KafkaSpoutRetryExponentialBackoff.TimeInterval.seconds(0))) .setFirstPollOffsetStrategy(KafkaSpoutConfig.FirstPollOffsetStrategy.EARLIEST) .setProp(ConsumerConfig.MAX_POLL_RECORDS_CONFIG, maxPollRecords) .build(); }

Target:
KafkaSpoutConfig<String, String> createSpoutConfig() { return SingleTopicKafkaSpoutConfiguration.setCommonSpoutConfig( KafkaSpoutConfig.builder("127.0.0.1:" + kafkaUnitRule.getKafkaUnit().getKafkaPort(), Pattern.compile(SingleTopicKafkaSpoutConfiguration.TOPIC))) .setOffsetCommitPeriodMs(commitOffsetPeriodMs) .setFirstPollOffsetStrategy(KafkaSpoutConfig.FirstPollOffsetStrategy.EARLIEST) .build(); }
Source:
private void deleteProject(URIish replicateURI) { if (!replicateURI.isRemote()) { deleteLocally(replicateURI); } else if (isSSH(replicateURI)) { deleteRemoteSsh(replicateURI); } else { log.warn(String.format("Cannot delete project on remote site %s." + " Only local paths and SSH URLs are supported" + " for remote repository creation", replicateURI)); } }

Target:
private void deleteProject(URIish replicateURI) { if (!replicateURI.isRemote()) { deleteLocally(replicateURI); } else if (isSSH(replicateURI)) { deleteRemoteSsh(replicateURI); } else { log.warn(String.format("Cannot delete project on remote site %s." + " Only local paths and SSH URLs are supported" + " for remote repository deletion", replicateURI)); } }
Source:
static InboxSignalId newSignalId(Object targetId, String uuid) { checkNotNull(targetId); checkNotNull(uuid); String rawValue = uuid + " @" + Stringifiers.toString(targetId); InboxSignalId result = InboxSignalId.newBuilder() .setValue(rawValue) .build(); return result; }

Target:
static InboxSignalId newSignalId(Object targetId, String uuid) { checkNotNull(targetId); checkNotNull(uuid); String rawValue = uuid + '@' + Stringifiers.toString(targetId); InboxSignalId result = InboxSignalId.newBuilder() .setValue(rawValue) .build(); return result; }
Source:
public Indexer(Config config, Deduper deduper) { this.config = config; this.deduper = deduper; this.localDatabase = new SqlDatabase(config); try { localDatabase.getConnection().setReadOnly(true); } catch (SQLException e) { e.printStackTrace(); } this.eventBus = LocalEventBus.getInstance(); }

Target:
public Indexer(Config config, Deduper deduper) { this.config = config; this.deduper = deduper; this.localDatabase = new SqlDatabase(config, true); this.eventBus = LocalEventBus.getInstance(); }
Source:
public void runTask(final int protectionTime, final int waitTime, final Player player) { this.task = new BukkitRunnable() { @Override public void run() { ArrowBlocker.this.livingTime++; isActive = true; if (protectionTime > 0 && ArrowBlocker.this.livingTime == protectionTime) { player.sendMessage(ChatWriter.pluginMessage(Main._l("ingame.specials.arrow-blocker.end"))); isActive = false; } if (ArrowBlocker.this.livingTime >= waitTime && ArrowBlocker.this.livingTime >= protectionTime) { ArrowBlocker.this.game.removeRunningTask(this); ArrowBlocker.this.game.removeSpecialItem(ArrowBlocker.this); ArrowBlocker.this.task = null; isActive = false; this.cancel(); return; } } }.runTaskTimer(Main.getInstance(), 20L, 20L); this.game.addRunningTask(this.task); }

Target:
public void runTask(final int protectionTime, final int waitTime, final Player player) { this.task = new BukkitRunnable() { @Override public void run() { ArrowBlocker.this.livingTime++; if (protectionTime > 0 && ArrowBlocker.this.livingTime == protectionTime) { player.sendMessage(ChatWriter.pluginMessage(Main._l("ingame.specials.arrow-blocker.end"))); isActive = false; } if (ArrowBlocker.this.livingTime >= waitTime && ArrowBlocker.this.livingTime >= protectionTime) { ArrowBlocker.this.game.removeRunningTask(this); ArrowBlocker.this.game.removeSpecialItem(ArrowBlocker.this); ArrowBlocker.this.task = null; isActive = false; this.cancel(); return; } } }.runTaskTimer(Main.getInstance(), 0, 20L); this.game.addRunningTask(this.task); }
Source:
private Map<String, byte[]> getAttributeContent(Mail mail) throws MailetException { Serializable attributeContent = mail.getAttribute(attribute); if (! (attributeContent instanceof Map)) { LOGGER.debug("Invalid attribute found into attribute " + "{} class Map expected but " + "{} found.", attribute, attributeContent.getClass()); return ImmutableMap.of(); } return (Map<String, byte[]>) attributeContent; }

Target:
private Map<String, byte[]> getAttributeContent(Mail mail) throws MailetException { Serializable attributeContent = mail.getAttribute(attribute); if (! (attributeContent instanceof Map)) { LOGGER.debug("Invalid attribute found into attribute class Map expected but found.", attribute, attributeContent.getClass()); return ImmutableMap.of(); } return (Map<String, byte[]>) attributeContent; }
Source:
public static String tokenizerToJson(Tokenizer tokenizer) { Map<String, String> settingsMap = new HashMap<String, String>(); if (tokenizer != null) { settingsMap.put(TOKENIZE, tokenizer.tokenizerName); settingsMap.put(TOKENIZE_ARGS, tokenizer.tokenizerArguments); } return new String(JSONUtils.serializeAsBytes(settingsMap), Charset.forName("UTF-8")); }

Target:
public static String tokenizerToJson(Tokenizer tokenizer) { Map<String, String> settingsMap = new HashMap<String, String>(); if (tokenizer != null) { settingsMap.put(TOKENIZE, tokenizer.tokenizerName); settingsMap.put(TOKENIZE_ARGS, tokenizer.tokenizerArguments); } return JSONUtils.serializeAsString(settingsMap); }
Source:
public void dropTable(String tableName) throws UndefinedTableException, InsufficientPrivilegeException { String[] splitted = CatalogUtil.splitFQTableName(tableName); final String databaseName = splitted[0]; final String simpleName = splitted[1]; try { final BlockingInterface stub = getStub(); final TableIdentifierProto request = buildTableIdentifier(databaseName, simpleName); final ReturnState state = stub.dropTable(null, request); throwsIfThisError(state, UndefinedTableException.class); throwsIfThisError(state, InsufficientPrivilegeException.class); ensureOk(state); } catch (ServiceException e) { throw new RuntimeException(e); } }

Target:
public void dropTable(String tableName) throws UndefinedDatabaseException, UndefinedTableException, InsufficientPrivilegeException { String[] splitted = CatalogUtil.splitFQTableName(tableName); final String databaseName = splitted[0]; final String simpleName = splitted[1]; try { final BlockingInterface stub = getStub(); final TableIdentifierProto request = buildTableIdentifier(databaseName, simpleName); final ReturnState state = stub.dropTable(null, request); throwsIfThisError(state, UndefinedDatabaseException.class); throwsIfThisError(state, UndefinedTableException.class); throwsIfThisError(state, InsufficientPrivilegeException.class); ensureOk(state); } catch (ServiceException e) { throw new RuntimeException(e); } }