auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void verify() { final AbstractTransactionalContext parentCtx = TransactionalContext.getCurrentContext(); if (parentCtx != null) { if (parentCtx.getTransaction().getRuntime() != this.runtime) { throw new IllegalStateException( "Attempting to nest transactions from different clients!"); } if (type != parentCtx.getTransaction().getType()) { throw new IllegalArgumentException( "Attempting to nest transactions with a different transaction type!"); } Token parentTimestamp = parentCtx.getSnapshotTimestamp(); if (!this.snapshot.equals(Token.UNINITIALIZED) && !this.snapshot.equals(parentTimestamp)) { String msg = String.format("Attempting to nest transactions with" + " different timestamps, parent ts=%s, user defined ts=%s", parentCtx.getSnapshotTimestamp(), this.snapshot); throw new IllegalArgumentException(msg); } } }

Target:
private void verify() { final AbstractTransactionalContext parentCtx = TransactionalContext.getCurrentContext(); if (parentCtx != null) { if (parentCtx.getTransaction().getRuntime() != this.runtime) { throw new IllegalStateException( "Attempting to nest transactions from different clients!"); } if (type != parentCtx.getTransaction().getType()) { String msg = String.format("Attempting to nest transactions with a " + "different transaction type, parent type=%s, nested type=%s", parentCtx.getTransaction().getType(), this.getType()); throw new IllegalArgumentException(msg); } Token parentTimestamp = parentCtx.getSnapshotTimestamp(); if (!this.snapshot.equals(Token.UNINITIALIZED) && !this.snapshot.equals(parentTimestamp)) { String msg = String.format("Attempting to nest transactions with" + " different timestamps, parent ts=%s, user defined ts=%s", parentCtx.getSnapshotTimestamp(), this.snapshot); throw new IllegalArgumentException(msg); } } }
Source:
private static String getWidget(Attribute attr) { if (attr.getType() == null) { return "type = null"; } if (attr.getType().equals("java.util.LinkedHashMap")) { return generateMap(attr.getValueAsMap(), attr.isWritable()); } else if (attr.getType().equals("java.lang.Integer")) { return generateNumberBox(attr.getValue(), attr.isWritable()); } else if (attr.getType().equals("java.lang.Boolean")) { return generateCheckBox(attr.getValue(), attr.isWritable()); } else if (attr.getType().equals("java.util.ArrayList") || attr.getType().equals("java.util.LargeArrayList")) { return generateList(attr.getValueAsJsArray(), attr.isWritable()); } return generateTextBox(attr.getValue(), attr.isWritable()); }

Target:
private static String getWidget(Attribute attr) { if (attr.getType() == null) { return "type = null"; } if (attr.getType().equals("java.util.LinkedHashMap")) { return generateMap(attr.getValueAsMap(), attr.isWritable()); } else if (attr.getType().equals("java.lang.Integer")) { return generateNumberBox(attr.getValue(), attr.isWritable()); } else if (attr.getType().equals("java.lang.Boolean")) { return generateCheckBox(attr.getValue(), attr.isWritable()); } else if (attr.getType().equals("java.util.ArrayList") || attr.getType().equals(Utils.largeArrayListClassName)) { return generateList(attr.getValueAsJsArray(), attr.isWritable()); } return generateTextBox(attr.getValue(), attr.isWritable()); }
Source:
public void validate(String authenticationMethod) { if (authenticationMethod.equalsIgnoreCase("Access Credentials")) { if (!containsMacro("accessID") && (accessID == null || accessID.isEmpty())) { throw new IllegalArgumentException("The Access ID must be specified if " + "authentication method is Access Credentials."); } if (!containsMacro("accessKey") && (accessKey == null || accessKey.isEmpty())) { throw new IllegalArgumentException("The Access Key must be specified if " + "authentication method is Access Credentials."); } } }

Target:
public void validate(String authenticationMethod) { if (authenticationMethod.equalsIgnoreCase(ACCESS_CREDENTIALS)) { if (!containsMacro("accessID") && (accessID == null || accessID.isEmpty())) { throw new IllegalArgumentException("The Access ID must be specified if " + "authentication method is Access Credentials."); } if (!containsMacro("accessKey") && (accessKey == null || accessKey.isEmpty())) { throw new IllegalArgumentException("The Access Key must be specified if " + "authentication method is Access Credentials."); } } else if (authenticationMethod.equalsIgnoreCase(IAM)) { if (!basePath.startsWith("s3a://")) { throw new IllegalArgumentException("Path must start with s3a:// for IAM based authentication."); } } }
Source:
public void processConfigFile(File dir) { if (dir.isDirectory() && dir.exists()) { File[] files = dir.listFiles(); Arrays.sort(files, new Comparator<File>() { @Override public int compare(File left, File right) { return Long.valueOf(left.lastModified()).compareTo(right.lastModified()); } }); for (File file : files) { processConfigFile(file); } } else { try { internalProcessConfigFile(dir); } catch (IOException e) { logger.warn("Could not process config file '{}': {}", dir.getName(), e.getMessage()); } } processOrphanExclusivePIDs(); storeCurrentExclusivePIDList(); }

Target:
public void processConfigFile(File dir) { if (dir.isDirectory() && dir.exists()) { File[] files = dir.listFiles(); Arrays.sort(files, new Comparator<File>() { @Override public int compare(File left, File right) { return Long.valueOf(left.lastModified()).compareTo(right.lastModified()); } }); for (File file : files) { try { internalProcessConfigFile(file); } catch (IOException e) { logger.warn("Could not process config file '{}': {}", file.getName(), e.getMessage()); } } } else { try { internalProcessConfigFile(dir); } catch (IOException e) { logger.warn("Could not process config file '{}': {}", dir.getName(), e.getMessage()); } } processOrphanExclusivePIDs(); storeCurrentExclusivePIDList(); }
Source:
private static boolean isValueBasedType(Type type) { if (type.isUnknown() || type.is(JAVA_TIME_CLOCK)) { return false; } if (VALUE_BASED_TYPES.stream().anyMatch(type::is)) { return true; } String fullyQualifiedName = type.fullyQualifiedName(); return fullyQualifiedName.startsWith(JAVA_TIME_PACKAGE) && fullyQualifiedName.split("\\.").length == 3; }

Target:
private static boolean isValueBasedType(Type type) { if (type.isUnknown() || type.is(JAVA_TIME_CLOCK)) { return false; } return VALUE_BASED_TYPES.stream().anyMatch(type::is) || JAVA_TIME_PACKAGE_PATTERN.matcher(type.fullyQualifiedName()).matches(); }
Source:
public void updateContent(B blob, @Nullable String filename, File file) { String nextPhysicalId = keyGenerator.generateId(); try { getPhysicalSpace().upload(nextPhysicalId, file); Optional<String> previousPhysicalId = updateBlob(blob, nextPhysicalId, file.length(), filename); if (previousPhysicalId.isPresent()) { blob.fetchVariants().forEach(BlobVariant::delete); getPhysicalSpace().delete(previousPhysicalId.get()); } blobByPathCache.clear(); } catch (Exception e) { try { getPhysicalSpace().delete(nextPhysicalId); } catch (Exception ex) { Exceptions.ignore(ex); } throw Exceptions.handle() .to(StorageUtils.LOG) .error(e) .withSystemErrorMessage("Layer 2: Cannot update the contents of %s in %s: %s (%s)", blob.getBlobKey(), spaceName) .handle(); } }

Target:
public void updateContent(B blob, @Nullable String filename, File file) { String nextPhysicalId = keyGenerator.generateId(); try { getPhysicalSpace().upload(nextPhysicalId, file); Optional<String> previousPhysicalId = updateBlob(blob, nextPhysicalId, file.length(), filename); if (previousPhysicalId.isPresent()) { blob.fetchVariants().forEach(BlobVariant::delete); getPhysicalSpace().delete(previousPhysicalId.get()); } if (Strings.isFilled(filename)) { blobByPathCache.clear(); } } catch (Exception e) { try { getPhysicalSpace().delete(nextPhysicalId); } catch (Exception ex) { Exceptions.ignore(ex); } throw Exceptions.handle() .to(StorageUtils.LOG) .error(e) .withSystemErrorMessage("Layer 2: Cannot update the contents of %s in %s: %s (%s)", blob.getBlobKey(), spaceName) .handle(); } }
Source:
private void checkBinary(ExecutableSequence s, ObjectContract c, Set<Integer> values, ErrorRevealingChecks checks) { for (Integer i : values) { for (Integer j : values) { ExecutionOutcome result1 = s.getResult(i); ExecutionOutcome result2 = s.getResult(j); if (! (result1 instanceof NormalExecution) && ! (result2 instanceof NormalExecution)) { throw new Error("Abnormal execution in sequence: " + s); } if (Log.isLoggingOn()) Log.logLine("Checking contract " + c.getClass() + " on " + i + ", " + j); ExecutionOutcome exprOutcome = ObjectContractUtils.execute(c, ((NormalExecution) result1).getRuntimeValue(), ((NormalExecution) result2).getRuntimeValue()); Check obs = null; if (exprOutcome instanceof NormalExecution) { NormalExecution e = (NormalExecution)exprOutcome; if (e.getRuntimeValue().equals(true)) { if (Log.isLoggingOn()) Log.logLine("Contract returned true."); continue; } else { if (Log.isLoggingOn()) Log.logLine("Contract returned false. Will add ExpressionEqFalse check"); obs = new ObjectCheck(c, i, s.sequence.getVariable(i), s.sequence.getVariable(j)); checks.add(obs); } } else if (exprOutcome instanceof ExceptionalExecution){ Throwable e = ((ExceptionalExecution)exprOutcome).getException(); if (Log.isLoggingOn()) Log.logLine("Contract threw exception: " + e.getMessage()); if (e instanceof BugInRandoopException) { throw new BugInRandoopException(e); } } else { throw new Error("Contract failed to execute during evaluation"); } } } }

Target:
private void checkBinary(ExecutableSequence s, ObjectContract c, Set<Integer> values, ErrorRevealingChecks checks) { for (Integer i : values) { for (Integer j : values) { ExecutionOutcome result1 = s.getResult(i); ExecutionOutcome result2 = s.getResult(j); if (! ((result1 instanceof NormalExecution) && (result2 instanceof NormalExecution))) { throw new Error("Abnormal execution in sequence: " + s); } if (Log.isLoggingOn()) Log.logLine("Checking contract " + c.getClass() + " on " + i + ", " + j); ExecutionOutcome exprOutcome = ObjectContractUtils.execute(c, ((NormalExecution) result1).getRuntimeValue(), ((NormalExecution) result2).getRuntimeValue()); Check obs = null; if (exprOutcome instanceof NormalExecution) { NormalExecution e = (NormalExecution)exprOutcome; if (e.getRuntimeValue().equals(true)) { if (Log.isLoggingOn()) Log.logLine("Contract returned true."); continue; } else { if (Log.isLoggingOn()) Log.logLine("Contract returned false. Will add ExpressionEqFalse check"); obs = new ObjectCheck(c, i, s.sequence.getVariable(i), s.sequence.getVariable(j)); checks.add(obs); } } else if (exprOutcome instanceof ExceptionalExecution){ Throwable e = ((ExceptionalExecution)exprOutcome).getException(); if (Log.isLoggingOn()) Log.logLine("Contract threw exception: " + e.getMessage()); if (e instanceof BugInRandoopException) { throw new BugInRandoopException(e); } } else { throw new Error("Contract failed to execute during evaluation"); } } } }
Source:
private void handleResponse(final DeviceResponse deviceResponse, final SetScheduleDeviceRequest deviceRequest) { final ScheduleMessageTypeDto scheduleMessageTypeDto = deviceRequest.getScheduleMessageDataContainer() .getScheduleMessageType(); switch (scheduleMessageTypeDto) { case RETRIEVE_CONFIGURATION: final GetConfigurationDeviceResponse response = (GetConfigurationDeviceResponse) deviceResponse; this.handleGetConfigurationBeforeSetScheduleResponse(deviceRequest, response); break; case SET_ASTRONOMICAL_OFFSETS: this.handleSetScheduleAstronomicalOffsetsResponse(deviceRequest); break; default: this.handleEmptyDeviceResponse(deviceResponse, this.responseMessageSender, deviceRequest.getDomain(), deviceRequest.getDomainVersion(), deviceRequest.getMessageType(), deviceRequest.getRetryCount()); } }

Target:
private void handleResponse(final DeviceResponse deviceResponse, final SetScheduleDeviceRequest deviceRequest) { final ScheduleMessageTypeDto scheduleMessageTypeDto = deviceRequest.getScheduleMessageDataContainer() .getScheduleMessageType(); switch (scheduleMessageTypeDto) { case RETRIEVE_CONFIGURATION: final GetConfigurationDeviceResponse response = (GetConfigurationDeviceResponse) deviceResponse; this.handleGetConfigurationBeforeSetScheduleResponse(deviceRequest, response); break; case SET_ASTRONOMICAL_OFFSETS: this.handleSetScheduleAstronomicalOffsetsResponse(deviceRequest); break; case SET_SCHEDULE: default: this.handleEmptyDeviceResponse(deviceResponse, this.responseMessageSender, deviceRequest.getDomain(), deviceRequest.getDomainVersion(), deviceRequest.getMessageType(), deviceRequest.getRetryCount()); } }
Source:
private Boolean isConditionOnRuntimeVariableMet(final ExecutableNode node) { final String condition = node.getCondition(); if (condition == null) { return true; } String replaced = condition; Matcher matcher = CONDITION_ON_JOB_STATUS_PATTERN.matcher(condition); if (matcher.find()) { replaced = condition.replace(matcher.group(1), "true"); } matcher = CONDITION_VARIABLE_REPLACEMENT_PATTERN.matcher(replaced); while (matcher.find()) { final String value = findValueForJobVariable(node, matcher.group(1), matcher.group(2)); if (value != null) { replaced = replaced.replace(matcher.group(), "'" + value + "'"); } this.logger.info("Resolved condition of " + node.getId() + " is " + replaced); } return evaluateExpression(replaced); }

Target:
private Boolean isConditionOnRuntimeVariableMet(final ExecutableNode node) { final String condition = node.getCondition(); if (condition == null) { return true; } String replaced = condition; final Matcher jobStatusMatcher = CONDITION_ON_JOB_STATUS_PATTERN.matcher (condition); if (jobStatusMatcher.find()) { replaced = condition.replace(jobStatusMatcher.group(1), "true"); } final Matcher variableMatcher = CONDITION_VARIABLE_REPLACEMENT_PATTERN.matcher(replaced); while (variableMatcher.find()) { final String value = findValueForJobVariable(node, variableMatcher.group(1), variableMatcher.group(2)); if (value != null) { replaced = replaced.replace(variableMatcher.group(), "'" + value + "'"); } this.logger.info("Resolved condition of " + node.getId() + " is " + replaced); } return evaluateExpression(replaced); }
Source:
public MigrateBrokerVDSCommand(P parameters) { super(parameters); String migMethod = VdsProperties.MigrationMethostoString(parameters.getMigrationMethod()); log.infoFormat("VdsBroker::migrate::Entered (vm_guid='{0}', srcHost='{1}', dstHost='{2}', method='{3}'", parameters.getVmId().toString(), parameters.getSrcHost(), parameters.getDstHost(), migMethod); migrationInfo = new HashMap<String, String>(); migrationInfo.put(VdsProperties.vm_guid, parameters.getVmId().toString()); migrationInfo.put(VdsProperties.src, String.format("%1$s", parameters.getSrcHost())); migrationInfo.put(VdsProperties.dst, String.format("%1$s", parameters.getDstHost())); migrationInfo.put(VdsProperties.method, migMethod); if (parameters.getTunnelMigration() != null) { migrationInfo.put(VdsProperties.TUNNELED, parameters.getTunnelMigration().toString()); } if (parameters.getDstQemu() != null && !parameters.getDstQemu().trim().equals("")) { migrationInfo.put(VdsProperties.dstQemu, parameters.getDstQemu()); } }

Target:
public MigrateBrokerVDSCommand(P parameters) { super(parameters); String migMethod = VdsProperties.MigrationMethostoString(parameters.getMigrationMethod()); log.infoFormat("VdsBroker::migrate::Entered (vm_guid='{0}', srcHost='{1}', dstHost='{2}', method='{3}'", parameters.getVmId().toString(), parameters.getSrcHost(), parameters.getDstHost(), migMethod); migrationInfo = new HashMap<String, String>(); migrationInfo.put(VdsProperties.vm_guid, parameters.getVmId().toString()); migrationInfo.put(VdsProperties.src, String.format("%1$s", parameters.getSrcHost())); migrationInfo.put(VdsProperties.dst, String.format("%1$s", parameters.getDstHost())); migrationInfo.put(VdsProperties.method, migMethod); if (parameters.getTunnelMigration() != null) { migrationInfo.put(VdsProperties.TUNNELED, parameters.getTunnelMigration().toString()); } if (StringUtils.isNotBlank(parameters.getDstQemu())) { migrationInfo.put(VdsProperties.DST_QEMU, parameters.getDstQemu()); } }
Source:
public FileHandle[] list () { if (type == FileType.Classpath) throw new GdxRuntimeException("Cannot list a classpath directory: " + file); if (type == FileType.Internal){ if(!Gdx.files.internal("assets.index").exists()) System.out.println("Asset index not found, please update your gradle configuration " + "according to: <LINK_0>"); else { String[] filePaths = Gdx.files.internal("assets.index").readString().split("\n"); FileHandle[] files = new FileHandle[filePaths.length]; for(int i = 0; i < filePaths.length; i++){ files[i] = Gdx.files.internal(filePaths[i]); } return files; } } String[] relativePaths = file().list(); if (relativePaths == null) return new FileHandle[0]; FileHandle[] handles = new FileHandle[relativePaths.length]; for (int i = 0, n = relativePaths.length; i < n; i++) handles[i] = child(relativePaths[i]); return handles; }

Target:
public FileHandle[] list () { if (type == FileType.Classpath) throw new GdxRuntimeException("Cannot list a classpath directory: " + file); if (type == FileType.Internal) { if (!Gdx.files.internal("assets.index").exists()) Gdx.app.log("FileHandle", "Asset index not found, listing content of internal directories will not be" + " possible. Check the documentation for more details."); else { if (assetIndex.size == 0) loadAssetIndex(); if (isDirectory()) { Array<String> children = assetIndex.get(path()); if (children != null) { FileHandle[] handles = new FileHandle[children.size]; for (int i = 0; i < handles.length; i++) { handles[i] = new FileHandle(children.get(i)); } return handles; } } } } String[] relativePaths = file().list(); if (relativePaths == null) return new FileHandle[0]; FileHandle[] handles = new FileHandle[relativePaths.length]; for (int i = 0, n = relativePaths.length; i < n; i++) handles[i] = child(relativePaths[i]); return handles; }
Source:
protected String getLocaleStringFromReferer(final HttpServletRequest request) { final URI refererURL; String result = null; try { String referer = request.getHeader(REFERER); if (null != referer) { refererURL = new URI(referer); String query = refererURL.getQuery(); if (query != query) { String[] parameters = query.split("&"); for (int i = 0; i < parameters.length; i++) { String[] keyValues = parameters[i].split("="); if (LOCALE.equalsIgnoreCase(keyValues[0])) { result = keyValues[1]; break; } } } } } catch (URISyntaxException e) { log.error("Unable to determine referer URI", e); } return result; }

Target:
protected String getLocaleStringFromReferer(final HttpServletRequest request) { final URI refererURL; String result = null; try { String referer = request.getHeader(REFERER); if (referer != null) { refererURL = new URI(referer); String query = refererURL.getQuery(); if (query != null) { String[] parameters = query.split("&"); for (int i = 0; i < parameters.length; i++) { String[] keyValues = parameters[i].split("="); if (LOCALE.equalsIgnoreCase(keyValues[0])) { result = keyValues[1]; break; } } } } } catch (URISyntaxException e) { log.error("Unable to determine referer URI", e); } return result; }
Source:
public boolean handlePost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { final String pathInfo = req.getPathInfo(); final Matcher matcher = PATTERN_UNLOAD_ADAPTER_RESOURCE_PATH.matcher(pathInfo); if (!matcher.matches()) { return false; } final String uiSessionId = matcher.group(1); if (StringUtility.hasText(uiSessionId)) { handleUnloadRequest(req, resp, uiSessionId); return true; } else { return false; } }

Target:
public boolean handlePost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { final String pathInfo = req.getPathInfo(); final Matcher matcher = UNLOAD_PATH_PATTERN.matcher(pathInfo); if (!matcher.matches()) { return false; } final String uiSessionId = matcher.group(1); handleUnloadRequest(req, resp, uiSessionId); return true; }
Source:
public void delete(PushApplication pushApplication) { PushApplication entity = entityManager.find(PushApplication.class, pushApplication.getId()); final List<Variant> variants = entity.getVariants(); if (variants != null && !variants.isEmpty()) { final List<Installation> resultList = entityManager.createQuery("from Installation i where i.variant = :variant", Installation.class) .setParameter("variant", variants).getResultList(); for (Installation installation : resultList) { entityManager.remove(installation); } } remove(entity); }

Target:
public void delete(PushApplication pushApplication) { PushApplication entity = entityManager.find(PushApplication.class, pushApplication.getId()); final List<Variant> variants = entity.getVariants(); if (variants != null && !variants.isEmpty()) { final List<Installation> resultList = entityManager.createQuery("from Installation i where i.variant in :variants", Installation.class) .setParameter("variants", variants).getResultList(); for (Installation installation : resultList) { entityManager.remove(installation); } } remove(entity); }
Source:
private String validate(Details details) { final DetailAST rcurly = details.rcurly; final DetailAST lcurly = details.lcurly; final DetailAST nextToken = details.nextToken; final boolean shouldCheckLastRcurly = details.shouldCheckLastRcurly; String violation = ""; String targetSourceLine = ""; if (shouldStartLine) { targetSourceLine = getLines()[rcurly.getLineNo() - 1]; } if (option == RightCurlyOption.SAME && !hasLineBreakBefore(rcurly) && lcurly.getLineNo() != rcurly.getLineNo()) { violation = MSG_KEY_LINE_BREAK_BEFORE; } else if (shouldCheckLastRcurly) { if (rcurly.getLineNo() == nextToken.getLineNo()) { violation = MSG_KEY_LINE_ALONE; } } else if (shouldBeOnSameLine(option, details)) { violation = MSG_KEY_LINE_SAME; } else if (shouldBeAloneOnLine(option, details)) { violation = MSG_KEY_LINE_ALONE; } else if (shouldStartLine && !isOnStartOfLine(details, targetSourceLine)) { violation = MSG_KEY_LINE_NEW; } return violation; }

Target:
private String validate(Details details) { final DetailAST rcurly = details.rcurly; final DetailAST lcurly = details.lcurly; final DetailAST nextToken = details.nextToken; final boolean shouldCheckLastRcurly = details.shouldCheckLastRcurly; String violation = ""; if (option == RightCurlyOption.SAME && !hasLineBreakBefore(rcurly) && lcurly.getLineNo() != rcurly.getLineNo()) { violation = MSG_KEY_LINE_BREAK_BEFORE; } else if (shouldCheckLastRcurly) { if (rcurly.getLineNo() == nextToken.getLineNo()) { violation = MSG_KEY_LINE_ALONE; } } else if (shouldBeOnSameLine(option, details)) { violation = MSG_KEY_LINE_SAME; } else if (shouldBeAloneOnLine(option, details)) { violation = MSG_KEY_LINE_ALONE; } else if (shouldStartLine) { final String targetSourceLine = getLines()[rcurly.getLineNo() - 1]; if (!isOnStartOfLine(details, targetSourceLine)) { violation = MSG_KEY_LINE_NEW; } } return violation; }
Source:
public void testRequeueWithNoAcknowledgementCallback() { TestChannelBinder binder = createBinder(); MessageConverterConfigurer configurer = this.context .getBean(MessageConverterConfigurer.class); DefaultPollableMessageSource pollableSource = new DefaultPollableMessageSource( this.messageConverter); configurer.configurePolledMessageSource(pollableSource, "foo"); AcknowledgmentCallback callback = mock(AcknowledgmentCallback.class); pollableSource.addInterceptor(new ChannelInterceptor() { @Override public Message<?> preSend(Message<?> message, MessageChannel channel) { return MessageBuilder.fromMessage(message) .build(); } }); ExtendedConsumerProperties<Object> properties = new ExtendedConsumerProperties<>(null); properties.setMaxAttempts(2); properties.setBackOffInitialInterval(0); binder.bindPollableConsumer("foo", "bar", pollableSource, properties); final AtomicInteger count = new AtomicInteger(); try { assertThat(pollableSource.poll(received -> { count.incrementAndGet(); throw new RequeueCurrentMessageException("test retry"); })).isTrue(); } catch (Exception e) { } assertThat(count.get()).isEqualTo(2); }

Target:
public void testRequeueWithNoAcknowledgementCallback() { TestChannelBinder binder = createBinder(); MessageConverterConfigurer configurer = this.context .getBean(MessageConverterConfigurer.class); DefaultPollableMessageSource pollableSource = new DefaultPollableMessageSource( this.messageConverter); configurer.configurePolledMessageSource(pollableSource, "foo"); pollableSource.addInterceptor(new ChannelInterceptor() { @Override public Message<?> preSend(Message<?> message, MessageChannel channel) { return MessageBuilder.fromMessage(message) .build(); } }); ExtendedConsumerProperties<Object> properties = new ExtendedConsumerProperties<>(null); properties.setMaxAttempts(2); properties.setBackOffInitialInterval(0); binder.bindPollableConsumer("foo", "bar", pollableSource, properties); final AtomicInteger count = new AtomicInteger(); assertThat(pollableSource.poll(received -> { count.incrementAndGet(); throw new RequeueCurrentMessageException("test retry"); })).isTrue(); assertThat(count.get()).isEqualTo(2); }
Source:
public List<Instance> getMachines(String workspaceId) throws NotFoundException { EnvironmentHolder environment; try (StripedLocks.ReadLock lock = stripedLocks.acquireReadLock(workspaceId)) { environment = environments.get(workspaceId); } if (environment == null) { throw new NotFoundException("Environment with ID " + workspaceId + " is not found"); } return environment.machines.stream() .collect(Collectors.toList()); }

Target:
public List<Instance> getMachines(String workspaceId) throws EnvironmentNotRunningException { EnvironmentHolder environment; try (StripedLocks.ReadLock lock = stripedLocks.acquireReadLock(workspaceId)) { environment = environments.get(workspaceId); if (environment == null) { throw new EnvironmentNotRunningException("Environment with ID '" + workspaceId + "' is not found"); } return new ArrayList<>(environment.machines); } }
Source:
public void testCreate() throws StripeException { Map<String, Object> params = new HashMap<String, Object>(); params.put("currency", "usd"); final Order order = Order.create(params); assertNotNull(order); verifyRequest( APIResource.RequestMethod.POST, "/v1/orders", params ); }

Target:
public void testCreate() throws StripeException { final Map<String, Object> params = new HashMap<String, Object>(); params.put("currency", "usd"); final Order order = Order.create(params); assertNotNull(order); verifyRequest( APIResource.RequestMethod.POST, "/v1/orders", params ); }
Source:
protected String loadStyleSheet() { return styleSheetProvider.getCSS(); }

Target:
protected String loadStyleSheet() { if (styleSheetProvider == null) { return null; } else { return styleSheetProvider.getCSS(); } }
Source:
public void execute(CommandContext context) { setIncrementalMode(context.getAppConfig().getIncrementalDeploy()); for (File resourceDir : getResourceDirs(context)) { processExecuteOnResourceDir(context, resourceDir); } }

Target:
public void execute(CommandContext context) { setIncrementalMode(context.getAppConfig().isIncrementalDeploy()); for (File resourceDir : getResourceDirs(context)) { processExecuteOnResourceDir(context, resourceDir); } }
Source:
public synchronized void updateAck(long zxid) { if (currentZxid == zxid) { currentTime = nextTime; currentZxid = nextZxid; nextTime = 0; nextZxid = 0; } else if (nextZxid == zxid) { LOG.warn("ACK for received before ACK for {}!!!!", zxid, currentZxid); nextTime = 0; nextZxid = 0; } }

Target:
public synchronized void updateAck(long zxid) { if (currentZxid == zxid) { currentTime = nextTime; currentZxid = nextZxid; nextTime = 0; nextZxid = 0; } else if (nextZxid == zxid) { LOG.warn( "ACK for 0x{} received before ACK for 0x{}", Long.toHexString(zxid), Long.toHexString(currentZxid)); nextTime = 0; nextZxid = 0; } }
Source:
protected void ExecuteVdsBrokerCommand() { getBroker().diskReplicateFinsih(getParameters().getVmId().toString(), getSrcDiskXmlRpc(), getDstDiskXmlRpc()); }

Target:
protected void ExecuteVdsBrokerCommand() { getBroker().diskReplicateFinish(getParameters().getVmId().toString(), getSrcDiskXmlRpc(), getDstDiskXmlRpc()); }
Source:
public Object get(DataFetchingEnvironment env) { Object source = env.getSource(); if (source == null) return null; Field field; try { field = source.getClass().getField(fieldName); } catch (NoSuchFieldException e) { return null; } try { return field.get(source); } catch (IllegalAccessException e) { throw new RuntimeException(e); } }

Target:
public Object get(DataFetchingEnvironment env) { Object source = env.getSource(); if (source == null) return null; return getField(source); }
Source:
private static Constraint extendSignatureArgumentConstraint(Constraint constraint) { if (Constraint.REGEXP.isStricterOrEqualTo(constraint)) { return constraint.or(Constraint.ANY_STRING); } else if (Constraint.STRING_PRIMITIVE.isStricterOrEqualTo(constraint)) { return constraint.or(Constraint.ANY_NUMBER).or(Constraint.DATE); } else if (Constraint.NUMBER_PRIMITIVE.isStricterOrEqualTo(constraint)) { return constraint.or(Constraint.DATE); } return constraint; }

Target:
private static Constraint extendSignatureArgumentConstraint(Constraint constraint) { if (Constraint.REGEXP.isStricterOrEqualTo(constraint)) { return constraint.or(Constraint.ANY_STRING).or(Constraint.ANY_NUMBER); } else if (Constraint.STRING_PRIMITIVE.isStricterOrEqualTo(constraint)) { return constraint.or(Constraint.ANY_NUMBER).or(Constraint.DATE); } else if (Constraint.NUMBER_PRIMITIVE.isStricterOrEqualTo(constraint)) { return constraint.or(Constraint.DATE); } return constraint; }
Source:
public void unshareButtonPressed(OCShare share) { Log_OC.d(TAG, "Unsharing " + share.getSharedWithDisplayName()); mListener.removeShare(share); }

Target:
public void unshareButtonPressed(OCShare share) { Log_OC.d(TAG, "Removing private share with " + share.getSharedWithDisplayName()); mListener.removeShare(share); }
Source:
protected AuditMessageType.ActiveParticipant getActiveParticipant(UserType oUserInfo) { AuditMessageType.ActiveParticipant participant = createActiveParticipantFromUser( oUserInfo, Boolean.TRUE); if (oUserInfo.getRoleCoded() != null) { participant.getRoleIDCode().add(AuditDataTransformHelper.createCodeValueType(oUserInfo.getRoleCoded().getCode(), "", oUserInfo.getRoleCoded().getCodeSystemName(), oUserInfo.getRoleCoded().getDisplayName())); } return participant; }

Target:
protected AuditMessageType.ActiveParticipant getActiveParticipant(UserType oUserInfo) { AuditMessageType.ActiveParticipant participant = createActiveParticipantFromUser(oUserInfo); if (oUserInfo.getRoleCoded() != null) { participant.getRoleIDCode().add(AuditDataTransformHelper.createCodeValueType(oUserInfo.getRoleCoded(). getCode(), "", oUserInfo.getRoleCoded().getCodeSystemName(), oUserInfo.getRoleCoded().getDisplayName())); } return participant; }
Source:
private void deleteExpiredSuprevisorTaskPartitionsIfNotRunning() throws InterruptedException { final DateTime now = DateTimes.nowUtc(); final Set<String> expiredSupervisorTasks = new HashSet<>(); for (Entry<String, DateTime> entry : supervisorTaskCheckTimes.entrySet()) { final String supervisorTaskId = entry.getKey(); final DateTime checkTime = entry.getValue(); if (checkTime.isAfter(now)) { expiredSupervisorTasks.add(supervisorTaskId); } } LOG.info("Found [%s] expired supervisor tasks", expiredSupervisorTasks.size()); if (!expiredSupervisorTasks.isEmpty()) { final Map<String, TaskStatus> taskStatuses = indexingServiceClient.getTaskStatuses(expiredSupervisorTasks); for (Entry<String, TaskStatus> entry : taskStatuses.entrySet()) { final String supervisorTaskId = entry.getKey(); final TaskStatus status = entry.getValue(); if (status.getStatusCode().isComplete()) { try { deletePartitions(supervisorTaskId); } catch (IOException e) { LOG.warn(e, "Failed to delete partitions for task[%s]", supervisorTaskId); } } else { supervisorTaskCheckTimes.put(supervisorTaskId, DateTimes.nowUtc()); } } } }

Target:
private void deleteExpiredSuprevisorTaskPartitionsIfNotRunning() throws InterruptedException { final DateTime now = DateTimes.nowUtc(); final Set<String> expiredSupervisorTasks = new HashSet<>(); for (Entry<String, DateTime> entry : supervisorTaskCheckTimes.entrySet()) { final String supervisorTaskId = entry.getKey(); final DateTime checkTime = entry.getValue(); if (checkTime.isAfter(now)) { expiredSupervisorTasks.add(supervisorTaskId); } } LOG.info("Found [%s] expired supervisor tasks", expiredSupervisorTasks.size()); if (!expiredSupervisorTasks.isEmpty()) { final Map<String, TaskStatus> taskStatuses = indexingServiceClient.getTaskStatuses(expiredSupervisorTasks); for (Entry<String, TaskStatus> entry : taskStatuses.entrySet()) { final String supervisorTaskId = entry.getKey(); final TaskStatus status = entry.getValue(); if (status.getStatusCode().isComplete()) { try { deletePartitions(supervisorTaskId); } catch (IOException e) { LOG.warn(e, "Failed to delete partitions for task[%s]", supervisorTaskId); } } else { supervisorTaskCheckTimes.put(supervisorTaskId, getExpiryTimeFromNow()); } } } }
Source:
public static void runTestListeners(ITestResult tr, List<ITestListener> listeners) { for (ITestListener itl : listeners) { switch (tr.getStatus()) { case ITestResult.SKIP: { itl.onTestSkipped(tr); break; } case ITestResult.SUCCESS_PERCENTAGE_FAILURE: { itl.onTestFailedButWithinSuccessPercentage(tr); break; } case ITestResult.FAILURE: { itl.onTestFailure(tr); break; } case ITestResult.SUCCESS: { itl.onTestSuccess(tr); break; } case ITestResult.STARTED: { itl.onTestStart(tr); break; } default: { assert false : "UNKNOWN STATUS:" + tr; } } } }

Target:
public static void runTestListeners(ITestResult tr, List<ITestListener> listeners) { for (ITestListener itl : listeners) { switch (tr.getStatus()) { case ITestResult.SKIP: itl.onTestSkipped(tr); break; case ITestResult.SUCCESS_PERCENTAGE_FAILURE: itl.onTestFailedButWithinSuccessPercentage(tr); break; case ITestResult.FAILURE: itl.onTestFailure(tr); break; case ITestResult.SUCCESS: itl.onTestSuccess(tr); break; case ITestResult.STARTED: itl.onTestStart(tr); break; default: throw new AssertionError("Unknown status: " + tr.getStatus()); } } }
Source:
public Optional<DefaultIdentifierBridgeExpectations<BigInteger>> getDefaultIdentifierBridgeExpectations() { return Optional.of( new DefaultIdentifierBridgeExpectations<BigInteger>() { @Override public List<BigInteger> getEntityIdentifierValues() { return Arrays.asList( BigInteger.valueOf( -10000 ), BigInteger.valueOf( -1 ), BigInteger.ZERO, BigInteger.ONE, BigInteger.TEN, BigInteger.valueOf( 10000 ) ); } @Override public List<String> getDocumentIdentifierValues() { return Arrays.asList( "-10000", "-1", "0", "1", "10", "10000" ); } @Override public Class<?> getTypeWithIdentifierBridge1() { return TypeWithIdentifierBridge1.class; } @Override public Object instantiateTypeWithIdentifierBridge1(BigInteger identifier) { TypeWithIdentifierBridge1 instance = new TypeWithIdentifierBridge1(); instance.id = identifier; return instance; } @Override public Class<?> getTypeWithIdentifierBridge2() { return TypeWithIdentifierBridge2.class; } } ); }

Target:
public Optional<DefaultIdentifierBridgeExpectations<BigInteger>> getDefaultIdentifierBridgeExpectations() { return Optional.of( new DefaultIdentifierBridgeExpectations<BigInteger>() { @Override public List<BigInteger> getEntityIdentifierValues() { return takeBigIntegerSequence(); } @Override public List<String> getDocumentIdentifierValues() { return Arrays.asList( "-10000", "-1", "0", "1", "10", "10000", "9223372036854775807000" ); } @Override public Class<?> getTypeWithIdentifierBridge1() { return TypeWithIdentifierBridge1.class; } @Override public Object instantiateTypeWithIdentifierBridge1(BigInteger identifier) { TypeWithIdentifierBridge1 instance = new TypeWithIdentifierBridge1(); instance.id = identifier; return instance; } @Override public Class<?> getTypeWithIdentifierBridge2() { return TypeWithIdentifierBridge2.class; } } ); }
Source:
public MulePackageBuilder withPackagingOptions(PackagingOptions packagingOptions) { checkNotNull(packagingOptions, "The PackagingOptions must not be null"); this.packagingOptions = packagingOptions; return this; }

Target:
public MulePackageBuilder withPackagingOptions(PackagingOptions packagingOptions) { checkArgument(packagingOptions != null, "The PackagingOptions must not be null"); this.packagingOptions = packagingOptions; return this; }
Source:
public Iterator<Collection<Object>> splitRelationshipTypesIntoRounds( Iterator<Entry<Object,MutableLong>> allTypes, long freeMemoryForDenseNodeCache ) { PrefetchingIterator<Entry<Object,MutableLong>> peekableAllTypes = new PrefetchingIterator<Entry<Object,MutableLong>>() { @Override protected Entry<Object,MutableLong> fetchNextOrNull() { return allTypes.hasNext() ? allTypes.next() : null; } }; long numberOfDenseNodes = calculateNumberOfDenseNodes(); return new PrefetchingIterator<Collection<Object>>() { @Override protected Collection<Object> fetchNextOrNull() { long currentSetOfRelationshipsMemoryUsage = 0; Set<Object> typesToImportThisRound = new HashSet<>(); while ( peekableAllTypes.hasNext() ) { Map.Entry<Object,MutableLong> type = peekableAllTypes.peek(); long relationshipCountForThisType = type.getValue().longValue(); long maxDenseNodesForThisType = min( numberOfDenseNodes, relationshipCountForThisType * 2 ); long memoryUsageForThisType = maxDenseNodesForThisType * NodeRelationshipCache.GROUP_ENTRY_SIZE; if ( currentSetOfRelationshipsMemoryUsage + memoryUsageForThisType > freeMemoryForDenseNodeCache && currentSetOfRelationshipsMemoryUsage > 0 ) { break; } peekableAllTypes.next(); typesToImportThisRound.add( type.getKey() ); currentSetOfRelationshipsMemoryUsage += memoryUsageForThisType; } return typesToImportThisRound.isEmpty() ? null : typesToImportThisRound; } }; }

Target:
public Iterator<Collection<Object>> splitRelationshipTypesIntoRounds( Iterator<Entry<Object,MutableLong>> allTypes, long freeMemoryForDenseNodeCache ) { PrefetchingIterator<Entry<Object,MutableLong>> peekableAllTypes = new PrefetchingIterator<Entry<Object,MutableLong>>() { @Override protected Entry<Object,MutableLong> fetchNextOrNull() { return allTypes.hasNext() ? allTypes.next() : null; } }; long numberOfDenseNodes = calculateNumberOfDenseNodes(); return new PrefetchingIterator<Collection<Object>>() { @Override protected Collection<Object> fetchNextOrNull() { long currentSetOfRelationshipsMemoryUsage = 0; Set<Object> typesToImportThisRound = new HashSet<>(); while ( peekableAllTypes.hasNext() ) { Map.Entry<Object,MutableLong> type = peekableAllTypes.peek(); long relationshipCountForThisType = type.getValue().longValue(); long maxDenseNodesForThisType = min( numberOfDenseNodes, relationshipCountForThisType * 2 ); long memoryUsageForThisType = maxDenseNodesForThisType * NodeRelationshipCache.GROUP_ENTRY_SIZE; long memoryUsageUpToAndIncludingThisType = currentSetOfRelationshipsMemoryUsage + memoryUsageForThisType; if ( memoryUsageUpToAndIncludingThisType > freeMemoryForDenseNodeCache && currentSetOfRelationshipsMemoryUsage > 0 ) { break; } peekableAllTypes.next(); typesToImportThisRound.add( type.getKey() ); currentSetOfRelationshipsMemoryUsage += memoryUsageForThisType; } return typesToImportThisRound.isEmpty() ? null : typesToImportThisRound; } }; }
Source:
public MetaMessage build() { publishedAt = clock.instant(); Long durationMs = publishedAt.toEpochMilli() - this.createdAt.toEpochMilli(); return new MetaMessage(ttl, createdAt, publishedAt, durationMs, serviceDetails); }

Target:
public MetaMessage build() { publishedAt = clock.instant(); Long durationMs = Duration.between(publishedAt, this.createdAt).toMillis();; return new MetaMessage(ttl, createdAt, publishedAt, durationMs, serviceDetails); }
Source:
public Status(Collection<DruidModule> modules) { this.version = "0.9.2"; this.modules = getExtensionVersions(modules); this.memory = new Memory(Runtime.getRuntime()); }

Target:
public Status(Collection<DruidModule> modules) { this.version = getDruidVersion(); this.modules = getExtensionVersions(modules); this.memory = new Memory(Runtime.getRuntime()); }
Source:
public void handleTasksOfCommandWithEmptyVdsmId(final List<AsyncTasks> tasks) { ThreadPoolUtil.execute(new Runnable() { @SuppressWarnings("synthetic-access") @Override public void run() { TransactionSupport.executeInNewTransaction(new TransactionMethod<Object>() { @Override public Object runInTransaction() { boolean isPartiallySubmittedCommand = isPartiallySubmittedCommand(tasks); for (AsyncTasks task : tasks) { handleTaskOfCommandWithEmptyVdsmId(isPartiallySubmittedCommand, task); } irsBrokerLatch.countDown(); return null; } }); } }); }

Target:
public void handleTasksOfCommandWithEmptyVdsmId(final List<AsyncTasks> tasks) { ThreadPoolUtil.execute(new Runnable() { @SuppressWarnings("synthetic-access") @Override public void run() { TransactionSupport.executeInNewTransaction(new TransactionMethod<Object>() { @Override public Object runInTransaction() { try { boolean isPartiallySubmittedCommand = isPartiallySubmittedCommand(tasks); for (AsyncTasks task : tasks) { handleTaskOfCommandWithEmptyVdsmId(isPartiallySubmittedCommand, task); } return null; } finally { irsBrokerLatch.countDown(); } } }); } }); }
Source:
public void testSTArea() { assertArea("POLYGON ((2 2, 2 6, 6 6, 6 2))", 16.0); assertArea("POLYGON EMPTY", 0.0); assertArea("LINESTRING (1 4, 2 5)", 0.0); assertArea("LINESTRING EMPTY", 0.0); assertArea("POINT (1 4)", 0.0); assertArea("POINT EMPTY", 0.0); assertArea("GEOMETRYCOLLECTION (POINT (8 8), LINESTRING (5 5, 6 6), POLYGON ((1 1, 3 1, 3 4, 1 4, 1 1)))", 6.0); assertArea("GEOMETRYCOLLECTION (POLYGON ((0 0, 2 0, 2 2, 0 2, 0 0)), POLYGON ((1 1, 3 1, 3 3, 1 3, 1 1)))", 8.0); assertArea("GEOMETRYCOLLECTION (POLYGON ((0 0, 2 0, 2 2, 0 2, 0 0)), POLYGON ((1 1, 3 1, 3 3, 1 3, 1 1)), GEOMETRYCOLLECTION (POINT (8 8), LINESTRING (5 5, 6 6), POLYGON ((1 1, 3 1, 3 4, 1 4, 1 1))))", 14.0); }

Target:
public void testSTArea() { assertArea("POLYGON ((2 2, 2 6, 6 6, 6 2))", 16.0); assertArea("POLYGON EMPTY", 0.0); assertArea("LINESTRING (1 4, 2 5)", 0.0); assertArea("LINESTRING EMPTY", 0.0); assertArea("POINT (1 4)", 0.0); assertArea("POINT EMPTY", 0.0); assertArea("GEOMETRYCOLLECTION EMPTY", 0.0); assertArea("GEOMETRYCOLLECTION (POINT (8 8), LINESTRING (5 5, 6 6), POLYGON ((1 1, 3 1, 3 4, 1 4, 1 1)))", 6.0); assertArea("GEOMETRYCOLLECTION (POLYGON ((0 0, 2 0, 2 2, 0 2, 0 0)), POLYGON ((1 1, 3 1, 3 3, 1 3, 1 1)))", 8.0); assertArea("GEOMETRYCOLLECTION (POLYGON ((0 0, 2 0, 2 2, 0 2, 0 0)), POLYGON ((1 1, 3 1, 3 3, 1 3, 1 1)), GEOMETRYCOLLECTION (POINT (8 8), LINESTRING (5 5, 6 6), POLYGON ((1 1, 3 1, 3 4, 1 4, 1 1))))", 14.0); }
Source:
public VehicleLocationRecordBean getVehicleLocationRecordForVehicleId( AgencyAndId vehicleId, long targetTime) { TargetTime target = new TargetTime(targetTime, targetTime); if (_blockLocationService == null) { _log.error("blocklocationservice is null"); return null; } BlockLocation blockLocation = _blockLocationService.getLocationForVehicleAndTime( vehicleId, target); if (blockLocation == null) return null; return getBlockLocationAsVehicleLocationRecord(blockLocation); }

Target:
public VehicleLocationRecordBean getVehicleLocationRecordForVehicleId( AgencyAndId vehicleId, long targetTime) { TargetTime target = new TargetTime(targetTime, targetTime); BlockLocation blockLocation = _blockLocationService.getLocationForVehicleAndTime( vehicleId, target); if (blockLocation == null) return null; return getBlockLocationAsVehicleLocationRecord(blockLocation); }
Source:
private void parse(File targetFile) throws IOException { if (!targetFile.exists()) { return; } BufferedReader br = new BufferedReader(new FileReader(targetFile)); String txt; while ((txt = br.readLine()) != null) { txt = txt.trim(); if (txt.length() > 0 && !txt.startsWith("#")) { rules.add(new IgnoreRule(txt)); } } }

Target:
private void parse(File targetFile) throws IOException { BufferedReader br = new BufferedReader(new FileReader(targetFile)); String txt; while ((txt = br.readLine()) != null) { txt = txt.trim(); if (txt.length() > 0 && !txt.startsWith("#")) { rules.add(new IgnoreRule(txt)); } } }
Source:
protected boolean canEdit(ClusterNetworkModel clusterNetworkModel) { Version clusterVersion = clusterNetworkModel.getCluster().getCompatibilityVersion(); boolean defaultRouteSupported = Version.v4_2.lessOrEquals(clusterVersion); return defaultRouteSupported && clusterNetworkModel.isAttached() && !clusterNetworkModel.isExternal() && (!isMultipleSelectionAllowed() || !clusterNetworkModel.isManagement() || !clusterNetworkModel.getOriginalNetworkCluster().isDefaultRoute()); }

Target:
protected boolean canEdit(ClusterNetworkModel clusterNetworkModel) { return clusterNetworkModel.isAttached() && !clusterNetworkModel.isExternal() && (!isMultipleSelectionAllowed() || !clusterNetworkModel.isManagement() || !clusterNetworkModel.getOriginalNetworkCluster().isDefaultRoute()); }
Source:
public void closeInterstitial() throws InterruptedException { boolean isMercury = false; try { isMercury = interstitialCloseButtonWrapperMercury.isDisplayed(); Log.log("Interstitial Mercury", "Yes", true); } catch (NoSuchElementException e) { Log.log("Interstitial Mercury", "No", true); } if (isMercury) { String closeButtonText = interstitialCloseButtonWrapperMercury.getText(); Log.log("Wait time for close button", String.valueOf(WAIT_BUTTON_DELAY_TOLERANCE), true); Thread.sleep((WAIT_BUTTON_DELAY_TOLERANCE) * 1000); interstitialCloseButtonMercury.click(); } else { wait.forElementVisible(interstitialCloseButton); interstitialCloseButton.click(); } }

Target:
public void closeInterstitial() { boolean isMercury = false; try { isMercury = interstitialCloseButtonWrapperMercury.isDisplayed(); Log.log("Interstitial Mercury", "Yes", true); } catch (NoSuchElementException e) { Log.log("Interstitial Mercury", "No", true); } if (isMercury) { wait.forElementVisible(interstitialCloseButtonMercury); interstitialCloseButtonMercury.click(); } else { wait.forElementVisible(interstitialCloseButton); interstitialCloseButton.click(); } }
Source:
public List<PropertyEditorCategory> getLayoutDragComponentProperties() { List<PropertyEditorCategory> result = getLayoutDragComponent().getPropertyCategories(layoutComponent); Map<String,String> propertyMap = layoutComponent.getProperties(); PropertyEditorCategory category = layoutCssHelper.createCategory(LayoutEditorCssHelper.CSS_CATEGORY_PANEL); category.withField(layoutCssHelper.createField(propertyMap, CssProperty.WIDTH)); category.withField(layoutCssHelper.createField(propertyMap, CssProperty.HEIGHT)); category.withField(layoutCssHelper.createField(propertyMap, CssProperty.BACKGROUND_COLOR)); result.add(0, category); category = layoutCssHelper.createCategory(LayoutEditorCssHelper.CSS_CATEGORY_MARGIN); category.withField(layoutCssHelper.createField(propertyMap, CssProperty.MARGIN_TOP)); category.withField(layoutCssHelper.createField(propertyMap, CssProperty.MARGIN_BOTTOM)); category.withField(layoutCssHelper.createField(propertyMap, CssProperty.MARGIN_LEFT)); category.withField(layoutCssHelper.createField(propertyMap, CssProperty.MARGIN_RIGHT)); result.add(1, category); category = layoutCssHelper.createCategory(LayoutEditorCssHelper.CSS_CATEGORY_PADDING); category.withField(layoutCssHelper.createField(propertyMap, CssProperty.PADDING_TOP)); category.withField(layoutCssHelper.createField(propertyMap, CssProperty.PADDING_BOTTOM)); category.withField(layoutCssHelper.createField(propertyMap, CssProperty.PADDING_LEFT)); category.withField(layoutCssHelper.createField(propertyMap, CssProperty.PADDING_RIGHT)); result.add(2, category); return result; }

Target:
public List<PropertyEditorCategory> getLayoutDragComponentProperties() { List<PropertyEditorCategory> result = layoutCssHelper.getComponentPropertyCategories(layoutComponent); result.addAll(getLayoutDragComponent().getPropertyCategories(layoutComponent)); return result; }
Source:
public Enumeration<URL> getResources(String name) throws IOException { for (String mask : masksResources) { if(name.startsWith(mask)) return null; } return super.getResources(name); }

Target:
public Enumeration<URL> getResources(String name) throws IOException { if (isMasked(name)) return Collections.emptyEnumeration(); return super.getResources(name); }
Source:
public void run() { while (!Thread.currentThread().isInterrupted()) { try { final OperatorChain query = operatorChainManager.pickOperatorChain(); if (query != null) { query.processNextEvent(); if (!query.isQueueEmpty()) { operatorChainManager.insert(query); } } } catch (final Exception t) { throw t; } } }

Target:
public void run() { while (!Thread.currentThread().isInterrupted()) { try { final OperatorChain query = operatorChainManager.pickOperatorChain(); if (query != null) { query.processNextEvent(); } } catch (final Exception t) { throw t; } } }