auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public static FlowDocument from(final Flow flow) { final FlowDocument doc = new FlowDocument(); doc.setTimestamp(flow.getTimestamp()); doc.setBytes(flow.getBytes()); doc.setDirection(Direction.from(flow.getDirection())); doc.setDstAddr(flow.getDstAddr()); doc.setDstAddrHostname(flow.getDstAddrHostname().orElse(null)); doc.setDstAs(flow.getDstAs()); doc.setDstMaskLen(flow.getDstMaskLen()); doc.setDstPort(flow.getDstPort()); doc.setEngineId(flow.getEngineId()); doc.setEngineType(flow.getEngineType()); doc.setFirstSwitched(flow.getFirstSwitched()); doc.setFlowRecords(flow.getFlowRecords()); doc.setFlowSeqNum(flow.getFlowSeqNum()); doc.setInputSnmp(flow.getInputSnmp()); doc.setIpProtocolVersion(flow.getIpProtocolVersion()); doc.setLastSwitched(flow.getLastSwitched()); doc.setNextHop(flow.getNextHop()); doc.setNextHopHostname(flow.getNextHopHostname().orElse(null)); doc.setOutputSnmp(flow.getOutputSnmp()); doc.setPackets(flow.getPackets()); doc.setProtocol(flow.getProtocol()); doc.setSamplingAlgorithm(SamplingAlgorithm.from(flow.getSamplingAlgorithm())); doc.setSamplingInterval(flow.getSamplingInterval()); doc.setSrcAddr(flow.getSrcAddr()); doc.setSrcAddrHostname(flow.getSrcAddrHostname().orElse(null)); doc.setSrcAs(flow.getSrcAs()); doc.setSrcMaskLen(flow.getSrcMaskLen()); doc.setSrcPort(flow.getSrcPort()); doc.setTcpFlags(flow.getTcpFlags()); doc.setTos(flow.getTos()); doc.setNetflowVersion(NetflowVersion.from(flow.getNetflowVersion())); doc.setVlan(flow.getVlan() != null ? Integer.toUnsignedString(flow.getVlan()) : null); return doc; }

Target:
public static FlowDocument from(final Flow flow) { final FlowDocument doc = new FlowDocument(); doc.setTimestamp(flow.getTimestamp()); doc.setBytes(flow.getBytes()); doc.setDirection(Direction.from(flow.getDirection())); doc.setDstAddr(flow.getDstAddr()); flow.getDstAddrHostname().ifPresent(doc::setDstAddrHostname); doc.setDstAs(flow.getDstAs()); doc.setDstMaskLen(flow.getDstMaskLen()); doc.setDstPort(flow.getDstPort()); doc.setEngineId(flow.getEngineId()); doc.setEngineType(flow.getEngineType()); doc.setFirstSwitched(flow.getFirstSwitched()); doc.setFlowRecords(flow.getFlowRecords()); doc.setFlowSeqNum(flow.getFlowSeqNum()); doc.setInputSnmp(flow.getInputSnmp()); doc.setIpProtocolVersion(flow.getIpProtocolVersion()); doc.setLastSwitched(flow.getLastSwitched()); doc.setNextHop(flow.getNextHop()); flow.getNextHopHostname().ifPresent(doc::setNextHopHostname); doc.setOutputSnmp(flow.getOutputSnmp()); doc.setPackets(flow.getPackets()); doc.setProtocol(flow.getProtocol()); doc.setSamplingAlgorithm(SamplingAlgorithm.from(flow.getSamplingAlgorithm())); doc.setSamplingInterval(flow.getSamplingInterval()); doc.setSrcAddr(flow.getSrcAddr()); flow.getSrcAddrHostname().ifPresent(doc::setSrcAddrHostname); doc.setSrcAs(flow.getSrcAs()); doc.setSrcMaskLen(flow.getSrcMaskLen()); doc.setSrcPort(flow.getSrcPort()); doc.setTcpFlags(flow.getTcpFlags()); doc.setTos(flow.getTos()); doc.setNetflowVersion(NetflowVersion.from(flow.getNetflowVersion())); doc.setVlan(flow.getVlan() != null ? Integer.toUnsignedString(flow.getVlan()) : null); return doc; }
Source:
public String getDisplayFileName() { if (displayName == null) { if(name != null) { if (version != null) { return name + ":" + version; } else { return name; } } else { return this.fileName; } } return this.displayName; }

Target:
public String getDisplayFileName() { if (displayName != null) { return displayName; } if (name == null) { return fileName; } if (version == null) { return name; } return name + ":" + version; }
Source:
public String checkOutConnection(String host, Port port) throws IOException { return getHostPortPoolManager(host, port).checkOutConnection(); }

Target:
public String checkOutConnection(String host, Port port) throws IOException { if (!isOpen) { throw new IllegalStateException("Connection Manager is closed"); } return getHostPortPoolManager(host, port).checkOutConnection(); }
Source:
public void handlePort(HttpField field) { String port = getLeftMost(field.getValue()); if (StringUtil.isEmpty(port)) throw new IllegalArgumentException(field.getName() + " has empty value"); if (!getForwardedPortAsAuthority()) { if (_for == null) _for = new PortSetHostPort(_request.getRemoteHost(), Integer.parseInt(port)); else if (_for instanceof PossiblyPartialHostPort && _for.getPort() <= 0) _for = new HostPort(HostPort.normalizeHost(_for.getHost()), Integer.parseInt(port)); } else { if (_host == null) _host = new PortSetHostPort(_request.getServerName(), Integer.parseInt(port)); else if (_host instanceof PossiblyPartialHostPort && _host.getPort() <= 0) _host = new HostPort(HostPort.normalizeHost(_host.getHost()), Integer.parseInt(port)); } }

Target:
public void handlePort(HttpField field) { int port = HostPort.parsePort(getLeftMost(field.getValue())); if (!getForwardedPortAsAuthority()) { if (_for == null) _for = new PortSetHostPort(_request.getRemoteHost(), port); else if (_for instanceof PossiblyPartialHostPort && _for.getPort() <= 0) _for = new HostPort(HostPort.normalizeHost(_for.getHost()), port); } else { if (_host == null) _host = new PortSetHostPort(_request.getServerName(), port); else if (_host instanceof PossiblyPartialHostPort && _host.getPort() <= 0) _host = new HostPort(HostPort.normalizeHost(_host.getHost()), port); } }
Source:
public static SignedCertificateTimestamp decode(InputStream input) throws SerializationException { int version = SerializationUtils.readNumber(input, CTConstants.VERSION_LENGTH); if (version != CTConstants.SCT_VERSION_V1) { throw new SerializationException("Unsupported SCT version " + version); } try { return new SignedCertificateTimestamp( version, SerializationUtils.readFixedBytes(input, CTConstants.LOGID_LENGTH), SerializationUtils.readLong(input, CTConstants.TIMESTAMP_LENGTH), SerializationUtils.readVariableBytes(input, CTConstants.EXTENSIONS_LENGTH_BYTES), DigitallySigned.decode(input) ); } catch (IllegalArgumentException e) { throw new SerializationException(e); } }

Target:
public static SignedCertificateTimestamp decode(InputStream input) throws SerializationException { int version = SerializationUtils.readNumber(input, CTConstants.VERSION_LENGTH); if (version != CTConstants.SCT_VERSION_V1) { throw new SerializationException("Unsupported SCT version " + version); } return new SignedCertificateTimestamp( version, SerializationUtils.readFixedBytes(input, CTConstants.LOGID_LENGTH), SerializationUtils.readLong(input, CTConstants.TIMESTAMP_LENGTH), SerializationUtils.readVariableBytes(input, CTConstants.EXTENSIONS_LENGTH_BYTES), DigitallySigned.decode(input) ); }
Source:
private Mono<Void> uploadBlocks(long fileSize, ParallelTransferOptions parallelTransferOptions, BlobHttpHeaders headers, Map<String, String> metadata, AccessTier tier, BlobRequestConditions accessConditions, AsynchronousFileChannel channel, BlockBlobAsyncClient client) { ProgressReceiver progressReceiver = parallelTransferOptions.getProgressReceiver(); AtomicLong totalProgress = new AtomicLong(); Lock progressLock = new ReentrantLock(); final SortedMap<Long, String> blockIds = new TreeMap<>(); return Flux.fromIterable(sliceFile(fileSize, parallelTransferOptions.getBlockSize())) .flatMap(chunk -> { String blockId = getBlockID(); blockIds.put(chunk.getOffset(), blockId); Flux<ByteBuffer> progressData = ProgressReporter.addParallelProgressReporting( FluxUtil.readFile(channel, chunk.getOffset(), chunk.getCount()), progressReceiver, progressLock, totalProgress); return client.stageBlockWithResponse(blockId, progressData, chunk.getCount(), accessConditions.getLeaseId()); }) .then(Mono.defer(() -> client.commitBlockListWithResponse( new ArrayList<>(blockIds.values()), headers, metadata, tier, accessConditions))) .then(); }

Target:
private Mono<Void> uploadBlocks(long fileSize, ParallelTransferOptions parallelTransferOptions, BlobHttpHeaders headers, Map<String, String> metadata, AccessTier tier, BlobRequestConditions accessConditions, AsynchronousFileChannel channel, BlockBlobAsyncClient client) { final ParallelTransferOptions finalParallelTransferOptions = (parallelTransferOptions == null) ? new ParallelTransferOptions(null, null, null) : new ParallelTransferOptions(parallelTransferOptions.getBlockSize(), parallelTransferOptions.getNumBuffers(), parallelTransferOptions.getProgressReceiver()); final BlobRequestConditions finalRequestConditions = (accessConditions == null) ? new BlobRequestConditions() : accessConditions; ProgressReceiver progressReceiver = finalParallelTransferOptions.getProgressReceiver(); AtomicLong totalProgress = new AtomicLong(); Lock progressLock = new ReentrantLock(); final SortedMap<Long, String> blockIds = new TreeMap<>(); return Flux.fromIterable(sliceFile(fileSize, finalParallelTransferOptions.getBlockSize())) .flatMap(chunk -> { String blockId = getBlockID(); blockIds.put(chunk.getOffset(), blockId); Flux<ByteBuffer> progressData = ProgressReporter.addParallelProgressReporting( FluxUtil.readFile(channel, chunk.getOffset(), chunk.getCount()), progressReceiver, progressLock, totalProgress); return client.stageBlockWithResponse(blockId, progressData, chunk.getCount(), finalRequestConditions.getLeaseId()); }) .then(Mono.defer(() -> client.commitBlockListWithResponse( new ArrayList<>(blockIds.values()), headers, metadata, tier, finalRequestConditions))) .then(); }
Source:
private static void proxyFields(FieldDecorator decorator, Object page, Class<?> proxyIn) { Field[] fields = proxyIn.getDeclaredFields(); for (Field field : fields) { int modifiers = field.getModifiers(); if (Modifier.isFinal(modifiers) || Modifier.isStatic(modifiers)) continue; Object value = decorator.decorate(page.getClass().getClassLoader(), field); if (value != null) { try { field.setAccessible(true); field.set(page, value); } catch (IllegalAccessException e) { throw new RuntimeException(e); } } } }

Target:
private static void proxyFields(FieldDecorator decorator, Object page, Class<?> proxyIn) { Field[] fields = proxyIn.getDeclaredFields(); for (Field field : fields) { int modifiers = field.getModifiers(); if (Modifier.isFinal(modifiers) || Modifier.isStatic(modifiers)) { continue; } Object value = decorator.decorate(page.getClass().getClassLoader(), field); if (value != null) { try { field.setAccessible(true); field.set(page, value); } catch (IllegalAccessException e) { throw new RuntimeException(e); } } } }
Source:
void removeChild(AttributeId attribute) { synchronized (this) { if (children == null) { throw new IllegalArgumentException("No child found : " + attribute); } AttributeNode<AttributeId> child = children.get(attribute); if (child == null) { throw new IllegalArgumentException("No child found : " + attribute); } if (child.refCount.decrementAndGet() == 0) { children.remove(attribute); if (children.isEmpty() && parent != null) { parent.removeChild(attribute); } } } }

Target:
void removeChild(AttributeId attribute) { if (children == null) { throw new IllegalArgumentException("No child found : " + attribute); } AttributeNode<AttributeId> child = children.get(attribute); if (child == null) { throw new IllegalArgumentException("No child found : " + attribute); } if (--child.refCount == 0) { children.remove(attribute); if (children.isEmpty() && parent != null) { parent.removeChild(attribute); } } }
Source:
public GlueHiveMetastore(HdfsEnvironment hdfsEnvironment, GlueHiveMetastoreConfig glueConfig, AWSGlueAsync glueClient) { this.hdfsEnvironment = requireNonNull(hdfsEnvironment, "hdfsEnvironment is null"); this.hdfsContext = new HdfsContext(new Identity(DEFAULT_METASTORE_USER, Optional.empty())); this.glueClient = glueClient; this.defaultDir = glueConfig.getDefaultWarehouseDir(); }

Target:
public GlueHiveMetastore(HdfsEnvironment hdfsEnvironment, GlueHiveMetastoreConfig glueConfig, AWSGlueAsync glueClient) { this.hdfsEnvironment = requireNonNull(hdfsEnvironment, "hdfsEnvironment is null"); this.hdfsContext = new HdfsContext(new Identity(DEFAULT_METASTORE_USER, Optional.empty())); this.glueClient = requireNonNull(glueClient, "glueClient is null"); this.defaultDir = glueConfig.getDefaultWarehouseDir(); }
Source:
public Response getPurchaseOrder(@PathParam(PurapPropertyConstants.PURAP_DOC_ID) String purapDocumentIdentifier, @Context HttpHeaders headers) { try { HashMap<String, String> map = new HashMap<>(); map.put(PurapPropertyConstants.PURAP_DOC_ID, purapDocumentIdentifier); PurchaseOrderDocument poDoc = getLookupDao().findObjectByMap(PurchaseOrderDocument.class.newInstance(), map); if (poDoc == null) { return respondNotFound(); } String responseBody = serializePoDocumentToJson(poDoc); return Response.ok(responseBody).build(); } catch (Exception ex) { LOG.error(ex); return respondInternalServerError(ex); } }

Target:
public Response getPurchaseOrder(@PathParam(PurapPropertyConstants.PURAP_DOC_ID) String purapDocumentIdentifier, @Context HttpHeaders headers) { try { HashMap<String, String> map = new HashMap<>(); map.put(PurapPropertyConstants.PURAP_DOC_ID, purapDocumentIdentifier); PurchaseOrderDocument poDoc = getLookupDao().findObjectByMap(PurchaseOrderDocument.class.newInstance(), map); if (ObjectUtils.isNull(poDoc)) { return respondNotFound(); } String responseBody = serializePoDocumentToJson(poDoc); return Response.ok(responseBody).build(); } catch (Exception ex) { LOG.error(ex); return respondInternalServerError(ex); } }
Source:
public Exec createExec(String container, boolean detach, String... cmd) throws IOException { final List<Pair<String, ?>> headers = new ArrayList<>(2); headers.add(Pair.of("Content-Type", "application/json")); final ExecConfig execConfig = new ExecConfig().withCmd(cmd); if (!detach) { execConfig.withAttachStderr(true).withAttachStdout(true); } final String entity = JsonHelper.toJson(execConfig, FIRST_LETTER_LOWERCASE); headers.add(Pair.of("Content-Length", entity.getBytes().length)); try (DockerConnection connection = openConnection(dockerDaemonUri).method("POST") .path("/containers/" + container + "/exec") .headers(headers) .entity(entity)) { final DockerResponse response = connection.request(); final int status = response.getStatus(); if (status / 100 != 2) { throw new DockerException(getDockerExceptionMessage(response), status); } return new Exec(cmd, parseResponseStreamAndClose(response.getInputStream(), ExecCreated.class).getId()); } catch (JsonParseException e) { throw new IOException(e.getLocalizedMessage(), e); } }

Target:
public Exec createExec(String container, boolean detach, String... cmd) throws IOException { final ExecConfig execConfig = new ExecConfig().withCmd(cmd); if (!detach) { execConfig.withAttachStderr(true).withAttachStdout(true); } final List<Pair<String, ?>> headers = new ArrayList<>(2); final String entity = JsonHelper.toJson(execConfig, FIRST_LETTER_LOWERCASE); headers.add(Pair.of("Content-Type", MediaType.APPLICATION_JSON)); headers.add(Pair.of("Content-Length", entity.getBytes().length)); try (DockerConnection connection = openConnection(dockerDaemonUri).method("POST") .path("/containers/" + container + "/exec") .headers(headers) .entity(entity)) { final DockerResponse response = connection.request(); final int status = response.getStatus(); if (status / 100 != 2) { throw new DockerException(getDockerExceptionMessage(response), status); } return new Exec(cmd, parseResponseStreamAndClose(response.getInputStream(), ExecCreated.class).getId()); } catch (JsonParseException e) { throw new IOException(e.getLocalizedMessage(), e); } }
Source:
public void create(final Budget b, final ApiCallback<Long> callback) { if (!hasInternet(callback)) return; RequestParams params = new RequestParams(); String startDate = b.getStartDate().toString(DATE_FORMAT); params.put("budget_name", b.getName()); params.put("amount", "" + b.getBudgetAmount()); params.put("recur", "" + b.isRecurring()); params.put("start_date", startDate); params.put("recurrence_duration", b.getDuration().toString()); client.post(budgetsUrl, params, new JsonHttpResponseHandler() { @Override public void onSuccess(JSONObject obj) { try { long id = obj.getLong("id"); b.setId(id); callback.onSuccess(id); } catch (JSONException e) { Log.e(TAG, e.getMessage()); callback.onFailure(e.getMessage()); } } @Override public void onFailure(Throwable t) { callback.onFailure(t.getMessage()); } @Override public void onFailure(Throwable e, String message) { if (e instanceof SocketTimeoutException) { callback.onFailure("Network Timeout"); } else { callback.onFailure("FAILURE"); } } }); }

Target:
public void create(final Budget b, final ApiCallback<Long> callback) { if (failOnNoInternet(callback)) return; RequestParams params = new RequestParams(); String startDate = b.getStartDate().toString(DATE_FORMAT); params.put("budget_name", b.getName()); params.put("amount", "" + b.getBudgetAmount()); params.put("recur", "" + b.isRecurring()); params.put("start_date", startDate); params.put("recurrence_duration", b.getDuration().toString()); client.post(budgetsUrl, params, new JsonHttpResponseHandler() { @Override public void onSuccess(JSONObject obj) { try { long id = obj.getLong("id"); b.setId(id); callback.onSuccess(id); } catch (JSONException e) { Log.e(TAG, e.getMessage()); callback.onFailure(e.getMessage()); } } @Override public void onFailure(Throwable t) { callback.onFailure(t.getMessage()); } @Override public void onFailure(Throwable e, String message) { if (e instanceof SocketTimeoutException) { callback.onFailure("Network Timeout"); } else { callback.onFailure("FAILURE"); } } }); }
Source:
public static boolean isExpenseReportURI(String URI) { if (StringUtils.isNotBlank(URI) && URI.contains(ConcurConstants.EXPENSE_REPORT_URI_INDICATOR)) { return true; } return false; }

Target:
public static boolean isExpenseReportURI(String URI) { return StringUtils.isNotBlank(URI) && URI.contains(ConcurConstants.EXPENSE_REPORT_URI_INDICATOR); }
Source:
private int readCSVFile(CommandLine cl, DcmDir main, int num) throws Exception { if (!cl.hasOption("record-config")) throw new MissingOptionException("Missing record-config option."); String delim = cl.hasOption("csv-delim") ? cl.getOptionValue("csv-delim") : ","; String quote = cl.hasOption("csv-quote") && !cl.getOptionValue("csv-quote").equals("") ? cl.getOptionValue("csv-quote") : "\""; BufferedReader br = null; try { br = new BufferedReader(new FileReader(cl.getOptionValue("csv"))); loadDefaultConfiguration(cl.getOptionValue("record-config")); String headerline = br.readLine(); String[] headers = headerline.split(delim); List<Integer> tags = new ArrayList<Integer>(); List<VR> vrs = new ArrayList<VR>(); for (int i = 0; i < headers.length; i++) { String header = headers[i].replaceAll(quote, ""); int tag = DICT.tagForKeyword(header); tags.add(tag); vrs.add(DICT.vrOf(tag)); } String nextLine; while((nextLine = br.readLine()) != null) { String escq = new StringBuilder().append("\\").append(quote).toString(); String regex = delim + "(?=(?:[^" + escq + "]*" + escq + "[^" + escq + "]*" + escq + ")*[^" + escq + "]*$)"; String[] values = nextLine.split(regex, -1); if (values.length > headers.length) { LOG.warn("Number of values in line " + nextLine + " does not match number of headers"); return num; } num = main.addReferenceToNextLine( tags.toArray(new Integer[tags.size()]), vrs.toArray(new VR[vrs.size()]), values, num, quote); } } finally { if (br != null) br.close(); } return num; }

Target:
private int readCSVFile(CommandLine cl, DcmDir main, int num) throws Exception { if (!cl.hasOption("record-config")) throw new MissingOptionException("Missing record-config option."); String delim = cl.hasOption("csv-delim") ? cl.getOptionValue("csv-delim") : ","; String quote = cl.hasOption("csv-quote") && !cl.getOptionValue("csv-quote").equals("") ? cl.getOptionValue("csv-quote") : "\""; BufferedReader br = null; try { br = new BufferedReader(new FileReader(cl.getOptionValue("csv"))); loadDefaultConfiguration(cl.getOptionValue("record-config")); String headerline = br.readLine(); String[] headers = headerline.split(delim); List<Integer> tags = new ArrayList<Integer>(); List<VR> vrs = new ArrayList<VR>(); for (int i = 0; i < headers.length; i++) { String header = headers[i].replaceAll(quote, ""); int tag = DICT.tagForKeyword(header); tags.add(tag); vrs.add(DICT.vrOf(tag)); } String nextLine; String esc = "\\"; String escq = esc.concat(quote); String regex = delim + "(?=(?:[^" + escq + "]*" + escq + "[^" + escq + "]*" + escq + ")*[^" + escq + "]*$)"; Pattern p = Pattern.compile(regex); while((nextLine = br.readLine()) != null) { String[] values = p.split(nextLine, -1); if (values.length > headers.length) { LOG.warn("Number of values in line " + nextLine + " does not match number of headers"); return num; } num = main.addReferenceToNextLine( tags.toArray(new Integer[tags.size()]), vrs.toArray(new VR[vrs.size()]), values, num, quote); } } finally { if (br != null) br.close(); } return num; }
Source:
public static List<Document> getAsList(final Observable<Document> observable) { final CountDownLatch latch = new CountDownLatch(1); final List<Document> queriedDocuments = new ArrayList<Document>(); observable.subscribe(new Observer<Document>() { @Override public void onCompleted() { latch.countDown(); } @Override public void onError(final Throwable e) { latch.countDown(); } @Override public void onNext(final Document next) { queriedDocuments.add(next); } }); try { latch.await(1, SECONDS); } catch (InterruptedException e) { throw new RuntimeException(); } return queriedDocuments; }

Target:
public static List<Document> getAsList(final Observable<Document> observable) { return observable.timeout(1, SECONDS).toList().toBlockingObservable().last(); }
Source:
public TfsCommand createCommand( ScmProviderRepository r, ScmFileSet f, String m ) { TfsCommand command = new TfsCommand( "checkin", r, f, getLogger() ); command.addArgument( "-noprompt" ); if ( m != null && !m.equals( "" ) ) { command.addArgument( "-comment:" + m + "" ); } command.addArgument( f ); TfsScmProviderRepository tfsScmProviderRepo = (TfsScmProviderRepository)r; if(tfsScmProviderRepo.isUseCheckinPolicies()) { String policiesFix = "/override:checkin_policy"; command.addArgument( policiesFix + ""); } return command; }

Target:
public TfsCommand createCommand( ScmProviderRepository r, ScmFileSet f, String m ) { TfsCommand command = new TfsCommand( "checkin", r, f, getLogger() ); command.addArgument( "-noprompt" ); if ( m != null && !m.equals( "" ) ) { command.addArgument( "-comment:" + m + "" ); } command.addArgument( f ); TfsScmProviderRepository tfsScmProviderRepo = ( TfsScmProviderRepository )r; if( tfsScmProviderRepo.isUseCheckinPolicies() ) { command.addArgument( policiesArgument ); } return command; }
Source:
public void testConnectionIsPooled() throws IOException{ TestCloudbigtableConnectionPool pool = new TestCloudbigtableConnectionPool(); Configuration config = new Configuration(); PoolEntry entry = pool.getConnection(config, "key"); pool.returnConnection(entry); for (int i = 0; i < 100; i++) { PoolEntry newEntry = pool.getConnection(config, "key"); assertSame(entry, newEntry); pool.returnConnection(newEntry); } }

Target:
public void testConnectionIsPooled() throws IOException{ TestCloudbigtableConnectionPool pool = new TestCloudbigtableConnectionPool(); PoolEntry entry = pool.getConnection(config, "key"); pool.returnConnection(entry); for (int i = 0; i < 100; i++) { PoolEntry newEntry = pool.getConnection(config, "key"); assertSame(entry, newEntry); pool.returnConnection(newEntry); } }
Source:
public static MavenProjectInformation getProjectInformation(MavenSession session, MavenProject project, File projectBaseFolder, boolean testJar, List<Deployment> deployments, String classifier, List<String> customDomains) { DefaultProjectInformation.Builder builder = new DefaultProjectInformation.Builder(); boolean isDeployment = isDeploymentGoal(session); builder.withGroupId(project.getGroupId()) .withArtifactId(project.getArtifactId()) .withVersion(project.getVersion()) .withPackaging(project.getPackaging()) .withClassifier(classifier) .withProjectBaseFolder(Paths.get(projectBaseFolder.toURI())) .withBuildDirectory(Paths.get(project.getBuild().getDirectory())) .setTestProject(testJar) .isDeployment(isDeployment) .withResolvedPom(new ResolvedPom(project.getModel())); if (isDeployment) { DistributionManagement management = project.getDistributionManagement(); DeploymentRepository repository = management != null ? management.getRepository() : null; Settings settings = session.getSettings(); Optional<ExchangeRepositoryMetadata> metadata = getExchangeRepositoryMetadata(repository, settings, customDomains); if (metadata.isPresent()) { if (deployments != null && isPlatformDeployment(deployments)) { builder.withDeployments(deployments); } new ExchangeHelper(customDomains).updateRepositoryUri(project, session.getRequest().getSystemProperties()); } else { builder.withDeployments(deployments); } } builder.withDependencyProject(new DependencyProject(project)); mavenProjectInformation.projectInformation = builder.build(); return mavenProjectInformation; }

Target:
public static MavenProjectInformation getProjectInformation(MavenSession session, MavenProject project, File projectBaseFolder, boolean testJar, List<Deployment> deployments, String classifier, List<String> customDomains) { DefaultProjectInformation.Builder builder = new DefaultProjectInformation.Builder(); boolean isDeployment = isDeploymentGoal(session); builder.withGroupId(project.getGroupId()) .withArtifactId(project.getArtifactId()) .withVersion(project.getVersion()) .withPackaging(project.getPackaging()) .withClassifier(classifier) .withProjectBaseFolder(Paths.get(projectBaseFolder.toURI())) .withBuildDirectory(Paths.get(project.getBuild().getDirectory())) .setTestProject(testJar) .isDeployment(isDeployment) .withResolvedPom(new ResolvedPom(project.getModel())); if (isDeployment) { DistributionManagement management = project.getDistributionManagement(); DeploymentRepository repository = management != null ? management.getRepository() : null; Settings settings = session.getSettings(); Optional<ExchangeRepositoryMetadata> metadata = getExchangeRepositoryMetadata(repository, settings, customDomains); if (metadata.isPresent()) { if (deployments != null && isPlatformDeployment(deployments)) { builder.withDeployments(deployments); } } else { builder.withDeployments(deployments); } } builder.withDependencyProject(new DependencyProject(project)); mavenProjectInformation.projectInformation = builder.build(); return mavenProjectInformation; }
Source:
public void testUseDriverManagerLoginTimout2() throws Exception { Properties props = new Properties(); props.setProperty("user", TestUtil.getUser()); props.setProperty("password", TestUtil.getPassword()); DriverManager.setLoginTimeout(5); props.setProperty("loginTimeout", "0"); Connection conn = DriverManager.getConnection(TestUtil.getURL(), props); conn.close(); DriverManager.setLoginTimeout(0); }

Target:
public void testUseDriverManagerLoginTimout2() throws Exception { Properties props = new Properties(); props.setProperty("user", TestUtil.getUser()); props.setProperty("password", TestUtil.getPassword()); DriverManager.setLoginTimeout(5); props.setProperty("loginTimeout", "10"); Connection conn = DriverManager.getConnection(TestUtil.getURL(), props); conn.close(); DriverManager.setLoginTimeout(0); }
Source:
public static Collector<CurrencyAmount, ?, MultiCurrencyAmount> collector() { return Collector.<CurrencyAmount, Map<Currency, CurrencyAmount>, MultiCurrencyAmount>of( HashMap::new, (map, ca) -> map.merge(ArgChecker.notNull(ca, "amount").getCurrency(), ca, CurrencyAmount::plus), (map1, map2) -> { map1.putAll(map2); return map1; }, (map) -> new MultiCurrencyAmount(ImmutableSortedSet.copyOf(map.values())), UNORDERED); }

Target:
public static Collector<CurrencyAmount, ?, MultiCurrencyAmount> collector() { return Collector.<CurrencyAmount, Map<Currency, CurrencyAmount>, MultiCurrencyAmount>of( HashMap::new, (map, ca) -> map.merge(ArgChecker.notNull(ca, "amount").getCurrency(), ca, CurrencyAmount::plus), (map1, map2) -> { map2.values().forEach((ca2) -> map1.merge(ca2.getCurrency(), ca2, CurrencyAmount::plus)); return map1; }, map -> new MultiCurrencyAmount(ImmutableSortedSet.copyOf(map.values())), UNORDERED); }
Source:
SplitKeyDelegatingTransactionService( Function<Long, T> timestampToServiceKey, Map<T, TransactionService> keyedServices) { this.timestampToServiceKey = timestampToServiceKey; this.keyedServices = keyedServices; this.keyedAsyncServices = KeyedStream.stream(keyedServices) .map(TransactionServices::synchronousAsAsyncTransactionService) .collectToMap(); }

Target:
SplitKeyDelegatingTransactionService( Function<Long, T> timestampToServiceKey, Map<T, TransactionService> keyedServices) { this.timestampToServiceKey = timestampToServiceKey; this.keyedServices = keyedServices; this.keyedSyncServices = KeyedStream.stream(keyedServices) .map(TransactionServices::synchronousAsAsyncTransactionService) .collectToMap(); }
Source:
Rational(final int numerator, final int denominator) throws IllegalArgumentException { if (denominator == 0) { throw new IllegalArgumentException("Denominator must not be zero."); } this.numerator = numerator; this.denominator = denominator; this.reduce(); this.ensureSignInNumerator(); }

Target:
Rational(final int numerator, final int denominator) { if (denominator == 0) { throw new IllegalArgumentException("Denominator must not be zero."); } this.numerator = numerator; this.denominator = denominator; this.reduce(); this.ensureSignInNumerator(); }
Source:
public void authenticate_shouldNotAuthenticateWithNullCredentials() { Context.authenticate((AuthenticationScheme) null , null); }

Target:
public void authenticate_shouldNotAuthenticateWithNullCredentials() { Context.authenticate(new UsernamePasswordAuthenticationScheme(), null); }
Source:
public List<Source> getSources() { return sources; }

Target:
@Nullable public List<Source> getSources() { return sources; }
Source:
public void showUploadInfo(){ launchAlertWithLink(getResources().getString(R.string.images_uploaded) ,getResources().getString(R.string.images_uploaded_explanation) , "<LINK_0>" , getResources().getString(R.string.read_more)); }

Target:
public void showUploadInfo(){ launchAlertWithLink(getResources().getString(R.string.images_uploaded) ,getResources().getString(R.string.images_uploaded_explanation) , IMAGES_UPLOADED_URL , getResources().getString(R.string.read_more)); }
Source:
double stringToTons(String value) { value = value.toLowerCase().replaceAll(" ", "").replaceAll("(tons|ton)", "t"); double factor = 1; if (value.endsWith("t")) { value = value.substring(0, value.length() - 1); } else if (value.endsWith("lbs")) { value = value.substring(0, value.length() - 3); factor = 0.00045359237; } return Double.parseDouble(value) * factor; }

Target:
public static double stringToTons(String value) { value = value.toLowerCase().replaceAll(" ", "").replaceAll("(tons|ton)", "t"); value = value.replace("mgw", "").trim(); double factor = 1; if (value.endsWith("t")) { value = value.substring(0, value.length() - 1); } else if (value.endsWith("lbs")) { value = value.substring(0, value.length() - 3); factor = 0.00045359237; } return Double.parseDouble(value) * factor; }
Source:
String prepare(String name, Map<String, Map<String, String>> domain) { StringBuilder builder = new StringBuilder(name); while (domain.containsKey(name)) { builder.append("~"); } domain.put(builder.toString(), new LinkedHashMap<>()); return builder.toString(); }

Target:
String prepare(String name, Map<String, Map<String, String>> domain) { StringBuilder builder = new StringBuilder(name); while (domain.containsKey(name)) { builder.append("~"); } String val = builder.toString(); domain.put(val, new LinkedHashMap<>()); return val; }
Source:
private boolean checkSummon(CommandSender sender, String type) { if (type == null) { return false; } EntityType entityType = EntityType.fromName(type); if (sender != null) sender.sendMessage(type + " == null: " + (entityType == null) + "!"); if (entityType != null && !EntityType.fromName(type).isSpawnable()) { if (sender != null) sender.sendMessage(ChatColor.RED + "The entity '" + EntityType.fromName(type).getName() + "' cannot be summoned."); return false; } if (entityType != null && EntityRegistry.getEntity(entityType) == null) { if (sender != null) sender.sendMessage(ChatColor.RED + "The entity '" + entityType.getName() + "' is not implemented yet."); return false; } else if (entityType == null && !EntityRegistry.isCustomEntityRegistered(type)) { if (sender != null) sender.sendMessage(ChatColor.RED + "The entity '" + type + "' is does not exist."); return false; } return true; }

Target:
private boolean checkSummon(CommandSender sender, String type) { if (type == null) { return false; } EntityType entityType = EntityType.fromName(type); if (sender != null) sender.sendMessage(type + " == null: " + (entityType == null) + "!"); if (entityType != null && !EntityType.fromName(type).isSpawnable()) { if (sender != null) sender.sendMessage(ChatColor.RED + "The entity '" + EntityType.fromName(type).getName() + "' cannot be summoned."); return false; } if (entityType != null && EntityRegistry.getEntity(entityType) == null) { if (sender != null) sender.sendMessage(ChatColor.RED + "The entity '" + entityType.getName() + "' is not implemented yet."); return false; } else if (entityType == null && !EntityRegistry.isCustomEntityRegistered(type)) { if (sender != null) sender.sendMessage(ChatColor.RED + "The entity '" + type + "' does not exist."); return false; } return true; }
Source:
public void beforeTestSnapshot() throws Exception { cleanPersistenceDir(); dfltCacheCfg = txCacheConfig(new CacheConfiguration<>(DEFAULT_CACHE_NAME)); persistence = true; }

Target:
public void beforeTestSnapshot() throws Exception { cleanPersistenceDir(); dfltCacheCfg = txCacheConfig(new CacheConfiguration<>(DEFAULT_CACHE_NAME)); }
Source:
public void onMessage(final Message message) { try { LOGGER.debug("Received message: {}", message.getJMSMessageID()); } catch (final JMSException e) { LOGGER.error("Received unintelligible message: {}", e); propagate(e); } try { final String eventType = message.getStringProperty(EVENT_TYPE_HEADER_NAME); final String id = message.getStringProperty(IDENTIFIER_HEADER_NAME); final String baseURL = message.getStringProperty(BASE_URL_HEADER_NAME); LOGGER.debug("Discovered id: in message.", id); LOGGER.debug("Discovered event type: in message.", eventType); LOGGER.debug("Discovered baseURL: in message.", baseURL); LOGGER.debug("Discovered properties: in message.", message.getStringProperty(PROPERTIES_HEADER_NAME)); index( baseURL, baseURL + id, eventType ); } catch (final JMSException e) { LOGGER.error("Error processing JMS event!", e); } }

Target:
public void onMessage(final Message message) { try { LOGGER.debug("Received message: {}", message.getJMSMessageID()); } catch (final JMSException e) { LOGGER.error("Received unintelligible message: {}", e); propagate(e); } try { final String eventType = message.getStringProperty(EVENT_TYPE_HEADER_NAME); final String id = message.getStringProperty(IDENTIFIER_HEADER_NAME); String baseURL = message.getStringProperty(BASE_URL_HEADER_NAME); LOGGER.debug("Discovered id: in message.", id); LOGGER.debug("Discovered event type: in message.", eventType); LOGGER.debug("Discovered baseURL: in message.", baseURL); LOGGER.debug("Discovered properties: in message.", message.getStringProperty(PROPERTIES_HEADER_NAME)); while (!Strings.isNullOrEmpty(baseURL) && baseURL.endsWith("/")) { baseURL = baseURL.substring(0, baseURL.length() - 1); } index( baseURL, id, eventType ); } catch (final JMSException e) { LOGGER.error("Error processing JMS event!", e); } }
Source:
public void registerNavDrawerItems(final Activity activity, ContextMenuAdapter adapter) { PackageManager pm = activity.getPackageManager(); for (Map.Entry<String, List<NavDrawerItem>> entry : getNavDrawerItems().entrySet()) { String appPackage = entry.getKey(); for (NavDrawerItem item : entry.getValue()) { Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(item.uri)); boolean isCopy = false; if (intent.resolveActivity(pm) == null) { intent = pm.getLaunchIntentForPackage(appPackage); } if (intent != null) { if (item.flags != -1) { intent.addFlags(item.flags); } final Intent finalIntent = intent; for (String s : adapter.getItemNames()) { if (item.name.equals(s)) { isCopy = true; } } if (!isCopy) { adapter.addItem(new ContextMenuItem.ItemBuilder() .setId(item.getId()) .setTitle(item.name) .setIcon(getIconId(item.iconName)) .setListener(new ContextMenuAdapter.ItemClickListener() { @Override public boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> adapter, int itemId, int position, boolean isChecked, int[] viewCoordinates) { activity.startActivity(finalIntent); return true; } }) .createItem()); } } } } }

Target:
public void registerNavDrawerItems(final Activity activity, ContextMenuAdapter adapter) { PackageManager pm = activity.getPackageManager(); for (Map.Entry<String, List<NavDrawerItem>> entry : getNavDrawerItems().entrySet()) { String appPackage = entry.getKey(); for (NavDrawerItem item : entry.getValue()) { Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(item.uri)); if (intent.resolveActivity(pm) == null) { intent = pm.getLaunchIntentForPackage(appPackage); } if (intent != null) { if (item.flags != -1) { intent.addFlags(item.flags); } final Intent finalIntent = intent; adapter.addItem(new ContextMenuItem.ItemBuilder() .setId(item.getId()) .setTitle(item.name) .setIcon(getIconId(item.iconName)) .setListener(new ContextMenuAdapter.ItemClickListener() { @Override public boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> adapter, int itemId, int position, boolean isChecked, int[] viewCoordinates) { activity.startActivity(finalIntent); return true; } }) .createItem()); } } } }
Source:
public PeriodGranularity( @JsonProperty("period") Period period, @JsonProperty("origin") DateTime origin, @JsonProperty("timeZone") DateTimeZone tz ) { this.period = period; Preconditions.checkArgument(!Period.ZERO.equals(period), "zero period is not acceptable in QueryGranularity!"); this.chronology = tz == null ? ISOChronology.getInstanceUTC() : ISOChronology.getInstance(tz); if(origin == null) { this.origin = new DateTime(0, DateTimeZone.UTC).withZoneRetainFields(chronology.getZone()).getMillis(); this.hasOrigin = false; } else { this.origin = origin.getMillis(); this.hasOrigin = true; } this.isCompound = isCompoundPeriod(period); }

Target:
public PeriodGranularity( @JsonProperty("period") Period period, @JsonProperty("origin") DateTime origin, @JsonProperty("timeZone") DateTimeZone tz ) { this.period = Preconditions.checkNotNull(period, "period can't be null!"); Preconditions.checkArgument(!Period.ZERO.equals(period), "zero period is not acceptable in QueryGranularity!"); this.chronology = tz == null ? ISOChronology.getInstanceUTC() : ISOChronology.getInstance(tz); if(origin == null) { this.origin = new DateTime(0, DateTimeZone.UTC).withZoneRetainFields(chronology.getZone()).getMillis(); this.hasOrigin = false; } else { this.origin = origin.getMillis(); this.hasOrigin = true; } this.isCompound = isCompoundPeriod(period); }
Source:
public Mono<ImmutabilityPolicyInner> deleteImmutabilityPolicyAsync( String resourceGroupName, String accountName, String containerName) { return deleteImmutabilityPolicyAsync(resourceGroupName, accountName, containerName); }

Target:
public Mono<Void> deleteImmutabilityPolicyAsync( String resourceGroupName, String accountName, String containerName) { return deleteImmutabilityPolicyAsync(resourceGroupName, accountName, containerName, null); }
Source:
public void checkWhitespaceAroundColon(TypeAnnotationContext ctx) { TerminalNodeImpl colon = (TerminalNodeImpl) ctx.getChild(0); ParseTree parentLeftSibling = ParseTreeUtil.getLeftSibling(colon.getParent()); ParseTree rightSibling = ctx.getChild(1); if (parentLeftSibling == null || rightSibling == null) { return; } Token left = parentLeftSibling instanceof ParserRuleContext ? ((ParserRuleContext) parentLeftSibling).getStop() : ((TerminalNodeImpl) parentLeftSibling).getSymbol(); Token right = rightSibling instanceof ParserRuleContext ? ((ParserRuleContext) rightSibling).getStart() : ((TerminalNodeImpl) rightSibling).getSymbol(); Token colonToken = colon.getSymbol(); if (colonToken.getLine() == left.getLine() && colonToken.getCharPositionInLine() - ListenerUtil.getLastCharPositionInLine(left) != 1) { printer.error(Messages.COLON + Messages.NO_SPACE_BEFORE, ListenerUtil.getTokenLocation(colonToken)); } if (right.getLine() == colonToken.getLine() && right.getCharPositionInLine() - ListenerUtil.getLastCharPositionInLine(colonToken) != 2) { printer.error(Messages.COLON + Messages.SPACE_AFTER, ListenerUtil.getTokenLocation(colonToken)); } }

Target:
void checkWhitespaceAroundColon(TypeAnnotationContext ctx) { TerminalNodeImpl colon = (TerminalNodeImpl) ctx.getChild(0); ParseTree parentLeftSibling = ParseTreeUtil.getLeftSibling(colon.getParent()); ParseTree rightSibling = ctx.getChild(1); assert !(parentLeftSibling == null || rightSibling == null); Token left = parentLeftSibling instanceof ParserRuleContext ? ((ParserRuleContext) parentLeftSibling).getStop() : ((TerminalNodeImpl) parentLeftSibling).getSymbol(); Token right = rightSibling instanceof ParserRuleContext ? ((ParserRuleContext) rightSibling).getStart() : ((TerminalNodeImpl) rightSibling).getSymbol(); Token colonToken = colon.getSymbol(); if (colonToken.getLine() == left.getLine() && colonToken.getCharPositionInLine() - ListenerUtil.getLastCharPositionInLine(left) != 1) { printer.error(Messages.COLON + Messages.NO_SPACE_BEFORE, ListenerUtil.getTokenLocation(colonToken)); } if (right.getLine() == colonToken.getLine() && right.getCharPositionInLine() - ListenerUtil.getLastCharPositionInLine(colonToken) != 2) { printer.error(Messages.COLON + Messages.SPACE_AFTER, ListenerUtil.getTokenLocation(colonToken)); } }
Source:
public void onBrowserEvent(Context context, Element parent, GlusterVolumeEntity volume, SafeHtml tooltipContent, NativeEvent event, ValueUpdater<GlusterVolumeEntity> valueUpdater) { VolumeStatus status = GlusterVolumeUtils.getVolumeStatus(volume); if (BrowserEvents.CLICK.equals(event.getType()) && onClickCommand != null && (status == VolumeStatus.ALL_BRICKS_DOWN || status == VolumeStatus.SOME_BRICKS_DOWN)) { onClickCommand.execute(); } else { super.onBrowserEvent(context, parent, volume, tooltipContent, event, valueUpdater); } }

Target:
public void onBrowserEvent(Context context, Element parent, GlusterVolumeEntity volume, SafeHtml tooltipContent, NativeEvent event, ValueUpdater<GlusterVolumeEntity> valueUpdater) { super.onBrowserEvent(context, parent, volume, tooltipContent, event, valueUpdater); VolumeStatus status = GlusterVolumeUtils.getVolumeStatus(volume); if (BrowserEvents.CLICK.equals(event.getType()) && onClickCommand != null && (status == VolumeStatus.ALL_BRICKS_DOWN || status == VolumeStatus.SOME_BRICKS_DOWN)) { onClickCommand.execute(); } }
Source:
default void updateServletContextHandler(ServletContextHandler servletContextHandler) { ServletHolder jerseyServlet = servletContextHandler.addServlet(ServletContainer.class, "/swagger"); jerseyServlet.setInitOrder(0); jerseyServlet.setInitParameter("jersey.config.server.provider.packages", "com.yahoo.elide.contrib.swagger.resources"); jerseyServlet.setInitParameter("javax.ws.rs.Application", ElideResourceConfig.class.getCanonicalName()); }

Target:
default void updateServletContextHandler(ServletContextHandler servletContextHandler) { }
Source:
public static String getAmazonS3InitParams(final ImmutableMap<String, String> requiredArgs) { if (requiredArgs.containsKey("bucketName")) { if (requiredArgs.containsKey("objectName")) { return "const char* bucket_name, const char* object_name"; } else { return "const char* bucket_name"; } } return "void"; }

Target:
public static String getAmazonS3InitParams(final ImmutableMap<String, String> requiredArgs) { if (!requiredArgs.containsKey("bucketName")) { return "void"; } else if (requiredArgs.containsKey("objectName")) { return "const char* bucket_name, const char* object_name"; } return "const char* bucket_name"; }
Source:
private void setupFocusHandling() { focusListener = new IWindowListener() { public void windowOpened(IWorkbenchWindow window) { } public void windowDeactivated(IWorkbenchWindow window) { } public void windowClosed(IWorkbenchWindow window) { } public void windowActivated(IWorkbenchWindow window) { if (rcs.doReschedule) rcs.schedule(); refreshJob.schedule(); } }; PlatformUI.getWorkbench().addWindowListener(focusListener); }

Target:
private void setupFocusHandling() { focusListener = new IWindowListener() { public void windowOpened(IWorkbenchWindow window) { } public void windowDeactivated(IWorkbenchWindow window) { } public void windowClosed(IWorkbenchWindow window) { } public void windowActivated(IWorkbenchWindow window) { if (rcs.doReschedule) rcs.schedule(); refreshJob.triggerRefresh(); } }; PlatformUI.getWorkbench().addWindowListener(focusListener); }
Source:
protected boolean isDragEnabled() { if (getScoutObject() != null) { return getScoutObject().isDragEnabled(); } else { return false; } }

Target:
protected boolean isDragEnabled() { if (getScoutObject() != null) { return getScoutObject().isDragEnabled(); } return false; }
Source:
public void refreshTestData() { super.prepareTestData(); dataBundle = getTypicalDataBundle(); removeAndRestoreTypicalDataBundle(); }

Target:
public void refreshTestData() { super.prepareTestData(); }
Source:
public boolean isDefaultOrEmptyAccessibilityDelegateCompat() { return (this.getClass().equals(AccessibilityDelegateCompat.class) && mOriginalDelegate.getClass().equals(AccessibilityDelegate.class)) || mOriginalDelegate == null; }

Target:
public boolean isDefaultOrEmptyAccessibilityDelegateCompat() { return mOriginalDelegate == null || (this.getClass().equals(AccessibilityDelegateCompat.class) && mOriginalDelegate.getClass().equals(AccessibilityDelegate.class)); }
Source:
public static String protectPerforceFilename(String name) { ArrayList<SimpleImmutableEntry<String,String>> transmap = new ArrayList<SimpleImmutableEntry<String,String>>() { { add(new SimpleImmutableEntry<>("%", "%25")); add(new SimpleImmutableEntry<>("#", "%23")); add(new SimpleImmutableEntry<>("\\*", "%2A")); add(new SimpleImmutableEntry<>("@", "%40")); } }; String t = name; for (SimpleImmutableEntry<String,String> ent : transmap) { t = t.replaceAll(ent.getKey(), ent.getValue()); } if (name != t) { LOGGER.log(Level.INFO, "protectPerforceFilename: replaced ''{0}'' with ''{1}''", new Object[]{name, t}); } return t; }

Target:
static String protectPerforceFilename(String name) { String t = name.replaceAll("%", "%25"); t = t.replaceAll("#", "%23"); t = t.replaceAll("\\*", "%2A"); t = t.replaceAll("@", "%40"); if (name != t) { LOGGER.log(Level.FINEST, "protectPerforceFilename: replaced ''{0}'' with ''{1}''", new Object[]{name, t}); } return t; }
Source:
public void setUpRpcClient() throws Exception { retries = 1; RpcConnectionPool.RpcConnectionKey rpcConnectionKey = new RpcConnectionPool.RpcConnectionKey( RpcUtils.getConnectAddress(server.getListenAddress()), DummyProtocol.class, true); client = new AsyncRpcClient(rpcConnectionKey, retries); stub = client.getStub(); }

Target:
public void setUpRpcClient() throws Exception { retries = 1; RpcConnectionPool.RpcConnectionKey rpcConnectionKey = new RpcConnectionPool.RpcConnectionKey( RpcUtils.getConnectAddress(server.getListenAddress()), DummyProtocol.class, true); client = new AsyncRpcClient(rpcConnectionKey, retries); client.acquire(RpcConnectionPool.DEFAULT_TIMEOUT); stub = client.getStub(); }