auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected ImageDescriptor decorateImage(ImageDescriptor baseImage, Object element) { if (!(element instanceof IFile)) { return super.decorateImage(baseImage, element); } IPath elementPath = new Path(repositoryMapping .getRepoRelativePath((IFile) element)); if (leftOnlyPaths.contains(elementPath)) { return UIIcons.ELCL16_ADD; } if (rightOnly.contains(elementPath)) { return UIIcons.ELCL16_DELETE; } if (equalContentPaths.contains(elementPath)) { return UIIcons.ELCL16_SYNCED; } return super.decorateImage(baseImage, element); }

Target:
protected ImageDescriptor decorateImage(ImageDescriptor baseImage, Object element) { if (!(element instanceof IFile)) { return super.decorateImage(baseImage, element); } IPath elementPath = new Path(repositoryMapping .getRepoRelativePath((IFile) element)); if (addedPaths.contains(elementPath)) { return UIIcons.ELCL16_ADD; } if (deletedPaths.contains(elementPath)) { return UIIcons.ELCL16_DELETE; } if (equalContentPaths.contains(elementPath)) { return UIIcons.ELCL16_SYNCED; } return super.decorateImage(baseImage, element); }
Source:
public void setUp() { final LocalizedMessage message1 = new LocalizedMessage(10, 51, "messages.properties", null, null, null, LeftCurlyCheck.class, null); final TreeWalkerAuditEvent event1 = new TreeWalkerAuditEvent(null, "Test.java", message1, null); final LocalizedMessage message2 = new LocalizedMessage(12, 30, "messages.properties", null, null, null, RightCurlyCheck.class, null); final TreeWalkerAuditEvent event2 = new TreeWalkerAuditEvent(null, "Test.java", message2, null); final LocalizedMessage message3 = new LocalizedMessage(10, 50, "messages.properties", null, null, null, LeftCurlyCheck.class, null); final TreeWalkerAuditEvent event3 = new TreeWalkerAuditEvent(null, "Test.java", message3, null); final LocalizedMessage message4 = new LocalizedMessage(10, 51, "messages.properties", null, null, null, LeftCurlyCheck.class, null); final TreeWalkerAuditEvent event4 = new TreeWalkerAuditEvent(null, "TestWrong.java", message4, null); XpathFileGeneratorAstFilter.addEvent(event1); XpathFileGeneratorAstFilter.addEvent(event2); XpathFileGeneratorAstFilter.addEvent(event3); XpathFileGeneratorAstFilter.addEvent(event4); XpathFileGeneratorAstFilter.addQuery("/QUERY/FIRST_CASE"); XpathFileGeneratorAstFilter.addQuery("/QUERY/SECOND_CASE"); XpathFileGeneratorAstFilter.addQuery("/QUERY/THIRD_CASE"); XpathFileGeneratorAstFilter.addQuery("/QUERY/FOURTH_CASE"); }

Target:
public void setUp() throws Exception { final TreeWalkerAuditEvent event1 = createTreeWalkerAuditEvent( "InputXpathFileGeneratorAuditListener.java", 3, 51, TokenTypes.LCURLY, LeftCurlyCheck.class); final TreeWalkerAuditEvent event2 = createTreeWalkerAuditEvent( "InputXpathFileGeneratorAuditListener.java", 15, 5, TokenTypes.METHOD_DEF, MethodParamPadCheck.class); final TreeWalkerAuditEvent event3 = createTreeWalkerAuditEvent( "InputXpathFileGeneratorAuditListener.java", 17, 13, TokenTypes.LITERAL_FOR, NestedForDepthCheck.class); final TreeWalkerAuditEvent event4 = createTreeWalkerAuditEvent( "InputXpathFileGeneratorAuditListener.java", 5, 5, TokenTypes.VARIABLE_DEF, JavadocVariableCheck.class); final XpathFileGeneratorAstFilter astFilter = new XpathFileGeneratorAstFilter(); astFilter.accept(event1); astFilter.accept(event2); astFilter.accept(event3); astFilter.accept(event4); }
Source:
void fetchEvents() { setIsLoading(true); if (Utils.isOnline(getActivity())) { onListLoadMore(1, 0); } else { App.getInstance().getModelCache().getAsync(mCacheKey, false, new ModelCache.CacheListener() { @Override public void onGet(Object item) { if (checkValidCache(item)) { ArrayList<Event> events = (ArrayList<Event>) item; mAdapter.addAll(events); setIsLoading(false); Snackbar snackbar = Snackbar.make(getView(), R.string.cached_content, Snackbar.LENGTH_SHORT); ColoredSnackBar.info(snackbar).show(); } else { App.getInstance().getModelCache().removeAsync(mCacheKey); onNotFound(); } } @Override public void onNotFound(String key) { onNotFound(); } private void onNotFound() { setIsLoading(false); showError(R.string.offline_alert); } }); } }

Target:
void fetchEvents() { setIsLoading(true); if (Utils.isOnline(getActivity())) { loadFirstPage(); } else { App.getInstance().getModelCache().getAsync(mCacheKey, false, new ModelCache.CacheListener() { @Override public void onGet(Object item) { if (checkValidCache(item)) { ArrayList<Event> events = (ArrayList<Event>) item; mAdapter.addAll(events); setIsLoading(false); Snackbar snackbar = Snackbar.make(getView(), R.string.cached_content, Snackbar.LENGTH_SHORT); ColoredSnackBar.info(snackbar).show(); } else { App.getInstance().getModelCache().removeAsync(mCacheKey); onNotFound(); } } @Override public void onNotFound(String key) { onNotFound(); } private void onNotFound() { setIsLoading(false); showError(R.string.offline_alert); } }); } }
Source:
public String toString() { return "CoreIdPool{" + "assigned=" + ids + ", available=" + available + '}'; }

Target:
public synchronized String toString() { return "CpuIdPool{" + "assigned=" + ids + ", available=" + available + '}'; }
Source:
protected ExecutionMediator createExecutionMediator() { if (executionMediatorFactory != null) { return executionMediatorFactory.get(); } return new DefaultExecutionMediator(extensionModel, componentModel, connectionManager, muleContext.getErrorTypeRepository()); }

Target:
protected ExecutionMediator createExecutionMediator() { return new DefaultExecutionMediator(extensionModel, componentModel, connectionManager, muleContext.getErrorTypeRepository()); }
Source:
private boolean match(SCM scm, URIish url) { if (scm instanceof GitSCM) { for (RemoteConfig remoteConfig : ((GitSCM) scm).getRepositories()) { for (URIish urIish : remoteConfig.getURIs()) { if (GitStatus.looselyMatches(urIish, url)) return true; } } } else if (scm instanceof MercurialSCM) { try { URI hgUri = new URI(((MercurialSCM) scm).getSource()); String remote = url.toString(); if (almostMatches(hgUri, remote)) return true; } catch (URISyntaxException ex) { LOGGER.log(Level.SEVERE, "Could not parse jobSource uri " + ex); } } return false; }

Target:
private boolean match(SCM scm, URIish url) { if (scm instanceof GitSCM) { for (RemoteConfig remoteConfig : ((GitSCM) scm).getRepositories()) { for (URIish urIish : remoteConfig.getURIs()) { if (GitStatus.looselyMatches(urIish, url)) { return true; } } } } else if (scm instanceof MercurialSCM) { try { URI hgUri = new URI(((MercurialSCM) scm).getSource()); String remote = url.toString(); if (looselyMatches(hgUri, remote)) { return true; } } catch (URISyntaxException ex) { LOGGER.log(Level.SEVERE, "Could not parse jobSource uri: {0} ", ex); } } return false; }
Source:
public boolean canMatchTrace(ITmfTrace trace) { if (!(trace instanceof CtfTmfTrace)) { return false; } CtfTmfTrace ktrace = (CtfTmfTrace) trace; String[] events = { TcpEventStrings.INET_SOCK_LOCAL_IN, TcpEventStrings.INET_SOCK_LOCAL_OUT }; Set<String> traceEvents = TmfEventTypeCollectionHelper.getEventNames(ktrace.getEventTypeSet()); traceEvents.retainAll(Arrays.asList(events)); return traceEvents.size() > 0; }

Target:
public boolean canMatchTrace(ITmfTrace trace) { if (!(trace instanceof CtfTmfTrace)) { return false; } CtfTmfTrace ktrace = (CtfTmfTrace) trace; Set<String> events = ImmutableSet.of( TcpEventStrings.INET_SOCK_LOCAL_IN, TcpEventStrings.INET_SOCK_LOCAL_OUT ); Set<String> traceEvents = TmfEventTypeCollectionHelper.getEventNames(ktrace.getEventTypes()); traceEvents.retainAll(events); return !traceEvents.isEmpty(); }
Source:
public AcknowledgementType auditLog(LogEventRequestType request, AssertionType assertion) { LOG.debug("Entering AuditRepositoryProxyWebServiceSecured.auditLog(...)"); if (request.getAuditMessage() == null) { LOG.error("Audit Request is null"); } secureRequest.setAuditMessage(request.getAuditMessage()); secureRequest.setDirection(request.getDirection()); secureRequest.setInterface(request.getInterface()); secureRequest.setCommunityId(request.getCommunityId()); try { String url = oProxyHelper.getUrlLocalHomeCommunity(NhincConstants.AUDIT_REPO_SECURE_SERVICE_NAME); if (NullChecker.isNotNullish(url)) { ServicePortDescriptor<AuditRepositoryManagerSecuredPortType> portDescriptor = new AuditRepositorySecuredServicePortDescriptor(); CONNECTClient<AuditRepositoryManagerSecuredPortType> client = CONNECTCXFClientFactory.getInstance() .getCONNECTClientSecured(portDescriptor, url, assertion); synchronized (result) { result = (AcknowledgementType) client.invokePort(AuditRepositoryManagerSecuredPortType.class, "logEvent", secureRequest); } } } catch (Exception e) { LOG.error("Failed to call the web service (" + NhincConstants.AUDIT_REPO_SECURE_SERVICE_NAME + "). An unexpected exception occurred. " + "Exception: " + e.getLocalizedMessage(), e); } LOG.debug("In AuditRepositoryProxyWebServiceSecured.auditLog(...) - completed called to ConnectionManager to retrieve endpoint."); return result; }

Target:
public AcknowledgementType auditLog(LogEventRequestType request, AssertionType assertion) { LOG.debug("Entering AuditRepositoryProxyWebServiceSecured.auditLog(...)"); if (request.getAuditMessage() == null) { LOG.error("Audit Request Message is null"); synchronized (result) { return result; } } else { secureRequest.setAuditMessage(request.getAuditMessage()); } secureRequest.setDirection(request.getDirection()); secureRequest.setInterface(request.getInterface()); secureRequest.setCommunityId(request.getCommunityId()); try { String url = oProxyHelper.getUrlLocalHomeCommunity(NhincConstants.AUDIT_REPO_SECURE_SERVICE_NAME); if (NullChecker.isNotNullish(url)) { ServicePortDescriptor<AuditRepositoryManagerSecuredPortType> portDescriptor = new AuditRepositorySecuredServicePortDescriptor(); CONNECTClient<AuditRepositoryManagerSecuredPortType> client = CONNECTCXFClientFactory.getInstance() .getCONNECTClientSecured(portDescriptor, url, assertion); synchronized (result) { result = (AcknowledgementType) client.invokePort(AuditRepositoryManagerSecuredPortType.class, invokeMethodName, secureRequest); } } } catch (Exception e) { LOG.error("Failed to call the web service (" + NhincConstants.AUDIT_REPO_SECURE_SERVICE_NAME + "). An unexpected exception occurred. " + "Exception: " + e.getLocalizedMessage(), e); } LOG.debug("In AuditRepositoryProxyWebServiceSecured.auditLog(...) - completed called to ConnectionManager to " + "retrieve endpoint."); return result; }
Source:
public void actionPerformed(@NotNull AnActionEvent e, @NotNull Notification notification) { final JFrame parent = WindowManager.getInstance().getFrame(e.getProject()); if (parent == null) { return; } UIUtil.invokeLaterIfNeeded(() -> { final Optional<ServerConnection> connection = getGlobalSettings().getServerConnections().stream().filter(s -> s.getName().equals(connectionName)).findAny(); if (connection.isPresent()) { SonarLintGlobalConfigurable globalConfigurable = new SonarLintGlobalConfigurable(); ShowSettingsUtil.getInstance().editConfigurable(parent, globalConfigurable, () -> globalConfigurable.editNotifications(connection.get())); } else if (e.getProject() != null) { SonarLintConsole.get(e.getProject()).error("Unable to find connection with name: " + connectionName); notification.expire(); } }); }

Target:
public void actionPerformed(@NotNull AnActionEvent e, @NotNull Notification notification) { final JFrame parent = WindowManager.getInstance().getFrame(e.getProject()); if (parent == null) { return; } UIUtil.invokeLaterIfNeeded(() -> { final Optional<ServerConnection> connectionToEditOpt = getGlobalSettings().getServerConnections().stream().filter(s -> s.getName().equals(connectionName)).findAny(); if (connectionToEditOpt.isPresent()) { final ServerConnection connectionToEdit = connectionToEditOpt.get(); final ServerConnectionWizard wizard = ServerConnectionWizard.forNotificationsEdition(connectionToEdit); if (wizard.showAndGet()) { final ServerConnection editedConnection = wizard.getConnection(); final List<ServerConnection> serverConnections = getGlobalSettings().getServerConnections(); serverConnections.set(serverConnections.indexOf(connectionToEdit), editedConnection); register(); } } else if (e.getProject() != null) { SonarLintConsole.get(e.getProject()).error("Unable to find connection with name: " + connectionName); notification.expire(); } }); }
Source:
private void setupCursors() { Dir d = directions[currentDirection]; switch ( d ) { case OUT: groupCursor.outgoing( relationshipCursor ); onRelationship = relationshipCursor.next(); break; case IN: groupCursor.incoming( relationshipCursor ); onRelationship = relationshipCursor.next(); break; case LOOP: groupCursor.loops( relationshipCursor ); onRelationship = relationshipCursor.next(); break; default: throw new IllegalStateException( "Lorem ipsus, Brutus" ); } }

Target:
private void setupCursors() { Dir d = directions[currentDirection]; switch ( d ) { case OUT: groupCursor.outgoing( relationshipCursor ); onRelationship = relationshipCursor.next(); break; case IN: groupCursor.incoming( relationshipCursor ); onRelationship = relationshipCursor.next(); break; case LOOP: groupCursor.loops( relationshipCursor ); onRelationship = relationshipCursor.next(); break; default: throw new IllegalStateException( "Lorem ipsus, Brutus. (could not setup cursor for Dir='" + d + "')" ); } }
Source:
private boolean checkprop(String vcard, String prop) { String lines[] = vcard.split(SEPARATOR); boolean isPresent = false; for (String line : lines) { if (!Character.isWhitespace(line.charAt(0)) && !line.startsWith("=")) { String currentProp = line.split("[;:]")[0]; if (prop.equals(currentProp)) { Log.e(TAG, "bit.prop.equals current prop :" + prop); isPresent = true; return isPresent; } } } return isPresent; }

Target:
private boolean checkprop(String vcard, String prop) { String lines[] = vcard.split(SEPARATOR); boolean isPresent = false; for (String line : lines) { if (!Character.isWhitespace(line.charAt(0)) && !line.startsWith("=")) { String currentProp = line.split("[;:]")[0]; if (prop.equals(currentProp)) { Log.d(TAG, "bit.prop.equals current prop :" + prop); isPresent = true; return isPresent; } } } return isPresent; }
Source:
public SegmentMetadataQuery withFinalizedAnalysisTypes(SegmentMetadataQueryConfig config) { return Druids.SegmentMetadataQueryBuilder .copy(this) .analysisTypes(com.google.common.base.Objects.firstNonNull(analysisTypes, config.getDefaultAnalysisTypes())) .build(); }

Target:
public SegmentMetadataQuery withFinalizedAnalysisTypes(SegmentMetadataQueryConfig config) { if (analysisTypes != null) { return this; } return Druids.SegmentMetadataQueryBuilder .copy(this) .analysisTypes(config.getDefaultAnalysisTypes()) .build(); }
Source:
public OauthAuthenticationResult authenticate(HttpServletRequest httpRequest) { Assert.notNull(httpRequest, "httpRequest argument cannot be null."); Assert.isInstanceOf(javax.servlet.http.HttpServletRequest.class, httpRequest, "The specified httpRequest argument must be an instance of " + HTTP_SERVLET_REQUEST_FQCN); com.stormpath.sdk.impl.http.ServletHttpRequest stmpHttpRequest = new com.stormpath.sdk.impl.http.ServletHttpRequest(httpRequest); return (OauthAuthenticationResult) Applications.oauthRequestAuthenticator(application).authenticate(stmpHttpRequest); }

Target:
public OauthAuthenticationResult authenticate(HttpServletRequest httpRequest) { Assert.notNull(httpRequest, "httpRequest argument cannot be null."); Assert.isInstanceOf(javax.servlet.http.HttpServletRequest.class, httpRequest, "The specified httpRequest argument must be an instance of " + HTTP_SERVLET_REQUEST_FQCN); com.stormpath.sdk.impl.http.ServletHttpRequest stmpHttpRequest = new com.stormpath.sdk.impl.http.ServletHttpRequest(httpRequest); return Applications.oauthRequestAuthenticator(application).authenticate(stmpHttpRequest); }
Source:
void fireChildRead(Http2Frame frame) { assert eventLoop().inEventLoop(); if (!isActive()) { ReferenceCountUtil.release(frame); } else { final RecvByteBufAllocator.Handle allocHandle = unsafe.recvBufAllocHandle(); flowControlledBytes += unsafe.doRead0(frame, allocHandle); if (allocHandle.continueReading()) { if (!readCompletePending) { readCompletePending = true; addChannelToReadCompletePendingQueue(); } } else { unsafe.notifyReadComplete(allocHandle, true); } } }

Target:
void fireChildRead(Http2Frame frame) { assert eventLoop().inEventLoop(); if (!isActive()) { ReferenceCountUtil.release(frame); } else { unsafe.doRead0(frame); if (!readCompletePending) { readCompletePending = true; addChannelToReadCompletePendingQueue(); } } }
Source:
public void loadSymbols() throws IOException { Section symbolsTableSection = null; Section dynamicSymbolSection = null; if (symbols == null) { Section section[] = getSections(Section.SHT_SYMTAB); if (section.length > 0) { symbolsTableSection = section[0]; symbolsTable = loadSymbolsBySection(section[0]); } else { symbolsTable = new Symbol[0]; } section = getSections(Section.SHT_DYNSYM); if (section.length > 0) { dynamicSymbolSection = section[0]; dynamicSymbols = loadSymbolsBySection(section[0]); } else { dynamicSymbols = new Symbol[0]; } if (symbolsTableSection != null) { symbols = symbolsTable; } else if (dynamicSymbolSection != null) { symbols = dynamicSymbols; } } }

Target:
public void loadSymbols() throws IOException { Section symbolsTableSection = null; Section dynamicSymbolSection = null; if (symbols == null) { Section section[] = getSections(Section.SHT_SYMTAB); if (section.length > 0) { symbolsTableSection = section[0]; symbolsTable = loadSymbolsBySection(section[0]); } else { symbolsTableSection = null; symbolsTable = new Symbol[0]; } section = getSections(Section.SHT_DYNSYM); if (section.length > 0) { dynamicSymbolSection = section[0]; dynamicSymbols = loadSymbolsBySection(section[0]); } else { dynamicSymbolSection = null; dynamicSymbols = new Symbol[0]; } if (symbolsTableSection != null) { symbols = symbolsTable; } else if (dynamicSymbolSection != null) { symbols = dynamicSymbols; } } }
Source:
private void processResponseCookies(Map<String, List<String>> headerFields) { if (http.getCookieFile() != null && http.getSaveCookies()) { List<HttpCookie> foundCookies = new LinkedList<>(); for (Map.Entry<String, List<String>> headerField : headerFields.entrySet()) { if (headerField.getValue() == null || headerField.getValue().size() == 0) { continue; } if (headerField.getKey().equalsIgnoreCase(HDR_SET_COOKIE)) { foundCookies.addAll(processCookieHeader(HDR_SET_COOKIE, headerField.getValue())); } else if (headerField.getKey().equalsIgnoreCase(HDR_SET_COOKIE2)) { foundCookies.addAll(processCookieHeader(HDR_SET_COOKIE2, headerField.getValue())); } } if (foundCookies.size() > 0) { cookies.addAll(foundCookies); relevantCookies.addAll(foundCookies); try { NetscapeCookieFile.write(Paths.get(http.getCookieFile()), cookies, baseUrl, new Date()); } catch (IOException e) { LOG.warn("Could not persist received cookies.", e); } } } }

Target:
private void processResponseCookies( Map<String, List<String>> headerFields) { if (http.getCookieFile() != null && http.getSaveCookies()) { List<HttpCookie> foundCookies = new LinkedList<>(); for (Map.Entry<String, List<String>> headerField : headerFields .entrySet()) { if (headerField.getValue() == null || headerField.getValue().size() == 0) { continue; } if (headerField.getKey().equalsIgnoreCase(HDR_SET_COOKIE)) { foundCookies.addAll(processCookieHeader(HDR_SET_COOKIE, headerField.getValue())); } else if (headerField.getKey() .equalsIgnoreCase(HDR_SET_COOKIE2)) { foundCookies.addAll(processCookieHeader(HDR_SET_COOKIE2, headerField.getValue())); } } if (foundCookies.size() > 0) { cookies.addAll(foundCookies); relevantCookies.addAll(foundCookies); try { NetscapeCookieFile.write(Paths.get(http.getCookieFile()), cookies, baseUrl, new Date()); } catch (IOException e) { LOG.warn(JGitText.get().couldNotPersistCookies, e); } } } }
Source:
public Object createOrPropagate(Throwable t) throws Exception { if (checkNotNull(t, "throwable") != null && t.getMessage().contains("Could not find key") && returnValueOnCodeOrNull(t, true, equalTo(404)) != null) { return null; } throw propagate(t); }

Target:
public Object createOrPropagate(Throwable t) throws Exception { if (checkNotNull(t, "throwable") != null && t.getMessage().contains("Key not found") && HttpUtils.contains404(t)) { return null; } throw propagate(t); }
Source:
public boolean schemaExists() throws GoraException { boolean exists = false; try (Statement stmt = connection.createStatement()) { String tableExistsSQL = IgniteSQLBuilder.tableExists(igniteMapping.getTableName()); ResultSet executeQuery = stmt.executeQuery(tableExistsSQL); executeQuery.close(); exists = true; } catch (SQLException ex) { if (ex.getSQLState() != null && ex.getSQLState().equals("42000")) { exists = false; } else { throw new GoraException(ex); } } return exists; }

Target:
public boolean schemaExists() throws GoraException { try (Statement stmt = connection.createStatement()) { String tableExistsSQL = IgniteSQLBuilder.tableExists(igniteMapping.getTableName()); ResultSet executeQuery = stmt.executeQuery(tableExistsSQL); executeQuery.close(); return true; } catch (SQLException ex) { if (ex.getSQLState() != null && ex.getSQLState().equals(IgniteBackendConstants.DEFAULT_IGNITE_TABLE_NOT_EXISTS_CODE)) { return false; } else { throw new GoraException(ex); } } }
Source:
public void testAppDataMetaData() { Client client = generateClient(); Map<String, Object> app = client.getAppData().getAppDataMetaData(); assertEquals(6, app.size()); assertEquals("Bugsnag Android Tests", app.get("name")); assertEquals("com.bugsnag.android.test", app.get("packageName")); assertEquals("1.0", app.get("versionName")); assertNotNull(app.get("memoryUsage")); assertNotNull(app.get("lowMemory")); }

Target:
public void testAppDataMetaData() { Client client = generateClient(); Map<String, Object> app = client.getAppData().getAppDataMetaData(); assertEquals(6, app.size()); assertEquals("Bugsnag Android Tests", app.get("name")); assertEquals("com.bugsnag.android.test", app.get("packageName")); assertEquals("1.0", app.get("versionName")); assertNotNull(app.get("memoryUsage")); assertTrue(app.containsKey("activeScreen")); assertNotNull(app.get("lowMemory")); }
Source:
public HttpResponse doResourceBundle(StaplerRequest request) { String baseName = request.getParameter("baseName"); if (baseName == null) { return HttpResponses.errorJSON("Mandatory parameter 'baseName' not specified."); } String language = request.getParameter("language"); String country = request.getParameter("country"); String variant = request.getParameter("variant"); try { Locale locale = request.getLocale(); if (language != null && country != null && variant != null) { locale = new Locale(language, country, variant); } else if (language != null && country != null) { locale = new Locale(language, country); } else if (language != null) { locale = new Locale(language); } return HttpResponses.okJSON(ResourceBundleUtil.getBundle(baseName, locale)); } catch (MissingResourceException e) { return HttpResponses.errorJSON(e.getMessage(), HttpServletResponse.SC_NOT_FOUND); } catch (Exception e) { return HttpResponses.errorJSON(e.getMessage(), HttpServletResponse.SC_INTERNAL_SERVER_ERROR); } }

Target:
public HttpResponse doResourceBundle(StaplerRequest request) { String baseName = request.getParameter("baseName"); if (baseName == null) { return HttpResponses.errorJSON("Mandatory parameter 'baseName' not specified."); } String language = request.getParameter("language"); String country = request.getParameter("country"); String variant = request.getParameter("variant"); try { Locale locale = request.getLocale(); if (language != null && country != null && variant != null) { locale = new Locale(language, country, variant); } else if (language != null && country != null) { locale = new Locale(language, country); } else if (language != null) { locale = new Locale(language); } return HttpResponses.okJSON(ResourceBundleUtil.getBundle(baseName, locale)); } catch (Exception e) { return HttpResponses.errorJSON(e.getMessage()); } }
Source:
public static int getNeighborIndexAtFace(int pos, EnumFacing facing) { switch (facing) { case DOWN: if ((pos >> renderChunkSizeBit * 2 & renderChunkMaxPos) == 0) { return -1; } return pos - visGraphDY; case UP: if ((pos >> renderChunkSizeBit * 2 & renderChunkMaxPos) == renderChunkMaxPos) { return -1; } return pos + visGraphDY; case NORTH: if ((pos >> renderChunkSizeBit & renderChunkMaxPos) == 0) { return -1; } return pos - visGraphDZ; case SOUTH: if ((pos >> renderChunkSizeBit & renderChunkMaxPos) == renderChunkMaxPos) { return -1; } return pos + visGraphDZ; case WEST: if ((pos >> 0 & renderChunkMaxPos) == 0) { return -1; } return pos - visGraphDX; case EAST: if ((pos >> 0 & renderChunkMaxPos) == renderChunkMaxPos) { return -1; } return pos + visGraphDX; default: return -1; } }

Target:
public static int getNeighborIndexAtFace(int pos, EnumFacing facing) { int x = pos & renderChunkMaxPos; int y = pos >> renderChunkSizeBit * 2 & renderChunkMaxPos; int z = pos >> renderChunkSizeBit & renderChunkMaxPos; switch (facing) { case DOWN: if (y == 0) return -1; return pos - visGraphDY; case UP: if (y == renderChunkMaxPos) return -1; return pos + visGraphDY; case NORTH: if (z == 0) return -1; return pos - visGraphDZ; case SOUTH: if (z == renderChunkMaxPos) return -1; return pos + visGraphDZ; case WEST: if (x == 0) return -1; return pos - visGraphDX; case EAST: if (x == renderChunkMaxPos) return -1; return pos + visGraphDX; default: return -1; } }
Source:
public void testTableScanNodeSymbolMapping() { PlanBuilder builder = new PlanBuilder(new PlanNodeIdAllocator(), metadata); Symbol custkey = builder.symbol("custkey", BIGINT); Symbol orderkey = builder.symbol("orderkey", BIGINT); TableScanNode tableScanNode = builder.tableScan( new TableHandle( new ConnectorId("local"), new TpchTableHandle("local", "orders", TINY_SCALE_FACTOR)), ImmutableMap.of( custkey, new TpchColumnHandle(custkey.getName(), BIGINT), orderkey, new TpchColumnHandle(orderkey.getName(), BIGINT))); SymbolMapper symbolMapper = SymbolMapper.builder() .put(custkey, orderkey) .put(orderkey, A) .build(); TableScanNode mappedTopNNode = symbolMapper.map(tableScanNode); assertEquals(mappedTopNNode.getOutputSymbols(), singletonList(A)); }

Target:
public void testTableScanNodeSymbolMapping() { PlanBuilder builder = new PlanBuilder(new PlanNodeIdAllocator(), metadata); Symbol custkey = builder.symbol("custkey"); Symbol orderkey = builder.symbol("orderkey"); TableScanNode tableScanNode = builder.tableScan( new TableHandle( new ConnectorId("local"), new TpchTableHandle("local", "orders", TINY_SCALE_FACTOR)), ImmutableList.of(custkey, orderkey), ImmutableMap.of( custkey, new TpchColumnHandle(custkey.getName(), BIGINT), orderkey, new TpchColumnHandle(orderkey.getName(), BIGINT)), custkey.toSymbolReference()); SymbolMapper symbolMapper = SymbolMapper.builder() .put(custkey, orderkey) .put(orderkey, A) .build(); TableScanNode mappedTopNNode = symbolMapper.map(tableScanNode); assertEquals(mappedTopNNode.getOutputSymbols(), singletonList(A)); assertEquals(mappedTopNNode.getOriginalConstraint(), A.toSymbolReference()); }
Source:
public void shouldValidateOnBudgetTotalForTrueParam() { configureParameterServiceForSuspensionCheck(new Boolean(true)); assertTrue(suspensionCategory.shouldValidateOnBudgetTotal()); }

Target:
public void shouldValidateOnBudgetTotalForTrueParam() { configureParameterServiceForSuspensionCheck(Boolean.TRUE); assertTrue(suspensionCategory.shouldValidateOnBudgetTotal()); }
Source:
protected void gatherOrderExprs( Blackboard bb, SqlSelect select, SqlNodeList orderList, List<SqlNode> extraOrderExprs, List<RelFieldCollation> collationList) { assert bb.root != null : "precondition: child != null"; assert select != null; if (orderList == null) { return; } if (!config.isKeepSortInSubQuery() && !bb.top) { SqlNode offset = select.getOffset(); if ((offset == null || (offset instanceof SqlLiteral && ((SqlLiteral) offset).bigDecimalValue() .equals(BigDecimal.ZERO))) && select.getFetch() == null) { return; } } for (SqlNode orderItem : orderList) { collationList.add( convertOrderItem(select, orderItem, extraOrderExprs, RelFieldCollation.Direction.ASCENDING, RelFieldCollation.NullDirection.UNSPECIFIED)); } }

Target:
protected void gatherOrderExprs( Blackboard bb, SqlSelect select, SqlNodeList orderList, List<SqlNode> extraOrderExprs, List<RelFieldCollation> collationList) { assert bb.root != null : "precondition: child != null"; assert select != null; if (orderList == null) { return; } if (removeSortInSubquery(bb.top)) { SqlNode offset = select.getOffset(); if ((offset == null || (offset instanceof SqlLiteral && ((SqlLiteral) offset).bigDecimalValue() .equals(BigDecimal.ZERO))) && select.getFetch() == null) { return; } } for (SqlNode orderItem : orderList) { collationList.add( convertOrderItem(select, orderItem, extraOrderExprs, RelFieldCollation.Direction.ASCENDING, RelFieldCollation.NullDirection.UNSPECIFIED)); } }
Source:
private void performPaymentWorksDisapprovalCancelProcessingForVendor(VendorDetail vendorDetail, String kfsDocumentNumber, String maintenanceAction) { if (isExistingPaymentWorksVendor(kfsDocumentNumber) && (isMaintenanceActionNewOrNewWithExisting(maintenanceAction))) { getPaymentWorksBatchUtilityService().registerKfsPvenDisapprovalForExistingPaymentWorksVendor(kfsDocumentNumber, vendorDetail); } }

Target:
private void performPaymentWorksDisapprovalCancelProcessingForVendor(VendorDetail vendorDetail, String kfsDocumentNumber, String maintenanceAction) { if (isExistingPaymentWorksVendor(kfsDocumentNumber) && (isMaintenanceActionNewOrNewWithExisting(maintenanceAction))) { getPaymentWorksBatchUtilityService().registerKfsPvenDisapprovalForExistingPaymentWorksVendor(kfsDocumentNumber, vendorDetail); } else { LOG.info("performPaymentWorksDisapprovalCancelProcessingForVendor: No PVEN Disapproval processing performed for PMW because not existing PMW vendor with maintenance action currently being tracked for PMW."); } }
Source:
public void onNext(T t) { if (done) { return; } long i = index; UnicastProcessor<T> w = window; if (i == 0) { getAndIncrement(); w = UnicastProcessor.<T>create(bufferSize, this); window = w; actual.onNext(w); } i++; if (w != null) { w.onNext(t); } if (i == size) { window = null; assert w != null; w.onComplete(); } if (i == skip) { index = 0; } else { index = i; } }

Target:
public void onNext(T t) { if (done) { return; } long i = index; UnicastProcessor<T> w = window; if (i == 0) { getAndIncrement(); w = UnicastProcessor.<T>create(bufferSize, this); window = w; actual.onNext(w); } i++; if (w != null) { w.onNext(t); } if (i == size) { window = null; w.onComplete(); } if (i == skip) { index = 0; } else { index = i; } }
Source:
public static SimplePriceIndexValues of( PriceIndex index, LocalDate valuationDate, NodalCurve curve, LocalDateDoubleTimeSeries fixings, DoubleArray seasonality) { ArgChecker.isFalse(curve instanceof SeasonalNodalCurve, "curve shoudl not be adjusted twice for seasonality"); YearMonth lastMonth = YearMonth.from(fixings.getLatestDate()); double nbMonth = YearMonth.from(valuationDate).until(lastMonth, MONTHS); DoubleArray x = curve.getXValues(); ArgChecker.isTrue(nbMonth < x.get(0), "The first estimation month should be after the last known index fixing"); SeasonalNodalCurve seasonalCurve = SeasonalNodalCurve .of(curve, valuationDate, lastMonth, nbMonth, SeasonalityDefinition.of(seasonality, ShiftType.SCALED)); return new SimplePriceIndexValues(index, valuationDate, seasonalCurve, fixings, seasonality); }

Target:
public static SimplePriceIndexValues of( PriceIndex index, LocalDate valuationDate, NodalCurve curve, LocalDateDoubleTimeSeries fixings, DoubleArray seasonality) { ArgChecker.isFalse(curve instanceof InflationNodalCurve, "Curve cannot be adjusted twice for seasonality"); YearMonth lastMonth = YearMonth.from(fixings.getLatestDate()); double nbMonth = YearMonth.from(valuationDate).until(lastMonth, MONTHS); DoubleArray x = curve.getXValues(); ArgChecker.isTrue(nbMonth < x.get(0), "The first estimation month should be after the last known index fixing"); InflationNodalCurve seasonalCurve = InflationNodalCurve.of( curve, valuationDate, lastMonth, nbMonth, SeasonalityDefinition.of(seasonality, ShiftType.SCALED)); return new SimplePriceIndexValues(index, valuationDate, seasonalCurve, fixings, seasonality); }
Source:
public MeasurementFilter getDefaultMeasurementFilter() throws IOException { if (defaultMeasurementFilter != null) { return defaultMeasurementFilter; } if (!prototypeFilterPath.isEmpty()) { defaultMeasurementFilter = PrototypeMeasurementFilter.loadFromPath( prototypeFilterPath); } else { defaultMeasurementFilter = new TagMeasurementFilter( meterNameRegex, tagNameRegex, tagValueRegex); } return defaultMeasurementFilter; }

Target:
public Predicate<Measurement> getDefaultMeasurementFilter() throws IOException { if (defaultMeasurementFilter != null) { return defaultMeasurementFilter; } if (!prototypeFilterPath.isEmpty()) { defaultMeasurementFilter = PrototypeMeasurementFilter.loadFromPath( prototypeFilterPath); } else { defaultMeasurementFilter = ALL_MEASUREMENTS_FILTER; } return defaultMeasurementFilter; }
Source:
<T> T clientSetup(Function<HttpPipeline, T> clientBuilder) { TokenCredential credential; if (interceptorManager.isPlaybackMode()) { credential = resource -> Mono.just(new AccessToken("Some fake token", OffsetDateTime.now(ZoneOffset.UTC).plus(Duration.ofMinutes(30)))); } else { credential = new DefaultAzureCredentialBuilder().build(); } HttpClient httpClient; final List<HttpPipelinePolicy> policies = new ArrayList<>(); policies.add(new UserAgentPolicy(null, AzureKeyVaultConfiguration.SDK_NAME, AzureKeyVaultConfiguration.SDK_VERSION, Configuration.getGlobalConfiguration().clone(), SecretServiceVersion.getLatest())); HttpPolicyProviders.addBeforeRetryPolicies(policies); policies.add(new RetryPolicy()); policies.add(new BearerTokenAuthenticationPolicy(credential, SecretAsyncClient.KEY_VAULT_SCOPE)); policies.addAll(policies); HttpPolicyProviders.addAfterRetryPolicies(policies); policies.add(new HttpLoggingPolicy(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BODY_AND_HEADERS))); if (interceptorManager.isPlaybackMode()) { httpClient = interceptorManager.getPlaybackClient(); policies.add(interceptorManager.getRecordPolicy()); } else { httpClient = new NettyAsyncHttpClientBuilder().wiretap(true).build(); policies.add(interceptorManager.getRecordPolicy()); } HttpPipeline pipeline = new HttpPipelineBuilder() .policies(policies.toArray(new HttpPipelinePolicy[0])) .httpClient(httpClient) .build(); T client; client = clientBuilder.apply(pipeline); return Objects.requireNonNull(client); }

Target:
<T> T clientSetup(Function<HttpPipeline, T> clientBuilder) { TokenCredential credential; if (interceptorManager.isPlaybackMode()) { credential = resource -> Mono.just(new AccessToken("Some fake token", OffsetDateTime.now(ZoneOffset.UTC).plus(Duration.ofMinutes(30)))); } else { credential = new DefaultAzureCredentialBuilder().build(); } HttpClient httpClient; final List<HttpPipelinePolicy> policies = new ArrayList<>(); policies.add(new UserAgentPolicy(AzureKeyVaultConfiguration.SDK_NAME, AzureKeyVaultConfiguration.SDK_VERSION, Configuration.getGlobalConfiguration().clone(), SecretServiceVersion.getLatest())); HttpPolicyProviders.addBeforeRetryPolicies(policies); policies.add(new RetryPolicy()); policies.add(new BearerTokenAuthenticationPolicy(credential, SecretAsyncClient.KEY_VAULT_SCOPE)); policies.addAll(policies); HttpPolicyProviders.addAfterRetryPolicies(policies); policies.add(new HttpLoggingPolicy(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BODY_AND_HEADERS))); if (interceptorManager.isPlaybackMode()) { httpClient = interceptorManager.getPlaybackClient(); policies.add(interceptorManager.getRecordPolicy()); } else { httpClient = new NettyAsyncHttpClientBuilder().wiretap(true).build(); policies.add(interceptorManager.getRecordPolicy()); } HttpPipeline pipeline = new HttpPipelineBuilder() .policies(policies.toArray(new HttpPipelinePolicy[0])) .httpClient(httpClient) .build(); T client; client = clientBuilder.apply(pipeline); return Objects.requireNonNull(client); }
Source:
public void testGetLowerUnboundSplits() throws Throwable { long ts = nextTimestamp(); initTableValues(ts); String url = getUrl() + ";" + PhoenixRuntime.CURRENT_SCN_ATTRIB + "=" + ts; Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES); Connection conn = DriverManager.getConnection(url, props); PreparedStatement stmt = conn.prepareStatement("ANALYZE STABLE"); stmt.execute(); conn.close(); conn = DriverManager.getConnection(url, props); conn.createStatement().executeQuery("SELECT * FROM STABLE"); Scan scan = new Scan(); scan.setStartRow(HConstants.EMPTY_START_ROW); scan.setStopRow(K1); List<KeyRange> keyRanges = getSplits(conn, ts, scan); assertEquals("Unexpected number of splits: " + keyRanges, 1, keyRanges.size()); }

Target:
public void testGetLowerUnboundSplits() throws Throwable { long ts = nextTimestamp(); initTableValues(ts); String url = getUrl() + ";" + PhoenixRuntime.CURRENT_SCN_ATTRIB; Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES); Connection conn = DriverManager.getConnection(url, props); PreparedStatement stmt = conn.prepareStatement("ANALYZE STABLE"); stmt.execute(); conn.createStatement().executeQuery("SELECT * FROM STABLE"); conn.close(); Scan scan = new Scan(); scan.setStartRow(HConstants.EMPTY_START_ROW); scan.setStopRow(K1); List<KeyRange> keyRanges = getSplits(conn, ts, scan); assertEquals("Unexpected number of splits: " + keyRanges, 2, keyRanges.size()); assertEquals(newKeyRange(KeyRange.UNBOUND, KMIN), keyRanges.get(0)); assertEquals(newKeyRange(KMIN, K3), keyRanges.get(1)); }
Source:
private void removeInvalidRefs() { LOG.debug("removeInvalidRefs()"); ArrayList<WeakReference<PluginRepository>> copy = new ArrayList<>(prs); for(WeakReference<PluginRepository> ref: copy) { if(ref.get() == null) { prs.remove(ref); } } LOG.debug("removed "+(copy.size()-prs.size())+" references, remaining "+prs.size()); }

Target:
private void removeInvalidRefs() { LOG.debug("removeInvalidRefs()"); ArrayList<WeakReference<PluginRepository>> copy = new ArrayList<>(prs); for(WeakReference<PluginRepository> ref: copy) { if(ref.get() == null) { prs.remove(ref); } } LOG.debug("removed references, remaining {}", copy.size()-prs.size(), prs.size()); }
Source:
public void install() { final VDS host = getSelectedItem(); InstallModel model = new InstallModel(); model.setVds(host); setWindow(model); model.setTitle(ConstantsManager.getInstance().getConstants().installHostTitle()); model.setHelpTag(HelpTag.install_host); model.setHashName("install_host"); model.getOVirtISO().setIsAvailable(false); model.getOverrideIpTables().setIsAvailable(false); model.getHostVersion().setEntity(host.getHostOs()); model.getHostVersion().setIsAvailable(false); getWindow().startProgress(); model.getUserPassword().setIsAvailable(true); model.getUserPassword().setIsChangeable(true); model.getOverrideIpTables().setIsAvailable(true); model.getOverrideIpTables().setEntity(true); model.getActivateHostAfterInstall().setEntity(true); if(host.getClusterSupportsGlusterService()) { model.getReconfigureGluster().setIsAvailable(true); } else { model.getReconfigureGluster().setIsAvailable(false); } model.getReconfigureGluster().setEntity(model.getReconfigureGluster().getEntity()); addInstallCommands(model, host, false); getWindow().stopProgress(); }

Target:
public void install() { final VDS host = getSelectedItem(); InstallModel model = new InstallModel(); model.setVds(host); setWindow(model); model.setTitle(ConstantsManager.getInstance().getConstants().installHostTitle()); model.setHelpTag(HelpTag.install_host); model.setHashName("install_host"); model.getOVirtISO().setIsAvailable(false); model.getOverrideIpTables().setIsAvailable(false); model.getHostVersion().setEntity(host.getHostOs()); model.getHostVersion().setIsAvailable(false); getWindow().startProgress(); model.getUserPassword().setIsAvailable(true); model.getUserPassword().setIsChangeable(true); model.getOverrideIpTables().setIsAvailable(true); model.getOverrideIpTables().setEntity(true); model.getActivateHostAfterInstall().setEntity(true); if(host.getClusterSupportsGlusterService()) { model.getReconfigureGluster().setIsAvailable(true); } else { model.getReconfigureGluster().setIsAvailable(false); } addInstallCommands(model, host, false); getWindow().stopProgress(); }
Source:
protected IValidationError decorate(IValidationError error, IValidatable<Date> validatable) { error = super.decorate(error, validatable); if (error instanceof ValidationError) { ValidationError ve = (ValidationError) error; ve.setVariable("inputdate", validatable.getValue()); if (format != null) { WebSession session = WebSession.get(); Locale locale = session.getLocale(); if (locale == null) { locale = Locale.getDefault(Locale.Category.FORMAT); } SimpleDateFormat sdf = new SimpleDateFormat(format, locale); if (getMinimum() != null) { ve.setVariable("minimum", sdf.format(getMinimum())); } if (getMaximum() != null) { ve.setVariable("maximum", sdf.format(getMaximum())); } ve.setVariable("inputdate", sdf.format(validatable.getValue())); } } return error; }

Target:
protected IValidationError decorate(IValidationError error, IValidatable<Date> validatable) { error = super.decorate(error, validatable); if (error instanceof ValidationError) { ValidationError ve = (ValidationError) error; ve.setVariable("inputdate", validatable.getValue()); if (format != null) { Locale locale; if (Session.exists()) { Session session = Session.get(); locale = session.getLocale(); if (locale == null) { locale = Locale.getDefault(Locale.Category.FORMAT); } } else { locale = Locale.getDefault(Locale.Category.FORMAT); } SimpleDateFormat sdf = new SimpleDateFormat(format, locale); if (getMinimum() != null) { ve.setVariable("minimum", sdf.format(getMinimum())); } if (getMaximum() != null) { ve.setVariable("maximum", sdf.format(getMaximum())); } ve.setVariable("inputdate", sdf.format(validatable.getValue())); } } return error; }
Source:
public void publishSegment(DataSegment segment) throws IOException { if (taskToolbox.getTaskActionClient().submit(new SetLockCriticalStateAction(segment.getInterval(), TaskLockCriticalState.UPGRADE))) { taskToolbox.publishSegments(ImmutableList.of(segment)); } else { throw new ISE( "WTF?! Lock upgrade failed for interval [%s] for RealtimeIndex Task !! This is really bad !! Is there a higher priority task running ?", segment.getInterval() ); } }

Target:
public void publishSegment(DataSegment segment) throws IOException { if (taskToolbox.getTaskActionClient().submit(new SetLockCriticalStateAction(segment.getInterval(), TaskLockCriticalState.UPGRADE))) { taskToolbox.publishSegments(ImmutableList.of(segment)); } else { throw new ISE( "WTF?! Lock upgrade failed for interval [%s] ! Is there a higher priority task running ?", segment.getInterval() ); } }
Source:
public boolean setLeashHolder(Entity holder) { if (this instanceof EnderDragon || this instanceof Wither || this instanceof Player || this instanceof Bat) { return false; } if (this.leashHolder != null) { this.leashHolder.leashedEntities.remove(this); } if (holder == null) { this.leashHolder = null; leashHolderChanged = true; return true; } if (holder.isDead()) { return false; } this.leashHolder = (GlowEntity) holder; this.leashHolder.leashedEntities.add(this); leashHolderChanged = true; return true; }

Target:
public boolean setLeashHolder(Entity holder) { if (!GlowLeashHitch.isAllowedLeashHolder(this.getType())) { return false; } if (this.leashHolder != null) { this.leashHolder.leashedEntities.remove(this); } if (holder == null) { this.leashHolder = null; leashHolderChanged = true; return true; } if (holder.isDead()) { return false; } this.leashHolder = (GlowEntity) holder; this.leashHolder.leashedEntities.add(this); leashHolderChanged = true; return true; }
Source:
public CompletableFuture<Void> shutdownDispatching() { return shutdownLatch.await(); }

Target:
public CompletableFuture<Void> shutdownDispatching() { commandProcessor.removeLocalSubscriptions(); return shutdownLatch.initiateShutdown(); }
Source:
public void postOpen(final ObserverContext<RegionCoprocessorEnvironment> c) { if (this.disabled) { super.postOpen(c); return; } if (this.stopped) { initBuilderAndWriter(c.getEnvironment()); } long start = EnvironmentEdgeManager.currentTimeMillis(); Multimap<HTableInterfaceReference, Mutation> updates = failedIndexEdits.getEdits(c.getEnvironment().getRegion()); try { if (updates == null || updates.size() == 0) { return; } LOGGER.info("Found some outstanding index updates that didn't succeed during" + " WAL replay - attempting to replay now."); try { writer.writeAndHandleFailure(updates, true, ScanUtil.UNKNOWN_CLIENT_VERSION); } catch (IOException e) { LOGGER.error("During WAL replay of outstanding index updates, " + "Exception is thrown instead of killing server during index writing", e); } } finally { long duration = EnvironmentEdgeManager.currentTimeMillis() - start; if (duration >= slowPostOpenThreshold) { if (LOGGER.isDebugEnabled()) { LOGGER.debug(getCallTooSlowMessage("postOpen", duration, slowPostOpenThreshold)); } metricSource.incrementNumSlowPostOpenCalls(); } metricSource.updatePostOpenTime(duration); } }

Target:
public void postOpen(final ObserverContext<RegionCoprocessorEnvironment> c) { if (this.disabled) { super.postOpen(c); return; } if (this.stopped) { try { initBuilderAndWriter(c.getEnvironment()); } catch (IOException e) { LOG.error("Init builder and writer failed", e); } } long start = EnvironmentEdgeManager.currentTimeMillis(); Multimap<HTableInterfaceReference, Mutation> updates = failedIndexEdits.getEdits(c.getEnvironment().getRegion()); try { if (updates == null || updates.size() == 0) { return; } LOGGER.info("Found some outstanding index updates that didn't succeed during" + " WAL replay - attempting to replay now."); try { writer.writeAndHandleFailure(updates, true, ScanUtil.UNKNOWN_CLIENT_VERSION); } catch (IOException e) { LOGGER.error("During WAL replay of outstanding index updates, " + "Exception is thrown instead of killing server during index writing", e); } } finally { long duration = EnvironmentEdgeManager.currentTimeMillis() - start; if (duration >= slowPostOpenThreshold) { if (LOGGER.isDebugEnabled()) { LOGGER.debug(getCallTooSlowMessage("postOpen", duration, slowPostOpenThreshold)); } metricSource.incrementNumSlowPostOpenCalls(); } metricSource.updatePostOpenTime(duration); } }
Source:
protected boolean canDoAction() { String sshPublicKey = getParameters().getUserProfile().getSshPublicKey(); if (sshPublicKey == null || sshPublicKey.isEmpty()) { log.info("Provided SSH key for user '{}'", (sshPublicKey == null) ?"null" :"empty", getUserId().toString()); return true; } if (!OpenSSHUtils.isPublicKeyValid(sshPublicKey)) { log.warn("Provided invalid SSH key for user '{}'", getUserId().toString()); return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_INVALID_PUBLIC_SSH_KEY); } log.info("Provided valid SSH key for user '{}'", getUserId().toString()); return true; }

Target:
protected boolean canDoAction() { String sshPublicKey = getParameters().getUserProfile().getSshPublicKey(); if (sshPublicKey == null || sshPublicKey.isEmpty()) { return true; } if (!OpenSSHUtils.isPublicKeyValid(sshPublicKey)) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_INVALID_PUBLIC_SSH_KEY); } return true; }
Source:
public void handlePut(ActionParameters params) throws ActionException { checkForAdminPermission(params); final MaplayerGroup maplayerGroup = new MaplayerGroup(); populateFromRequest(params, maplayerGroup); final int id = oskariMapLayerGroupService.insert(maplayerGroup); final MaplayerGroup savedMapLayerGroup = oskariMapLayerGroupService.find(id); ResponseHelper.writeResponse(params, savedMapLayerGroup.getAsJSON()); }

Target:
public void handlePut(ActionParameters params) throws ActionException { params.requireAdminUser(); MaplayerGroup maplayerGroup = populateFromRequest(params.getPayLoadJSON()); if(!isAllowedGroupDepth(maplayerGroup)) { throw new ActionParamsException("Maximum group depth is 3"); } final int id = oskariMapLayerGroupService.insert(maplayerGroup); final MaplayerGroup savedMapLayerGroup = oskariMapLayerGroupService.find(id); ResponseHelper.writeResponse(params, savedMapLayerGroup.getAsJSON()); }