auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private Map<String, Set<String>> getAgentNamesForMonitoringParameters(Set<? extends MetricNode> nodeList) { Map<String, Set<String>> agentNames = new HashMap<>(); for (MetricNode node : nodeList) { node.getMetricNameDtoList().stream() .filter(metricNameDto -> (metricNameDto.getOrigin() == MONITORING) || (metricNameDto.getOrigin() == TEST_GROUP_METRIC)) .map(metricNameDto -> MonitoringIdUtils.splitMonitoringMetricId(metricNameDto.getMetricName())) .filter(Objects::nonNull) .forEach(monitoringId -> defaultMonitoringParams.keySet().stream() .filter(key -> defaultMonitoringParams.get(key).contains(monitoringId.getMonitoringName())) .forEach(key -> { agentNames.putIfAbsent(key, new HashSet<>()); agentNames.get(key).add(monitoringId.getAgentName()); })); } return agentNames; }

Target:
private Map<String, Set<String>> getAgentNamesForMonitoringParameters(Set<? extends MetricNode> nodeList) { Map<String, Set<String>> agentNames = new HashMap<>(); for (MetricNode node : nodeList) { node.getMetricNameDtoList().stream() .filter(metricNameDto -> metricNameDto.getOrigin() == TEST_GROUP_METRIC) .map(metricNameDto -> MonitoringIdUtils.splitMonitoringMetricId(metricNameDto.getMetricName())) .filter(Objects::nonNull) .forEach(monitoringId -> defaultMonitoringParams.keySet().stream() .filter(key -> defaultMonitoringParams.get(key).contains(monitoringId.getMonitoringName())) .forEach(key -> { agentNames.putIfAbsent(key, new HashSet<>()); agentNames.get(key).add(monitoringId.getAgentName()); })); } return agentNames; }
Source:
private static <RESPONSE extends PaxosResponse> void cancelOutstandingRequestsAfterTimeout( List<Future<RESPONSE>> responseFutures) { boolean areAllRequestsComplete = Iterables.all(responseFutures, Future::isDone); if (areAllRequestsComplete) { return; } CANCELLATION_EXECUTOR.schedule(() -> { for (Future<?> future : responseFutures) { boolean isCanceled = future.cancel(true); if (isCanceled) { cancelOutstandingRequestSuccess.mark(); } else { cancelOutstandingRequestNoOp.mark(); } } }, OUTSTANDING_REQUEST_CANCELLATION_TIMEOUT_MILLIS, TimeUnit.MILLISECONDS); if (log.isDebugEnabled() && shouldLogException()) { log.debug("Quorum checker canceled pending requests" + ". Rate of successful cancellations: {}, rate of no-op cancellations: {}", SafeArg.of("rateCancelled", cancelOutstandingRequestSuccess.getOneMinuteRate()), SafeArg.of("rateNoOpCancellation", cancelOutstandingRequestNoOp.getOneMinuteRate())); } }

Target:
private static <RESPONSE extends PaxosResponse> void cancelOutstandingRequestsAfterTimeout( List<Future<RESPONSE>> responseFutures) { boolean areAllRequestsComplete = Iterables.all(responseFutures, Future::isDone); if (areAllRequestsComplete) { return; } CANCELLATION_EXECUTOR.schedule(() -> { for (Future<?> future : responseFutures) { boolean isCanceled = future.cancel(true); if (isCanceled) { cancelOutstandingRequestSuccess.mark(); } else { cancelOutstandingRequestNoOp.mark(); } } }, OUTSTANDING_REQUEST_CANCELLATION_TIMEOUT_MILLIS, TimeUnit.MILLISECONDS); if (log.isDebugEnabled() && shouldLogDiagnosticInformation()) { log.debug("Quorum checker canceled pending requests" + ". Rate of successful cancellations: {}, rate of no-op cancellations: {}", SafeArg.of("rateCancelled", cancelOutstandingRequestSuccess.getOneMinuteRate()), SafeArg.of("rateNoOpCancellation", cancelOutstandingRequestNoOp.getOneMinuteRate())); } }
Source:
public ConnectionManager(String filepath) { data = new DecryptBase64().DecryptBase64(filepath); }

Target:
public ConnectionManager(String filepath) { List<String> data = new Base64Decryptor().getDecryptedDataList(filepath); dataSource = createDataSource(data); }
Source:
protected void onStart() { super.onStart(); final String pathId = getIntent().getStringExtra(EXTRA_PATH_ID); final String url = environment.getConfig().getCourseDiscoveryConfig() .getCourseInfoUrlTemplate() .replace("{" + EXTRA_PATH_ID + "}", pathId); loadUrlBasedOnOsVersion(url); }

Target:
protected void onStart() { super.onStart(); final String pathId = getIntent().getStringExtra(EXTRA_PATH_ID); final String url = environment.getConfig().getCourseDiscoveryConfig() .getCourseInfoUrlTemplate() .replace("{" + EXTRA_PATH_ID + "}", pathId); loadUrl(url); }
Source:
private CharSequence checkState(String arg0, String retValue1, String retValue2, String retValue3) { switch (arg0.toLowerCase()) { case "skipped": return retValue1; case "passed": return retValue2; case "failed": return retValue3; } return "undefined"; }

Target:
private CharSequence checkState(String arg0, String retValue1, String retValue2, String retValue3) { switch (arg0.toLowerCase()) { case Constants.SKIPPED: return retValue1; case Constants.PASSED: return retValue2; case Constants.FAILED: return retValue3; } return Constants.UNDEFINED; }
Source:
public void append(LogEvent event) { if (!recursiveCall.get()) { try { recursiveCall.set(true); if (!systemInitialized) { if (JobModelManager.currentJobModelManager() != null) { setupSystem(); systemInitialized = true; } else { log.trace("Waiting for the JobCoordinator to be instantiated..."); } } else { if (!logQueue.offer(encodeLogEventToBytes(event), queueTimeoutS, TimeUnit.SECONDS)) { int messagesDropped = logQueue.drainTo(new ArrayList<>()) + 1; log.warn(String.format("Exceeded timeout %ss while trying to log to %s. Dropping %d log messages.", queueTimeoutS, systemStream.toString(), messagesDropped)); metrics.logMessagesDropped.inc(messagesDropped); } metrics.bufferFillPct.set(Math.round(100f * logQueue.size() / DEFAULT_QUEUE_SIZE)); } } catch (Exception e) { System.err.println(String.format("[%s] Error sending log message:", appenderName)); e.printStackTrace(); } finally { recursiveCall.set(false); } } else if (metrics != null) { metrics.recursiveCalls.inc(); } }

Target:
public void append(LogEvent event) { if (!recursiveCall.get()) { try { recursiveCall.set(true); if (!systemInitialized) { if (JobModelManager.currentJobModelManager() != null) { setupSystem(); systemInitialized = true; } else { log.trace("Waiting for the JobCoordinator to be instantiated..."); } } else { if (!logQueue.offer(encodeLogEventToBytes(event), queueTimeoutS, TimeUnit.SECONDS)) { int messagesDropped = logQueue.drainTo(new ArrayList<>()) + 1; log.warn(String.format("Exceeded timeout %ss while trying to log to %s. Dropping %d log messages.", queueTimeoutS, systemStream.toString(), messagesDropped)); metrics.logMessagesDropped.inc(messagesDropped); } metrics.bufferFillPct.set(Math.round(100f * logQueue.size() / DEFAULT_QUEUE_SIZE)); } } catch (Exception e) { if (metrics != null) { metrics.logMessagesErrors.inc(); } System.err.println(String.format("[%s] Error sending log message:", getName())); e.printStackTrace(); } finally { recursiveCall.set(false); } } else if (metrics != null) { metrics.recursiveCalls.inc(); } }
Source:
public static boolean canHarvestBlock(Block block, EntityPlayer player, IBlockAccess world, BlockPos pos) { IBlockState state = world.getBlockState(pos); state = state.getBlock().getActualState(state, world, pos); return canHarvestBlock(block, player, state); }

Target:
public static boolean canHarvestBlock(Block block, EntityPlayer player, IBlockAccess world, BlockPos pos) { IBlockState state = world.getBlockState(pos); state = state.getBlock().getActualState(state, world, pos); return canHarvestBlock(player, state); }
Source:
public ProjectUI(ProjectObject project) { if (project != null) { this.ID = String.valueOf(project.getId()); this.ProjectName = project.getName(); this.ProjectDisplayName = project.getDisplayName(); this.Commnet = project.getComment(); this.ProjectManager = project.getManager(); this.AttachFileSize = String.valueOf(project.getAttachFileSize()); this.ProjectCreateDate = DateUtil.format(project.getCreateTime(), DateUtil._16DIGIT_DATE_TIME); } }

Target:
public ProjectUI(ProjectObject project) { if (project != null) { ID = String.valueOf(project.getId()); ProjectName = project.getName(); ProjectDisplayName = project.getDisplayName(); Commnet = project.getComment(); ProjectManager = project.getManager(); AttachFileSize = String.valueOf(project.getAttachFileSize()); ProjectCreateDate = DateUtil.format(project.getCreateTime(), DateUtil._16DIGIT_DATE_TIME); } }
Source:
public VdcQueryParametersBase(String sessionId) { this.sessionId = sessionId; refresh = true; }

Target:
public VdcQueryParametersBase(String sessionId) { this(); this.sessionId = sessionId; }
Source:
private boolean hasLooseRef() throws IOException { return Files.walk(refsDir.toPath()).filter(p -> Files.isRegularFile(p)) .findAny().isPresent(); }

Target:
private boolean hasLooseRef() throws IOException { return Files.walk(refsDir.toPath()).anyMatch(Files::isRegularFile); }
Source:
public static Map<String, Class<?>> loadUdfsFromJar(java.io.File jarFile) throws IOException { Map<String, Class<?>> udafs = new HashMap<>(); for (Class<?> udfClass : UDF_CLASSES) { for (Class<?> clazz : ProxyUtil.loadAllClassesFromJar(jarFile, udfClass)) { udafs.put(clazz.getCanonicalName(), clazz); } } return udafs; }

Target:
public static Map<String, Class<?>> loadUdfsFromJar(java.io.File jarFile) throws IOException { Map<String, Class<?>> udafs = new HashMap<>(); for (Class<?> udfClass : UDF_CLASSES) { for (Class<?> clazz : ProxyUtil.loadAllClassesFromJar(jarFile, udfClass)) { udafs.put(clazz.getName(), clazz); } } return udafs; }
Source:
public String compact(String message) { if (expected == null || actual == null || expected.equals(actual)) { return Assert.format(message, expected, actual); } else { String prefix = sharedPrefix(expected, actual); String suffix = sharedSuffix(expected, actual, prefix.length()); String expectedDiff = extractDiff(expected, prefix, suffix); String actualDiff = extractDiff(actual, prefix, suffix); String compactedPrefix = compactPrefix(prefix); String compactedSuffix = compactSuffix(suffix); return Assert.format(message, compactedPrefix + expectedDiff + compactedSuffix, compactedPrefix + actualDiff + compactedSuffix); } }

Target:
public String compact(String message) { if (expected == null || actual == null || expected.equals(actual)) { return Assert.format(message, expected, actual); } else { DiffExtractor extractor = new DiffExtractor(); String compactedPrefix = extractor.compactPrefix(); String compactedSuffix = extractor.compactSuffix(); return Assert.format(message, compactedPrefix + extractor.expectedDiff() + compactedSuffix, compactedPrefix + extractor.actualDiff() + compactedSuffix); } }
Source:
protected boolean proceed(JavaSymbolicObject object) { return ((!substitution.isEmpty() && !object.isGround()) || !object.isNormal()); }

Target:
protected boolean proceed(JavaSymbolicObject object) { return object.canSubstituteAndEvaluate(substitution); }
Source:
void addNextChunkFromMemorySegment(MemorySegment segment, int offset, int numBytes) throws IOException { Tuple2<Integer, Integer> positionAndRemaining = readLengthIfNeeded(segment, offset, numBytes); int startPos = positionAndRemaining.f0; int remaining = positionAndRemaining.f1; if (remaining == 0) { return; } int toCopy = min(recordLength - accumulatedRecordBytes, remaining); if (toCopy > 0) { readData(segment, startPos, toCopy); } if (remaining > toCopy) { leftOverData = segment; leftOverStart = startPos + toCopy; leftOverLimit = offset + numBytes; } }

Target:
void addNextChunkFromMemorySegment(MemorySegment segment, int offset, int numBytes) throws IOException { int limit = offset + numBytes; int numBytesRead = isReadingLength() ? readLength(segment, offset, numBytes) : 0; offset += numBytesRead; numBytes -= numBytesRead; if (numBytes == 0) { return; } int toCopy = min(recordLength - accumulatedRecordBytes, numBytes); if (toCopy > 0) { copyFromSegment(segment, offset, toCopy); } if (numBytes > toCopy) { leftOverData = segment; leftOverStart = offset + toCopy; leftOverLimit = limit; } }
Source:
private void runPushOperation() { if not (pool.requestRunway(this)) { log.info("Rescheduling replication to " + uri + " to avoid collision with an in-flight push."); pool.reschedule(this, RetryReason.COLLISON); return; } if (!canceled) { try { git = gitManager.openRepository(projectName); runImpl(); } catch (RepositoryNotFoundException e) { log.error("Cannot replicate " + projectName + "; " + e.getMessage()); } catch (NoRemoteRepositoryException e) { log.error("Cannot replicate to " + uri + "; repository not found"); } catch (NotSupportedException e) { log.error("Cannot replicate to " + uri, e); } catch (TransportException e) { Throwable cause = e.getCause(); if (cause instanceof JSchException && cause.getMessage().startsWith("UnknownHostKey:")) { log.error("Cannot replicate to " + uri + ": " + cause.getMessage()); } else { log.error("Cannot replicate to " + uri, e); } pool.reschedule(this, RetryReason.TRANSPORT_ERROR); } catch (IOException e) { log.error("Cannot replicate to " + uri, e); } catch (RuntimeException e) { log.error("Unexpected error during replication to " + uri, e); } catch (Error e) { log.error("Unexpected error during replication to " + uri, e); } finally { if (git != null) { git.close(); } pool.notifyFinished(this); } } }

Target:
private void runPushOperation() { if (!pool.requestRunway(this)) { log.info("Rescheduling replication to " + uri + " to avoid collision with an in-flight push."); pool.reschedule(this, Destination.RetryReason.COLLISION); return; } if (!canceled) { try { git = gitManager.openRepository(projectName); runImpl(); } catch (RepositoryNotFoundException e) { log.error("Cannot replicate " + projectName + "; " + e.getMessage()); } catch (NoRemoteRepositoryException e) { log.error("Cannot replicate to " + uri + "; repository not found"); } catch (NotSupportedException e) { log.error("Cannot replicate to " + uri, e); } catch (TransportException e) { Throwable cause = e.getCause(); if (cause instanceof JSchException && cause.getMessage().startsWith("UnknownHostKey:")) { log.error("Cannot replicate to " + uri + ": " + cause.getMessage()); } else { log.error("Cannot replicate to " + uri, e); } pool.reschedule(this, Destination.RetryReason.TRANSPORT_ERROR); } catch (IOException e) { log.error("Cannot replicate to " + uri, e); } catch (RuntimeException e) { log.error("Unexpected error during replication to " + uri, e); } catch (Error e) { log.error("Unexpected error during replication to " + uri, e); } finally { if (git != null) { git.close(); } pool.notifyFinished(this); } } }
Source:
public Optional<FunctionDefinition> getModelClass() { final FunctionDefinition function = new FunctionDefinition(); return Optional.of(function); }

Target:
public Optional<FunctionDefinition> getModelClass() { return Optional.of(new FunctionDefinition()); }
Source:
private void find(final IProgressMonitor m, final IContainer c, boolean searchLinkedFolders) throws CoreException { if (!searchLinkedFolders && c.isLinked()) return; final IPath loc = c.getLocation(); SubMonitor progress = SubMonitor.convert(m, 101); progress.subTask(CoreText.RepositoryFinder_finding); if (loc == null) { throw new CoreException(Activator.error( NLS.bind(CoreText.RepositoryFinder_ResourceDoesNotExist, c), null)); } final File fsLoc = loc.toFile(); assert fsLoc.isAbsolute(); if (c instanceof IProject) findInDirectoryAndParents(c, fsLoc); else findInDirectory(c, fsLoc); progress.worked(1); if (findInChildren) { final IResource[] children = c.members(); if (children != null && children.length > 0) { final int scale = 100 / children.length; for (int k = 0; k < children.length; k++) { final IResource o = children[k]; if (o instanceof IContainer && !o.getName().equals(Constants.DOT_GIT)) { find(progress.newChild(scale), (IContainer) o, searchLinkedFolders); } else { progress.worked(scale); } } } } }

Target:
private void find(final IProgressMonitor m, final IContainer c, boolean searchLinkedFolders) throws CoreException { if (!searchLinkedFolders && c.isLinked()) return; final IPath loc = c.getLocation(); SubMonitor progress = SubMonitor.convert(m, 101); progress.subTask(CoreText.RepositoryFinder_finding); if (loc == null) { throw new CoreException(Activator.error( NLS.bind(CoreText.RepositoryFinder_ResourceDoesNotExist, c), null)); } final File fsLoc = loc.toFile(); assert fsLoc.isAbsolute(); if (c instanceof IProject) findInDirectoryAndParents(c, fsLoc); else findInDirectory(c, fsLoc); progress.worked(1); if (findInChildren) { final IResource[] children = c.members(); if (children != null && children.length > 0) { progress.setWorkRemaining(children.length); for (int k = 0; k < children.length; k++) { final IResource o = children[k]; if (o instanceof IContainer && !o.getName().equals(Constants.DOT_GIT)) { find(progress.newChild(1), (IContainer) o, searchLinkedFolders); } else { progress.worked(1); } } } } }
Source:
private static final HostThread readHostThread(ISafeByteBufferReader buffer) { short valueSize = buffer.getShort(); byte[] array = new byte[valueSize]; buffer.get(array); String host = new String(array, CHARSET); if (buffer.get() != 0) { throw new IllegalStateException("Host thread's host could not be correctly serialized / deserialized"); } int tid = buffer.getInt(); return new HostThread(host, tid); }

Target:
private static final HostThread readHostThread(ISafeByteBufferReader buffer) { String host = buffer.getString(); int tid = buffer.getInt(); return new HostThread(host, tid); }
Source:
protected void activate(Config config) { this.useCache = config.useResourceCache(); if(this.useCache){ this.cache = new ConcurrentHashMap<>(); } }

Target:
protected void activate(Config config) { long size = config.maxSizeCount(); long ttl = config.getTtl(); if (ttl != Config.DEFAULT_TTL) { cache = CacheBuilder.newBuilder() .maximumSize(size ) .expireAfterWrite(ttl, TimeUnit.SECONDS) .recordStats() .build(); } else { cache = CacheBuilder.newBuilder() .maximumSize(size) .recordStats() .build(); } }
Source:
public List<Map<String,Object>> findTokens(String accountId) { List<Map<String, Object>> tokens = jdbi.withHandle(handle -> handle.createQuery("SELECT token_link, description, to_char(revoked,'DD Mon YYYY') as revoked FROM tokens WHERE account_id = :account_id ORDER BY issued DESC") .bind("account_id", accountId) .list()); return tokens.stream().map(tokenMap -> { if (tokenMap.get("revoked") != null) return tokenMap; else { Map<String, Object> newMap = new HashMap<>(); newMap.put("token_link", tokenMap.get("token_link")); newMap.put("description", tokenMap.get("description")); return newMap; } }).collect(Collectors.toList()); }

Target:
public List<Map<String,Object>> findTokens(String accountId) { return jdbi.withHandle(handle -> handle.createQuery("SELECT token_link, description, to_char(revoked,'DD Mon YYYY') as revoked FROM tokens WHERE account_id = :account_id ORDER BY issued DESC") .bind("account_id", accountId) .list()); }
Source:
public void formatEventTitleTest() { int distance = 0; double azimuth = 0.0; String expectation = String.format("0 km S of name, country_name"); JsonObject feature = Json.createObjectBuilder() .add("properties", Json.createObjectBuilder().add("name", "name").add("country_code", "country_code") .add("admin1_name", "admin1_name").add("country_name", "country_name").add("distance", distance) .add("azimuth", azimuth)) .build(); Assert.assertEquals(expectation, module.formatEventTitle(feature)); expectation = String.format("0 km S of name, admin1_name"); feature = Json.createObjectBuilder() .add("properties", Json.createObjectBuilder().add("name", "name").add("country_code", "us").add("admin1_name", "admin1_name") .add("country_name", "country_name").add("distance", distance).add("azimuth", azimuth)) .build(); Assert.assertEquals(expectation, module.formatEventTitle(feature)); }

Target:
public void formatEventTitleTest() { int distance = 0; double azimuth = 0.0; String expectation = String.format("0 km S of name, country_name"); JsonObject feature = Json.createObjectBuilder() .add("properties", Json.createObjectBuilder() .add("admin1_name", "admin1_name") .add("azimuth", azimuth) .add("country_code", "country_code") .add("country_name", "country_name") .add("distance", distance) .add("name", "name")) .build(); Assert.assertEquals(expectation, module.formatEventTitle(feature)); expectation = String.format("0 km S of name, admin1_name"); feature = Json.createObjectBuilder() .add("properties", Json.createObjectBuilder() .add("admin1_name", "admin1_name") .add("azimuth", azimuth) .add("country_code", "us") .add("country_name", "country_name") .add("distance", distance) .add("name", "name")) .build(); Assert.assertEquals(expectation, module.formatEventTitle(feature)); }
Source:
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { try { Integer width = new Integer(500); Integer height = new Integer(300); String mimeType = PNG_MIME_TYPE; try { width = Integer.parseInt(request.getParameter("width")); } catch (Exception e) { log.debug ("Error during parseInt",e); } try { height = Integer.parseInt(request.getParameter("height")); } catch (Exception e) { log.debug ("Error during parseInt",e); } if (request.getParameter("mimeType") != null) { mimeType = request.getParameter("mimeType"); } JFreeChart chart = createChart(request, response); response.setHeader("Pragma", "No-cache"); response.setDateHeader("Expires", 0); response.setHeader("Cache-Control", "no-cache"); try { if (JPG_MIME_TYPE.equalsIgnoreCase(mimeType)) { response.setContentType(JPG_MIME_TYPE); ChartUtilities.writeChartAsJPEG(response.getOutputStream(), chart, width, height); } else if (PNG_MIME_TYPE.equalsIgnoreCase(mimeType)) { response.setContentType(PNG_MIME_TYPE); ChartUtilities.writeChartAsPNG(response.getOutputStream(), chart, width, height); } else { } } catch (IOException e) { log.error(e); } } catch (Exception e) { log.error(e); } }

Target:
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { try { Integer width = new Integer(500); Integer height = new Integer(300); String mimeType = PNG_MIME_TYPE; try { width = Integer.parseInt(request.getParameter("width")); } catch (Exception e) { log.error ("Error during width parseInt", e); } try { height = Integer.parseInt(request.getParameter("height")); } catch (Exception e) { log.error ("Error during height parseInt", e); } if (request.getParameter("mimeType") != null) { mimeType = request.getParameter("mimeType"); } JFreeChart chart = createChart(request, response); response.setHeader("Pragma", "No-cache"); response.setDateHeader("Expires", 0); response.setHeader("Cache-Control", "no-cache"); try { if (JPG_MIME_TYPE.equalsIgnoreCase(mimeType)) { response.setContentType(JPG_MIME_TYPE); ChartUtilities.writeChartAsJPEG(response.getOutputStream(), chart, width, height); } else if (PNG_MIME_TYPE.equalsIgnoreCase(mimeType)) { response.setContentType(PNG_MIME_TYPE); ChartUtilities.writeChartAsPNG(response.getOutputStream(), chart, width, height); } else { } } catch (IOException e) { log.error(e); } } catch (Exception e) { log.error(e); } }
Source:
private Descriptors.EnumValueDescriptor translateEnumValue(Binary binaryValue) { Descriptors.EnumValueDescriptor protoValue = enumLookup.get(binaryValue); if (protoValue == null) { String unknownLabel = new String(binaryValue.getBytes()); if (unknownLabel.startsWith(unknownEnumPrefix)) { try { int i = Integer.parseInt(unknownLabel.substring(unknownEnumPrefix.length())); Descriptors.EnumValueDescriptor unknownEnumValue = enumType.findValueByNumberCreatingIfUnknown(i); enumLookup.put(binaryValue, unknownEnumValue); return unknownEnumValue; } catch (NumberFormatException e) { } } if (!acceptUnknownEnum) { Set<Binary> knownValues = enumLookup.keySet(); String msg = "Illegal enum value \"" + binaryValue + "\"" + " in protocol buffer \"" + fieldType.getFullName() + "\"" + " legal values are: \"" + knownValues + "\""; throw new InvalidRecordException(msg); } LOG.error("Found unknown value " + unknownLabel + " for field " + fieldType.getFullName() + " probably because your proto schema is outdated, accept it as unknown enum with number -1"); Descriptors.EnumValueDescriptor unrecognized = enumType.findValueByNumberCreatingIfUnknown(-1); enumLookup.put(binaryValue, unrecognized); return unrecognized; } return protoValue; }

Target:
private Descriptors.EnumValueDescriptor translateEnumValue(Binary binaryValue) { Descriptors.EnumValueDescriptor protoValue = enumLookup.get(binaryValue); if (protoValue == null) { String unknownLabel = binaryValue.toStringUsingUTF8(); if (unknownLabel.startsWith(unknownEnumPrefix)) { try { int i = Integer.parseInt(unknownLabel.substring(unknownEnumPrefix.length())); Descriptors.EnumValueDescriptor unknownEnumValue = enumType.findValueByNumberCreatingIfUnknown(i); enumLookup.put(binaryValue, unknownEnumValue); return unknownEnumValue; } catch (NumberFormatException e) { } } if (!acceptUnknownEnum) { Set<Binary> knownValues = enumLookup.keySet(); String msg = "Illegal enum value \"" + binaryValue + "\"" + " in protocol buffer \"" + fieldType.getFullName() + "\"" + " legal values are: \"" + knownValues + "\""; throw new InvalidRecordException(msg); } LOG.error("Found unknown value " + unknownLabel + " for field " + fieldType.getFullName() + " probably because your proto schema is outdated, accept it as unknown enum with number -1"); Descriptors.EnumValueDescriptor unrecognized = enumType.findValueByNumberCreatingIfUnknown(-1); enumLookup.put(binaryValue, unrecognized); return unrecognized; } return protoValue; }
Source:
public void createAccountSupportsHashedPasswords() throws Exception { HudsonPrivateSecurityRealm securityRealm = new HudsonPrivateSecurityRealm(false, false, null); j.jenkins.setSecurityRealm(securityRealm); securityRealm.createAccount("user_unhashed", "password"); securityRealm.createAccount("user_hashed", "#jbcrypt:" + BCrypt.hashpw("password", BCrypt.gensalt())); WebClient wc1 = j.createWebClient(); wc1.login("user_unhashed", "password"); WebClient wc2 = j.createWebClient(); wc2.login("user_hashed", "password"); XmlPage w1 = (XmlPage) wc1.goTo("whoAmI/api/xml", "application/xml"); assertThat(w1, hasXPath(" XmlPage w2 = (XmlPage) wc2.goTo("whoAmI/api/xml", "application/xml"); assertThat(w2, hasXPath(" }

Target:
public void createAccountSupportsHashedPasswords() throws Exception { HudsonPrivateSecurityRealm securityRealm = new HudsonPrivateSecurityRealm(false, false, null); j.jenkins.setSecurityRealm(securityRealm); securityRealm.createAccountWithHashedPassword("user_hashed", "#jbcrypt:" + BCrypt.hashpw("password", BCrypt.gensalt())); WebClient wc = j.createWebClient(); wc.login("user_hashed", "password"); XmlPage w2 = (XmlPage) wc.goTo("whoAmI/api/xml", "application/xml"); assertThat(w2, hasXPath(" }
Source:
public CompiledMangoJavaScript(MangoJavaScript vo, ScriptPointValueSetter setter, ScriptLog log, MangoJavaScriptResult result, MangoJavaScriptService service) { this.log = log; this.additionalContext = vo.getAdditionalContext() == null ? Collections.emptyMap() : vo.getAdditionalContext(); this.additionalUtilities = vo.getAdditionalUtilities() == null ? Collections.emptyList() : vo.getAdditionalUtilities(); this.importExclusions = Collections.emptyList(); this.testRun = true; this.service = service; this.result = result; this.utilities = Collections.emptyList(); this.user = vo.getPermissions(); this.setter = setter; }

Target:
public CompiledMangoJavaScript(MangoJavaScript vo, ScriptPointValueSetter setter, ScriptLog log, MangoJavaScriptResult result, MangoJavaScriptService service) { this.log = log; this.additionalContext = vo.getAdditionalContext() == null ? Collections.emptyMap() : vo.getAdditionalContext(); this.additionalUtilities = vo.getAdditionalUtilities() == null ? Collections.emptyList() : vo.getAdditionalUtilities(); this.importExclusions = Collections.emptyList(); this.testRun = true; this.service = service; this.result = result; this.utilities = Collections.emptyList(); this.permissionHolder = vo.getPermissions(); this.setter = setter; }
Source:
public static Float convertObjectToFloat(Object valObj) { if (valObj == null) { return 0.0f; } if (valObj instanceof Float) { return (Float) valObj; } else if (valObj instanceof Number) { return ((Number) valObj).floatValue(); } else if (valObj instanceof String) { try { return Float.valueOf(((String) valObj).replace(",", "")); } catch (Exception e) { throw new ParseException(e, "Unable to parse value[%s] as float", valObj); } } else { throw new ParseException("Unknown type[%s]", valObj.getClass()); } }

Target:
public static Float convertObjectToFloat(Object valObj) { if (valObj == null) { return 0.0f; } if (valObj instanceof Float) { return (Float) valObj; } else if (valObj instanceof Number) { return ((Number) valObj).floatValue(); } else if (valObj instanceof String) { try { return Floats.tryParse((String) valObj); } catch (Exception e) { throw new ParseException(e, "Unable to parse value[%s] as float", valObj); } } else { throw new ParseException("Unknown type[%s]", valObj.getClass()); } }
Source:
public String toString() { return MoreObjects.toStringHelper(BufferedChannel.class) .add("logId", logId) .add("logFile", logFile) .toString(); }

Target:
public String toString() { return MoreObjects.toStringHelper(BufferedChannel.class) .add("logId", logId) .add("logFile", logFile) .add("ledgerIdAssigned", ledgerIdAssigned) .toString(); }
Source:
@Nullable public final String tag(I input, @Nullable TraceContext context, SpanCustomizer span) { if (input == null) throw new NullPointerException("input == null"); if (span == null) throw new NullPointerException("span == null"); if (span == NoopSpanCustomizer.INSTANCE) return null; return tag(span, input, context); }

Target:
public final void tag(I input, @Nullable TraceContext context, SpanCustomizer span) { if (input == null) throw new NullPointerException("input == null"); if (span == null) throw new NullPointerException("span == null"); if (span == NoopSpanCustomizer.INSTANCE) return; tag(span, input, context); }
Source:
public void setRecordToOpen(@Nullable final TableRecordReference record, final @Nullable String adWindowId, @NonNull final OpenTarget target) { if (record == null) { setRecordToOpen(null); } else { setRecordToOpen(RecordsToOpen.builder() .record(record) .adWindowId(adWindowId) .target(target) .automaticallySetReferencingDocumentPaths(true) .build()); } }

Target:
public void setRecordToOpen(@Nullable final TableRecordReference record, final @Nullable String adWindowId, @NonNull final OpenTarget target) { if (record == null) { setRecordToOpen(null); } else { setRecordToOpen(RecordsToOpen.builder() .record(record) .adWindowId(adWindowId) .target(target) .targetTab(RecordsToOpen.TargetTab.SAME_TAB) .automaticallySetReferencingDocumentPaths(true) .build()); } }
Source:
public void onComplete() { if (inMaybe) { actual.onComplete(); } else { inMaybe = true; DisposableHelper.replace(this, null); MaybeSource<? extends T> c = other; other = null; c.subscribe(this); } }

Target:
public void onComplete() { if (inMaybe) { actual.onComplete(); } else { inMaybe = true; DisposableHelper.replace(this, null); MaybeSource<? extends T> ms = other; other = null; ms.subscribe(this); } }
Source:
protected void setup(Binder binder) { binder.bind(HiveMetastoreClientFactory.class).in(Scopes.SINGLETON); binder.bind(HiveCluster.class).to(StaticHiveCluster.class).in(Scopes.SINGLETON); configBinder(binder).bindConfig(StaticMetastoreConfig.class); binder.bind(HiveMetastore.class).to(ThriftHiveMetastore.class).in(Scopes.SINGLETON); if (buildConfigObject(HiveClientConfig.class).getRecordingPath() != null) { binder.bind(ExtendedHiveMetastore.class) .annotatedWith(ForRecordingHiveMetastore.class) .to(BridgingHiveMetastore.class) .in(Scopes.SINGLETON); binder.bind(ExtendedHiveMetastore.class) .annotatedWith(ForCachingHiveMetastore.class) .to(RecordingHiveMetastore.class) .in(Scopes.SINGLETON); newExporter(binder).export(ExtendedHiveMetastore.class) .annotatedWith(ForCachingHiveMetastore.class) .as(generatedNameOf(RecordingHiveMetastore.class, connectorId)); } else { binder.bind(ExtendedHiveMetastore.class) .annotatedWith(ForCachingHiveMetastore.class) .to(BridgingHiveMetastore.class) .in(Scopes.SINGLETON); } binder.bind(ExtendedHiveMetastore.class).to(CachingHiveMetastore.class).in(Scopes.SINGLETON); newExporter(binder).export(HiveMetastore.class) .as(generatedNameOf(ThriftHiveMetastore.class, connectorId)); newExporter(binder).export(ExtendedHiveMetastore.class) .as(generatedNameOf(CachingHiveMetastore.class, connectorId)); }

Target:
protected void setup(Binder binder) { binder.bind(HiveMetastoreClientFactory.class).in(Scopes.SINGLETON); binder.bind(HiveCluster.class).to(StaticHiveCluster.class).in(Scopes.SINGLETON); configBinder(binder).bindConfig(StaticMetastoreConfig.class); binder.bind(HiveMetastore.class).to(ThriftHiveMetastore.class).in(Scopes.SINGLETON); if (buildConfigObject(HiveClientConfig.class).getRecordingPath() != null) { binder.bind(ExtendedHiveMetastore.class) .annotatedWith(ForRecordingHiveMetastore.class) .to(BridgingHiveMetastore.class) .in(Scopes.SINGLETON); binder.bind(ExtendedHiveMetastore.class) .annotatedWith(ForCachingHiveMetastore.class) .to(RecordingHiveMetastore.class) .in(Scopes.SINGLETON); binder.bind(RecordingHiveMetastore.class).in(Scopes.SINGLETON); newExporter(binder).export(RecordingHiveMetastore.class) .as(generatedNameOf(RecordingHiveMetastore.class, connectorId)); } else { binder.bind(ExtendedHiveMetastore.class) .annotatedWith(ForCachingHiveMetastore.class) .to(BridgingHiveMetastore.class) .in(Scopes.SINGLETON); } binder.bind(ExtendedHiveMetastore.class).to(CachingHiveMetastore.class).in(Scopes.SINGLETON); newExporter(binder).export(HiveMetastore.class) .as(generatedNameOf(ThriftHiveMetastore.class, connectorId)); newExporter(binder).export(ExtendedHiveMetastore.class) .as(generatedNameOf(CachingHiveMetastore.class, connectorId)); }
Source:
public File mainDefinitionFile() { File m = mainDefinitionFile; if (m == null) { if (parameters == null || parameters.size() == 0) { throw KEMException.criticalError("You have to provide exactly one main file in order to compile."); } m = mainDefinitionFile = files.get().resolveWorkingDirectory(parameters.get(0)); } return m; }

Target:
public synchronized File mainDefinitionFile() { if (mainDefinitionFile == null) { if (parameters == null || parameters.size() == 0) { throw KEMException.criticalError("You have to provide exactly one main file in order to compile."); } mainDefinitionFile = files.get().resolveWorkingDirectory(parameters.get(0)); } return mainDefinitionFile; }
Source:
public void typeInEditArea(String text) { waitForDialogVisible(); waitForElementNotVisibleByElement(loadingIndicator); WebElement editArea = dialog.findElement(editAreaBy); waitForElementVisibleByElement(editArea); waitForElementClickableByElement(editArea); editArea.sendKeys(text); waitForValueToBePresentInElementsAttributeByElement(editArea, "value", text); PageObjectLogging.log("typeInEditArea", "Typed " + text, true, driver); }

Target:
public void typeInEditArea(String text) { waitForDialogVisible(); waitForElementNotVisibleByElement(loadingIndicator); WebElement editArea = dialog.findElement(editAreaBy); waitForElementClickableByElement(editArea); editArea.sendKeys(text); waitForValueToBePresentInElementsAttributeByElement(editArea, "value", text); PageObjectLogging.log("typeInEditArea", "Typed " + text, true, driver); }
Source:
public void visitReturnStatement(ReturnStatementTree tree) { super.visitReturnStatement(tree); executionState.checkUsageOfClosables(tree.expression()); }

Target:
public void visitReturnStatement(ReturnStatementTree tree) { executionState.checkUsageOfClosables(tree.expression()); }
Source:
public void testonlyObjectReferences() throws Exception { final DefaultConfiguration checkConfig = createCheckConfig(ExplicitInitializationCheck.class); checkConfig.addAttribute("onlyObjectReferences", "true"); final String[] expected = { "5:20: " + getCheckMessage(MSG_KEY, "bar", "null"), "14:22: " + getCheckMessage(MSG_KEY, "str1", "null"), "14:35: " + getCheckMessage(MSG_KEY, "str3", "null"), "15:9: " + getCheckMessage(MSG_KEY, "ar1", "null"), "39:25: " + getCheckMessage(MSG_KEY, "bar", "null"), "40:27: " + getCheckMessage(MSG_KEY, "barArray", "null"), "48:29: " + getCheckMessage(MSG_KEY, "bar", "null"), "49:31: " + getCheckMessage(MSG_KEY, "barArray", "null"), "53:25: " + getCheckMessage(MSG_KEY, "bar", "null"), "54:27: " + getCheckMessage(MSG_KEY, "barArray", "null"), }; verify(checkConfig, getPath("InputExplicitInit.java"), expected); }

Target:
public void testonlyObjectReferences() throws Exception { final DefaultConfiguration checkConfig = createCheckConfig(ExplicitInitializationCheck.class); checkConfig.addAttribute("onlyObjectReferences", "true"); final String[] expected = { "5:20: " + getCheckMessage(MSG_KEY, "bar", "null"), "14:22: " + getCheckMessage(MSG_KEY, "str1", "null"), "14:35: " + getCheckMessage(MSG_KEY, "str3", "null"), "15:9: " + getCheckMessage(MSG_KEY, "ar1", "null"), "39:25: " + getCheckMessage(MSG_KEY, "bar", "null"), "40:27: " + getCheckMessage(MSG_KEY, "barArray", "null"), "48:29: " + getCheckMessage(MSG_KEY, "bar", "null"), "49:31: " + getCheckMessage(MSG_KEY, "barArray", "null"), "53:25: " + getCheckMessage(MSG_KEY, "bar", "null"), "54:27: " + getCheckMessage(MSG_KEY, "barArray", "null"), }; verify(checkConfig, getPath("InputExplicitInitialization.java"), expected); }
Source:
public BaseFilterOperator run() { FilterContext filter = _queryContext.getFilter(); if (filter != null) { BaseFilterOperator filterOperator = constructPhysicalOperator(filter, _queryContext.getDebugOptions()); if (_indexSegment.getValidDocIndex() != null) { BaseFilterOperator validDocFilter = new BitmapBasedFilterOperator(_indexSegment.getValidDocIndex().getValidDocBitmap(), false, _numDocs); return FilterOperatorUtils.getAndFilterOperator(Lists.newArrayList(filterOperator, validDocFilter), _numDocs, _queryContext.getDebugOptions()); } else { return filterOperator; } } else if (_indexSegment.getValidDocIndex() != null) { return new BitmapBasedFilterOperator(_indexSegment.getValidDocIndex().getValidDocBitmap(), false, _numDocs); } else { return new MatchAllFilterOperator(_numDocs); } }

Target:
public BaseFilterOperator run() { FilterContext filter = _queryContext.getFilter(); ValidDocIndexReader validDocIndexReader = _indexSegment.getValidDocIndex(); if (filter != null) { BaseFilterOperator filterOperator = constructPhysicalOperator(filter, _queryContext.getDebugOptions()); if (validDocIndexReader != null) { BaseFilterOperator validDocFilter = new BitmapBasedFilterOperator(validDocIndexReader.getValidDocBitmap(), false, _numDocs); return FilterOperatorUtils.getAndFilterOperator(Arrays.asList(filterOperator, validDocFilter), _numDocs, _queryContext.getDebugOptions()); } else { return filterOperator; } } else if (validDocIndexReader != null) { return new BitmapBasedFilterOperator(validDocIndexReader.getValidDocBitmap(), false, _numDocs); } else { return new MatchAllFilterOperator(_numDocs); } }
Source:
public List<EnsemblTranscript> getEnsemblTranscriptsByTranscriptId(String transcriptId) throws EnsemblTranscriptNotFoundException { List<EnsemblTranscript> transcripts = this.ensemblRepository.findByTranscriptId(transcriptId); if (transcripts.size() == 0) { throw new EnsemblTranscriptNotFoundException(transcriptId, "id"); } return transcripts; }

Target:
public List<EnsemblTranscript> getEnsemblTranscriptsByTranscriptId(String transcriptId) { return this.ensemblRepository.findByTranscriptId(transcriptId); }
Source:
public void testGestures() { doubleTapZoom(lightboxWrapper); System.out.println("Wrapper"); doubleTapZoom(lightboxInner); System.out.println("Inner"); doubleTapZoom(lightboxContent); System.out.println("Content"); doubleTapZoom(pageWrapper); System.out.println("page wrapper"); }

Target:
public void testGestures() { doubleTapZoom(lightboxWrapper); doubleTapZoom(lightboxInner); doubleTapZoom(lightboxContent); doubleTapZoom(pageWrapper); PageObjectLogging.log("testGestures", "Double tap zoom was correctly simulated 4 times", true, driver); }
Source:
public void init(SortedKeyValueIterator<Key, Value> source, Map<String, String> options, IteratorEnvironment env) throws IOException { validateOptions(options); event = new EventFields(); this.comparator = getKeyComparator(); this.iterator = source; String eventFieldsOpt = options.get(SELECT_FIELDS); if(eventFieldsOpt != null) selectFields = new HashSet<String>(asList(splitPreserveAllTokens(eventFieldsOpt, NULL_BYTE))); try { if (null != this.skipExpressions && this.skipExpressions.size() != 0) { for (String skip : this.skipExpressions) { String field = skip.substring(0, skip.indexOf(" ") - 1); this.expression = this.expression.replaceAll(skip, field + " == null"); } } this.evaluator = new QueryEvaluator(this.expression); } catch (ParseException e) { throw new IllegalArgumentException("Failed to parse criteria", e); } EventFields.initializeKryo(kryo); }

Target:
public void init(SortedKeyValueIterator<Key, Value> source, Map<String, String> options, IteratorEnvironment env) throws IOException { validateOptions(options); event = new EventFields(); this.comparator = getKeyComparator(); this.iterator = source; String eventFieldsOpt = options.get(SELECT_FIELDS); if(eventFieldsOpt != null) selectFields = Sets.newHashSet(splitPreserveAllTokens(eventFieldsOpt, NULL_BYTE)); try { if (null != this.skipExpressions && this.skipExpressions.size() != 0) { for (String skip : this.skipExpressions) { String field = skip.substring(0, skip.indexOf(" ") - 1); this.expression = this.expression.replaceAll(skip, field + " == null"); } } this.evaluator = new QueryEvaluator(this.expression); } catch (ParseException e) { throw new IllegalArgumentException("Failed to parse criteria", e); } EventFields.initializeKryo(kryo); }
Source:
public String getResolvedPropertyName() { return propertyName; }

Target:
public String getResolvedPropertyName() { return resolvedPropertyName; }
Source:
public boolean put(@Nullable K key, @Nullable V value) { SpillableArrayListImpl<V> spillableArrayList = getHelper(key); if (spillableArrayList == null) { spillableArrayList = new SpillableArrayListImpl<V>(bucket, serdeKey.serialize(key).buffer, store, serdeValue); cache.put(key, spillableArrayList); } spillableArrayList.add(value); return true; }

Target:
public boolean put(@Nullable K key, @Nullable V value) { SpillableArrayListImpl<V> spillableArrayList = getHelper(key); if (spillableArrayList == null) { Slice keyPrefix = SliceUtils.concatenate(identifier, serdeKey.serialize(key)); spillableArrayList = new SpillableArrayListImpl<V>(bucket, keyPrefix.toByteArray(), store, serdeValue); cache.put(key, spillableArrayList); } spillableArrayList.add(value); return true; }
Source:
public int makeCube(Vector pos, Pattern block, int length, int height, int width, boolean filled) throws MaxChangedBlocksException { int affected = 0; length--; width--; height--; filled=(filled || length == 0 || height == 0 || width == 0); pos=pos.subtract(length/2, height/2, width/2); for(int x = 0; x <= length; ++x) for(int y = 0; y <= height; ++y) for(int z = 0; z <= width; ++z) if((filled || ( x%length == 0 || y%height == 0 || z%width == 0)) && setBlock(pos.add(x,y,z),block)) affected++; return affected; }

Target:
public int makeCube(Vector pos, Pattern block, int length, int height, int width, boolean filled) throws MaxChangedBlocksException { int affected = 0; length--; width--; height--; filled = (filled || length == 0 || height == 0 || width == 0); pos=pos.subtract(length/2, height/2, width/2); for(int x = 0; x <= length; ++x) { for (int y = 0; y <= height; ++y) { for (int z = 0; z <= width; ++z) { if ((filled || (x % length == 0 || y % height == 0 || z % width == 0)) && setBlock(pos.add(x, y, z), block)) { affected++; } } } } return affected; }
Source:
public void selectAnnotation(RCTMGLPointAnnotation annotation) { final long id = annotation.getMapboxID(); if (id != mActiveMarkerID) { final MarkerView markerView = annotation.getMarker(); String title = annotation.getTitle(); String snippet = annotation.getSnippet(); annotation.onSelect(true); mActiveMarkerID = id; RCTMGLCallout calloutView = annotation.getCalloutView(); if (title != null || snippet !== null || (!markerView.isInfoWindowShown() && calloutView != null)) { mMap.selectMarker(markerView); } if (!markerView.isInfoWindowShown() && calloutView != null) { markerView.showInfoWindow(mMap, this); } } }

Target:
public void selectAnnotation(RCTMGLPointAnnotation annotation) { final long id = annotation.getMapboxID(); if (id != mActiveMarkerID) { final MarkerView markerView = annotation.getMarker(); annotation.onSelect(true); mActiveMarkerID = id; if (!markerView.isInfoWindowShown() && annotation.hasInfoWindow()) { mMap.selectMarker(markerView); } } }
Source:
public boolean isEmailValid(String email) { if (StringUtils.isBlank(email)) { return true; } Matcher matcher = EMAIL_PATTERN.matcher(email); return matcher.matches(); }

Target:
private boolean isEmailValid(String email) { return EmailValidator.getInstance().isValid(email); }
Source:
public static Properties defaultProperties() { System.setProperty(TTL_MIN_IN_SEC, "60"); System.setProperty(TTL_MAX_IN_SEC, "1209600"); System.setProperty(MESSAGE_MAX, "20"); System.setProperty(MESSAGE_BODY_MAX_IN_BYTES, "262144"); Properties properties = BaseHttpApiMetadata.defaultProperties(); properties.setProperty(SERVICE_TYPE, ServiceType.QUEUES); properties.setProperty(CREDENTIAL_TYPE, CredentialTypes.PASSWORD_CREDENTIALS); return properties; }

Target:
public static Properties defaultProperties() { Properties properties = BaseHttpApiMetadata.defaultProperties(); properties.setProperty(SERVICE_TYPE, ServiceType.QUEUES); properties.setProperty(CREDENTIAL_TYPE, CredentialTypes.PASSWORD_CREDENTIALS); return properties; }
Source:
@Test public void shouldHandleSchemeInsensitiveCase() { String[] schemes = { "http", "https", "HTTP", "HTTPS", "HTtP", }; for (String scheme : schemes) { final Uri uri = URI_1.buildUpon().scheme(scheme).build(); final Boolean shouldHandle = networkHandler.canHandleRequest( TestUtils.mockRequest(uri) ); assertThat(shouldHandle).isTrue(); } }

Target:
@Test public void shouldHandleSchemeInsensitiveCase() { String[] schemes = { "http", "https", "HTTP", "HTTPS", "HTtP", }; for (String scheme : schemes) { Uri uri = URI_1.buildUpon().scheme(scheme).build(); assertThat(networkHandler.canHandleRequest(TestUtils.mockRequest(uri))).isTrue(); } }
Source:
public void should_handle_set_tracing_without_args() { NullStatementBuilder builder = new NullStatementBuilder(); assertFalse(builder.tracing); builder.setTracing(); assertTrue(builder.tracing); }

Target:
public void should_handle_set_tracing_without_args() { NullStatementBuilder builder = new NullStatementBuilder(); assertThat(builder.tracing).isFalse(); builder.setTracing(); assertThat(builder.tracing).isTrue(); }
Source:
private QueryStatus getQueryStatus(MetricSpecification query, Buckets<IHasShortcut> buckets) { MetricKey key = MetricKey.fromValue(query); QueryStatus result = buckets.getQueryStatus(key); if (null == result) { result = new QueryStatus(QueryStatus.QueryStatusEnum.UNKNOWN, String.format("Query status lookup failed for query %s", query.toString())); } return result; }

Target:
private QueryStatus getQueryStatus(MetricSpecification query, Buckets<IHasShortcut> buckets) { MetricKey key = MetricKey.fromValue(query); QueryStatus result = buckets.getQueryStatus(key); if (null == result) { result = new QueryStatus(QueryStatus.QueryStatusEnum.UNKNOWN, String.format("Unknown query status for query %s", query.toString())); } return result; }