auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public static TypeName get(TypeMirror mirror) { return mirror.accept(new SimpleTypeVisitor6<TypeName, Void>() { @Override public TypeName visitPrimitive(PrimitiveType t, Void p) { switch (t.getKind()) { case BOOLEAN: return TypeName.BOOLEAN; case BYTE: return TypeName.BYTE; case SHORT: return TypeName.SHORT; case INT: return TypeName.INT; case LONG: return TypeName.LONG; case CHAR: return TypeName.CHAR; case FLOAT: return TypeName.FLOAT; case DOUBLE: return TypeName.DOUBLE; default: throw new AssertionError(); } } @Override public TypeName visitDeclared(DeclaredType t, Void p) { ClassName rawType = ClassName.get((TypeElement) t.asElement()); if (t.getTypeArguments().isEmpty()) return rawType; List<TypeName> typeArgumentNames = new ArrayList<>(); for (TypeMirror mirror : t.getTypeArguments()) { typeArgumentNames.add(get(mirror)); } return new ParameterizedTypeName(rawType, typeArgumentNames); } @Override public ArrayTypeName visitArray(ArrayType t, Void p) { return ArrayTypeName.get(t); } @Override public TypeName visitTypeVariable(javax.lang.model.type.TypeVariable t, Void p) { return TypeVariableName.get(t); } @Override public TypeName visitWildcard(javax.lang.model.type.WildcardType t, Void p) { return WildcardTypeName.get(t); } @Override public TypeName visitNoType(NoType t, Void p) { if (t.getKind() == TypeKind.VOID) return TypeName.VOID; return super.visitUnknown(t, p); } @Override protected TypeName defaultAction(TypeMirror e, Void p) { throw new IllegalArgumentException("Unexpected type mirror: " + e); } }, null); }

Target:
public static TypeName get(TypeMirror mirror) { return mirror.accept(new SimpleTypeVisitor7<TypeName, Void>() { @Override public TypeName visitPrimitive(PrimitiveType t, Void p) { switch (t.getKind()) { case BOOLEAN: return TypeName.BOOLEAN; case BYTE: return TypeName.BYTE; case SHORT: return TypeName.SHORT; case INT: return TypeName.INT; case LONG: return TypeName.LONG; case CHAR: return TypeName.CHAR; case FLOAT: return TypeName.FLOAT; case DOUBLE: return TypeName.DOUBLE; default: throw new AssertionError(); } } @Override public TypeName visitDeclared(DeclaredType t, Void p) { ClassName rawType = ClassName.get((TypeElement) t.asElement()); if (t.getTypeArguments().isEmpty()) return rawType; List<TypeName> typeArgumentNames = new ArrayList<>(); for (TypeMirror mirror : t.getTypeArguments()) { typeArgumentNames.add(get(mirror)); } return new ParameterizedTypeName(rawType, typeArgumentNames); } @Override public ArrayTypeName visitArray(ArrayType t, Void p) { return ArrayTypeName.get(t); } @Override public TypeName visitTypeVariable(javax.lang.model.type.TypeVariable t, Void p) { return TypeVariableName.get(t); } @Override public TypeName visitWildcard(javax.lang.model.type.WildcardType t, Void p) { return WildcardTypeName.get(t); } @Override public TypeName visitNoType(NoType t, Void p) { if (t.getKind() == TypeKind.VOID) return TypeName.VOID; return super.visitUnknown(t, p); } @Override protected TypeName defaultAction(TypeMirror e, Void p) { throw new IllegalArgumentException("Unexpected type mirror: " + e); } }, null); }
Source:
protected Map<String, Pair<String, String>> getSharedLocks() { if (getDisk() == null) { return null; } if (getDisk().getVmEntityType() != null) { switch (getDisk().getVmEntityType()) { case VM: return createSharedLocksForVmDisk(); case TEMPLATE: return createSharedLocksForTemplateDisk(); } } log.warnFormat("No shared locks are taken while removing disk of entity: {0}", getDisk().getVmEntityType()); return null; }

Target:
protected Map<String, Pair<String, String>> getSharedLocks() { if (getDisk() == null) { return null; } if (getDisk().getVmEntityType() != null) { switch (getDisk().getVmEntityType()) { case VM: return createSharedLocksForVmDisk(); case TEMPLATE: return createSharedLocksForTemplateDisk(); } } return null; }
Source:
public Call<ResponseBody> setProfileImage(@NonNull String username, @NonNull final File file) { final String mimeType = "image/jpeg"; return userService.setProfileImage( username, "attachment;filename=filename." + MimeTypeMap.getSingleton().getExtensionFromMimeType(mimeType), RequestBody.create(MediaType.parse("image/jpeg"), file)); }

Target:
public Call<ResponseBody> setProfileImage(@NonNull String username, @NonNull final File file) { final String mimeType = "image/jpeg"; return userService.setProfileImage( username, "attachment;filename=filename." + MimeTypeMap.getSingleton().getExtensionFromMimeType(mimeType), RequestBody.create(MediaType.parse(mimeType), file)); }
Source:
public final boolean equals(Object obj) { if (super.equals(obj)) { final RangePredicate<?> other = (RangePredicate<?>) obj; return Objects.equals(lower(), other.lower()) && Objects.equals(upper(), other.upper()) && Objects.equals(isIncludeLower(), other.isIncludeLower()) && Objects.equals(isIncludeUpper(), other.isIncludeUpper()); } else { return false; } }

Target:
public final boolean equals(Object obj) { if (super.equals(obj)) { final RangePredicate<?> other = (RangePredicate<?>) obj; return Objects.equals(lower(), other.lower()) && Objects.equals(upper(), other.upper()) && isIncludeLower() == other.isIncludeLower() && isIncludeUpper() == other.isIncludeUpper(); } else { return false; } }
Source:
public ConnectorBucketNodeMap getBucketNodeMap(ConnectorTransactionHandle transactionHandle, ConnectorSession session, ConnectorPartitioningHandle partitioningHandle) { Set<Node> nodes = nodeManager.getRequiredWorkerNodes(); checkState(!nodes.isEmpty(), "No TPCDS nodes available"); return new ConnectorBucketNodeMap(nodes.size() * splitsPerNode); }

Target:
public ConnectorBucketNodeMap getBucketNodeMap(ConnectorTransactionHandle transactionHandle, ConnectorSession session, ConnectorPartitioningHandle partitioningHandle) { Set<Node> nodes = nodeManager.getRequiredWorkerNodes(); checkState(!nodes.isEmpty(), "No TPCDS nodes available"); return createBucketNodeMap(toIntExact((long) nodes.size() * splitsPerNode)); }
Source:
public static EntityClassType getEntityClassType(int id) { return ID.get(id); }

Target:
public static EntityClassType getEntityClassType(int id) { return (id >= ID.size() || id < 0) ? null : ID.get(id); }
Source:
public void isValidAuthority(URL authorizationEndpoint, AuthenticationCallback<Boolean> callback) { if (authorizationEndpoint != null && !StringExtensions.IsNullOrBlank(authorizationEndpoint.getHost()) && authorizationEndpoint.getProtocol().equals("https") && StringExtensions.IsNullOrBlank(authorizationEndpoint.getQuery()) && StringExtensions.IsNullOrBlank(authorizationEndpoint.getRef()) && !StringExtensions.IsNullOrBlank(authorizationEndpoint.getPath()) && authorizationEndpoint.getPath().indexOf("/", 1) == -1 ) { if(isADFSAuthority(authorizationEndpoint)){ callback.onError(new AuthenticationException(ADALError.DISCOVERY_NOT_SUPPORTED)); }else if (mValidHosts.contains(authorizationEndpoint.getHost().toLowerCase(Locale.US))) { callback.onSuccess(true); }else{ queryInstance(authorizationEndpoint, callback); } }else{ callback.onSuccess(false); } }

Target:
public void isValidAuthority(URL authorizationEndpoint, AuthenticationCallback<Boolean> callback) { if (authorizationEndpoint != null && !StringExtensions.IsNullOrBlank(authorizationEndpoint.getHost()) && authorizationEndpoint.getProtocol().equals("https") && StringExtensions.IsNullOrBlank(authorizationEndpoint.getQuery()) && StringExtensions.IsNullOrBlank(authorizationEndpoint.getRef()) && !StringExtensions.IsNullOrBlank(authorizationEndpoint.getPath())) { if (isADFSAuthority(authorizationEndpoint)) { callback.onError(new AuthenticationException(ADALError.DISCOVERY_NOT_SUPPORTED)); } else if (mValidHosts.contains(authorizationEndpoint.getHost().toLowerCase(Locale.US))) { callback.onSuccess(true); } else { queryInstance(authorizationEndpoint, callback); } } else { callback.onSuccess(false); } }
Source:
public ComputationRunnerTerminatedContext( String name, LogOffset logOffset, long timestamp, RetryPolicy retryPolicy, Collection<LogPartition> partitions) { super(); this.name = name; this.logOffset = logOffset; this.timestamp = timestamp; this.retryPolicy = retryPolicy; this.partitions = new ArrayList<>(partitions); Collections.sort(this.partitions, (c1, c2) -> c1.toString().compareTo(c2.toString())); }

Target:
public ComputationRunnerTerminatedContext( String name, LogOffset logOffset, long timestamp, RetryPolicy retryPolicy, Collection<LogPartition> partitions) { super(); this.name = name; this.logOffset = logOffset; this.timestamp = timestamp; this.retryPolicy = retryPolicy; this.partitions = new ArrayList<>(partitions); Collections.sort(this.partitions, Comparator.comparing(LogPartition::toString)); }
Source:
public ResponseEntity<Void> removeUserPhoto(@RequestHeader(value = Constants.PASSWORD_HEADER) Optional<String> password, @PathVariable UUID userId) { try (CryptoSession cryptoSession = CryptoSession.start(password, () -> userService.canAccessPrivateData(userId))) { userPhotoService.removeUserPhoto(userId); return new ResponseEntity<Void>(HttpStatus.OK); } }

Target:
public void removeUserPhoto(@RequestHeader(value = Constants.PASSWORD_HEADER) Optional<String> password, @PathVariable UUID userId) { try (CryptoSession cryptoSession = CryptoSession.start(password, () -> userService.canAccessPrivateData(userId))) { userPhotoService.removeUserPhoto(userId); } }
Source:
public void testGetCodeType() throws Exception { ICodeService remoteService = createRemoteService(); CodeServiceClientProxy service = createServiceUnderTest(remoteService); CompanyRatingCodeType ct1 = service.getCodeType(CompanyRatingCodeType.class); assertNotNull(ct1); CompanyRatingCodeType ct2 = service.getCodeType(CompanyRatingCodeType.class); assertNotNull(ct2); assertTrue(ct1 == ct2); CompanyTypeCodeType ct3 = service.getCodeType(CompanyTypeCodeType.class); assertNotNull(ct3); verify(remoteService, times(1)).getCodeType(CompanyRatingCodeType.class); verify(remoteService, times(1)).getCodeType(CompanyTypeCodeType.class); verifyNoMoreInteractions(remoteService); }

Target:
public void testGetCodeType() throws Exception { CompanyRatingCodeType ct1 = m_service.getCodeType(CompanyRatingCodeType.class); assertNotNull(ct1); CompanyRatingCodeType ct2 = m_service.getCodeType(CompanyRatingCodeType.class); assertNotNull(ct2); assertTrue(ct1 == ct2); CompanyTypeCodeType ct3 = m_service.getCodeType(CompanyTypeCodeType.class); assertNotNull(ct3); verify(m_remoteService, times(1)).getCodeType(CompanyRatingCodeType.class); verify(m_remoteService, times(1)).getCodeType(CompanyTypeCodeType.class); verifyNoMoreInteractions(m_remoteService); }
Source:
public void shutdown() { logger.info("Shutting down Http2BlockingChannelPool."); eventLoopGroup.shutdownGracefully(); }

Target:
public void shutdown() { logger.info("Shutting down Http2BlockingChannelPool."); try { eventLoopGroup.shutdownGracefully().await(http2ClientConfig.http2BlockingChannelPoolShutdownTimeoutMs); } catch (InterruptedException e) { logger.info("EventLoopGroup shutdown timeout: ms", http2ClientConfig.http2BlockingChannelPoolShutdownTimeoutMs); } }
Source:
public void createManagementNetworkIfRequired() { final String managementNetwork = NetworkUtils.getEngineNetwork(); if (host == null) { return; } Map<String, Network> vdsNetworks = Entities.entitiesByName(host.getNetworks()); if (vdsNetworks.containsKey(managementNetwork)) { log.info("The management network '{}' is already configured on host '{}'", managementNetwork, host.getName()); return; } if (!FeatureSupported.setupManagementNetwork(host.getVdsGroupCompatibilityVersion())) { log.warn("Cluster of host '{}' does not support normalize management network feature", host.getName()); return; } VdsNetworkInterface nic = findNicToSetupManagementNetwork(); if (nic == null) { return; } List<VdsNetworkInterface> interfaces = filterBondsWithoutSlaves(host.getInterfaces()); if (interfaces.contains(nic)) { nic.setNetworkName(managementNetwork); configureManagementNetwork(createSetupNetworkParams(interfaces)); } else { final AuditLogableBase event = createEvent(); event.addCustomValue("InterfaceName", nic.getName()); AuditLogDirector.log(event, AuditLogType.INVALID_INTERFACE_FOR_MANAGEMENT_NETWORK_CONFIGURATION, NETWORK_CONFIG_LOG_ERR); throw new NetworkConfiguratorException(MANAGEMENET_NETWORK_CONFIG_ERR); } }

Target:
public void createManagementNetworkIfRequired() { if (host == null) { return; } final String managementNetworkName = resolveManagementNetworkName(); final String hostManagementNetworkAddress = resolveHostManagementNetworkAddress(managementNetworkName); if (hostManagementNetworkAddress != null && hostManagementNetworkAddress.equals(host.getHostName())) { log.info("The management network '{}' is already configured on host '{}'", managementNetworkName, host.getName()); return; } if (!FeatureSupported.setupManagementNetwork(host.getVdsGroupCompatibilityVersion())) { log.warn("Cluster of host '{}' does not support normalize management network feature", host.getName()); return; } VdsNetworkInterface nic = findNicToSetupManagementNetwork(); if (nic == null) { return; } List<VdsNetworkInterface> interfaces = filterBondsWithoutSlaves(host.getInterfaces()); if (interfaces.contains(nic)) { nic.setNetworkName(managementNetworkName); configureManagementNetwork(createSetupNetworkParams(interfaces)); } else { final AuditLogableBase event = createEvent(); event.addCustomValue("InterfaceName", nic.getName()); auditLogDirector.log(event, AuditLogType.INVALID_INTERFACE_FOR_MANAGEMENT_NETWORK_CONFIGURATION, NETWORK_CONFIG_LOG_ERR); throw new NetworkConfiguratorException(MANAGEMENET_NETWORK_CONFIG_ERR); } }
Source:
private void createTooltipShell(Shell parent, Control control, MouseEvent event, Point pt) { fModel.clear(); final Display display = parent.getDisplay(); if (fTipShell != null && !fTipShell.isDisposed()) { fTipShell.dispose(); } fTipShell = new Shell(parent, SWT.ON_TOP | SWT.TOOL | SWT.RESIZE | SWT.NO_SCROLL); fTipShell.addDisposeListener(e -> e.display.removeFilter(SWT.MouseMove, fListener)); fTipShell.addDisposeListener(e -> e.display.removeFilter(SWT.FocusOut, fFocusLostListener)); fTipShell.addListener(SWT.Deactivate, e -> { if (!fTipShell.isDisposed()) { fTipShell.dispose(); } }); fTipShell.setLayout(new FillLayout()); fTipShell.setBackground(display.getSystemColor(SWT.COLOR_INFO_BACKGROUND)); fTipComposite = new Composite(fTipShell, SWT.NO_FOCUS); fTipComposite.setLayout(new FillLayout()); fill(control, event, pt); ITooltipContent content = null; if (isBrowserAvailable(fTipComposite)) { content = new BrowserContent(fTipComposite); } else { content = new DefaultContent(fTipComposite); } content.setInput(fModel); content.create(); Point p = content.computePreferredSize(); Rectangle t = fTipShell.computeTrim(0, 0, p.x, p.y); fTipShell.setSize(Math.min(t.width, 750), Math.min(t.height, 700)); }

Target:
private void createTooltipShell(Shell parent, Control control, MouseEvent event, Point pt) { final Display display = parent.getDisplay(); if (fTipShell != null && !fTipShell.isDisposed()) { fTipShell.dispose(); } fModel.clear(); fTipShell = new Shell(parent, SWT.ON_TOP | SWT.TOOL | SWT.RESIZE | SWT.NO_SCROLL); fTipShell.addDisposeListener(e -> e.display.removeFilter(SWT.MouseMove, fListener)); fTipShell.addDisposeListener(e -> e.display.removeFilter(SWT.FocusOut, fFocusLostListener)); fTipShell.addListener(SWT.Deactivate, e -> { if (!fTipShell.isDisposed()) { fTipShell.dispose(); } }); fTipShell.setLayout(new FillLayout()); fTipShell.setBackground(display.getSystemColor(SWT.COLOR_INFO_BACKGROUND)); fTipComposite = new Composite(fTipShell, SWT.NO_FOCUS); fTipComposite.setLayout(new FillLayout()); fill(control, event, pt); ITooltipContent content = null; if (isBrowserAvailable(fTipComposite)) { content = new BrowserContent(fTipComposite); } else { content = new DefaultContent(fTipComposite); } content.setInput(fModel); content.create(); Point p = content.computePreferredSize(); Rectangle t = fTipShell.computeTrim(0, 0, p.x, p.y); fTipShell.setSize(Math.min(t.width, 750), Math.min(t.height, 700)); }
Source:
public void start(StartContext context) { modelControllerClient = modelControllerClientFactory.get().createSuperUserClient(managementExecutor.get()); metricCollector = new MetricCollector(modelControllerClient, processStateNotifier.get()); metricCollectorConsumer.accept(metricCollector); }

Target:
public void start(StartContext context) { modelControllerClient = modelControllerClientFactory.get().createClient(managementExecutor.get()); metricCollector = new MetricCollector(modelControllerClient, processStateNotifier.get()); metricCollectorConsumer.accept(metricCollector); }
Source:
public Response getToolZip(@ApiParam(hidden = true) @Auth Optional<User> user, @ApiParam(value = "toolId", required = true) @PathParam("toolId") Long toolId, @ApiParam(value = "tagId", required = true) @PathParam("tagId") Long tagId) { Tool tool = toolDAO.findById(toolId); if (tool.getIsPublished()) { tool = toolDAO.findPublishedById(toolId); checkEntry(tool); } else { checkEntry(tool); if (user.isPresent()) { checkUser(user.get(), tool); } else { throw new CustomWebApplicationException("Forbidden: you do not have the credentials required to access this entry.", HttpStatus.SC_FORBIDDEN); } } Tag tag = tool.getTags().stream().filter(innertag -> innertag.getId() == tagId).findFirst() .orElseThrow(() -> new CustomWebApplicationException("Could not find tag", HttpStatus.SC_NOT_FOUND)); Set<SourceFile> sourceFiles = tag.getSourceFiles(); if (sourceFiles == null || sourceFiles.size() == 0) { throw new CustomWebApplicationException("no files found to zip", HttpStatus.SC_NO_CONTENT); } String fileName = tool.getToolPath().replaceAll("/", "-") + ".zip"; return Response.ok().entity((StreamingOutput)output -> writeStreamAsZip(sourceFiles, output)) .header("Content-Disposition", "attachment; filename=\"" + fileName + "\"").build(); }

Target:
public Response getToolZip(@ApiParam(hidden = true) @Auth Optional<User> user, @ApiParam(value = "toolId", required = true) @PathParam("toolId") Long toolId, @ApiParam(value = "tagId", required = true) @PathParam("tagId") Long tagId) { Tool tool = toolDAO.findById(toolId); if (tool.getIsPublished()) { checkEntry(tool); } else { checkEntry(tool); if (user.isPresent()) { checkUser(user.get(), tool); } else { throw new CustomWebApplicationException("Forbidden: you do not have the credentials required to access this entry.", HttpStatus.SC_FORBIDDEN); } } Tag tag = tool.getTags().stream().filter(innertag -> innertag.getId() == tagId).findFirst() .orElseThrow(() -> new CustomWebApplicationException("Could not find tag", HttpStatus.SC_NOT_FOUND)); Set<SourceFile> sourceFiles = tag.getSourceFiles(); if (sourceFiles == null || sourceFiles.size() == 0) { throw new CustomWebApplicationException("no files found to zip", HttpStatus.SC_NO_CONTENT); } String fileName = tool.getToolPath().replaceAll("/", "-") + ".zip"; return Response.ok().entity((StreamingOutput)output -> writeStreamAsZip(sourceFiles, output)) .header("Content-Disposition", "attachment; filename=\"" + fileName + "\"").build(); }
Source:
public void openDialog() { final String[] items = context.getResources().getStringArray(R.array.feed_episodes_sort_options); final String[] valueStrs = context.getResources().getStringArray(R.array.feed_episodes_sort_values); final SortOrder[] values = new SortOrder[valueStrs.length]; for (int i = 0; i < valueStrs.length; i++) { values[i] = SortOrder.valueOf(valueStrs[i]); } int idxCurrentSort = -1; for (int i = 0; i < values.length; i++) { if (currentSortOrder == values[i] || currentSortOrder == null) { idxCurrentSort = i; break; } } AlertDialog.Builder builder = new AlertDialog.Builder(context); builder.setTitle(R.string.sort); builder.setSingleChoiceItems(items, idxCurrentSort, (dialog, idxNewSort) -> { updateSort(values[idxNewSort]); dialog.dismiss(); }); builder.setNegativeButton(R.string.cancel_label, null); builder.create().show(); }

Target:
public void openDialog() { final String[] items = context.getResources().getStringArray(R.array.feed_episodes_sort_options); final String[] valueStrs = context.getResources().getStringArray(R.array.feed_episodes_sort_values); final SortOrder[] values = new SortOrder[valueStrs.length]; for (int i = 0; i < valueStrs.length; i++) { values[i] = SortOrder.valueOf(valueStrs[i]); } int idxCurrentSort = 0; for (int i = 0; i < values.length; i++) { if (currentSortOrder == values[i]) { idxCurrentSort = i; break; } } AlertDialog.Builder builder = new AlertDialog.Builder(context); builder.setTitle(R.string.sort); builder.setSingleChoiceItems(items, idxCurrentSort, (dialog, idxNewSort) -> { updateSort(values[idxNewSort]); dialog.dismiss(); }); builder.setNegativeButton(R.string.cancel_label, null); builder.create().show(); }
Source:
public static void initDriver() throws Exception { synchronized (TestUtil.class) { if (initialized) { return; } Properties p = loadPropertyFiles("build.properties"); p.putAll(System.getProperties()); System.getProperties().putAll(p); if (org.postgresql.Driver.isRegistered()) { LogManager manager = LogManager.getLogManager(); java.util.logging.Logger logger = manager.getLogger("org.postgresql"); switch (getLogLevel()) { case 0: logger.setLevel(java.util.logging.Level.OFF); break; case 1: logger.setLevel(java.util.logging.Level.FINER); break; case 2: logger.setLevel(java.util.logging.Level.FINEST); break; } } initialized = true; } }

Target:
public static void initDriver() throws Exception { synchronized (TestUtil.class) { if (initialized) { return; } Properties p = loadPropertyFiles("build.properties"); p.putAll(System.getProperties()); System.getProperties().putAll(p); initialized = true; } }
Source:
public boolean isAllRecipientOptionsDisplayed(int questionNumber) { List<WebElement> recipientOptions = browser.driver.findElements(By.cssSelector("#recipienttype-" + questionNumber + " option")); for (WebElement recipientOption : recipientOptions) { String recipientOptionStyle = recipientOption.getAttribute("style"); if ("display: none;".equals(recipientOptionStyle)) { return false; } } return true; }

Target:
public boolean isAllRecipientOptionsDisplayed(int questionNumber) { List<WebElement> recipientOptions = browser.driver.findElements(By.cssSelector("#recipienttype-" + questionNumber + " option")); for (WebElement recipientOption : recipientOptions) { if ("none".equals(recipientOption.getCssValue("display"))) { return false; } } return true; }
Source:
public StreamInflatingIndexingOutputStream(final OutputStream s1, final File indexFile) { try { this.s1 = s1; this.s2 = new PipedOutputStream(); final PipedInputStream pin = new PipedInputStream(this.s2, Defaults.NON_ZERO_BUFFER_SIZE); this.thread = new Thread(new Indexer(indexFile.toPath(), pin), "BamIndexingThread"); this.thread.start(); } catch (final IOException ioe) { throw new RuntimeIOException(ioe); } }

Target:
public StreamInflatingIndexingOutputStream(final OutputStream s1, final File indexFile) { this(s1, indexFile.toPath()); }
Source:
public void removeDocument(String entityType, int entityId, int documentId) { checkViewAttached(); getMvpView().showProgressbar(true); mSubscriptions.add(mDataManagerDocument.removeDocument(entityType, entityId, documentId) .observeOn(AndroidSchedulers.mainThread()) .subscribeOn(Schedulers.io()) .subscribe(new Subscriber<DocumentRelatedResponse>() { @Override public void onCompleted() { } @Override public void onError(Throwable e) { getMvpView().showProgressbar(false); if (e instanceof HttpException) { try { String errorMessage = ((HttpException) e).response().errorBody() .string(); getMvpView().showErrorMessage(MFErrorParser.parseError(errorMessage) .getErrors().get(0).getDefaultUserMessage()); } catch (Throwable throwable) { RxJavaPlugins.getInstance().getErrorHandler().handleError(e); } } else { getMvpView().showErrorMessage(e.getLocalizedMessage()); } } @Override public void onNext(DocumentRelatedResponse documentRemoveResponse) { getMvpView().showProgressbar(false); getMvpView().showDocumentRemovedSuccessfully(); } }) ); }

Target:
public void removeDocument(String entityType, int entityId, int documentId) { checkViewAttached(); getMvpView().showProgressbar(true); mSubscriptions.add(mDataManagerDocument.removeDocument(entityType, entityId, documentId) .observeOn(AndroidSchedulers.mainThread()) .subscribeOn(Schedulers.io()) .subscribe(new Subscriber<DocumentRelatedResponse>() { @Override public void onCompleted() { } @Override public void onError(Throwable e) { getMvpView().showProgressbar(false); getMvpView().showErrorMessage(MFErrorParser.errorMessage(e)); } @Override public void onNext(DocumentRelatedResponse documentRemoveResponse) { getMvpView().showProgressbar(false); getMvpView().showDocumentRemovedSuccessfully(); } }) ); }
Source:
private static void parseConditions(XmlPullParser reader, SystemPropertyConditionBuilder conditionBuilder) throws XmlPullParserException, IOException { atLeast1_7(reader); assertNoAttributes(reader); int eventType; for (;;) { eventType = reader.nextTag(); switch (eventType) { case END_TAG: { return; } case START_TAG: { validateNamespace(reader); switch (reader.getName()) { case E_PROPERTY_EQUAL: parseConditionalProperty(reader, true, conditionBuilder); break; case E_PROPERTY_NOT_EQUAL: parseConditionalProperty(reader, false, conditionBuilder); break; default: throw unexpectedContent(reader); } break; } default: { throw unexpectedContent(reader); } } } }

Target:
private static void parseConditions(XmlPullParser reader, SystemPropertyConditionBuilder conditionBuilder) throws XmlPullParserException, IOException { if(!atLeast1_7(reader)) { throw unexpectedContent(reader); } assertNoAttributes(reader); int eventType; for (;;) { eventType = reader.nextTag(); switch (eventType) { case END_TAG: { return; } case START_TAG: { validateNamespace(reader); switch (reader.getName()) { case E_PROPERTY_EQUAL: parseConditionalProperty(reader, true, conditionBuilder); break; case E_PROPERTY_NOT_EQUAL: parseConditionalProperty(reader, false, conditionBuilder); break; default: throw unexpectedContent(reader); } break; } default: { throw unexpectedContent(reader); } } } }
Source:
private void checkHttpConnection() { String url = devMachine.getWsAgentBaseUrl() + '/'; final String pingUrl = restContext + "/workspace-agent-health/" + devMachine.getWorkspace() + '/' + WSAGENT_REFERENCE; asyncRequestFactory.createGetRequest(url).send(new StringUnmarshaller()).then(new Operation<String>() { @Override public void apply(String result) throws OperationException { JSONObject object = null; try { object = JSONParser.parseStrict(result).isObject(); } catch (Exception exception) { Log.warn(getClass(), "Parse root resources failed."); } if (object != null && object.containsKey("rootResources")) { JSONArray rootResources = object.get("rootResources").isArray(); for (int i = 0; i < rootResources.size(); i++) { JSONObject rootResource = rootResources.get(i).isObject(); String regex = rootResource.get("regex").isString().stringValue(); String fqn = rootResource.get("fqn").isString().stringValue(); String path = rootResource.get("path").isString().stringValue(); availableServices.add(new RestServiceInfo(fqn, regex, path)); } } checkWsConnection(); } }).catchError(new Operation<PromiseError>() { @Override public void apply(PromiseError arg) throws OperationException { asyncRequestFactory.createGetRequest(pingUrl) .header(ACCEPT, APPLICATION_JSON) .send(dtoUnmarshallerFactory.newUnmarshaller(AgentHealthStateDto.class)) .then(new Operation<AgentHealthStateDto>() { @Override public void apply(AgentHealthStateDto arg) throws OperationException { if (RUNNING.equals(arg.getWorkspaceStatus())) { checkStateOfWsAgent(arg); } } }).catchError(new Operation<PromiseError>() { @Override public void apply(PromiseError arg) throws OperationException { Log.error(getClass(), arg.getMessage()); } }); } }); }

Target:
private void checkHttpConnection() { String url = devMachine.getWsAgentBaseUrl() + '/'; asyncRequestFactory.createGetRequest(url).send(new StringUnmarshaller()).then(new Operation<String>() { @Override public void apply(String result) throws OperationException { try { JSONObject object = JSONParser.parseStrict(result).isObject(); if (object.containsKey("rootResources")) { JSONArray rootResources = object.get("rootResources").isArray(); for (int i = 0; i < rootResources.size(); i++) { JSONObject rootResource = rootResources.get(i).isObject(); String regex = rootResource.get("regex").isString().stringValue(); String fqn = rootResource.get("fqn").isString().stringValue(); String path = rootResource.get("path").isString().stringValue(); availableServices.add(new RestServiceInfo(fqn, regex, path)); } } } catch (Exception exception) { Log.warn(getClass(), "Parse root resources failed."); } checkWsConnection(); } }).catchError(new Operation<PromiseError>() { @Override public void apply(PromiseError arg) throws OperationException { checkWsAgentHealth(); } }); }
Source:
boolean testRow(final int i, final long startTime) throws IOException, InterruptedException { if (opts.randomSleep > 0) { Thread.sleep(rd.nextInt(opts.randomSleep)); } HRegionLocation hRegionLocation = regionLocator.getRegionLocation(Bytes.toBytes(Integer.toString(rd.nextInt(100) + 1)), true); return true; }

Target:
boolean testRow(final int i, final long startTime) throws IOException, InterruptedException { if (opts.randomSleep > 0) { Thread.sleep(rd.nextInt(opts.randomSleep)); } HRegionLocation hRegionLocation = regionLocator.getRegionLocation( getSplitKey(rd.nextInt(opts.perClientRunRows)), true); LOG.debug("get location for region: " + hRegionLocation); return true; }
Source:
public RESTWorkItemHandler(String username, String password, ClassLoader classLoader, boolean doCacheClient, int totalPoolConnections, int maxPoolConnectionsPerRoute, String handlingProcessId, String handlingStrategy) { printProtocol(); this.username = username; this.password = password; this.type = AuthenticationType.BASIC; this.classLoader = classLoader; this.doCacheClient = doCacheClient; if (doCacheClient) { connectionManager.setMaxTotal(totalPoolConnections); connectionManager.setDefaultMaxPerRoute(maxPoolConnectionsPerRoute); } this.handlingProcessId = handlingProcessId; this.handlingStrategy = handlingStrategy; }

Target:
public RESTWorkItemHandler(String username, String password, ClassLoader classLoader, boolean doCacheClient, int totalPoolConnections, int maxPoolConnectionsPerRoute, String handlingProcessId, String handlingStrategy) { logProtocol(); this.username = username; this.password = password; this.type = AuthenticationType.BASIC; this.classLoader = classLoader; this.doCacheClient = doCacheClient; if (doCacheClient) { connectionManager.setMaxTotal(totalPoolConnections); connectionManager.setDefaultMaxPerRoute(maxPoolConnectionsPerRoute); } this.handlingProcessId = handlingProcessId; this.handlingStrategy = handlingStrategy; }
Source:
private void addMatch(final String match, final T value, final boolean immutableMatch, boolean notifyListeners) { lock.writeLock().lock(); try { String modifiedMatch = matchModifier.modify(match); if (usesWildcards(modifiedMatch)) { clearCache(); } else if (modifiedMatch != null && cache.containsKey(modifiedMatch)) { cache.remove(modifiedMatch); } if (immutableMatch) { immutables.add(modifiedMatch); } Match.verify(modifiedMatch, wildcardConfiguration); Match<T> match1 = new Match<>(modifiedMatch, value, wildcardConfiguration); matches.put(modifiedMatch, match1); } finally { lock.writeLock().unlock(); } if (notifyListeners) { onChange(); } }

Target:
private void addMatch(final String match, final T value, final boolean immutableMatch, boolean notifyListeners) { lock.writeLock().lock(); try { String modifiedMatch = matchModifier.modify(match); if (usesWildcards(modifiedMatch)) { clearCache(); } else if (modifiedMatch != null && cache.containsKey(modifiedMatch)) { cache.remove(modifiedMatch); } if (immutableMatch) { immutables.add(modifiedMatch); } Match.verify(modifiedMatch, wildcardConfiguration); Match<T> match1 = new Match<>(modifiedMatch, value, wildcardConfiguration); if (usesWildcards(modifiedMatch)) { wildcardMatches.put(modifiedMatch, match1); } else { exactMatches.put(modifiedMatch, match1); } } finally { lock.writeLock().unlock(); } if (notifyListeners) { onChange(); } }
Source:
public VLCPlayer() { System.setProperty("jna.nosys", "true"); mediaPlayerComponent = new EmbeddedMediaPlayerComponent(); videoSurface = mediaPlayerComponent.getVideoSurface(); mediaPlayer = mediaPlayerComponent.getMediaPlayer(); gameSurface = EngineDesktop.frame.getLwjglCanvas().getCanvas(); mediaPlayer.setEnableKeyInputHandling(false); videoSurface.addKeyListener(new KeyAdapter() { @Override public void keyPressed(KeyEvent e) { if (e.getKeyCode() == KeyEvent.VK_ESCAPE) { end(); } } }); mediaPlayer.addMediaPlayerEventListener(new MediaPlayerEventAdapter() { @Override public void finished(MediaPlayer mediaPlayer) { Gdx.app.error("Video", "Video finished."); skip = true; end(); } @Override public void error(MediaPlayer mediaPlayer) { Gdx.app.error("Video", "An error ocurred while playing video."); skip = true; end(); } }); }

Target:
public VLCPlayer() { tempVideos = new HashMap<String, String>(); try { System.setProperty("jna.nosys", "true"); mediaPlayerComponent = new EmbeddedMediaPlayerComponent(); videoSurface = mediaPlayerComponent.getVideoSurface(); mediaPlayer = mediaPlayerComponent.getMediaPlayer(); gameSurface = EngineDesktop.frame.getLwjglCanvas().getCanvas(); mediaPlayer.setEnableKeyInputHandling(false); videoSurface.addKeyListener(new KeyAdapter() { @Override public void keyPressed(KeyEvent e) { if (e.getKeyCode() == KeyEvent.VK_ESCAPE) { end(); } } }); mediaPlayer .addMediaPlayerEventListener(new MediaPlayerEventAdapter() { @Override public void finished(MediaPlayer mediaPlayer) { Gdx.app.debug("Video", "Video finished."); skip = true; end(); } @Override public void error(MediaPlayer mediaPlayer) { Gdx.app.error("Video", "An error ocurred while playing video."); skip = true; end(); } }); vlcNotInstalled = false; } catch (Exception e) { Gdx.app .error("VLCPlayer", "VLC is not installed. All video's in this game will be skipped."); vlcNotInstalled = true; } }
Source:
public void testSnippetTabStops() throws PartInitException, InvocationTargetException, CoreException { CompletionItem completionItem = createCompletionItem("sum(${1:x}, ${2:y})", CompletionItemKind.Method, new Range(new Position(0, 0), new Position(0, 1))); completionItem.setInsertTextFormat(InsertTextFormat.Snippet); MockLanguageSever.INSTANCE .setCompletionList(new CompletionList(false, Collections.singletonList(completionItem))); ITextViewer viewer = TestUtils.openTextViewer(TestUtils.createUniqueTestFile(project, "")); int invokeOffset = 0; ICompletionProposal[] proposals = contentAssistProcessor.computeCompletionProposals(viewer, invokeOffset); assertEquals(1, proposals.length); ((LSCompletionProposal) proposals[0]).apply(viewer, '\n', 0, invokeOffset); assertEquals("sum(x, y)", viewer.getDocument().get()); Point range = proposals[0].getSelection(null); assertEquals(range.x, 4); assertEquals(range.y, 1); Event event = new Event(); event.character = SWT.TAB; viewer.getTextWidget().notifyListeners(ST.VerifyKey, event); range = viewer.getSelectedRange(); assertEquals(range.x, 7); assertEquals(range.y, 1); }

Target:
public void testSnippetTabStops() throws PartInitException, InvocationTargetException, CoreException { CompletionItem completionItem = createCompletionItem("sum(${1:x}, ${2:y})", CompletionItemKind.Method, new Range(new Position(0, 0), new Position(0, 1))); completionItem.setInsertTextFormat(InsertTextFormat.Snippet); MockLanguageSever.INSTANCE .setCompletionList(new CompletionList(false, Collections.singletonList(completionItem))); ITextViewer viewer = TestUtils.openTextViewer(TestUtils.createUniqueTestFile(project, "")); int invokeOffset = 0; ICompletionProposal[] proposals = contentAssistProcessor.computeCompletionProposals(viewer, invokeOffset); assertEquals(1, proposals.length); ((LSCompletionProposal) proposals[0]).apply(viewer, '\n', 0, invokeOffset); assertEquals("sum(x, y)", viewer.getDocument().get()); Point range = proposals[0].getSelection(viewer.getDocument()); assertEquals(4, range.x); assertEquals(1, range.y); Event event = new Event(); event.character = SWT.TAB; viewer.getTextWidget().notifyListeners(ST.VerifyKey, event); range = viewer.getSelectedRange(); assertEquals(7, range.x); assertEquals(1, range.y); }
Source:
protected int getHighestProblemSeverity(IResource resource) { int problemSeverity = super.getHighestProblemSeverity(resource); if (resource instanceof IContainer && problemSeverity < IMarker.SEVERITY_ERROR) { try { final CompletableFuture<NestedProjectsProblemsModel> problemsModelSnapshot = refreshModelJob; if (problemsModelSnapshot != null) { problemSeverity = Math.max(problemSeverity, problemsModelSnapshot.get(50, TimeUnit.MILLISECONDS) .getMaxSeverityIncludingNestedProjects(resource)); } } catch (InterruptedException | ExecutionException | RuntimeException e) { WorkbenchNavigatorPlugin.log(e.getMessage(), new Status(IStatus.ERROR, WorkbenchNavigatorPlugin.PLUGIN_ID, e.getMessage(), e)); } catch (TimeoutException e) { } } return problemSeverity; }

Target:
protected int getHighestProblemSeverity(IResource resource) { int problemSeverity = super.getHighestProblemSeverity(resource); if (resource instanceof IContainer && problemSeverity < IMarker.SEVERITY_ERROR) { try { final CompletableFuture<NestedProjectsProblemsModel> problemsModelSnapshot = refreshModelJob; if (problemsModelSnapshot != null) { problemSeverity = Math.max(problemSeverity, problemsModelSnapshot.get(50, TimeUnit.MILLISECONDS) .getMaxSeverityIncludingNestedProjects(resource)); } } catch (TimeoutException e) { } catch (InterruptedException | ExecutionException | RuntimeException e) { WorkbenchNavigatorPlugin.log(e.getMessage(), new Status(IStatus.ERROR, WorkbenchNavigatorPlugin.PLUGIN_ID, e.getMessage(), e)); } } return problemSeverity; }
Source:
public static <T extends Throwable> T rewrap(final String newMessage, final T throwable) { Preconditions.checkNotNull(throwable); log.info("Rewrapping throwable with newMessage {}", newMessage, throwable); try { Constructor<?>[] constructors = throwable.getClass().getConstructors(); for (Constructor<?> c : constructors) { if (Arrays.equals(new Class<?>[] {String.class, Throwable.class}, c.getParameterTypes())) { @SuppressWarnings("unchecked") T rv = (T) c.newInstance(newMessage, throwable); return rv; } else if (Arrays.equals(new Class<?>[] {String.class}, c.getParameterTypes())) { @SuppressWarnings("unchecked") T rv = (T) c.newInstance(newMessage); return chain(rv, throwable); } } return throwable; } catch (Exception e) { log.error("Unexpected error encountered while rewrapping throwable of class {}", throwable.getClass(), e); throw createPalantirRuntimeException(newMessage, throwable); } }

Target:
public static <T extends Throwable> T rewrap(final String newMessage, final T throwable) { Preconditions.checkNotNull(throwable); log.info("Rewrapping throwable with newMessage {}", throwable, newMessage); try { Constructor<?>[] constructors = throwable.getClass().getConstructors(); for (Constructor<?> c : constructors) { if (Arrays.equals(new Class<?>[] {String.class, Throwable.class}, c.getParameterTypes())) { @SuppressWarnings("unchecked") T rv = (T) c.newInstance(newMessage, throwable); return rv; } else if (Arrays.equals(new Class<?>[] {String.class}, c.getParameterTypes())) { @SuppressWarnings("unchecked") T rv = (T) c.newInstance(newMessage); return chain(rv, throwable); } } return throwable; } catch (Exception e) { log.error("Unexpected error encountered while rewrapping throwable of class {}", throwable.getClass(), e); throw createPalantirRuntimeException(newMessage, throwable); } }
Source:
public <T> T getProxy(Invoker<T> invoker, boolean generic) throws RpcException { Set<Class<?>> interfaces = new HashSet<Class<?>>(); String config = invoker.getUrl().getParameter(INTERFACES); if (config != null && config.length() > 0) { String[] types = COMMA_SPLIT_PATTERN.split(config); for (String type : types) { interfaces.add(ReflectUtils.forName(type)); } } interfaces.add(EchoService.class); if (generic) { if (!GenericService.class.isAssignableFrom(invoker.getInterface())) { interfaces.add(GenericService.class); } try { String realInterface = invoker.getUrl().getParameter(Constants.INTERFACE); interfaces.add(ReflectUtils.forName(realInterface)); } catch (Throwable e) { } } return getProxy(invoker, interfaces.toArray(new Class<?>[0])); }

Target:
public <T> T getProxy(Invoker<T> invoker, boolean generic) throws RpcException { Set<Class<?>> interfaces = new HashSet<>(); String config = invoker.getUrl().getParameter(INTERFACES); if (config != null && config.length() > 0) { String[] types = COMMA_SPLIT_PATTERN.split(config); for (String type : types) { interfaces.add(ReflectUtils.forName(type)); } } if (generic) { if (!GenericService.class.isAssignableFrom(invoker.getInterface())) { interfaces.add(com.alibaba.dubbo.rpc.service.GenericService.class); } try { String realInterface = invoker.getUrl().getParameter(Constants.INTERFACE); interfaces.add(ReflectUtils.forName(realInterface)); } catch (Throwable e) { } } interfaces.add(invoker.getInterface()); interfaces.addAll(Arrays.asList(INTERNAL_INTERFACES)); return getProxy(invoker, interfaces.toArray(new Class<?>[0])); }
Source:
private void updateActionAvailability() { VDS vds = getEntity(); boolean createBrickAllowed = false; boolean syncStorageDeviceAllowed = false; if (vds != null && vds.getStatus() == VDSStatus.Up) { syncStorageDeviceAllowed = true; createBrickAllowed = !getItems().isEmpty() && canCreateBrick(); if (createBrickAllowed && !getSelectedItems().isEmpty()) { for (StorageDevice device : getSelectedItems()) { if (device.getCanCreateBrick()) { createBrickAllowed = false; break; } } } } getSyncStorageDevicesCommand().setIsExecutionAllowed(syncStorageDeviceAllowed); getCreateBrickCommand().setIsExecutionAllowed(createBrickAllowed); }

Target:
private void updateActionAvailability() { VDS vds = getEntity(); boolean createBrickAllowed = false; boolean syncStorageDeviceAllowed = false; if (vds != null && vds.getStatus() == VDSStatus.Up) { syncStorageDeviceAllowed = true; createBrickAllowed = !getItems().isEmpty() && canCreateBrick(); if (createBrickAllowed && !getSelectedItems().isEmpty()) { for (StorageDevice device : getSelectedItems()) { if (!device.getCanCreateBrick()) { createBrickAllowed = false; break; } } } } getSyncStorageDevicesCommand().setIsExecutionAllowed(syncStorageDeviceAllowed); getCreateBrickCommand().setIsExecutionAllowed(createBrickAllowed); }
Source:
public Observable<Channels> getChannelsFor(User user) { return Observable.zip( privateChannelsFor(user), publicChannels(), new Func2<List<Channel>, List<Channel>, Channels>() { @Override public Channels call(List<Channel> channels, List<Channel> channels2) { List<Channel> combinedChannels = new ArrayList<>(channels); combinedChannels.addAll(channels2); return new Channels(combinedChannels); } } ); }

Target:
public Observable<Channels> getChannelsFor(User user) { return Observable.zip( privateChannelsFor(user), publicChannels(), new Func2<List<Channel>, List<Channel>, Channels>() { @Override public Channels call(List<Channel> privateChannels, List<Channel> publicChannels) { List<Channel> combinedChannels = new ArrayList<>(privateChannels); combinedChannels.addAll(publicChannels); return new Channels(combinedChannels); } } ); }
Source:
public static List<ITmfStateInterval> queryHistoryRange(ITmfStateSystem ss, int attributeQuark, long t1, long t2, long resolution, @Nullable IProgressMonitor monitor) throws AttributeNotFoundException, StateSystemDisposedException { List<ITmfStateInterval> intervals = new LinkedList<>(); Iterator<ITmfStateInterval> iter = getIteratorOverQuark(ss, attributeQuark, t1, t2); while (iter.hasNext()) { if (monitor != null && monitor.isCanceled()) { return intervals; } intervals.add(iter.next()); } return intervals; }

Target:
public static List<ITmfStateInterval> queryHistoryRange(ITmfStateSystem ss, int attributeQuark, long t1, long t2, long resolution, @Nullable IProgressMonitor monitor) throws AttributeNotFoundException, StateSystemDisposedException { List<ITmfStateInterval> intervals = new LinkedList<>(); ITmfStateInterval currentInterval = null; long ts, tEnd; if (t2 < t1 || resolution <= 0) { throw new TimeRangeException(ss.getSSID() + " Start:" + t1 + ", End:" + t2 + ", Resolution:" + resolution); } if (t2 > ss.getCurrentEndTime()) { tEnd = ss.getCurrentEndTime(); } else { tEnd = t2; } IProgressMonitor mon = monitor; if (mon == null) { mon = new NullProgressMonitor(); } for (ts = t1; ts <= tEnd; ts += ((currentInterval.getEndTime() - ts) / resolution + 1) * resolution) { if (mon.isCanceled()) { return intervals; } currentInterval = ss.querySingleState(ts, attributeQuark); intervals.add(currentInterval); } if (currentInterval != null && currentInterval.getEndTime() < tEnd) { currentInterval = ss.querySingleState(tEnd, attributeQuark); intervals.add(currentInterval); } return intervals; }
Source:
public boolean equals(final Object that) { return this == that || ResponseOf.class.equals(that.getClass()); }

Target:
public boolean equals(final Object that) { return new Unchecked<>( new Or( () -> this == that, new And( () -> that != null, () -> ResponseOf.class.equals(that.getClass()), () -> { final ResponseOf other = (ResponseOf) that; return new And( () -> { final Iterator<String> iter = other.head() .iterator(); return new And( (String hdr) -> hdr.equals(iter.next()), this.head() ).value(); }, () -> new Equality<>( new BytesOf(this.body()), new BytesOf(other.body()) ).value() == 0 ).value(); } ) ) ).value(); }
Source:
protected boolean isHoliday(final HolidaySearchRequest request, final LocalDate dateToCheck) { ArgumentChecker.notNull(request, "request"); ArgumentChecker.notNull(dateToCheck, "dateToCheck"); if (isWeekend(dateToCheck)) { return true; } if (_cacheHolidayCalendars) { ImmutableSet<LocalDate> cachedDates = _cachedHolidays.get(request); if (cachedDates != null) { if (cachedDates.isEmpty()) { return false; } return cachedDates.contains(dateToCheck); } HolidayDocument doc = getMaster().search(request).getFirstDocument(); HolidaySearchRequest cacheKey = request.clone(); if (doc == null) { _cachedHolidays.put(cacheKey, EMPTY); } else { _cachedHolidays.put(cacheKey, ImmutableSet.copyOf(doc.getHoliday().getHolidayDates())); } return isHoliday(doc, dateToCheck); } request.setDateToCheck(dateToCheck); HolidayDocument doc = getMaster().search(request).getFirstDocument(); return isHoliday(doc, dateToCheck); }

Target:
protected boolean isHoliday(final HolidaySearchRequest request, final LocalDate dateToCheck) { ArgumentChecker.notNull(request, "request"); ArgumentChecker.notNull(dateToCheck, "dateToCheck"); if (isWeekend(dateToCheck)) { return true; } if (_cacheHolidayCalendars) { ImmutableSet<LocalDate> cachedDates = _cachedHolidays.get(request); if (cachedDates != null) { return cachedDates.contains(dateToCheck); } HolidayDocument doc = getMaster().search(request).getFirstDocument(); HolidaySearchRequest cacheKey = request.clone(); if (doc == null) { _cachedHolidays.put(cacheKey, EMPTY); } else { _cachedHolidays.put(cacheKey, ImmutableSet.copyOf(doc.getHoliday().getHolidayDates())); } return isHoliday(doc, dateToCheck); } request.setDateToCheck(dateToCheck); HolidayDocument doc = getMaster().search(request).getFirstDocument(); return isHoliday(doc, dateToCheck); }
Source:
public synchronized void doConfigExecutorsSubmit( StaplerRequest req, StaplerResponse rsp ) throws IOException, ServletException, FormException { checkPermission(ADMINISTER); BulkChange bc = new BulkChange(this); try { JSONObject json = req.getSubmittedForm(); MasterBuildConfiguration mbc = ExtensionList.lookupSingleton(MasterBuildConfiguration.class); mbc.configure(req,json); getNodeProperties().rebuild(req, json.optJSONObject("nodeProperties"), NodeProperty.all()); } finally { bc.commit(); } updateComputerList(); rsp.sendRedirect(req.getContextPath()+'/'+toComputer().getUrl()); }

Target:
public synchronized void doConfigExecutorsSubmit( StaplerRequest req, StaplerResponse rsp ) throws IOException, ServletException, FormException { checkPermission(ADMINISTER); BulkChange bc = new BulkChange(this); try { JSONObject json = req.getSubmittedForm(); ExtensionList.lookupSingleton(MasterBuildConfiguration.class).configure(req,json); getNodeProperties().rebuild(req, json.optJSONObject("nodeProperties"), NodeProperty.all()); } finally { bc.commit(); } updateComputerList(); rsp.sendRedirect(req.getContextPath()+'/'+toComputer().getUrl()); }