auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public static AlertDialog buildAboutCommCareDialog(Activity activity) { final String commcareVersion = CommCareApplication._().getCurrentVersionString(); LayoutInflater li = LayoutInflater.from(activity); View view = li.inflate(R.layout.about_commcare_dialog, null); TextView titleView = (TextView) view.findViewById(R.id.dialog_title).findViewById(R.id.dialog_title_text); titleView.setText("About CommCare"); TextView aboutText = (TextView)view.findViewById(R.id.about_commcare_text); String msg = activity.getString(R.string.aboutdialog, commcareVersion); Spannable markdownText = MarkupUtil.returnMarkdown(activity, msg); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) { aboutText.setText(markdownText); } else { aboutText.setText(markdownText.toString()); } AlertDialog.Builder builder = new AlertDialog.Builder(activity); builder.setView(view); return builder.create(); }

Target:
public static AlertDialog buildAboutCommCareDialog(Activity activity) { final String commcareVersion = CommCareApplication._().getCurrentVersionString(); LayoutInflater li = LayoutInflater.from(activity); View view = li.inflate(R.layout.about_commcare_dialog, null); TextView titleView = (TextView) view.findViewById(R.id.dialog_title).findViewById(R.id.dialog_title_text); titleView.setText(activity.getString(R.string.about_cc)); TextView aboutText = (TextView)view.findViewById(R.id.about_commcare_text); String msg = activity.getString(R.string.aboutdialog, commcareVersion); Spannable markdownText = MarkupUtil.returnMarkdown(activity, msg); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) { aboutText.setText(markdownText); } else { aboutText.setText(markdownText.toString()); } AlertDialog.Builder builder = new AlertDialog.Builder(activity); builder.setView(view); return builder.create(); }
Source:
public int getSerializedSizeInBytes() { return NAME.length() + SIZE_OF_INT + SIZE_OF_INT + SIZE_OF_BYTE + nullsBufferIndex + (remainingNullsCount > 0 ? SIZE_OF_BYTE : 0) + valuesBufferIndex; }

Target:
public long getSerializedSizeInBytes() { return NAME.length() + SIZE_OF_INT + SIZE_OF_INT + getNullsBufferSerializedSizeInBytes() + valuesBufferIndex; }
Source:
private void handlePackError(IOException e, PackFile p) { String warnTmpl = null; String errTmpl = JGitText.get().exceptionWhileReadingPack; if ((e instanceof CorruptObjectException) || (e instanceof PackInvalidException)) { warnTmpl = JGitText.get().corruptPack; removePack(p); } else if (e instanceof FileNotFoundException) { if (p.getPackFile().exists()) { errTmpl = JGitText.get().packInaccessible; } else { warnTmpl = JGitText.get().packWasDeleted; removePack(p); } } else if (FileUtils.isStaleFileHandleInCausalChain(e)) { warnTmpl = JGitText.get().packHandleIsStale; removePack(p); } if (warnTmpl != null) { if (LOG.isDebugEnabled()) { LOG.debug(MessageFormat.format(warnTmpl, p.getPackFile().getAbsolutePath()), e); } else { LOG.warn(MessageFormat.format(warnTmpl, p.getPackFile().getAbsolutePath())); } } else { LOG.error(MessageFormat.format( errTmpl, p.getPackFile().getAbsolutePath()), e); } }

Target:
private void handlePackError(IOException e, PackFile p) { String warnTmpl = null; int retryTransientCount = 0; String errTmpl = JGitText.get().exceptionWhileReadingPack; if ((e instanceof CorruptObjectException) || (e instanceof PackInvalidException)) { warnTmpl = JGitText.get().corruptPack; removePack(p); } else if (e instanceof FileNotFoundException) { if (p.getPackFile().exists()) { errTmpl = JGitText.get().packInaccessible; retryTransientCount = p.incrementTransientErrorCount(); } else { warnTmpl = JGitText.get().packWasDeleted; removePack(p); } } else if (FileUtils.isStaleFileHandleInCausalChain(e)) { warnTmpl = JGitText.get().packHandleIsStale; removePack(p); } else { retryTransientCount = p.incrementTransientErrorCount(); } if (warnTmpl != null) { if (LOG.isDebugEnabled()) { LOG.debug(MessageFormat.format(warnTmpl, p.getPackFile().getAbsolutePath()), e); } else { LOG.warn(MessageFormat.format(warnTmpl, p.getPackFile().getAbsolutePath())); } } else { if (doLogExponentialBackoff(retryTransientCount)) { LOG.error(MessageFormat.format(errTmpl, p.getPackFile().getAbsolutePath()), Integer.valueOf(retryTransientCount), e); } } }
Source:
public TexasProvider(final String apiBase, final String authorization) { super(NetworkId.TX, apiBase, authorization); setTimeZone("America/Chicago"); }

Target:
public TexasProvider(final String apiBase, final String authorization) { super(NetworkId.TEXAS, apiBase, authorization); setTimeZone("America/Chicago"); }
Source:
public synchronized HttpResponse doStop() throws IOException, ServletException { Executor e = Executor.of(this); if (e == null) { for (Computer c : Jenkins.getActiveInstance().getComputers()) { for (Executor e1 : c.getOneOffExecutors()) { if (e1.getCurrentExecutable() == this) e = e1; } } } if (e != null) { return e.doStop(); } else { return HttpResponses.forwardToPreviousPage(); } }

Target:
public synchronized HttpResponse doStop() throws IOException, ServletException { Executor e = Executor.of(this); if (e != null) { return e.doStop(); } else { return HttpResponses.forwardToPreviousPage(); } }
Source:
@Override protected void prepareConnectionForEditing(StorageServerConnections connection)

Target:
protected void prepareConnectionForEditing(StorageServerConnections connection)
Source:
public void testBundlePreservesFullUrl() { Bundle bundle = new Bundle(); bundle.setType(BundleType.DOCUMENT); Composition composition = new Composition(); composition.setTitle("Visit Summary"); bundle.addEntry().setFullUrl("http://foo").setResource(composition); IIdType id = myClient.create().resource(bundle).execute().getId(); Bundle retBundle = myClient.read().resource(Bundle.class).withId(id).execute(); ourLog.info(myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(retBundle)); assertEquals("http://foo", bundle.getEntry().get(0).getFullUrl()); }

Target:
public void testBundlePreservesFullUrl() { Bundle bundle = new Bundle(); bundle.setType(BundleType.DOCUMENT); Composition composition = new Composition(); composition.setTitle("Visit Summary"); bundle.addEntry().setFullUrl("http://foo").setResource(composition); IIdType id = ourClient.create().resource(bundle).execute().getId(); Bundle retBundle = ourClient.read().resource(Bundle.class).withId(id).execute(); ourLog.info(myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(retBundle)); assertEquals("http://foo", bundle.getEntry().get(0).getFullUrl()); }
Source:
public Query createNativeQuery(String sqlString, Class resultClass) { SQLQuery q = ( (Session) getDelegate() ).createSQLQuery( sqlString ); q.addEntity( "alias1", resultClass.getName(), LockMode.READ ); return new QueryImpl( q, (AbstractEntityManagerImpl) hibernateEm ); }

Target:
public Query createNativeQuery(String sqlString, Class resultClass) { SQLQuery q = ( (Session) getDelegate() ).createSQLQuery( sqlString ); q.addEntity( "alias1", resultClass.getName(), LockMode.READ ); return new OgmNativeQuery( q, hibernateEm ); }
Source:
RowLock(ReentrantLock rlock, ByteSequence rowSeq) { this.rlock = rlock; this.count = new AtomicInteger(1); this.rowSeq = rowSeq; }

Target:
RowLock(ReentrantLock rlock, ByteSequence rowSeq) { this.rlock = rlock; this.count = 1; this.rowSeq = rowSeq; }
Source:
public void setStringValue(BaseElement element, String value) { String[] variables = value.split(","); for (String variable : variables) { if (!variable.isEmpty()) { FeatureMap.Entry extension = extensionOf( DOCUMENT_ROOT__GLOBAL, globalTypeDataOf(variable)); getExtensionElements(element).add(extension); } } }

Target:
protected void setStringValue(BaseElement element, String value) { Stream.of(value.split(",")) .map(this::extensionOf) .forEach(getExtensionElements(element)::add); }
Source:
public Socket createSocket() throws IOException { Socket tcpSocket = super.createSocket(); SSLSocket sslSocket = (SSLSocket) sslSocketFactory.createSocket(tcpSocket, host, port, true); ArrayList<String> protocolsList = Utils.splitString(sslConfig.sslEnabledProtocols, ","); if (!protocolsList.isEmpty()) { String[] enabledProtocols = protocolsList.toArray(new String[protocolsList.size()]); sslSocket.setEnabledProtocols(enabledProtocols); } ArrayList<String> cipherSuitesList = Utils.splitString(sslConfig.sslCipherSuites, ","); if (!cipherSuitesList.isEmpty()) { String[] cipherSuites = cipherSuitesList.toArray(new String[cipherSuitesList.size()]); sslSocket.setEnabledCipherSuites(cipherSuites); } try { sslSocket.startHandshake(); sslClientHandshakeCount.inc(); } catch (IOException e) { sslClientHandshakeErrorCount.inc(); throw e; } logger.debug( "Converted socket to SSL with enabled protocols and ciphers {}", sslSocket.getEnabledProtocols(), sslSocket.getEnabledCipherSuites() ); return sslSocket; }

Target:
public Socket createSocket() throws IOException { Socket tcpSocket = super.createSocket(); SSLSocket sslSocket = null; try { sslSocket = (SSLSocket) sslSocketFactory.createSocket(tcpSocket, host, port, true); ArrayList<String> protocolsList = Utils.splitString(sslConfig.sslEnabledProtocols, ","); if (!protocolsList.isEmpty()) { String[] enabledProtocols = protocolsList.toArray(new String[protocolsList.size()]); sslSocket.setEnabledProtocols(enabledProtocols); } ArrayList<String> cipherSuitesList = Utils.splitString(sslConfig.sslCipherSuites, ","); if (!cipherSuitesList.isEmpty()) { String[] cipherSuites = cipherSuitesList.toArray(new String[cipherSuitesList.size()]); sslSocket.setEnabledCipherSuites(cipherSuites); } sslSocket.startHandshake(); sslClientHandshakeCount.inc(); } catch (IOException e) { sslClientHandshakeErrorCount.inc(); tcpSocket.setSoLinger(true, 0); tcpSocket.close(); throw e; } logger.debug( "Converted socket to SSL with enabled protocols and ciphers {}", sslSocket.getEnabledProtocols(), sslSocket.getEnabledCipherSuites() ); return sslSocket; }
Source:
public void testLoadPropertiesWithoutPropertiesFile() throws Exception { Properties testProperties = PROPERTIES_LOADER.loadProperties(null, null); Properties emptyProperties = new Properties(); Assert.assertEquals("Returns empty properties", emptyProperties, testProperties); }

Target:
public void testLoadPropertiesWithoutPropertiesFile() throws Exception { Properties testProperties = PROPERTIES_LOADER.loadProperties(null, null); assertThat(testProperties.entrySet(), is(empty())); }
Source:
private LogicalPlan plan(String statement) { return withMemoryLimit(ByteSizeUnit.MB.toBytes(8), () -> sqlExecutor.logicalPlan(statement)); }

Target:
private LogicalPlan plan(String statement) { return assertMaxBytesAllocated(ByteSizeUnit.MB.toBytes(8), () -> sqlExecutor.logicalPlan(statement)); }
Source:
public PaxosAgent(TimeLockInstallConfiguration install, Observable<TimeLockRuntimeConfiguration> runtime, TimeLockDeprecatedConfiguration deprecated, Consumer<Object> registrar) { super(install, runtime, deprecated, registrar); Preconditions.checkState(install.algorithm() instanceof PaxosInstallConfiguration, "Cannot initialize a Paxos agent with a non-Paxos algorithm configuration."); this.paxosInstall = (PaxosInstallConfiguration) install.algorithm(); this.paxosResource = PaxosResource.create(paxosInstall.dataDirectory().toString()); this.leadershipAgent = new PaxosLeadershipCreator(install, runtime, registrar); this.lockCreator = new LockCreator(runtime, deprecated); this.timestampCreator = new PaxosTimestampCreator(paxosResource, PaxosRemotingUtils.getRemoteServerPaths(install), install.cluster().cluster().security().map(SslSocketFactories::createSslSocketFactory), runtime.map(x -> x.algorithm().orElse(ImmutablePaxosRuntimeConfiguration.builder().build()))); }

Target:
public PaxosAgent(TimeLockInstallConfiguration install, Observable<TimeLockRuntimeConfiguration> runtime, TimeLockDeprecatedConfiguration deprecated, Consumer<Object> registrar) { super(install, runtime, deprecated, registrar); this.paxosInstall = install.algorithm(); this.paxosResource = PaxosResource.create(paxosInstall.dataDirectory().toString()); this.leadershipAgent = new PaxosLeadershipCreator(install, runtime, registrar); this.lockCreator = new LockCreator(runtime, deprecated); this.timestampCreator = new PaxosTimestampCreator(paxosResource, PaxosRemotingUtils.getRemoteServerPaths(install), install.cluster().cluster().security().map(SslSocketFactories::createSslSocketFactory), runtime.map(x -> x.algorithm().orElse(ImmutablePaxosRuntimeConfiguration.builder().build()))); }
Source:
public void map(Text key, Writable value, Context context) throws IOException, InterruptedException { String url; try { if (value instanceof CrawlDatum) { context.write(key, (CrawlDatum) value); } else if (value instanceof HostDatum) { String host = key.toString(); if((url = filterNormalize("http://" + host + "/")) == null && (url = filterNormalize("https://" + host + "/")) == null && (url = filterNormalize("ftp://" + host + "/")) == null && (url = filterNormalize("file:/" + host + "/")) == null) { context.getCounter("Sitemap", "filtered_records").increment(1); return; } BaseRobotRules rules = protocolFactory.getProtocol(url).getRobotRules(new Text(url), datum, new LinkedList<>()); List<String> sitemaps = rules.getSitemaps(); for(String sitemap: sitemaps) { context.getCounter("Sitemap", "sitemaps_from_hostdb").increment(1); generateSitemapUrlDatum(protocolFactory.getProtocol(sitemap), sitemap, context); } } else if (value instanceof Text) { if((url = filterNormalize(key.toString())) == null) { context.getCounter("Sitemap", "filtered_records").increment(1); return; } context.getCounter("Sitemap", "sitemap_seeds").increment(1); generateSitemapUrlDatum(protocolFactory.getProtocol(url), url, context); } } catch (Exception e) { LOG.warn("Exception for record " + key.toString() + " : " + StringUtils.stringifyException(e)); } }

Target:
public void map(Text key, Writable value, Context context) throws IOException, InterruptedException { String url; try { if (value instanceof CrawlDatum) { context.write(key, (CrawlDatum) value); } else if (value instanceof HostDatum) { String host = key.toString(); if((url = filterNormalize("http://" + host + "/")) == null && (url = filterNormalize("https://" + host + "/")) == null && (url = filterNormalize("ftp://" + host + "/")) == null && (url = filterNormalize("file:/" + host + "/")) == null) { context.getCounter("Sitemap", "filtered_records").increment(1); return; } BaseRobotRules rules = protocolFactory.getProtocol(url).getRobotRules(new Text(url), datum, null); List<String> sitemaps = rules.getSitemaps(); for(String sitemap: sitemaps) { context.getCounter("Sitemap", "sitemaps_from_hostdb").increment(1); generateSitemapUrlDatum(protocolFactory.getProtocol(sitemap), sitemap, context); } } else if (value instanceof Text) { if((url = filterNormalize(key.toString())) == null) { context.getCounter("Sitemap", "filtered_records").increment(1); return; } context.getCounter("Sitemap", "sitemap_seeds").increment(1); generateSitemapUrlDatum(protocolFactory.getProtocol(url), url, context); } } catch (Exception e) { LOG.warn("Exception for record : {}", key.toString(), StringUtils.stringifyException(e)); } }
Source:
private void verifyMasterSecret(final Socket sock) { if (sock instanceof SSLSocket) { SSLSocket ssl = (SSLSocket)sock; final SSLSession session = ssl.getSession(); if (session != null) { final String className = session.getClass().getName(); if ("sun.security.ssl.SSLSessionImpl".equals(className)) { boolean success = false; Object masterSecret = null; try { masterSecret = AccessController.doPrivileged(new PrivilegedExceptionAction<Object>() { @Override public Object run() throws Exception { Class<?> clazz = Class.forName(className); Method method = clazz.getDeclaredMethod("getMasterSecret"); method.setAccessible(true); return method.invoke(session); } }); success = true; } catch (SecurityException e) { failedToVerifyMasterSecret(e); } catch (PrivilegedActionException e) { Throwable cause = e.getCause(); if (cause instanceof InvocationTargetException) { cause = cause.getCause(); } failedToVerifyMasterSecret(cause); } if (success && masterSecret == null) throw log(new SecurityException("Invalid SSL master secret")); } } } return; }

Target:
private void verifyMasterSecret(final Socket sock) throws SSLException { if (sock instanceof SSLSocket) { SSLSocket ssl = (SSLSocket)sock; SSLSession session = ssl.getSession(); if (session != null) { String className = session.getClass().getName(); if ("sun.security.ssl.SSLSessionImpl".equals(className)) { try { Class<?> clazz = Class.forName(className); Method method = clazz.getDeclaredMethod("getMasterSecret"); method.setAccessible(true); Object masterSecret = method.invoke(session); if (masterSecret == null) { session.invalidate(); if (log.isDebugEnabled()) { log.debug("Invalidated session " + session); } throw log(new SSLException("Invalid SSL master secret")); } } catch (SecurityException e) { failedToVerifyMasterSecret(e); } catch (ClassNotFoundException e) { failedToVerifyMasterSecret(e); } catch (NoSuchMethodException e) { failedToVerifyMasterSecret(e); } catch (IllegalAccessException e) { failedToVerifyMasterSecret(e); } catch (InvocationTargetException e) { failedToVerifyMasterSecret(e.getCause()); } } } } return; }
Source:
public int read(byte[] b, int off, int len) throws IOException { validateParameters(b, off, len); if (len == 0) { return 0; } if (firstRead) { firstRead = false; parsedStream = new DataFileStream<>(networkStream, new GenericDatumReader<>()); this.userBuffer = new ByteArrayInputStream(new byte[0]); } if (this.userBuffer.available() == 0) { while (this.userBuffer.available() == 0 && this.parsedStream.hasNext()) { parseRecord(this.parsedStream.next()); } } if (this.userBuffer.available() > 0) { return this.userBuffer.read(b, off, len); } if (this.endRecordSeen) { return -1; } return 0; }

Target:
public int read(byte[] b, int off, int len) throws IOException { validateParameters(b, off, len); if (len == 0) { return 0; } if (this.parsedStream == null) { parsedStream = new DataFileStream<>(networkStream, new GenericDatumReader<>()); this.buffer = new ByteArrayInputStream(new byte[0]); } if (this.buffer.available() == 0) { while (this.buffer.available() == 0 && this.parsedStream.hasNext()) { parseRecord(this.parsedStream.next()); } } if (this.buffer.available() > 0) { return this.buffer.read(b, off, len); } if (this.endRecordSeen) { return -1; } else { throw new IOException("Error parsing blob quick query stream. No end record was present. This may indicate " + "that not all data was returned."); } }
Source:
private void quitLeading() { synchronized(connectingFollowers) { quitWaitForEpoch = true; connectingFollowers.notifyAll(); } LOG.info("Quit leading due to disloyal voter."); }

Target:
private void quitLeading() { synchronized(connectingFollowers) { quitWaitForEpoch = true; connectingFollowers.notifyAll(); } LOG.info("Quit leading due to voter changed mind."); }
Source:
private static String simpleTypeName(TypeMirror type) { switch (type.getKind()) { case ARRAY: return simpleTypeName(((ArrayType) type).getComponentType()) + "[]"; case TYPEVAR: return ((TypeVariable) type).asElement().getSimpleName().toString(); case DECLARED: return ((DeclaredType) type).asElement().getSimpleName().toString(); default: if (type.getKind().isPrimitive()) { switch (type.getKind()) { case BOOLEAN: return "boolean"; case BYTE: return "byte"; case CHAR: return "char"; case DOUBLE: return "double"; case FLOAT: return "float"; case INT: return "int"; case LONG: return "long"; case SHORT: return "short"; default: throw new BugInCF("expected a primitive type, but found " + type); } } } throw new BugInCF("ElementUtils: unhandled type kind: %s, type: %s", type.getKind(), type); }

Target:
private static String simpleTypeName(TypeMirror type) { switch (type.getKind()) { case ARRAY: return simpleTypeName(((ArrayType) type).getComponentType()) + "[]"; case TYPEVAR: return ((TypeVariable) type).asElement().getSimpleName().toString(); case DECLARED: return ((DeclaredType) type).asElement().getSimpleName().toString(); default: if (type.getKind().isPrimitive()) { return TypeAnnotationUtils.unannotatedType(type).toString(); } } throw new BugInCF("ElementUtils: unhandled type kind: %s, type: %s", type.getKind(), type); }
Source:
public static RelDataType createJoinType( RelDataTypeFactory typeFactory, RelDataType leftType, RelDataType rightType, List<String> fieldNameList, List<RelDataTypeField> systemFieldList) { assert (fieldNameList == null) || (fieldNameList.size() == (systemFieldList.size() + leftType.getFieldCount() + (rightType == null ? 0 : rightType.getFieldCount()))); List<String> nameList = new ArrayList<>(); final List<RelDataType> typeList = new ArrayList<>(); final Set<String> uniqueNameList = typeFactory.getTypeSystem().isSchemaCaseSensitive() ? new HashSet<String>() : new TreeSet<>(String.CASE_INSENSITIVE_ORDER); addFields(systemFieldList, typeList, nameList, uniqueNameList); addFields(leftType.getFieldList(), typeList, nameList, uniqueNameList); if (rightType != null) { addFields( rightType.getFieldList(), typeList, nameList, uniqueNameList); } if (fieldNameList != null) { assert fieldNameList.size() == nameList.size(); nameList = fieldNameList; } return typeFactory.createStructType(typeList, nameList); }

Target:
public static RelDataType createJoinType( RelDataTypeFactory typeFactory, RelDataType leftType, RelDataType rightType, List<String> fieldNameList, List<RelDataTypeField> systemFieldList) { assert rightType != null; assert (fieldNameList == null) || (fieldNameList.size() == (systemFieldList.size() + leftType.getFieldCount() + rightType.getFieldCount())); List<String> nameList = new ArrayList<>(); final List<RelDataType> typeList = new ArrayList<>(); final Set<String> uniqueNameList = typeFactory.getTypeSystem().isSchemaCaseSensitive() ? new HashSet<String>() : new TreeSet<>(String.CASE_INSENSITIVE_ORDER); addFields(systemFieldList, typeList, nameList, uniqueNameList); addFields(leftType.getFieldList(), typeList, nameList, uniqueNameList); if (rightType != null) { addFields( rightType.getFieldList(), typeList, nameList, uniqueNameList); } if (fieldNameList != null) { assert fieldNameList.size() == nameList.size(); nameList = fieldNameList; } return typeFactory.createStructType(typeList, nameList); }
Source:
public boolean sameAs(FormEntryPrompt question) { return question != null && question.getIndex().equals(index) && (question.getQuestionText() == null ? questionText == null : question.getQuestionText().equals(questionText)) && (question.getHelpText() == null ? helpText == null : question.getHelpText().equals(helpText)) && (question.getAnswerText() == null ? answerText == null : question.getAnswerText().equals(answerText)) && (question.isReadOnly() == isReadOnly) && (question.getSelectChoices() == null ? selectChoices == null : question.getSelectChoices().equals(selectChoices)); }

Target:
public boolean sameAs(FormEntryPrompt question) { return question != null && question.getIndex().equals(index) && (question.getQuestionText() == null ? questionText == null : question.getQuestionText().equals(questionText)) && (question.getHelpText() == null ? helpText == null : question.getHelpText().equals(helpText)) && (getGuidanceHintText(question) == null ? guidanceText == null : getGuidanceHintText(question).equals(guidanceText)) && (question.getAnswerText() == null ? answerText == null : question.getAnswerText().equals(answerText)) && (question.isReadOnly() == isReadOnly) && selectChoiceListsEqual(question.getSelectChoices(), selectChoices); }
Source:
public static List<CurveGroup> load( LocalDate marketDataDate, ResourceLocator groupsResource, ResourceLocator settingsResource, Collection<ResourceLocator> curvesResources) { List<CurveGroupDefinition> curveGroups = CurveGroupDefinitionCsvLoader.loadCurveGroups(groupsResource); Multimap<LocalDate, Curve> allCurves = loadCurves(settingsResource, curvesResources, marketDataDate); Collection<Curve> curves = allCurves.get(marketDataDate); Set<CurveName> curveNames = new HashSet<>(); for (Curve curve : curves) { if (curveNames.contains(curve.getName())) { throw new IllegalArgumentException("Multiple curves with the same name: " + curve.getName()); } curveNames.add(curve.getName()); } return curveGroups.stream().map(groupDef -> CurveGroup.ofCurves(groupDef, curves)).collect(toImmutableList()); }

Target:
public static List<CurveGroup> load( LocalDate marketDataDate, ResourceLocator groupsResource, ResourceLocator settingsResource, Collection<ResourceLocator> curvesResources) { List<CurveGroupDefinition> curveGroups = CurveGroupDefinitionCsvLoader.loadCurveGroups(groupsResource); Multimap<LocalDate, Curve> allCurves = loadCurves(settingsResource, curvesResources, marketDataDate); Collection<Curve> curves = allCurves.get(marketDataDate); Set<CurveName> curveNames = new HashSet<>(); for (Curve curve : curves) { if (!curveNames.add(curve.getName())) { throw new IllegalArgumentException("Multiple curves with the same name: " + curve.getName()); } } return curveGroups.stream().map(groupDef -> CurveGroup.ofCurves(groupDef, curves)).collect(toImmutableList()); }
Source:
public void send(RiemannEvent event) { try { String tagsArr[] = ObjectArrays.concat(event.tags.toArray(new String[event.tags.size()]), new String[]{"storm"}, String.class); createEvent() .description(event.description) .host(event.host) .service(machineName + " " + event.service) .state(event.state) .time(event.time) .metric(event.metric) .ttl(event.ttl) .tags(tagsArr) .attributes(event.customAttributes) .send(); } catch (Throwable t) { logger.warn("Riemann error during general event ("+ event.description+") send attempt: ", t); } }

Target:
public void send(RiemannEvent event) { try { createEvent() .description(event.description) .host(event.host) .service(machineName + " " + event.service) .state(event.state) .time(event.time) .metric(event.metric) .ttl(event.ttl) .tag("storm") .tags(event.tags) .attributes(event.customAttributes) .send(); } catch (Throwable t) { logger.warn("Riemann error during event ("+ event.description+") send attempt: ", t); } }
Source:
private Mono<HttpResponse> attemptAsync(final HttpPipelineCallContext context, final HttpPipelineNextPolicy next, final HttpRequest originalHttpRequest, final int tryCount) { context.setHttpRequest(originalHttpRequest.copy()); return next.clone().process() .flatMap(httpResponse -> { if (shouldRetry(httpResponse, tryCount)) { return attemptAsync(context, next, originalHttpRequest, tryCount + 1) .delaySubscription(determineDelayDuration(httpResponse)); } else { return Mono.just(httpResponse); } }) .onErrorResume(err -> { if (tryCount < maxRetries) { return attemptAsync(context, next, originalHttpRequest, tryCount + 1) .delaySubscription(this.delayDuration); } else { return Mono.error(new RuntimeException("Max retries exceeded. Error Details: " + err.getMessage(), err)); } }); }

Target:
private Mono<HttpResponse> attemptAsync(final HttpPipelineCallContext context, final HttpPipelineNextPolicy next, final HttpRequest originalHttpRequest, final int tryCount) { context.setHttpRequest(originalHttpRequest.copy()); return next.clone().process() .flatMap(httpResponse -> { if (shouldRetry(httpResponse, tryCount)) { return attemptAsync(context, next, originalHttpRequest, tryCount + 1) .delaySubscription(determineDelayDuration(httpResponse)); } else { return Mono.just(httpResponse); } }) .onErrorResume(err -> { if (tryCount < maxRetries) { return attemptAsync(context, next, originalHttpRequest, tryCount + 1) .delaySubscription(this.delayDuration); } else { return Mono.error(new RuntimeException( String.format("Max retries %d times exceeded. Error Details: %s", maxRetries, err.getMessage()), err)); } }); }
Source:
private Iterator<HiveFileInfo> cachingIterator(Iterator<HiveFileInfo> iterator, Path path) { return new Iterator<HiveFileInfo>() { private final List<HiveFileInfo> files = new ArrayList<>(); @Override public boolean hasNext() { boolean hasNext = iterator.hasNext(); if (!hasNext) { cache.put(path, files); } return hasNext; } @Override public HiveFileInfo next() { HiveFileInfo next = iterator.next(); files.add(next); return next; } }; }

Target:
private Iterator<HiveFileInfo> cachingIterator(Iterator<HiveFileInfo> iterator, Path path) { return new Iterator<HiveFileInfo>() { private final List<HiveFileInfo> files = new ArrayList<>(); @Override public boolean hasNext() { boolean hasNext = iterator.hasNext(); if (!hasNext) { cache.put(path, ImmutableList.copyOf(files)); } return hasNext; } @Override public HiveFileInfo next() { HiveFileInfo next = iterator.next(); files.add(next); return next; } }; }
Source:
public DomainRootDefinition( final DomainController domainController, final HostControllerEnvironment environment, final ExtensibleConfigurationPersister configurationPersister, final ContentRepository contentRepo, final HostFileRepository fileRepository, final boolean isMaster, final LocalHostControllerInfo hostControllerInfo, final ExtensionRegistry extensionRegistry, final IgnoredDomainResourceRegistry ignoredDomainResourceRegistry, final PathManagerService pathManager, final DomainControllerRuntimeIgnoreTransformationRegistry runtimeIgnoreTransformationRegistry, final DelegatingConfigurableAuthorizer authorizer, final HostRegistrations hostRegistrations) { this(domainController, environment, configurationPersister, contentRepo, fileRepository, isMaster, hostControllerInfo, extensionRegistry, ignoredDomainResourceRegistry, pathManager, runtimeIgnoreTransformationRegistry, authorizer, hostRegistrations, null); }

Target:
public DomainRootDefinition( final DomainController domainController, final HostControllerEnvironment environment, final ExtensibleConfigurationPersister configurationPersister, final ContentRepository contentRepo, final HostFileRepository fileRepository, final boolean isMaster, final LocalHostControllerInfo hostControllerInfo, final ExtensionRegistry extensionRegistry, final IgnoredDomainResourceRegistry ignoredDomainResourceRegistry, final PathManagerService pathManager, final DomainControllerRuntimeIgnoreTransformationRegistry runtimeIgnoreTransformationRegistry, final DelegatingConfigurableAuthorizer authorizer, final HostRegistrations hostRegistrations) { super(null, DomainResolver.getResolver(DOMAIN, false)); this.domainController = domainController; this.isMaster = isMaster; this.environment = environment; this.hostControllerInfo = hostControllerInfo; this.configurationPersister = configurationPersister; this.contentRepo = contentRepo; this.fileRepository = fileRepository; this.extensionRegistry = extensionRegistry; this.ignoredDomainResourceRegistry = ignoredDomainResourceRegistry; this.pathManager = pathManager; this.runtimeIgnoreTransformationRegistry = runtimeIgnoreTransformationRegistry; this.authorizer = authorizer; this.hostRegistrations = hostRegistrations; }
Source:
private void waitForPriorityEvents(InputGate inputGate, MailboxExecutor mailboxExecutor) { final CompletableFuture<?> priorityEventAvailableFuture = inputGate.getPriorityEventAvailableFuture(); priorityEventAvailableFuture.thenRun(() -> { mailboxExecutor.execute(this::processPriorityEvents, "process priority even @ gate %s", inputGate); }); }

Target:
private void waitForPriorityEvents(InputGate inputGate, MailboxExecutor mailboxExecutor) { final CompletableFuture<?> priorityEventAvailableFuture = inputGate.getPriorityEventAvailableFuture(); priorityEventAvailableFuture.thenRun(() -> mailboxExecutor.execute(this::processPriorityEvents, "process priority event @ gate %s", inputGate)); }
Source:
public Response intercept(final Chain chain) throws IOException { final Response response = chain.proceed(chain.request()); if (response.isSuccessful()) { return response; } else { try { final JsonNode responseBody = mapper.readTree(response.body().string()); throw new GenieClientException(response.code(), response.message() + " : " + responseBody.get("message")); } catch (JsonMappingException jme) { throw new GenieClientException(response.code(), response.message() + response.body().toString()); } } }

Target:
public Response intercept(final Chain chain) throws IOException { final Response response = chain.proceed(chain.request()); if (response.isSuccessful()) { return response; } else { final String bodyContent = response.body().string(); try { final JsonNode responseBody = mapper.readTree(bodyContent); throw new GenieClientException(response.code(), response.message() + " : " + responseBody.get("message")); } catch (JsonProcessingException jpe) { throw new GenieClientException(response.code(), response.message() + bodyContent); } } }
Source:
public String toXMLString() throws XMLStreamException, FactoryConfigurationError { StringWriter buffer = new StringWriter(); XMLStreamWriter writer = XMLOutputFactory.newFactory().createXMLStreamWriter(buffer); String server = getServer(); int port = getPort(); String group = getGroup(); String database = getDatabase(); String modulesDatabase = getModulesDatabase(); writer.writeStartDocument(); writer.writeStartElement("rest-api"); writer.writeDefaultNamespace("<LINK_0>"); writer.writeStartElement("name"); if(server != null) writer.writeCharacters(server); writer.writeEndElement(); if (group != null && group.length() > 0) { writer.writeStartElement("group"); writer.writeCharacters(group); writer.writeEndElement(); } writer.writeStartElement("database"); if(database != null) writer.writeCharacters(database); writer.writeEndElement(); if (modulesDatabase != null && modulesDatabase.length() > 0) { writer.writeStartElement("modules-database"); writer.writeCharacters(modulesDatabase); writer.writeEndElement(); } writer.writeStartElement("port"); if(String.valueOf(port) != null) writer.writeCharacters(String.valueOf(port)); writer.writeEndElement(); writer.writeEndElement(); writer.writeEndDocument(); return buffer.toString(); }

Target:
public String toXMLString() throws XMLStreamException, FactoryConfigurationError { StringWriter buffer = new StringWriter(); XMLStreamWriter writer = XMLOutputFactory.newFactory().createXMLStreamWriter(buffer); String server = getServer(); int port = getPort(); String group = getGroup(); String database = getDatabase(); String modulesDatabase = getModulesDatabase(); writer.writeStartDocument(); writer.writeStartElement("rest-api"); writer.writeDefaultNamespace("<LINK_0>"); writer.writeStartElement("name"); if(server != null) writer.writeCharacters(server); writer.writeEndElement(); if (group != null && group.length() > 0) { writer.writeStartElement("group"); writer.writeCharacters(group); writer.writeEndElement(); } writer.writeStartElement("database"); if(database != null) writer.writeCharacters(database); writer.writeEndElement(); if (modulesDatabase != null && modulesDatabase.length() > 0) { writer.writeStartElement("modules-database"); writer.writeCharacters(modulesDatabase); writer.writeEndElement(); } writer.writeStartElement("port"); writer.writeCharacters(String.valueOf(port)); writer.writeEndElement(); writer.writeEndElement(); writer.writeEndDocument(); return buffer.toString(); }
Source:
private Cursor fetchThemes(int position) { if (WordPress.getCurrentBlog() == null) { return null; } String blogId = String.valueOf(WordPress.getCurrentBlog().getRemoteBlogId()); switch (position) { case 2: return WordPress.wpDB.getThemesPremium(blogId); case 1: return WordPress.wpDB.getThemesFree(blogId); case 0: default: return WordPress.wpDB.getThemesAll(blogId); } }

Target:
private Cursor fetchThemes(int position) { if (WordPress.getCurrentBlog() == null) { return null; } String blogId = String.valueOf(WordPress.getCurrentBlog().getRemoteBlogId()); switch (position) { case THEME_FILTER_PREMIUM_INDEX: return WordPress.wpDB.getThemesPremium(blogId); case THEME_FILTER_FREE_INDEX: return WordPress.wpDB.getThemesFree(blogId); case THEME_FILTER_ALL_INDEX: default: return WordPress.wpDB.getThemesAll(blogId); } }
Source:
private SortedSet<Edge<V>> convertEdges(final Set<DefaultEdge> input) { Iterator<DefaultEdge> edgeIt = input.iterator(); SortedSet<Edge<V>> output = new TreeSet<>(new EdgeComparatorByVertex()); while (edgeIt.hasNext()) { output.add(edgeFact.getEdge(edgeIt.next())); } return output; }

Target:
private SortedSet<Edge<V>> convertEdges(final Set<DefaultEdge> input) { SortedSet<Edge<V>> output = new TreeSet<>(new EdgeComparatorByVertex()); for (DefaultEdge e : input) { output.add(edgeFact.getEdge(e)); } return output; }
Source:
public static void main(String[] args) throws Exception { InputAdvanceJava9TryWithResources v = new InputAdvanceJava9TryWithResources(); try (v.finalWrapper.finalField) { } try (new InputAdvanceJava9TryWithResources() { }.finalWrapper.finalField) { } try ((args.length > 0 ? v : new InputAdvanceJava9TryWithResources()).finalWrapper.finalField) { } InputAdvanceJava9TryWithResources i1 = new InputAdvanceJava9TryWithResources(); try (i1; InputAdvanceJava9TryWithResources i2 = new InputAdvanceJava9TryWithResources(true)) { } InputAdvanceJava9TryWithResources m1 = new InputAdvanceJava9TryWithResources(); try (m1; InputAdvanceJava9TryWithResources m2 = m1; InputAdvanceJava9TryWithResources m3 = m2;) { } try { } catch (Exception ex) { try (v) { } } InputAdvanceJava9TryWithResources n = null; try (n) { } AutoCloseable a = new AutoCloseable() { public void close() { }; }; try (a) { } catch (Exception e) }

Target:
public static void main(String[] args) throws Exception { InputAdvanceJava9TryWithResources v = new InputAdvanceJava9TryWithResources(); try (v.finalWrapper.finalField) { } try (new InputAdvanceJava9TryWithResources() { }.finalWrapper.finalField) { } try ((args.length > 0 ? v : new InputAdvanceJava9TryWithResources()).finalWrapper.finalField) { } InputAdvanceJava9TryWithResources i1 = new InputAdvanceJava9TryWithResources(); try (i1; InputAdvanceJava9TryWithResources i2 = new InputAdvanceJava9TryWithResources()) { } InputAdvanceJava9TryWithResources m1 = new InputAdvanceJava9TryWithResources(); try (m1; InputAdvanceJava9TryWithResources m2 = m1; InputAdvanceJava9TryWithResources m3 = m2;) { } }
Source:
private static int maskVar(final String desc, final boolean constructor) { final Type[] argumentTypes = Type.getMethodType(desc) .getArgumentTypes(); int slot = 0; for (int i = 0; i < argumentTypes.length - (constructor ? 1 : 2); i++) { slot += argumentTypes[i].getSize(); } return slot; }

Target:
private static int maskVar(final String desc, final boolean constructor) { int slot = 0; if (constructor) { slot++; } final Type[] argumentTypes = Type.getMethodType(desc) .getArgumentTypes(); final int penultimateArgument = argumentTypes.length - 2; for (int i = 0; i < penultimateArgument; i++) { slot += argumentTypes[i].getSize(); } return slot; }
Source:
public void trackConstructorTest() { URL resourceUrl = getClass().getResource("/beep.mp3"); Path resourcePath; try { resourcePath = Paths.get(resourceUrl.toURI()); Track tr = new Track(resourcePath.toString()); assertEquals(tr.getAlbum(), "Beeps of the year"); assertEquals(tr.getTitle(), "Beep"); assertEquals(tr.getArtist(), "Flix"); assertEquals(tr.getLength(), new Long(575)); } catch (URISyntaxException e) { fail("file wans't read correctly"); e.printStackTrace(); } }

Target:
public void trackConstructorTest() { URL resourceUrl = getClass().getResource("/beep.mp3"); Path resourcePath; try { resourcePath = Paths.get(resourceUrl.toURI()); Track track = new Track(resourcePath.toString()); assertEquals(track.getAlbum(), "Beeps of the year"); assertEquals(track.getTitle(), "Beep"); assertEquals(track.getArtist(), "Flix"); assertEquals(track.getLength(), new Long(575)); } catch (URISyntaxException e) { fail("file wans't read correctly"); e.printStackTrace(); } }
Source:
public static EmbeddedCacheManager createCacheManagerEnforceJmxDomain(String jmxDomain, String cacheManagerName, boolean exposeGlobalJmx, boolean exposeCacheJmx, boolean allowDuplicates) { GlobalConfigurationBuilder globalConfiguration = new GlobalConfigurationBuilder(); globalConfiguration .globalJmxStatistics() .allowDuplicateDomains(allowDuplicates) .jmxDomain(jmxDomain) .mBeanServerLookup(MBeanServerLookupProvider.create()) .enabled(exposeGlobalJmx); if (cacheManagerName != null) globalConfiguration.cacheManagerName(cacheManagerName); ConfigurationBuilder configuration = new ConfigurationBuilder(); configuration.jmxStatistics().enabled(exposeCacheJmx); return createCacheManager(globalConfiguration, configuration, true); }

Target:
public static EmbeddedCacheManager createCacheManagerEnforceJmxDomain(String jmxDomain, String cacheManagerName, boolean exposeGlobalJmx, boolean exposeCacheJmx, boolean allowDuplicates) { GlobalConfigurationBuilder globalConfiguration = new GlobalConfigurationBuilder(); globalConfiguration .cacheContainer().statistics(exposeGlobalJmx) .globalJmxStatistics() .allowDuplicateDomains(allowDuplicates) .jmxDomain(jmxDomain) .mBeanServerLookup(MBeanServerLookupProvider.create()); if (cacheManagerName != null) globalConfiguration.cacheManagerName(cacheManagerName); ConfigurationBuilder configuration = new ConfigurationBuilder(); configuration.jmxStatistics().enabled(exposeCacheJmx); return createCacheManager(globalConfiguration, configuration, true); }
Source:
public boolean isReachable() { Socket socket = null; boolean reachable = false; try { if (LOG.isDebugEnabled()) LOG.debug("Checking host "+ InetAddress.getLocalHost() + "and port " + getPort() ); if (port.isPresent()) { socket = new Socket(InetAddress.getLocalHost(), getPort().get()); reachable = true; } } catch (Exception e) { } finally { IOUtils.closeQuietly(socket); } return reachable; }

Target:
public boolean isReachable() { Socket socket = null; boolean reachable = false; try { if (LOG.isDebugEnabled()) { LOG.debug("Checking host " + InetAddress.getLocalHost() + " and port " + getPort()); } if (port.isPresent()) { socket = new Socket(InetAddress.getLocalHost(), getPort().get()); reachable = true; } } catch (Exception e) { } finally { IOUtils.closeQuietly(socket); } return reachable; }
Source:
public DistributedObject createDistributedObject(String cacheNameWithPrefix) { try { CacheConfig cacheConfig = getCacheConfig(cacheNameWithPrefix); if (cacheConfig == null) { String cacheName = cacheNameWithPrefix.substring(HazelcastCacheManager.CACHE_MANAGER_PREFIX.length()); cacheConfig = findCacheConfig(cacheName); if (cacheConfig == null) { throw new CacheNotExistsException("Couldn't find cache config with name " + cacheNameWithPrefix); } cacheConfig.setManagerPrefix(HazelcastCacheManager.CACHE_MANAGER_PREFIX); } SplitBrainMergePolicyProvider mergePolicyProvider = nodeEngine.getSplitBrainMergePolicyProvider(); checkCacheConfig(cacheConfig, mergePolicyProvider); String mergePolicyName = cacheConfig.getMergePolicyConfig().getPolicy(); Object mergePolicy = mergePolicyProvider.getMergePolicy(mergePolicyName); checkMergePolicySupportsInMemoryFormat(cacheConfig.getName(), mergePolicy, cacheConfig.getInMemoryFormat(), true, logger); if (putCacheConfigIfAbsent(cacheConfig) == null) { createCacheConfigOnAllMembers(PreJoinCacheConfig.of(cacheConfig)); } return new CacheProxy(cacheConfig, nodeEngine, this); } catch (Throwable t) { throw rethrow(t); } }

Target:
public DistributedObject createDistributedObject(String cacheNameWithPrefix) { try { CacheConfig cacheConfig = getCacheConfig(cacheNameWithPrefix); if (cacheConfig == null) { String cacheName = cacheNameWithPrefix.substring(HazelcastCacheManager.CACHE_MANAGER_PREFIX.length()); cacheConfig = findCacheConfig(cacheName); if (cacheConfig == null) { throw new CacheNotExistsException("Couldn't find cache config with name " + cacheNameWithPrefix); } cacheConfig.setManagerPrefix(HazelcastCacheManager.CACHE_MANAGER_PREFIX); } checkCacheConfig(cacheConfig, mergePolicyProvider); String mergePolicyName = cacheConfig.getMergePolicyConfig().getPolicy(); Object mergePolicy = mergePolicyProvider.getMergePolicy(mergePolicyName); checkMergePolicySupportsInMemoryFormat(cacheConfig.getName(), mergePolicy, cacheConfig.getInMemoryFormat(), true, logger); if (putCacheConfigIfAbsent(cacheConfig) == null) { createCacheConfigOnAllMembers(PreJoinCacheConfig.of(cacheConfig)); } return new CacheProxy(cacheConfig, nodeEngine, this); } catch (Throwable t) { throw rethrow(t); } }
Source:
public static boolean eq(Object b0, Object b1) { if (b0.getClass().equals(b1.getClass())) { if (bothParametersAssignable(b0, b1, BigDecimal.class)) { return eq((BigDecimal) b0, (BigDecimal) b1); } else { return b0.equals(b1); } } else if (bothParametersAssignable(b0, b1, Number.class)) { return eq(toBigDecimal((Number) b0), toBigDecimal((Number) b1)); } return false; }

Target:
public static boolean eq(Object b0, Object b1) { return b0.equals(b1); }
Source:
public void testAddMergeAggregatorOff() { when(_mockConfig.getBoolean(eq("kairosdb.proxy.addMergeAggregator"))).thenReturn(false); final KairosDbProxyController controller = new KairosDbProxyController( _mockConfig, _mockWSClient, _mockKairosDbClient, OBJECT_MAPPER, _mockMetricsFactory, _mockMetricsqueryConfig ); final Metric metric1 = new Metric.Builder() .setName("metric1") .setAggregators(ImmutableList.of(new Aggregator.Builder().setName("count").build())) .build(); final Metric metric2 = new Metric.Builder() .setName("metric2") .setAggregators(ImmutableList.of(new Aggregator.Builder().setName("filter").build())) .build(); final MetricsQuery metricsQuery = new MetricsQuery.Builder() .setStartTime(Instant.now()) .setMetrics(ImmutableList.of(metric1, metric2)) .build(); final Http.RequestBuilder request = Helpers.fakeRequest() .method(Helpers.POST) .uri("/api/v1/datapoints/query") .header("Content-Type", "application/json") .bodyJson(OBJECT_MAPPER.<JsonNode>valueToTree(metricsQuery)); when(_mockKairosDbClient.queryMetrics(metricsQuery)).thenReturn( CompletableFuture.completedFuture(new MetricsQueryResponse.Builder() .setQueries(ImmutableList.of()).build()) ); final Result result = Helpers.invokeWithContext(request, Helpers.contextComponents(), () -> { final CompletionStage<Result> completionStage = controller.queryMetrics(); return completionStage.toCompletableFuture().get(10, TimeUnit.SECONDS); }); assertEquals(Http.Status.OK, result.status()); assertEquals("{\"queries\":[]}", Helpers.contentAsString(result)); }

Target:
public void testAddMergeAggregatorOff() { when(_mockConfig.getBoolean(eq("kairosdb.proxy.addMergeAggregator"))).thenReturn(false); final KairosDbProxyController controller = new KairosDbProxyController( _mockConfig, _mockWSClient, _mockKairosDbClient, OBJECT_MAPPER, _mockMetricsFactory, _mockMetricsqueryConfig ); final Metric metric1 = new Metric.Builder() .setName("metric1") .setAggregators(ImmutableList.of(new Aggregator.Builder().setName("count").build())) .build(); final Metric metric2 = new Metric.Builder() .setName("metric2") .setAggregators(ImmutableList.of(new Aggregator.Builder().setName("filter").build())) .build(); final MetricsQuery metricsQuery = new MetricsQuery.Builder() .setStartTime(Instant.now()) .setMetrics(ImmutableList.of(metric1, metric2)) .build(); mockQueryMetrics(controller, metricsQuery, metricsQuery); }
Source:
void tryEmit(InnerSubscriber<T> subscriber, T value) { boolean success = false; long r = producer.get(); if (r != 0L) { synchronized (this) { r = producer.get(); if (!emitting && r != 0L) { emitting = true; success = true; } } } if (success) { if (subscriber.queue == null || subscriber.queue.isEmpty()) { emitScalar(subscriber, value, r); } else { queueScalar(subscriber, value); emitLoop(); } } else { queueScalar(subscriber, value); emit(); } }

Target:
void tryEmit(InnerSubscriber<T> subscriber, T value) { boolean success = false; long r = producer.get(); if (r != 0L) { synchronized (this) { r = producer.get(); if (!emitting && r != 0L) { emitting = true; success = true; } } } if (success) { RxRingBuffer subscriberQueue = subscriber.queue; if (subscriberQueue == null || subscriberQueue.isEmpty()) { emitScalar(subscriber, value, r); } else { queueScalar(subscriber, value); emitLoop(); } } else { queueScalar(subscriber, value); emit(); } }
Source:
public void bind(TypeBindingContext context) { context.getDependencies().useRootOnly(); IndexReferenceHolder indexReferenceProvider = createIndexReferenceProvider(context, 5); Descriptor descriptor = globalReferenceHolder.getDescriptor(rootMessageName); context.setBridge(new ProtobufMessageBridge(indexReferenceProvider, descriptor)); }

Target:
public void bind(TypeBindingContext context) { context.getDependencies().useRootOnly(); IndexReferenceHolder indexReferenceProvider = createIndexReferenceProvider(context, MAX_DEPTH); Descriptor descriptor = globalReferenceHolder.getDescriptor(rootMessageName); context.setBridge(new ProtobufMessageBridge(indexReferenceProvider, descriptor)); }