auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public TemplateCommand() { Options o = CommandLineHelper.getCommonOptions(); o.addOption("i", "input", true, "load ontology to merge from a file"); o.addOption("I", "input-iri", true, "load ontology to merge from an IRI"); o.addOption("o", "output", true, "save ontology to a file"); o.addOption("O", "ontology-iri", true, "set the output ontology IRI"); o.addOption("V", "version-iri", true, "set the output version IRI"); o.addOption("t", "template", true, "read template from a file"); o.addOption("A", "ancestors", false, "MIREOT ancestors into results"); o.addOption("m", "merge-before", false, "merge into input ontology before any output"); o.addOption("M", "merge-after", false, "merge into input ontology after any output"); o.addOption( "c", "collapse-import-closure", true, "if true, collapse the import closure when merging"); o.addOption( "a", "include-annotations", true, "if true, include ontology annotations from merge input"); options = o; }

Target:
public TemplateCommand() { Options o = CommandLineHelper.getCommonOptions(); o.addOption("i", "input", true, "load ontology to merge from a file"); o.addOption("I", "input-iri", true, "load ontology to merge from an IRI"); o.addOption("o", "output", true, "save ontology to a file"); o.addOption("O", "ontology-iri", true, "set the output ontology IRI"); o.addOption("V", "version-iri", true, "set the output version IRI"); o.addOption("t", "template", true, "read template from a file"); o.addOption("a", "ancestors", false, "MIREOT ancestors into results"); o.addOption("m", "merge-before", false, "merge into input ontology before any output"); o.addOption("M", "merge-after", false, "merge into input ontology after any output"); o.addOption( "c", "collapse-import-closure", true, "if true, collapse the import closure when merging"); o.addOption( "A", "include-annotations", true, "if true, include ontology annotations from merge input"); options = o; }
Source:
private static String getElixirSdkPath(){ if(SystemInfo.isMac) return ELIXIR_SDK_PATH + "/" + ELIXIR_SDK_VERSION; throw new RuntimeException("Only Mac supported"); }

Target:
private static String getElixirSdkPath(){ if(SystemInfo.isMac) return MAC_ELIXIR_SDK_PATH + "/" + ELIXIR_SDK_VERSION; if(SystemInfo.isLinux) return LINUX_ELIXIR_SDK_PATH + "/elixir-" + TRAVIS_CI_ELIXIR_SDK_VERSION + "/lib/elixir"; throw new RuntimeException("Only Mac supported"); }
Source:
private static ColumnDescription convertPBColumnDescription(RiakKvPB.TsColumnDescription pbColumn) { final String name = pbColumn.getName().toStringUtf8(); final ColumnDescription.ColumnType type = ColumnDescription.ColumnType.valueOf(pbColumn.getType().getNumber()); final List<ColumnDescription.ColumnType> complexType = new ArrayList<ColumnDescription.ColumnType>(pbColumn.getComplexTypeCount()); for (RiakKvPB.TsColumnType pbComplexType : pbColumn.getComplexTypeList()) { complexType.add(ColumnDescription.ColumnType.valueOf(pbComplexType.getNumber())); } return new ColumnDescription(name, type, complexType); }

Target:
private static ColumnDescription convertPBColumnDescription(RiakKvPB.TsColumnDescription pbColumn) { final String name = pbColumn.getName().toStringUtf8(); final ColumnDescription.ColumnType type = ColumnDescription.ColumnType.valueOf(pbColumn.getType().getNumber()); return new ColumnDescription(name, type); }
Source:
public Long getUuid() { return new Long(artifact.getArtId()); }

Target:
public Long getUuid() { return Long.valueOf(artifact.getArtId()); }
Source:
public List<ReportDesign> constructReportDesigns(ReportDefinition reportDefinition) { List<ReportDesign> l = new ArrayList<ReportDesign>(); l.add(ReportManagerUtil.createExcelDesign("c1e93868-633a-11e7-907b-a6006ad3dba0", reportDefinition)); return l; }

Target:
public List<ReportDesign> constructReportDesigns(ReportDefinition reportDefinition) { List<ReportDesign> l = new ArrayList<ReportDesign>(); l.add(ReportManagerUtil.createExcelDesign("c410998d-b71e-428b-8e5c-f88536c83761", reportDefinition)); return l; }
Source:
public BaseAuthoriseResponse.AuthoriseStatus queryPaymentStatus(ChargeEntity charge) { Either<GatewayError, GatewayClient.Response> response = authoriseClient.postRequestFor( ROUTE_FOR_QUERY_ORDER, charge.getGatewayAccount(), buildQueryOrderRequestFor(charge) ); GatewayResponse<BaseAuthoriseResponse> gatewayResponse = GatewayResponseGenerator.getEpdqGatewayResponse(authoriseClient, response, EpdqAuthorisationResponse.class); return gatewayResponse.getBaseResponse().map(epdqStatus -> ((EpdqAuthorisationResponse) epdqStatus).authoriseStatus()).orElse(BaseAuthoriseResponse.AuthoriseStatus.ERROR); }

Target:
public ChargeQueryResponse queryPaymentStatus(ChargeEntity charge) { Either<GatewayError, GatewayClient.Response> response = authoriseClient.postRequestFor( ROUTE_FOR_QUERY_ORDER, charge.getGatewayAccount(), buildQueryOrderRequestFor(charge) ); GatewayResponse<EpdqQueryResponse> epdqGatewayResponse = GatewayResponseGenerator.getEpdqGatewayResponse(authoriseClient, response, EpdqQueryResponse.class); return epdqGatewayResponse.getBaseResponse().map(EpdqQueryResponse::toChargeQueryResponse).orElseGet(() -> { throw new WebApplicationException("Things went wrong"); }); }
Source:
public void clean() { System.clearProperty("org.jbpm.task.assignment.enabled"); AssignmentServiceProvider.clear(); if (emf != null) { emf.close(); } if (pds != null) { pds.close(); } }

Target:
public void clean() { System.clearProperty("org.jbpm.task.assignment.enabled"); System.clearProperty("org.jbpm.task.assignment.strategy"); AssignmentServiceProvider.clear(); if (emf != null) { emf.close(); } if (pds != null) { pds.close(); } }
Source:
public ChannelFuture connect(final Subscriber<? super ObservableConnection<I, O>> subscriber, RxClient.ServerInfo serverInfo, final ClientConnectionFactory<I, O, ? extends ObservableConnection<I, O>> connectionFactory) { final ChannelFuture connectFuture = clientBootstrap.connect(serverInfo.getHost(), serverInfo.getPort()); subscriber.add(Subscriptions.create(new Action0() { @Override public void call() { if (!connectFuture.isDone()) { connectFuture.cancel(true); } } })); connectFuture.addListener(new ChannelFutureListener() { @Override public void operationComplete(ChannelFuture future) throws Exception { if (!future.isSuccess()) { subscriber.onError(future.cause()); } else { ChannelPipeline pipeline = future.channel().pipeline(); ChannelHandlerContext ctx = pipeline.lastContext(); final ObservableConnection<I, O> newConnection = connectionFactory.newConnection(ctx); ChannelHandler lifecycleHandler = pipeline.get(RxRequiredConfigurator.CONN_LIFECYCLE_HANDLER_NAME); if (null == lifecycleHandler) { onNewConnection(newConnection, subscriber); } else { @SuppressWarnings("unchecked") ConnectionLifecycleHandler<I, O> handler = (ConnectionLifecycleHandler<I, O>) lifecycleHandler; ChannelHandler sslHandler = pipeline.get(SslHandler.class); if (null == sslHandler) { handler.setConnection(newConnection); onNewConnection(newConnection, subscriber); } else { handler.setConnectionAction(new Action0() { @Override public void call() { onNewConnection(newConnection, subscriber); } }); } } } } }); return connectFuture; }

Target:
public ChannelFuture connect(final Subscriber<? super ObservableConnection<I, O>> subscriber, RxClient.ServerInfo serverInfo, final ClientConnectionFactory<I, O, ? extends ObservableConnection<I, O>> connectionFactory) { final ChannelFuture connectFuture = clientBootstrap.connect(serverInfo.getHost(), serverInfo.getPort()); subscriber.add(Subscriptions.create(new Action0() { @Override public void call() { if (!connectFuture.isDone()) { connectFuture.cancel(true); } } })); connectFuture.addListener(new ChannelFutureListener() { @Override public void operationComplete(ChannelFuture future) throws Exception { if (!future.isSuccess()) { subscriber.onError(future.cause()); } else { ChannelPipeline pipeline = future.channel().pipeline(); ChannelHandlerContext ctx = pipeline.lastContext(); final ObservableConnection<I, O> newConnection = connectionFactory.newConnection(ctx); ChannelHandler lifecycleHandler = pipeline.get(RxRequiredConfigurator.CONN_LIFECYCLE_HANDLER_NAME); if (null == lifecycleHandler) { onNewConnection(newConnection, subscriber); } else { @SuppressWarnings("unchecked") ConnectionLifecycleHandler<I, O> handler = (ConnectionLifecycleHandler<I, O>) lifecycleHandler; SslHandler sslHandler = pipeline.get(SslHandler.class); if (null == sslHandler) { handler.setConnection(newConnection); onNewConnection(newConnection, subscriber); } else { sslHandler.handshakeFuture().addListener(new GenericFutureListener<Future<? super Channel>>() { @Override public void operationComplete(Future<? super Channel> future) throws Exception { onNewConnection(newConnection, subscriber); } }); } } } } }); return connectFuture; }
Source:
private void evalArguments( List<Object> posargs, Map<String, Object> kwargs, Environment env) throws EvalException, InterruptedException { ImmutableList.Builder<String> duplicatesBuilder = null; for (int i = 0; i < arguments.size(); i++) { Argument.Passed arg = arguments.get(i); Object value = arg.getValue().eval(env); if (arg.isPositional()) { posargs.add(value); } else if (arg.isStar()) { Collection<?> items; try { items = EvalUtils.toCollection(value, getLocation(), env); } catch (EvalException e) { throw new EvalException( getLocation(), "argument after * must be an iterable, not " + EvalUtils.getDataTypeName(value)); } for (Object starArgUnit : items) { posargs.add(starArgUnit); } } else if (arg.isStarStar()) { ImmutableList<String> duplicates = addKeywordArgsAndReturnDuplicates(kwargs, value, getLocation()); if (duplicates != null) { if (duplicatesBuilder == null) { duplicatesBuilder = ImmutableList.builder(); } duplicatesBuilder.addAll(duplicates); } } else { if (addKeywordArgAndCheckIfDuplicate(kwargs, arg.getName(), value)) { if (duplicatesBuilder == null) { duplicatesBuilder = ImmutableList.builder(); } duplicatesBuilder.add(arg.getName()); } } } if (duplicatesBuilder != null) { ImmutableList<String> dups = duplicatesBuilder.build(); throw new EvalException( getLocation(), "duplicate keyword" + (dups.size() > 1 ? "s" : "") + " '" + Joiner.on("', '").join(dups) + "' in call to " + function); } }

Target:
private void evalArguments( List<Object> posargs, Map<String, Object> kwargs, Environment env) throws EvalException, InterruptedException { ImmutableList.Builder<String> duplicatesBuilder = null; for (int i = 0; i < arguments.size(); i++) { Argument.Passed arg = arguments.get(i); Object value = arg.getValue().eval(env); if (arg.isPositional()) { posargs.add(value); } else if (arg.isStar()) { Iterable<?> items; try { items = EvalUtils.toIterable(value, getLocation(), env); } catch (EvalException e) { throw new EvalException( getLocation(), "argument after * must be an iterable, not " + EvalUtils.getDataTypeName(value)); } for (Object starArgUnit : items) { posargs.add(starArgUnit); } } else if (arg.isStarStar()) { ImmutableList<String> duplicates = addKeywordArgsAndReturnDuplicates(kwargs, value, getLocation()); if (duplicates != null) { if (duplicatesBuilder == null) { duplicatesBuilder = ImmutableList.builder(); } duplicatesBuilder.addAll(duplicates); } } else { if (addKeywordArgAndCheckIfDuplicate(kwargs, arg.getName(), value)) { if (duplicatesBuilder == null) { duplicatesBuilder = ImmutableList.builder(); } duplicatesBuilder.add(arg.getName()); } } } if (duplicatesBuilder != null) { ImmutableList<String> dups = duplicatesBuilder.build(); throw new EvalException( getLocation(), "duplicate keyword" + (dups.size() > 1 ? "s" : "") + " '" + Joiner.on("', '").join(dups) + "' in call to " + function); } }
Source:
public void testReadValidFile() { Map<Integer, File> filters = new HashMap<>(); filters.put(1101, TILE_1101_FILTER); LocsFileReader locsFileReader = new LocsFileReader(new File("testdata/picard/illumina/readerTests/s_1_6.locs")); List<AbstractIlluminaPositionFileReader.PositionInfo> locs = locsFileReader.toList(); final CbclReader reader = new CbclReader(Arrays.asList(PASSING_CBCL_C99_1, PASSING_CBCL_C100_1), filters, new int[]{2}, 1101, locs); int i = 0; while (reader.hasNext()) { final BclData bv = reader.next(); for (int cluster = 0; cluster < bv.bases.length; cluster++) { for (int cycle = 0; cycle < bv.bases[cluster].length; cycle++) { String actual = new String(new byte[]{bv.bases[cluster][cycle]}); String expected = new String(new char[]{expectedBases[i]}); Assert.assertEquals(actual, expected, "For cluster " + cluster + " cycle " + cycle + ","); Assert.assertEquals(bv.qualities[cluster][cycle], expectedQuals[i], "For cluster " + cluster + " cycle " + cycle + ","); i++; } } } Assert.assertEquals(i, expectedBases.length); reader.close(); }

Target:
public void testReadValidFile() { Map<Integer, File> filters = new HashMap<>(); filters.put(1101, TILE_1101_FILTER); LocsFileReader locsFileReader = new LocsFileReader(new File("testdata/picard/illumina/readerTests/s_1_6.locs")); List<AbstractIlluminaPositionFileReader.PositionInfo> locs = locsFileReader.toList(); final CbclReader reader = new CbclReader(Arrays.asList(PASSING_CBCL_C99_1, PASSING_CBCL_C100_1), filters, new int[]{2}, 1101, locs, false); int i = 0; while (reader.hasNext()) { final BclData bv = reader.next(); for (int cluster = 0; cluster < bv.bases.length; cluster++) { for (int cycle = 0; cycle < bv.bases[cluster].length; cycle++) { String actual = new String(new byte[]{bv.bases[cluster][cycle]}); String expected = new String(new char[]{expectedBases[i]}); Assert.assertEquals(actual, expected, "For cluster " + cluster + " cycle " + cycle + ","); Assert.assertEquals(bv.qualities[cluster][cycle], expectedQuals[i], "For cluster " + cluster + " cycle " + cycle + ","); i++; } } } Assert.assertEquals(i, expectedBases.length); reader.close(); }
Source:
public void pingWhileSubscribed() { Jedis client = new Jedis("localhost", server.getPort(), 1000000000); MockSubscriber mockSubscriber = new MockSubscriber(); executor.submit(() -> client.subscribe(mockSubscriber, "same")); mockSubscriber.awaitSubscribe("same"); mockSubscriber.ping(); GeodeAwaitility.await() .untilAsserted(() -> assertThat(mockSubscriber.getReceivedPings().size()).isEqualTo(1)); assertThat(mockSubscriber.getReceivedPings().get(0)).isEqualTo(""); mockSubscriber.unsubscribe(); client.close(); }

Target:
public void pingWhileSubscribed() { Jedis client = new Jedis("localhost", server.getPort()); MockSubscriber mockSubscriber = new MockSubscriber(); executor.submit(() -> client.subscribe(mockSubscriber, "same")); mockSubscriber.awaitSubscribe("same"); mockSubscriber.ping(); GeodeAwaitility.await() .untilAsserted(() -> assertThat(mockSubscriber.getReceivedPings().size()).isEqualTo(1)); assertThat(mockSubscriber.getReceivedPings().get(0)).isEqualTo(""); mockSubscriber.unsubscribe(); client.close(); }
Source:
public void getVolumesForForceSessionCreate() { GlusterVolumeGeoRepCreateModel.this.startProgress(constants.fetchingDataMessage()); AsyncQuery _asyncQuery = new AsyncQuery(); _asyncQuery.setModel(this); _asyncQuery.asyncCallback = new INewAsyncCallback() { @Override public void onSuccess(Object model, Object ReturnValue) { VdcQueryReturnValue vdcReturnValue = (VdcQueryReturnValue) ReturnValue; GlusterVolumeGeoRepCreateModel.this.stopProgress(); if(!vdcReturnValue.getSucceeded()) { setQueryFailureMessage(vdcReturnValue.getExceptionString()); } else { setVolumeList((Collection) vdcReturnValue.getReturnValue()); Set<String> clusterForVolumes = getClusterForVolumes(getVolumeList()); getSlaveClusters().setItems(clusterForVolumes, clusterForVolumes.iterator().next()); } } }; SearchParameters vdcQueryParametersBase = new SearchParameters("Volumes:", SearchType.GlusterVolume, false); vdcQueryParametersBase.setRefresh(true); Frontend.getInstance().runQuery(VdcQueryType.Search, vdcQueryParametersBase, _asyncQuery); }

Target:
public void getVolumesForForceSessionCreate() { GlusterVolumeGeoRepCreateModel.this.startProgress(constants.fetchingDataMessage()); AsyncQuery _asyncQuery = new AsyncQuery(); _asyncQuery.setModel(this); _asyncQuery.asyncCallback = new INewAsyncCallback() { @Override public void onSuccess(Object model, Object ReturnValue) { VdcQueryReturnValue vdcReturnValue = (VdcQueryReturnValue) ReturnValue; GlusterVolumeGeoRepCreateModel.this.stopProgress(); if(!vdcReturnValue.getSucceeded()) { setQueryFailureMessage(vdcReturnValue.getExceptionString()); } else { setVolumeList((Collection) vdcReturnValue.getReturnValue()); Set<String> clusterForVolumes = getClusterForVolumes(getVolumeList()); getSlaveClusters().setItems(clusterForVolumes, clusterForVolumes.iterator().next()); } } }; SearchParameters volumesSearchParameters = new SearchParameters("Volumes:", SearchType.GlusterVolume, false); volumesSearchParameters.setRefresh(true); Frontend.getInstance().runQuery(VdcQueryType.Search, volumesSearchParameters, _asyncQuery); }
Source:
public boolean isObjectFactory() { return getTargetTypeParameter() != null || getParameters().isEmpty(); }

Target:
public boolean isObjectFactory() { return false; }
Source:
public Long getAccountIdForZendesk(@Scope({OAuthScope.ZENDESK_EXTENSION}) final AccessToken accessToken, @PathParam("email") final String email){ LOGGER.debug("Looking account up by email {}", email); final Optional<Account> accountByEmailOptional = accountDAO.getByEmail(email.toLowerCase()); if (!accountByEmailOptional.isPresent()) { throw new WebApplicationException(Response.status(Response.Status.NOT_FOUND).entity("Account not found").build()); } return accountByEmailOptional.get().id.get(); }

Target:
public Long getAccountIdForZendesk(@Scope({OAuthScope.ZENDESK_EXTENSION}) final AccessToken accessToken, @PathParam("email") final String email){ LOGGER.debug("Looking account up by email {}", email); final String zendeskHeader = this.request.getHeader(HelloHttpHeader.ZENDESK); if (zendeskHeader == null || !zendeskHeader.equals("mixpanel")) { throw new WebApplicationException(Response.status(Response.Status.UNAUTHORIZED).build()); } final Optional<Account> accountByEmailOptional = accountDAO.getByEmail(email.toLowerCase()); if (!accountByEmailOptional.isPresent()) { throw new WebApplicationException(Response.status(Response.Status.NOT_FOUND).entity("Account not found").build()); } return accountByEmailOptional.get().id.get(); }
Source:
public void testBooleanRetrievalFromProperty() { boolean value = true; boolean defaultValue = false; x509Util = new ClientX509Util(); System.setProperty(x509Util.getSslProtocolProperty(), Boolean.toString(value)); ZKConfig conf = new ZKConfig(); boolean result = conf.getBoolean(x509Util.getSslProtocolProperty(), defaultValue); assertEquals(value, result); System.clearProperty(x509Util.getSslProtocolProperty()); }

Target:
public void testBooleanRetrievalFromProperty() { boolean value = true; boolean defaultValue = false; System.setProperty(x509Util.getSslProtocolProperty(), Boolean.toString(value)); ZKConfig conf = new ZKConfig(); boolean result = conf.getBoolean(x509Util.getSslProtocolProperty(), defaultValue); assertEquals(value, result); }
Source:
public void removeMessageGroup(Object groupId) { Lock lock = this.lockRegistry.obtain(groupId); try { lock.lockInterruptibly(); try { if (!groupIdToMessageGroup.containsKey(groupId)) { return; } this.groupToUpperBound.remove(groupId).release(this.groupCapacity); this.groupIdToMessageGroup.remove(groupId); } finally { lock.unlock(); } } catch (InterruptedException e) { Thread.currentThread().interrupt(); throw new MessagingException("Interrupted while obtaining lock", e); } }

Target:
public void removeMessageGroup(Object groupId) { Lock lock = this.lockRegistry.obtain(groupId); try { lock.lockInterruptibly(); try { MessageGroup messageGroup = this.groupIdToMessageGroup.remove(groupId); if (messageGroup != null) { UpperBound upperBound = this.groupToUpperBound.remove(groupId); Assert.state(upperBound != null, "'upperBound' must not be null."); upperBound.release(this.groupCapacity); } } finally { lock.unlock(); } } catch (InterruptedException e) { Thread.currentThread().interrupt(); throw new MessagingException("Interrupted while obtaining lock", e); } }
Source:
public String execute(SampleResult previousResult, Sampler currentSampler) throws InvalidVariableException { String digestAlgorithm = values[0].execute(); String stringToEncode = values[1].execute(); String salt = values.length > 2 ? values[2].execute() : null; String encodedString = null; try { MessageDigest md = MessageDigest.getInstance(digestAlgorithm); md.update(stringToEncode.getBytes(StandardCharsets.UTF_8.name())); if (StringUtils.isNotEmpty(salt)) { md.update(salt.getBytes(StandardCharsets.UTF_8.name())); } byte[] bytes = md.digest(); encodedString = uppercase(Hex.encodeHexString(bytes), values, 3); addVariableValue(encodedString, values, 4); } catch (NoSuchAlgorithmException | UnsupportedEncodingException e) { log.error("Error calling function with value {}, digest algorithm {}, salt {}, ", KEY, stringToEncode, digestAlgorithm, salt, e); } return encodedString; }

Target:
public String execute(SampleResult previousResult, Sampler currentSampler) throws InvalidVariableException { String digestAlgorithm = values[0].execute(); String stringToEncode = values[1].execute(); String salt = values.length > 2 ? values[2].execute() : null; String encodedString = null; try { MessageDigest md = MessageDigest.getInstance(digestAlgorithm); md.update(stringToEncode.getBytes(StandardCharsets.UTF_8)); if (StringUtils.isNotEmpty(salt)) { md.update(salt.getBytes(StandardCharsets.UTF_8)); } byte[] bytes = md.digest(); encodedString = uppercase(Hex.encodeHexString(bytes), values, 3); addVariableValue(encodedString, values, 4); } catch (NoSuchAlgorithmException | UnsupportedEncodingException e) { log.error("Error calling function with value {}, digest algorithm {}, salt {}, ", KEY, stringToEncode, digestAlgorithm, salt, e); } return encodedString; }
Source:
protected void executeStreamDestroy(String... streamNames) { for (String streamName : streamNames) { CommandResult cr = executeCommand("stream destroy --name " + streamName); assertTrue("Failure to destroy job " + streamName + ". CommandResult = " + cr.toString(), cr.isSuccess()); } }

Target:
protected void executeStreamDestroy(String... streamNames) { for (String streamName : streamNames) { CommandResult cr = executeCommand("stream destroy --name " + streamName); assertTrue("Failure to destroy stream " + streamName + ". CommandResult = " + cr.toString(), cr.isSuccess()); } }
Source:
static int getExifTranslation(int orientation) { switch (orientation) { case ORIENTATION_FLIP_HORIZONTAL: case ORIENTATION_FLIP_VERTICAL: case ORIENTATION_TRANSPOSE: case ORIENTATION_TRANSVERSE: return -1; default: return 1; } }

Target:
static int getExifTranslation(int orientation) { int translation; switch (orientation) { case ORIENTATION_FLIP_HORIZONTAL: case ORIENTATION_FLIP_VERTICAL: case ORIENTATION_TRANSPOSE: case ORIENTATION_TRANSVERSE: translation = -1; break; default: translation = 1; } return translation; }
Source:
public void testJobSubmission() throws Exception { dispatcher = createAndStartDispatcher(heartbeatServices, haServices, new ExpectedJobIdJobManagerRunnerFactory(TEST_JOB_ID, createdJobManagerRunnerLatch)); jobMasterLeaderElectionService.isLeader(UUID.randomUUID()); DispatcherGateway dispatcherGateway = dispatcher.getSelfGateway(DispatcherGateway.class); dispatcherGateway.submitJob(jobGraph, TIMEOUT).get(); CommonTestUtils.waitUntilCondition(() -> dispatcherGateway.requestJobStatus(jobGraph.getJobID(), TIMEOUT).get() == JobStatus.RUNNING, Deadline.fromNow(Duration.of(10, ChronoUnit.SECONDS)), 20L); assertTrue( "jobManagerRunner was not started", jobMasterLeaderElectionService.getStartFuture().isDone()); }

Target:
public void testJobSubmission() throws Exception { dispatcher = createAndStartDispatcher(heartbeatServices, haServices, new ExpectedJobIdJobManagerRunnerFactory(TEST_JOB_ID, createdJobManagerRunnerLatch)); DispatcherGateway dispatcherGateway = dispatcher.getSelfGateway(DispatcherGateway.class); dispatcherGateway.submitJob(jobGraph, TIMEOUT).get(); jobMasterLeaderElectionService.getStartFuture().get(); assertTrue( "jobManagerRunner was not started", jobMasterLeaderElectionService.getStartFuture().isDone()); }
Source:
public PropertyParameter[] getParameters() { return m_parameters.values().toArray(new PropertyParameter[m_parameters.values().size()]); }

Target:
public Collection<PropertyParameter> getParameters() { return m_parameters.values(); }
Source:
private static StageExecutionPlan createPlan(ConnectorSplitSource splitSource) { Symbol symbol = new Symbol("column"); PlanNodeId tableScanNodeId = new PlanNodeId("plan_id"); TableScanNode tableScan = new TableScanNode( tableScanNodeId, new TableHandle(CONNECTOR_ID, new TestingTableHandle()), ImmutableList.of(symbol), ImmutableMap.of(symbol, new TestingColumnHandle("column"))); RemoteSourceNode remote = new RemoteSourceNode(new PlanNodeId("remote_id"), new PlanFragmentId("plan_fragment_id"), ImmutableList.of(), Optional.empty(), GATHER); PlanFragment testFragment = new PlanFragment( new PlanFragmentId("plan_id"), new JoinNode(new PlanNodeId("join_id"), INNER, tableScan, remote, ImmutableList.of(), ImmutableList.<Symbol>builder() .addAll(tableScan.getOutputSymbols()) .addAll(remote.getOutputSymbols()) .build(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()), ImmutableMap.of(symbol, VARCHAR), SOURCE_DISTRIBUTION, ImmutableList.of(tableScanNodeId), new PartitioningScheme(Partitioning.create(SINGLE_DISTRIBUTION, ImmutableList.of()), ImmutableList.of(symbol)), StageExecutionStrategy.ungroupedExecution(), emptyMap(), emptyMap()); return new StageExecutionPlan( testFragment, ImmutableMap.of(tableScanNodeId, new ConnectorAwareSplitSource(CONNECTOR_ID, TestingTransactionHandle.create(), splitSource)), ImmutableList.of()); }

Target:
private static StageExecutionPlan createPlan(ConnectorSplitSource splitSource) { Symbol symbol = new Symbol("column"); PlanNodeId tableScanNodeId = new PlanNodeId("plan_id"); TableScanNode tableScan = new TableScanNode( tableScanNodeId, new TableHandle(CONNECTOR_ID, new TestingTableHandle()), ImmutableList.of(symbol), ImmutableMap.of(symbol, new TestingColumnHandle("column"))); RemoteSourceNode remote = new RemoteSourceNode(new PlanNodeId("remote_id"), new PlanFragmentId("plan_fragment_id"), ImmutableList.of(), Optional.empty(), GATHER); PlanFragment testFragment = new PlanFragment( new PlanFragmentId("plan_id"), new JoinNode(new PlanNodeId("join_id"), INNER, tableScan, remote, ImmutableList.of(), ImmutableList.<Symbol>builder() .addAll(tableScan.getOutputSymbols()) .addAll(remote.getOutputSymbols()) .build(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()), ImmutableMap.of(symbol, VARCHAR), SOURCE_DISTRIBUTION, ImmutableList.of(tableScanNodeId), new PartitioningScheme(Partitioning.create(SINGLE_DISTRIBUTION, ImmutableList.of()), ImmutableList.of(symbol)), StageExecutionStrategy.ungroupedExecution(), StatsAndCosts.empty()); return new StageExecutionPlan( testFragment, ImmutableMap.of(tableScanNodeId, new ConnectorAwareSplitSource(CONNECTOR_ID, TestingTransactionHandle.create(), splitSource)), ImmutableList.of()); }
Source:
protected boolean validate() { if (isImagesAlreadyOnTarget()) { if (!validateExternalVnicProfileMapping()) { return false; } ImportValidator importValidator = getImportValidator(); if (!validate(importValidator.validateUnregisteredEntity(vmFromConfiguration, ovfEntityData))) { return false; } if (!validateMacs(vmFromConfiguration)) { return false; } if (!validate(importValidator.validateStorageExistForUnregisteredEntity(getImages(), getParameters().isAllowPartialImport(), imageToDestinationDomainMap, failedDisksToImportForAuditLog))) { return false; } if (!validate(importValidator.validateStorageExistForMemoryDisks(getVm().getSnapshots(), getParameters().isAllowPartialImport(), failedDisksToImportForAuditLog))) { return false; } setImagesWithStoragePoolId(getParameters().getStoragePoolId(), getVm().getImages()); } return super.validate(); }

Target:
protected boolean validate() { if (isImagesAlreadyOnTarget()) { if (!validateExternalVnicProfileMapping()) { return false; } ImportValidator importValidator = getImportValidator(); if (!validate(importValidator.validateUnregisteredEntity(vmFromConfiguration, ovfEntityData))) { return false; } if (!validateMacs(vmFromConfiguration)) { return false; } if (!validate(importValidator.validateStorageExistForUnregisteredEntity(getImages(), getParameters().isAllowPartialImport(), imageToDestinationDomainMap, failedDisksToImportForAuditLog))) { return false; } if (!validate(importValidator.validateStorageExistsForMemoryDisks(getVm().getSnapshots(), getParameters().isAllowPartialImport(), failedDisksToImportForAuditLog))) { return false; } setImagesWithStoragePoolId(getParameters().getStoragePoolId(), getVm().getImages()); } return super.validate(); }
Source:
protected boolean checkIfElementOnPage(By cssSelectorBy) { changeImplicitWait(500, TimeUnit.MILLISECONDS); boolean isElementOnPage = true; try { if (driver.findElements(cssSelectorBy).size() < 1) { isElementOnPage = false; } } catch (Exception ex) { isElementOnPage = false; } finally { restoreDeaultImplicitWait(); } return isElementOnPage; }

Target:
protected boolean checkIfElementOnPage(By cssSelectorBy) { changeImplicitWait(500, TimeUnit.MILLISECONDS); try { return driver.findElements(cssSelectorBy).size() > 0; } finally { restoreDeaultImplicitWait(); } }
Source:
public void unregisterFor(GitHubRepositoryName name, List<GitHubRepositoryName> aliveRepos) { try { GHRepository repo = from(name.resolve(allowedToManageHooks())).firstMatch(withAdminAccess()).orNull(); if (!(name.resolve(allowedToManageHooks()).iterator().hasNext())) { if (repo == null) { LOGGER.debug("Skipped removing GitHub webhook for because not configured to Manage Hooks, " + "also there are no credentials with admin access to manage such hooks", name); } else { LOGGER.debug("Skipped removing GitHub webhook for because not configured to Manage Hooks", name); } GitHubHookRegisterProblemMonitor.get().registerProblem(name, new Exception( "Skipped removing GitHub webhook because not configured to Manage Hooks")); return; } repo = checkNotNull(repo, "There are no credentials with admin access to manage hooks on %s", name ); LOGGER.debug("Check for redundant hooks...", repo); Predicate<GHHook> predicate = aliveRepos.contains(name) ? serviceWebhookFor(endpoint) : or(serviceWebhookFor(endpoint), webhookFor(endpoint)); from(fetchHooks().apply(repo)) .filter(predicate) .filter(deleteWebhook()) .filter(log("Deleted hook")).toList(); } catch (Throwable t) { LOGGER.warn("Failed to remove hook from {}", name, t); GitHubHookRegisterProblemMonitor.get().registerProblem(name, t); } }

Target:
public void unregisterFor(GitHubRepositoryName name, List<GitHubRepositoryName> aliveRepos) { try { Iterable<GHRepository> manageableIterable = name.resolve(allowedToManageHooks()); GHRepository repo = from(manageableIterable).firstMatch(withAdminAccess()).orNull(); if (!(manageableIterable.iterator().hasNext())) { if (repo == null) { LOGGER.debug("Skipped removing GitHub webhook for because not configured to Manage Hooks, " + "also there are no credentials with admin access to manage such hooks", name); } else { LOGGER.debug("Skipped removing GitHub webhook for because not configured to Manage Hooks", name); } GitHubHookRegisterProblemMonitor.get().registerProblem(name, new Exception( "Skipped removing GitHub webhook because not configured to Manage Hooks")); return; } repo = checkNotNull(repo, "There are no credentials with admin access to manage hooks on %s", name ); LOGGER.debug("Check for redundant hooks...", repo); Predicate<GHHook> predicate = aliveRepos.contains(name) ? serviceWebhookFor(endpoint) : or(serviceWebhookFor(endpoint), webhookFor(endpoint)); from(fetchHooks().apply(repo)) .filter(predicate) .filter(deleteWebhook()) .filter(log("Deleted hook")).toList(); } catch (Throwable t) { LOGGER.warn("Failed to remove hook from {}", name, t); GitHubHookRegisterProblemMonitor.get().registerProblem(name, t); } }
Source:
public void testBug549457() throws Exception { IFolder srcPackageFolder = env.getWorkspace().getRoot().getFolder(this.srcPackage); assertTrue("package in source must exist", srcPackageFolder.exists()); env.addClass(this.src, "p", "X", "package p;\n public interface X { default void foo() { } }"); fullBuild(this.project); expectCompileProblem(this.project, "Default methods are allowed only at source level 1.8 or above"); IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot(); IProject testProject = workspaceRoot.getProject("Bug549457Test"); IJavaProject javaProject = JavaCore.create(testProject); javaProject.setOption("org.eclipse.jdt.core.compiler.compliance", "1.8"); javaProject.setOption("org.eclipse.jdt.core.compiler.source", "1.8"); testProject.refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor()); waitForAutoBuild(); fullBuild(this.project); expectNoCompileProblems(this.project); IFile settingsFile = testProject.getFile(".settings/org.eclipse.jdt.core.prefs"); assertTrue("expected \"org.eclipse.jdt.core.prefs\" to exist after setting compiler compliance to Java 1.7", settingsFile.exists()); String newContents = String.join( "org.eclipse.jdt.core.compiler.compliance=1.7", "org.eclipse.jdt.core.compiler.source=1.7"); settingsFile.setContents(new ByteArrayInputStream(newContents.getBytes()), IResource.FORCE, new NullProgressMonitor()); waitForAutoBuild(); expectCompileProblem(this.project, "Default methods are allowed only at source level 1.8 or above"); }

Target:
public void testBug549457() throws Exception { IFolder srcPackageFolder = env.getWorkspace().getRoot().getFolder(this.srcPackage); assertTrue("package in source must exist", srcPackageFolder.exists()); env.addClass(this.src, "p", "X", "package p;\n public interface X { default void foo() { } }"); fullBuild(this.project); expectCompileProblem(this.project, "Default methods are allowed only at source level 1.8 or above"); IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot(); IProject testProject = workspaceRoot.getProject("Bug549457Test"); IJavaProject javaProject = JavaCore.create(testProject); javaProject.setOption(CompilerOptions.OPTION_Compliance, "1.8"); javaProject.setOption(CompilerOptions.OPTION_Source, "1.8"); testProject.refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor()); waitForAutoBuild(); fullBuild(this.project); expectNoCompileProblems(this.project); String jdtCorePreferencesFile = JavaProject.DEFAULT_PREFERENCES_DIRNAME + IPath.SEPARATOR + JavaProject.JAVA_CORE_PREFS_FILE; IFile settingsFile = testProject.getFile(jdtCorePreferencesFile); assertTrue("expected \"" + jdtCorePreferencesFile + "\" to exist after setting compiler compliance to Java 1.7", settingsFile.exists()); String newContents = String.join( CompilerOptions.OPTION_Compliance + "=1.7", CompilerOptions.OPTION_Source + "=1.7"); settingsFile.setContents(new ByteArrayInputStream(newContents.getBytes()), IResource.FORCE, new NullProgressMonitor()); waitForAutoBuild(); expectCompileProblem(this.project, "Default methods are allowed only at source level 1.8 or above"); }
Source:
public synchronized Collection<PendingConfirm> expire(Listener listener, long cutoffTime) { SortedMap<Long, PendingConfirm> pendingConfirmsForListener = this.pendingConfirms.get(listener); if (pendingConfirmsForListener == null) { return Collections.<PendingConfirm>emptyList(); } else { synchronized (pendingConfirmsForListener) { List<PendingConfirm> expired = new ArrayList<PendingConfirm>(); Iterator<Entry<Long, PendingConfirm>> iterator = pendingConfirmsForListener.entrySet().iterator(); while (iterator.hasNext()) { PendingConfirm pendingConfirm = iterator.next().getValue(); if (pendingConfirm.getTimestamp() < cutoffTime) { expired.add(pendingConfirm); iterator.remove(); } else { break; } } return expired; } } }

Target:
public synchronized Collection<PendingConfirm> expire(Listener listener, long cutoffTime) { SortedMap<Long, PendingConfirm> pendingConfirmsForListener = this.pendingConfirms.get(listener); if (pendingConfirmsForListener == null) { return Collections.<PendingConfirm>emptyList(); } else { List<PendingConfirm> expired = new ArrayList<PendingConfirm>(); Iterator<Entry<Long, PendingConfirm>> iterator = pendingConfirmsForListener.entrySet().iterator(); while (iterator.hasNext()) { PendingConfirm pendingConfirm = iterator.next().getValue(); if (pendingConfirm.getTimestamp() < cutoffTime) { expired.add(pendingConfirm); iterator.remove(); } else { break; } } return expired; } }
Source:
public void createServiceBusProcessorClient() { Consumer<ServiceBusReceivedMessageContext> processMessage = messageContext -> { try { System.out.println(messageContext.getMessage().getMessageId()); messageContext.complete(); } catch (Exception ex) { messageContext.abandon(); } }; Consumer<ServiceBusErrorContext> processError = errorContext -> { System.err.println("Error occurred while receiving message: " + errorContext.getException()); }; ServiceBusProcessorClient processorClient = new ServiceBusClientBuilder() .connectionString("<< CONNECTION STRING FOR THE SERVICE BUS NAMESPACE >>") .processor() .queueName("<< QUEUE NAME >>") .processMessage(processMessage) .processError(processError) .buildProcessorClient(); processorClient.start(); }

Target:
public void createServiceBusProcessorClient() { Consumer<ServiceBusReceivedMessageContext> processMessage = messageContext -> { try { System.out.println(messageContext.getMessage().getMessageId()); messageContext.complete(); } catch (Exception ex) { messageContext.abandon(); } }; Consumer<ServiceBusErrorContext> processError = errorContext -> { System.err.println("Error occurred while receiving message: " + errorContext.getException()); }; ServiceBusProcessorClient processorClient = new ServiceBusClientBuilder() .connectionString("<< CONNECTION STRING FOR THE SERVICE BUS NAMESPACE >>") .processor() .queueName("<< QUEUE NAME >>") .processMessage(processMessage) .processError(processError) .disableAutoComplete() .buildProcessorClient(); processorClient.start(); }
Source:
public boolean equals(final Object obj) { if (this == obj) { return true; } if (!super.equals(obj)) { return false; } if (this.getClass() != obj.getClass()) { return false; } final SmartMeter other = (SmartMeter) obj; if (this.channel == null) { if (other.channel != null) { return false; } } else if (!this.channel.equals(other.channel)) { return false; } if (this.supplier == null) { if (other.supplier != null) { return false; } } else if (!this.supplier.equals(other.supplier)) { return false; } return true; }

Target:
public boolean equals(final Object obj) { return super.equals(obj) && Objects.equals(this.supplier, ((SmartMeter) obj).supplier) && Objects.equals(this.channel, ((SmartMeter) obj).channel); }
Source:
public void into(ImageView target, Callback callback) { long started = System.nanoTime(); checkMain(); if (target == null) { throw new IllegalArgumentException("Target must not be null."); } if (!data.hasImage()) { picasso.cancelRequest(target); if (setPlaceholder) { setPlaceholder(target, getPlaceholderDrawable()); } return; } if (deferred) { if (data.hasSize()) { throw new IllegalStateException("Fit cannot be used with resize."); } int width = target.getWidth(); int height = target.getHeight(); if (width == 0 || height == 0) { if (setPlaceholder) { setPlaceholder(target, getPlaceholderDrawable()); } picasso.defer(target, new DeferredRequestCreator(this, target, callback)); return; } data.resize(width, height); } Request request = createRequest(started); String requestKey = createKey(request); if ((memoryPolicy & MemoryPolicy.NO_CACHE.index) == 0) { Bitmap bitmap = picasso.quickMemoryCacheCheck(requestKey); if (bitmap != null) { picasso.cancelRequest(target); setBitmap(target, picasso.context, bitmap, MEMORY, noFade, picasso.indicatorsEnabled); if (picasso.loggingEnabled) { log(OWNER_MAIN, VERB_COMPLETED, request.plainId(), "from " + MEMORY); } if (callback != null) { callback.onSuccess(); } return; } } if (setPlaceholder) { setPlaceholder(target, getPlaceholderDrawable()); } Action action = new ImageViewAction(picasso, target, request, memoryPolicy, noFade, errorResId, errorDrawable, requestKey, tag, callback); picasso.enqueueAndSubmit(action); }

Target:
public void into(ImageView target, Callback callback) { long started = System.nanoTime(); checkMain(); if (target == null) { throw new IllegalArgumentException("Target must not be null."); } if (!data.hasImage()) { picasso.cancelRequest(target); if (setPlaceholder) { setPlaceholder(target, getPlaceholderDrawable()); } return; } if (deferred) { if (data.hasSize()) { throw new IllegalStateException("Fit cannot be used with resize."); } int width = target.getWidth(); int height = target.getHeight(); if (width == 0 || height == 0) { if (setPlaceholder) { setPlaceholder(target, getPlaceholderDrawable()); } picasso.defer(target, new DeferredRequestCreator(this, target, callback)); return; } data.resize(width, height); } Request request = createRequest(started); String requestKey = createKey(request); if (shouldReadFromMemoryCache(memoryPolicy)) { Bitmap bitmap = picasso.quickMemoryCacheCheck(requestKey); if (bitmap != null) { picasso.cancelRequest(target); setBitmap(target, picasso.context, bitmap, MEMORY, noFade, picasso.indicatorsEnabled); if (picasso.loggingEnabled) { log(OWNER_MAIN, VERB_COMPLETED, request.plainId(), "from " + MEMORY); } if (callback != null) { callback.onSuccess(); } return; } } if (setPlaceholder) { setPlaceholder(target, getPlaceholderDrawable()); } Action action = new ImageViewAction(picasso, target, request, memoryPolicy, noFade, errorResId, errorDrawable, requestKey, tag, callback); picasso.enqueueAndSubmit(action); }
Source:
static GoogleCloudStorageFileSystemOptions.Builder getGcsFsOptionsBuilder(Configuration config) throws IOException { return GoogleCloudStorageFileSystemOptions.builder() .setBucketDeleteEnabled(GCE_BUCKET_DELETE_ENABLE.get(config, config::getBoolean)) .setMarkerFilePattern(GCS_MARKER_FILE_PATTERN.get(config, config::get)) .setPerformanceCacheEnabled(GCS_PERFORMANCE_CACHE_ENABLE.get(config, config::getBoolean)) .setCooperativeLockingEnabled( GCS_COOPERATIVE_LOCKING_ENABLE.get(config, config::getBoolean)) .setPerformanceCacheOptions(getPerformanceCachingOptions(config)) .setStatusParallelEnabled(GCS_STATUS_PARALLEL_ENABLE.get(config, config::getBoolean)) .setCloudStorageOptions(getGcsOptionsBuilder(config).build()); }

Target:
static GoogleCloudStorageFileSystemOptions.Builder getGcsFsOptionsBuilder(Configuration config) { return GoogleCloudStorageFileSystemOptions.builder() .setBucketDeleteEnabled(GCE_BUCKET_DELETE_ENABLE.get(config, config::getBoolean)) .setMarkerFilePattern(GCS_MARKER_FILE_PATTERN.get(config, config::get)) .setPerformanceCacheEnabled(GCS_PERFORMANCE_CACHE_ENABLE.get(config, config::getBoolean)) .setCooperativeLockingEnabled( GCS_COOPERATIVE_LOCKING_ENABLE.get(config, config::getBoolean)) .setPerformanceCacheOptions(getPerformanceCachingOptions(config)) .setStatusParallelEnabled(GCS_STATUS_PARALLEL_ENABLE.get(config, config::getBoolean)) .setCloudStorageOptions(getGcsOptionsBuilder(config).build()); }
Source:
public void onUpdate(String interpreterGroupId, AngularObject object) { if (getNotebook() == null || object.getNoteId() == null) { return; } Note note = getNotebook().getNote(object.getNoteId()); if (null != note) { List<InterpreterSetting> intpSettings = getNotebook().getInterpreterSettingManager().getInterpreterSettings(note.getId()); if (intpSettings.isEmpty()) { return; } connectionManager.broadcast(note.getId(), new Message(OP.ANGULAR_OBJECT_UPDATE) .put("angularObject", object) .put("interpreterGroupId", interpreterGroupId).put("noteId", note.getId()) .put("paragraphId", object.getParagraphId())); } }

Target:
public void onUpdate(String interpreterGroupId, AngularObject object) { if (getNotebook() == null) { return; } List<Note> notes = getNotebook().getAllNotes(); for (Note note : notes) { if (object.getNoteId() != null && !note.getId().equals(object.getNoteId())) { continue; } List<InterpreterSetting> intpSettings = getNotebook().getInterpreterSettingManager().getInterpreterSettings(note.getId()); if (intpSettings.isEmpty()) { continue; } connectionManager.broadcast(note.getId(), new Message(OP.ANGULAR_OBJECT_UPDATE) .put("angularObject", object) .put("interpreterGroupId", interpreterGroupId).put("noteId", note.getId()) .put("paragraphId", object.getParagraphId())); } }
Source:
@Test void testNotInOperation() { checkPlanEquals("select\n" + "4 not in ('1', '2', '3') as f0,\n" + "(3, 4) not in (('1', '2')) as f1,\n" + "(2, 3) not in (('1', '2'), ('3', '4')) as f2\n" + "from (values (true, true, true))"); }

Target:
@Test void testNotInOperation() { checkPlanEquals("select\n" + "1 not in ('1', '2', '3') as f0,\n" + "(1, 2) not in (('1', '2')) as f1,\n" + "(1, 2) not in (('1', '2'), ('3', '4')) as f2\n" + "from (values (false, false, false))"); }
Source:
public void process(FContext ctx, FProtocol iprot, FProtocol oprot) throws TException { Ping_args args = new Ping_args(); try { args.read(iprot); } catch (TException e) { iprot.readMessageEnd(); synchronized (WRITE_LOCK) { e = writeApplicationException(ctx, oprot, TApplicationException.PROTOCOL_ERROR, "Ping", e.getMessage()); } throw e; } iprot.readMessageEnd(); Ping_result result = new Ping_result(); try { handler.Ping(ctx); } catch (TApplicationException e) { oprot.writeResponseHeader(ctx); oprot.writeMessageBegin(new TMessage("ping", TMessageType.EXCEPTION, 0)); e.write(oprot); return; } catch (TException e) { synchronized (WRITE_LOCK) { e = writeApplicationException(ctx, oprot, TApplicationException.INTERNAL_ERROR, "ping", "Internal error processing Ping: " + e.getMessage()); } throw e; } synchronized (WRITE_LOCK) { try { oprot.writeResponseHeader(ctx); oprot.writeMessageBegin(new TMessage("ping", TMessageType.REPLY, 0)); result.write(oprot); oprot.writeMessageEnd(); oprot.getTransport().flush(); } catch (TException e) { if (e instanceof TTransportException) { TTransportException trException = (TTransportException) e; if (trException.getType() == FTransportException.RESPONSE_TOO_LARGE) { writeApplicationException(ctx, oprot, FApplicationException.RESPONSE_TOO_LARGE, "ping", "response too large: " + e.getMessage()); } } else { throw e; } } } }

Target:
public void process(FContext ctx, FProtocol iprot, FProtocol oprot) throws TException { Ping_args args = new Ping_args(); try { args.read(iprot); } catch (TException e) { iprot.readMessageEnd(); synchronized (WRITE_LOCK) { e = writeApplicationException(ctx, oprot, FrugalTApplicationExceptionType.PROTOCOL_ERROR, "Ping", e.getMessage()); } throw e; } iprot.readMessageEnd(); Ping_result result = new Ping_result(); try { handler.Ping(ctx); } catch (TApplicationException e) { oprot.writeResponseHeader(ctx); oprot.writeMessageBegin(new TMessage("ping", TMessageType.EXCEPTION, 0)); e.write(oprot); return; } catch (TException e) { synchronized (WRITE_LOCK) { e = writeApplicationException(ctx, oprot, FrugalTApplicationExceptionType.INTERNAL_ERROR, "ping", "Internal error processing Ping: " + e.getMessage()); } throw e; } synchronized (WRITE_LOCK) { try { oprot.writeResponseHeader(ctx); oprot.writeMessageBegin(new TMessage("ping", TMessageType.REPLY, 0)); result.write(oprot); oprot.writeMessageEnd(); oprot.getTransport().flush(); } catch (TTransportException e) { if (e.getType() == FrugalTTransportExceptionType.RESPONSE_TOO_LARGE) { writeApplicationException(ctx, oprot, FrugalTApplicationExceptionType.RESPONSE_TOO_LARGE, "ping", "response too large: " + e.getMessage()); } else { throw e; } } } }