auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testSimpleIntrospectionHandler() throws Exception { final Injector injector = Initialization.makeInjectorWithModules( GuiceInjectors.makeStartupInjector(), ImmutableList.of( new Module() { @Override public void configure(Binder binder) { JsonConfigProvider.bindInstance( binder, Key.get(DruidNode.class, Self.class), new DruidNode("test-inject", null, null, null, new ServerConfig()) ); } } ) ); final ObjectMapper mapper = injector.getInstance(Key.get(ObjectMapper.class, Json.class)); mapper.registerSubtypes(NamespaceLookupExtractorFactory.class); final String str = "{ \"type\": \"cachedNamespace\", \"extractionNamespace\": { \"type\": \"staticMap\", \"map\": {\"foo\":\"bar\"} }, \"firstCacheTimeout\":10000 }"; final LookupExtractorFactory lookupExtractorFactory = mapper.readValue(str, LookupExtractorFactory.class); Assert.assertTrue(lookupExtractorFactory.start()); try { final LookupIntrospectHandler handler = lookupExtractorFactory.getIntrospectHandler(); Assert.assertNotNull(handler); final Class<? extends LookupIntrospectHandler> clazz = handler.getClass(); Assert.assertNotNull(clazz.getMethod("getVersion").invoke(handler)); Assert.assertEquals(ImmutableSet.of("foo"), ((Response) clazz.getMethod("getKeys").invoke(handler)).getEntity()); Assert.assertEquals( ImmutableSet.of("bar"), ((Response) clazz.getMethod("getValues").invoke(handler)).getEntity() ); Assert.assertEquals( ImmutableMap.builder().put("foo", "bar").build(), ((Response) clazz.getMethod("getMap").invoke(handler)).getEntity() ); } finally { Assert.assertTrue(lookupExtractorFactory.close()); } }

Target:
public void testSimpleIntrospectionHandler() throws Exception { final Injector injector = makeInjector(); final ObjectMapper mapper = injector.getInstance(Key.get(ObjectMapper.class, Json.class)); mapper.registerSubtypes(NamespaceLookupExtractorFactory.class); final String str = "{ \"type\": \"cachedNamespace\", \"extractionNamespace\": { \"type\": \"staticMap\", \"map\": {\"foo\":\"bar\"} }, \"firstCacheTimeout\":10000 }"; final LookupExtractorFactory lookupExtractorFactory = mapper.readValue(str, LookupExtractorFactory.class); Assert.assertTrue(lookupExtractorFactory.start()); try { final LookupIntrospectHandler handler = lookupExtractorFactory.getIntrospectHandler(); Assert.assertNotNull(handler); final Class<? extends LookupIntrospectHandler> clazz = handler.getClass(); Assert.assertNotNull(clazz.getMethod("getVersion").invoke(handler)); Assert.assertEquals(ImmutableSet.of("foo"), ((Response) clazz.getMethod("getKeys").invoke(handler)).getEntity()); Assert.assertEquals( ImmutableSet.of("bar"), ((Response) clazz.getMethod("getValues").invoke(handler)).getEntity() ); Assert.assertEquals( ImmutableMap.builder().put("foo", "bar").build(), ((Response) clazz.getMethod("getMap").invoke(handler)).getEntity() ); } finally { Assert.assertTrue(lookupExtractorFactory.close()); } }
Source:
public Token nextToken() throws IOException { if (pushCount > 0) { pushCount--; return token; } else if (upcomingToken.type != Tokenizer.TT_ERROR) { token.assign(upcomingToken); upcomingToken.type = Tokenizer.TT_ERROR; return token; } else { token.init(); char[] chr = new char[1]; while (hasMore()) { read(chr, 1); int symbolIndex = lookupSymbol(chr[0]); if (symbolIndex != -1) { TokenizerToken workToken = token.type == Tokenizer.TT_TOKEN && token.text.length() > 0 ? upcomingToken : token; TokenizerSymbol symbol = (symbols.get(symbolIndex)); boolean hideSymbol = symbol.hidden; if (!hideSymbol) { workToken.init(); workToken.text.append(symbol.startText); workToken.type = Tokenizer.TT_SYMBOL; workToken.name = symbol.name; } if (symbol.tailText != null) { while (hasMore() && !compare(symbol.tailText.toCharArray(), 0)) { read(chr, 1); if (!hideSymbol) { workToken.text.append(chr); workToken.innerText.append(chr); } } if (!hideSymbol) { workToken.text.append(symbol.tailText); } workToken.type = Tokenizer.TT_BLOCK; } if (token.text.length() > 0) { break; } } else { token.text.append(chr); token.type = Tokenizer.TT_TOKEN; } } } return token; }

Target:
public Token nextToken() throws IOException { if (pushCount > 0) { pushCount--; return token; } else if (upcomingToken.type != Tokenizer.TT_ERROR) { token.assign(upcomingToken); upcomingToken.type = Tokenizer.TT_ERROR; return token; } else { token.init(); char[] chr = new char[1]; while (hasMore()) { read(chr, 1); int symbolIndex = lookupSymbol(chr[0]); if (symbolIndex != -1) { TokenizerToken workToken = token.type == Tokenizer.TT_TOKEN && token.text.length() > 0 ? upcomingToken : token; TokenizerSymbol symbol = ((TokenizerSymbol) symbols.get(symbolIndex)); boolean hideSymbol = symbol.hidden; if (!hideSymbol) { workToken.init(); workToken.text.append(symbol.startText); workToken.type = Tokenizer.TT_SYMBOL; workToken.name = symbol.name; } if (symbol.tailText != null) { while (hasMore() && !compare(symbol.tailText.toCharArray(), 0)) { read(chr, 1); if (!hideSymbol) { workToken.text.append(chr); workToken.innerText.append(chr); } } if (!hideSymbol) { workToken.text.append(symbol.tailText); } workToken.type = Tokenizer.TT_BLOCK; } if (token.text.length() > 0) { break; } } else { token.text.append(chr); token.type = Tokenizer.TT_TOKEN; } } } return token; }
Source:
public static Double lineLocatePoint(@SqlType(GEOMETRY_TYPE_NAME) Slice lineSlice, @SqlType(GEOMETRY_TYPE_NAME) Slice pointSlice) { if (lineSlice == null || pointSlice == null) { return null; } Geometry line = JtsGeometrySerde.deserialize(lineSlice); Geometry point = JtsGeometrySerde.deserialize(pointSlice); if (line.isEmpty() || point.isEmpty()) { return null; } GeometryType lineType = getForJtsGeometryType(line.getGeometryType()); if (lineType != LINE_STRING && lineType != MULTI_LINE_STRING) { throw new PrestoException(INVALID_FUNCTION_ARGUMENT, format("First argument to line_locate_point must be a LineString or a MultiLineString. Got: %s", line.getGeometryType())); } GeometryType pointType = getForJtsGeometryType(point.getGeometryType()); if (pointType != POINT) { throw new PrestoException(INVALID_FUNCTION_ARGUMENT, format("Second argument to line_locate_point must be a Point. Got: %s", point.getGeometryType())); } return new LengthIndexedLine(line).indexOf(point.getCoordinate()); }

Target:
public static Double lineLocatePoint(@SqlType(GEOMETRY_TYPE_NAME) Slice lineSlice, @SqlType(GEOMETRY_TYPE_NAME) Slice pointSlice) { Geometry line = JtsGeometrySerde.deserialize(lineSlice); Geometry point = JtsGeometrySerde.deserialize(pointSlice); if (line.isEmpty() || point.isEmpty()) { return null; } GeometryType lineType = getForJtsGeometryType(line.getGeometryType()); if (lineType != LINE_STRING && lineType != MULTI_LINE_STRING) { throw new PrestoException(INVALID_FUNCTION_ARGUMENT, format("First argument to line_locate_point must be a LineString or a MultiLineString. Got: %s", line.getGeometryType())); } GeometryType pointType = getForJtsGeometryType(point.getGeometryType()); if (pointType != POINT) { throw new PrestoException(INVALID_FUNCTION_ARGUMENT, format("Second argument to line_locate_point must be a Point. Got: %s", point.getGeometryType())); } return new LengthIndexedLine(line).indexOf(point.getCoordinate()); }
Source:
public DiffBuilder append(final String fieldName, final Object lhs, final Object rhs) { if (objectsTriviallyEqual) { return this; } if (lhs == rhs) { return this; } Object objectToTest; if (lhs != null) { objectToTest = lhs; } else { objectToTest = rhs; } if (objectToTest.getClass().isArray()) { if (objectToTest instanceof boolean[]) { return append(fieldName, (boolean[]) lhs, (boolean[]) rhs); } if (objectToTest instanceof byte[]) { return append(fieldName, (byte[]) lhs, (byte[]) rhs); } if (objectToTest instanceof char[]) { return append(fieldName, (char[]) lhs, (char[]) rhs); } if (objectToTest instanceof double[]) { return append(fieldName, (double[]) lhs, (double[]) rhs); } if (objectToTest instanceof float[]) { return append(fieldName, (float[]) lhs, (float[]) rhs); } if (objectToTest instanceof int[]) { return append(fieldName, (int[]) lhs, (int[]) rhs); } if (objectToTest instanceof long[]) { return append(fieldName, (long[]) lhs, (long[]) rhs); } if (objectToTest instanceof short[]) { return append(fieldName, (short[]) lhs, (short[]) rhs); } return append(fieldName, (Object[]) lhs, (Object[]) rhs); } if (left != null ? left.equals(right) : right.equals(left)) { return this; } diffs.add(new Diff<Object>(fieldName) { private static final long serialVersionUID = 1L; @Override public Object getLeft() { return lhs; } @Override public Object getRight() { return rhs; } }); return this; }

Target:
public DiffBuilder append(final String fieldName, final Object lhs, final Object rhs) { if (objectsTriviallyEqual) { return this; } if (lhs == rhs) { return this; } Object objectToTest; if (lhs != null) { objectToTest = lhs; } else { objectToTest = rhs; } if (objectToTest.getClass().isArray()) { if (objectToTest instanceof boolean[]) { return append(fieldName, (boolean[]) lhs, (boolean[]) rhs); } if (objectToTest instanceof byte[]) { return append(fieldName, (byte[]) lhs, (byte[]) rhs); } if (objectToTest instanceof char[]) { return append(fieldName, (char[]) lhs, (char[]) rhs); } if (objectToTest instanceof double[]) { return append(fieldName, (double[]) lhs, (double[]) rhs); } if (objectToTest instanceof float[]) { return append(fieldName, (float[]) lhs, (float[]) rhs); } if (objectToTest instanceof int[]) { return append(fieldName, (int[]) lhs, (int[]) rhs); } if (objectToTest instanceof long[]) { return append(fieldName, (long[]) lhs, (long[]) rhs); } if (objectToTest instanceof short[]) { return append(fieldName, (short[]) lhs, (short[]) rhs); } return append(fieldName, (Object[]) lhs, (Object[]) rhs); } if (lhs != null ? lhs.equals(rhs) : rhs.equals(lhs)) { return this; } diffs.add(new Diff<Object>(fieldName) { private static final long serialVersionUID = 1L; @Override public Object getLeft() { return lhs; } @Override public Object getRight() { return rhs; } }); return this; }
Source:
public boolean saveAnswer(FormIndex index, IAnswerData data) throws JavaRosaException { try { return formEntryController.saveAnswer(index, data, true); } catch (Exception e) { Timber.w("Error saving answer of type %s with ref %s for index %s", data.getClass().toString(), index.getReference(), index); throw new JavaRosaException(e); } }

Target:
public boolean saveAnswer(FormIndex index, IAnswerData data) throws JavaRosaException { try { return formEntryController.saveAnswer(index, data, true); } catch (Exception e) { String dataType = data != null ? data.getClass().toString() : null; String ref = index != null ? index.getReference().toString() : null; Timber.w("Error saving answer of type %s with ref %s for index %s", dataType, ref, index); throw new JavaRosaException(e); } }
Source:
public void set(final boolean s) { if (Gerrit.isSignedIn() && s != get()) { final ToggleStarRequest req = new ToggleStarRequest(); req.toggle(cache.getChangeId(), s); com.google.gerrit.client.changes.Util.LIST_SVC.toggleStars(req, new GerritCallback<VoidResult>() { public void onSuccess(final VoidResult result) { setStarred(s); fireEvent(new ValueChangeEvent<Boolean>(s){}); } }); } }

Target:
public void set(final boolean s) { if (Gerrit.isSignedIn() && s != get()) { final ToggleStarRequest req = new ToggleStarRequest(); req.toggle(cache.getChangeId(), s); Util.LIST_SVC.toggleStars(req, new GerritCallback<VoidResult>() { public void onSuccess(final VoidResult result) { setStarred(s); fireEvent(new ValueChangeEvent<Boolean>(s){}); } }); } }
Source:
protected KeySpec engineGetKeySpec(SecretKey secretKey, Class<?> aClass) throws InvalidKeySpecException { if (secretKey == null) { throw new InvalidKeySpecException("Null SecretKey"); } if (aClass == SecretKeySpec.class) { return (KeySpec) secretKey; } else if (aClass == DESedeKeySpec.class) { try { return new DESedeKeySpec(secretKey.getEncoded()); } catch (InvalidKeyException e) { throw new InvalidKeySpecException(e); } } else { throw new InvalidKeySpecException("Unsupported KeySpec class: " + aClass.getName()); } }

Target:
protected KeySpec engineGetKeySpec(SecretKey secretKey, Class<?> aClass) throws InvalidKeySpecException { if (secretKey == null) { throw new InvalidKeySpecException("Null SecretKey"); } if (aClass == SecretKeySpec.class) { if (secretKey instanceof SecretKeySpec) { return (KeySpec) secretKey; } else { return new SecretKeySpec(secretKey.getEncoded(), "DESEDE"); } } else if (aClass == DESedeKeySpec.class) { try { return new DESedeKeySpec(secretKey.getEncoded()); } catch (InvalidKeyException e) { throw new InvalidKeySpecException(e); } } else { throw new InvalidKeySpecException("Unsupported KeySpec class: " + aClass); } }
Source:
Bound(DoubleArray xValues, DoubleArray yValues, BoundCurveInterpolator interpolator) { this.interpolator = (AbstractBoundCurveInterpolator) interpolator; }

Target:
Bound(DoubleArray xValues, DoubleArray yValues, BoundCurveInterpolator interpolator) { ArgChecker.isTrue(interpolator instanceof AbstractBoundCurveInterpolator); this.interpolator = (AbstractBoundCurveInterpolator) interpolator; }
Source:
public void execute(HttpRequest req, HttpResponse resp) throws IOException { Map<String, Object> args = json.toType(req.getContentString(), Json.MAP_TYPE); String file = (String) args.get("file"); File tempDir = session.getFileSystem().createTempDir("upload", "file"); Zip.unzip(file, tempDir); File[] allFiles = tempDir.listFiles(); Response response = new Response(session.getId()); if (allFiles == null || allFiles.length != 1) { response.setStatus(ErrorCodes.UNHANDLED_ERROR); response.setValue(new WebDriverException( "Expected there to be only 1 file. There were: " + (allFiles == null ? 0 : allFiles.length))); } else { Path uploads_dir = Files.createDirectories(tempDir.toPath().getParent().resolve("remote_uploads")); Path dest = uploads_dir.resolve(allFiles[0].getName()); if (Files.exists(dest)){ Path prevFileDir = session.getFileSystem().createTempDir("prevupload", "file").toPath(); Files.move(dest, prevFileDir.resolve(allFiles[0].getName())); } dest = Files.move(allFiles[0].toPath(), dest, REPLACE_EXISTING); response.setStatus(ErrorCodes.SUCCESS); response.setValue(dest.toAbsolutePath().toString()); } session.getDownstreamDialect().getResponseCodec().encode(() -> resp, response); }

Target:
public void execute(HttpRequest req, HttpResponse resp) throws IOException { Map<String, Object> args = json.toType(req.getContentString(), Json.MAP_TYPE); String file = (String) args.get("file"); File tempDir = session.getFileSystem().createTempDir("upload", "file"); Zip.unzip(file, tempDir); File[] allFiles = tempDir.listFiles(); Response response = new Response(session.getId()); if (allFiles == null || allFiles.length != 1) { response.setStatus(ErrorCodes.UNHANDLED_ERROR); response.setValue(new WebDriverException( "Expected there to be only 1 file. There were: " + (allFiles == null ? 0 : allFiles.length))); } else { Path uploadsDir = Files.createDirectories(tempDir.toPath().getParent().resolve("remote_uploads")); Path dest = uploadsDir.resolve(allFiles[0].getName()); if (Files.exists(dest)){ Path prevFileDir = session.getFileSystem().createTempDir("prevupload", "file").toPath(); Files.move(dest, prevFileDir.resolve(allFiles[0].getName())); } dest = Files.move(allFiles[0].toPath(), dest, REPLACE_EXISTING); response.setStatus(ErrorCodes.SUCCESS); response.setValue(dest.toAbsolutePath().toString()); } session.getDownstreamDialect().getResponseCodec().encode(() -> resp, response); }
Source:
public FileUpdateWatcher(String fileName, FileUpdateCallback fileUpdateCb) throws IOException { File file = new File(fileName); if (!file.exists() || file.isDirectory()) { throw new IllegalArgumentException("script file doesn't exist"); } this.fileName = fileName; Path path = Paths.get(file.getParent()); this.callback = fileUpdateCb; watcher = path.getFileSystem().newWatchService(); path.register(watcher, StandardWatchEventKinds.ENTRY_CREATE, StandardWatchEventKinds.ENTRY_MODIFY); final Executor executor = Executors.newSingleThreadExecutor(); executor.execute(new FileWatcherThread()); LOG.info(" started watcher thread"); }

Target:
public FileUpdateWatcher(String fileName, FileUpdateCallback fileUpdateCb) throws IOException { File file = new File(fileName); if (!file.exists() || file.isDirectory()) { throw new IllegalArgumentException(String.format("file %s doesn't exist", fileName)); } this.fileName = fileName; Path path = Paths.get(file.getParent()); this.callback = fileUpdateCb; watcher = path.getFileSystem().newWatchService(); path.register(watcher, StandardWatchEventKinds.ENTRY_CREATE, StandardWatchEventKinds.ENTRY_MODIFY); Thread thread = new Thread(new FileWatcherThread()); thread.setName(String.format("fileUpdateWatcher-%s", file.getName())); thread.start(); LOG.info("started watcher thread for file : {}", file.getName()); }
Source:
public void test_of_Currency() { CurrencyAmount test = CurrencyAmount.of(Currency.USD, A1); assertEquals(test.getCurrency(), Currency.USD); assertEquals(test.getAmount(), A1, 0.0001d); }

Target:
public void test_of_Currency() { CurrencyAmount test = CurrencyAmount.of(Currency.USD, AMT1); assertEquals(test.getCurrency(), Currency.USD); assertEquals(test.getAmount(), AMT1, 0); }
Source:
public static void updateDatabase(Connection dbConnection, String sqlStmt, Object... params) throws UserStoreException { try ( PreparedStatement prepStmt = dbConnection.prepareStatement(sqlStmt)) { if (params != null && params.length > 0) { for (int i = 0; i < params.length; i++) { Object param = params[i]; if (param == null) { prepStmt.setString(i + 1, null); } else if (param instanceof String) { prepStmt.setString(i + 1, (String) param); } else if (param instanceof Integer) { prepStmt.setInt(i + 1, (Integer) param); } else if (param instanceof Short) { prepStmt.setShort(i + 1, (Short) param); } else if (param instanceof Date) { Date date = (Date) param; Timestamp time = new Timestamp(date.getTime()); prepStmt.setTimestamp(i + 1, time); } } } prepStmt.executeUpdate(); } catch (SQLException e) { String errorMessage = "Using sql : " + sqlStmt + " " + e.getMessage(); if (log.isDebugEnabled()) { log.debug(errorMessage, e); } throw new UserStoreException(errorMessage, e); } }

Target:
public static void updateDatabase(Connection dbConnection, String sqlStmt, Object... params) throws UserStoreException { try ( PreparedStatement prepStmt = dbConnection.prepareStatement(sqlStmt)) { if (params != null && params.length > 0) { for (int i = 0; i < params.length; i++) { Object param = params[i]; if (param == null) { prepStmt.setString(i + 1, null); } else if (param instanceof String) { prepStmt.setString(i + 1, (String) param); } else if (param instanceof Integer) { prepStmt.setInt(i + 1, (Integer) param); } else if (param instanceof Short) { prepStmt.setShort(i + 1, (Short) param); } else if (param instanceof Date) { Date date = (Date) param; Timestamp time = new Timestamp(date.getTime()); prepStmt.setTimestamp(i + 1, time); } } } prepStmt.executeUpdate(); } catch (SQLException e) { String errorMessage = "Using sql : " + sqlStmt + " " + e.getMessage(); if (log.isDebugEnabled()) { log.debug(errorMessage, e); } throw new UserStoreException(errorMessage, e); } finally { close(dbConnection); } }
Source:
public void start() throws Exception { log.info("[init] running spawn2 on port " + configuration.webPort + (sslEnabled ? (" and port " + configuration.webPortSSL) : "")); ResourceHandler resourceHandler = new ResourceHandler(); resourceHandler.setDirectoriesListed(true); resourceHandler.setWelcomeFiles(new String[]{INDEX_FILENAME}); resourceHandler.setResourceBase(WEB_DIR); resourceHandler.setCacheControl("max-age=" + SPAWN_RESOURCE_MAX_AGE_SECONDS); ServletContextHandler handler = new ServletContextHandler(); webSocketManager.setHandler(handler); HandlerList handlers = new HandlerList(); handlers.setHandlers(new Handler[]{resourceHandler, webSocketManager}); GzipHandler gzipHandler = new GzipHandler(); gzipHandler.setHandler(handlers); ServletContainer servletContainer = new ServletContainer(servlets); ServletHolder sh = new ServletHolder(servletContainer); handler.addFilter(GzipFilter.class, "/*", EnumSet.of(DispatcherType.REQUEST)); handler.addServlet(new ServletHolder(new MetricsServlet()), "/yammer_metrics"); handler.addServlet(sh, "/*"); PrometheusServletCreator.create(jetty, handler); jetty.setAttribute("org.eclipse.jetty.Request.maxFormContentSize", 5000000); jetty.setHandler(gzipHandler); jetty.start(); jetty.addLifeCycleListener(new AbstractLifeCycle.AbstractLifeCycleListener() { @Override public void lifeCycleStopping(LifeCycle event) { super.lifeCycleStopping(event); try { resourceCloser.close(); } catch (IOException ex) { log.error("IOException while closing jetty resources: ", ex); } } }); }

Target:
public void start() throws Exception { log.info("[init] running spawn2 on port " + configuration.webPort + (sslEnabled ? (" and port " + configuration.webPortSSL) : "")); ResourceHandler resourceHandler = new ResourceHandler(); resourceHandler.setDirectoriesListed(true); resourceHandler.setWelcomeFiles(new String[]{INDEX_FILENAME}); resourceHandler.setResourceBase(WEB_DIR); resourceHandler.setCacheControl("max-age=" + SPAWN_RESOURCE_MAX_AGE_SECONDS); ServletContextHandler handler = new ServletContextHandler(); webSocketManager.setHandler(handler); HandlerList handlers = new HandlerList(); handlers.setHandlers(new Handler[]{resourceHandler, webSocketManager}); GzipHandler gzipHandler = new GzipHandler(); gzipHandler.setHandler(handlers); ServletContainer servletContainer = new ServletContainer(servlets); ServletHolder sh = new ServletHolder(servletContainer); handler.addFilter(GzipFilter.class, "/*", EnumSet.of(DispatcherType.REQUEST)); handler.addServlet(sh, "/*"); PrometheusServletCreator.create(jetty, handler); jetty.setAttribute("org.eclipse.jetty.Request.maxFormContentSize", 5000000); jetty.setHandler(gzipHandler); jetty.start(); jetty.addLifeCycleListener(new AbstractLifeCycle.AbstractLifeCycleListener() { @Override public void lifeCycleStopping(LifeCycle event) { super.lifeCycleStopping(event); try { resourceCloser.close(); } catch (IOException ex) { log.error("IOException while closing jetty resources: ", ex); } } }); }
Source:
private int getMaximumThumbnailWidthForEditor() { if (mMaxThumbWidth == 0) { mMaxThumbWidth = org.wordpress.android.editor.MediaUtils.getMaximumThumbnailSizeForEditor(this); } return mMaxThumbWidth; }

Target:
private int getMaximumThumbnailWidthForEditor() { if (mMaxThumbWidth == 0) { mMaxThumbWidth = EditorMediaUtils.getMaximumThumbnailSizeForEditor(this); } return mMaxThumbWidth; }
Source:
protected void handleGet(final HttpServletRequest req, final HttpServletResponse resp, final Session session) throws ServletException, IOException { if(isAdmin(session.getUser())) { handleNotePageLoad(req, resp, session); } }

Target:
protected void handleGet(final HttpServletRequest req, final HttpServletResponse resp, final Session session) throws ServletException, IOException { if(isAdmin(session.getUser())) { handleNotePageLoad(req, resp, session); } else { warningNonAdminUsers(resp, "The requested user doesn't have admin permission"); } }
Source:
public void close() { reset(false); try { baos.close(); } catch (IOException e) { throw new ParquetRuntimeException("Error closing output stream.", e){ }; } }

Target:
public void close() { reset(false); baos.close(); }
Source:
public ACNVModeledSegment(final SimpleInterval interval, final PosteriorSummary segmentMeanPosteriorSummary, final PosteriorSummary minorAlleleFractionPosteriorSummary) { super(interval, ModeledSegment.NO_CALL, 0, segmentMeanPosteriorSummary.mean()); this.segmentMeanPosteriorSummary = segmentMeanPosteriorSummary; this.minorAlleleFractionPosteriorSummary = minorAlleleFractionPosteriorSummary; }

Target:
public ACNVModeledSegment(final SimpleInterval interval, final PosteriorSummary segmentMeanPosteriorSummary, final PosteriorSummary minorAlleleFractionPosteriorSummary) { super(interval, ModeledSegment.NO_CALL, 0, segmentMeanPosteriorSummary.center()); this.segmentMeanPosteriorSummary = segmentMeanPosteriorSummary; this.minorAlleleFractionPosteriorSummary = minorAlleleFractionPosteriorSummary; }
Source:
@Test public void fails_when_unused_stubbings() throws Throwable { try { run(new MockitoStatement() { public void evaluate(IMethods mock, IMethods mock2) throws Throwable { given(mock.simpleMethod(10)).willReturn("foo"); mock2.simpleMethod(15); } }); fail(); } catch (MockitoAssertionError e) { Assertions.assertThat(e.getMessage()).startsWith("Unused stubbings"); } }

Target:
@Test public void fails_when_unused_stubbings() throws Throwable { rule.expectFailure(UnnecessaryStubbingException.class); given(mock.simpleMethod(10)).willReturn("foo"); mock2.simpleMethod(10); }
Source:
public void errorResponseHasRegistryObjectList() throws Exception { AdapterDocQueryOrchImpl impl = new AdapterDocQueryOrchImpl(); try { impl.respondingGatewayCrossGatewayQuery(null, null); Assert.fail(); } catch (ErrorEventException e) { AdhocQueryResponse response = (AdhocQueryResponse) e.getReturnOverride(); assertNotNull(response.getRegistryObjectList()); assertEquals(0, response.getRegistryObjectList().getIdentifiable().size()); } }

Target:
public void errorResponseHasRegistryObjectList() { AdapterDocQueryOrchImpl impl = new AdapterDocQueryOrchImpl(); try { impl.respondingGatewayCrossGatewayQuery(null, null); Assert.fail(); } catch (ErrorEventException e) { AdhocQueryResponse response = (AdhocQueryResponse) e.getReturnOverride(); assertNotNull(response.getRegistryObjectList()); assertEquals(0, response.getRegistryObjectList().getIdentifiable().size()); } }
Source:
public RevTag call() throws JGitInternalException, ConcurrentRefUpdateException, NoHeadException { checkCallable(); RepositoryState state = repo.getRepositoryState(); processOptions(state); try { TagBuilder newTag = new TagBuilder(); newTag.setTag(name); newTag.setMessage(message); newTag.setTagger(author); if (id == null) { Ref head = repo.getRef(Constants.HEAD); if (head == null) throw new NoHeadException( JGitText.get().tagOnRepoWithoutHEADCurrentlyNotSupported); newTag.setObjectId(repo.resolve(Constants.HEAD + "^{commit}"), Constants.OBJ_COMMIT); } else { newTag.setObjectId(id); } ObjectInserter inserter = repo.newObjectInserter(); try { ObjectId tagId = inserter.insert(Constants.OBJ_TAG, newTag.format()); newTag.setTagId(tagId); inserter.flush(); RevWalk revWalk = new RevWalk(repo); try { RevTag revTag = revWalk.parseTag(newTag.getTagId()); String refName = Constants.R_TAGS + newTag.getTag(); RefUpdate tagRef = repo.updateRef(refName); tagRef.setNewObjectId(tagId); tagRef.setForceUpdate(forceUpdate); Result updateResult = tagRef.update(); switch (updateResult) { case NEW: case FORCED: return revTag; case LOCK_FAILURE: throw new ConcurrentRefUpdateException(JGitText .get().couldNotLockHEAD, tagRef.getRef(), updateResult); default: throw new JGitInternalException(MessageFormat .format(JGitText.get().updatingRefFailed, refName, newTag.toString(), updateResult)); } } finally { revWalk.release(); } } finally { inserter.release(); } } catch (IOException e) { throw new JGitInternalException( JGitText.get().exceptionCaughtDuringExecutionOfTagCommand, e); } }

Target:
public RevTag call() throws JGitInternalException, ConcurrentRefUpdateException, NoHeadException { checkCallable(); RepositoryState state = repo.getRepositoryState(); processOptions(state); try { TagBuilder newTag = new TagBuilder(); newTag.setTag(name); newTag.setMessage(message); newTag.setTagger(tagger); if (id == null) { ObjectId objectId = repo.resolve(Constants.HEAD + "^{commit}"); if (objectId == null) throw new NoHeadException( JGitText.get().tagOnRepoWithoutHEADCurrentlyNotSupported); newTag.setObjectId(objectId, Constants.OBJ_COMMIT); } else { newTag.setObjectId(id); } ObjectInserter inserter = repo.newObjectInserter(); try { ObjectId tagId = inserter.insert(newTag); inserter.flush(); RevWalk revWalk = new RevWalk(repo); try { RevTag revTag = revWalk.parseTag(newTag.getTagId()); String refName = Constants.R_TAGS + newTag.getTag(); RefUpdate tagRef = repo.updateRef(refName); tagRef.setNewObjectId(tagId); tagRef.setForceUpdate(forceUpdate); Result updateResult = tagRef.update(revWalk); switch (updateResult) { case NEW: case FORCED: return revTag; case LOCK_FAILURE: throw new ConcurrentRefUpdateException( JGitText.get().couldNotLockHEAD, tagRef.getRef(), updateResult); default: throw new JGitInternalException(MessageFormat.format( JGitText.get().updatingRefFailed, refName, newTag.toString(), updateResult)); } } finally { revWalk.release(); } } finally { inserter.release(); } } catch (IOException e) { throw new JGitInternalException( JGitText.get().exceptionCaughtDuringExecutionOfTagCommand, e); } }
Source:
public Mono<Void> initialize() { BootstrapperImpl self = this; self.isInitialized = false; return Mono.just(self) .flatMap( value -> self.leaseStore.isInitialized()) .flatMap(initialized -> { self.isInitialized = initialized; if (initialized) { return Mono.empty(); } else { return self.leaseStore.acquireInitializationLock(self.lockTime) .flatMap(lockAcquired -> { self.isLockAcquired = lockAcquired; if (!self.isLockAcquired) { logger.info("Another instance is initializing the store"); try { Thread.sleep(self.sleepTime.toMillis()); } catch (InterruptedException ex) { logger.warn("Unexpected exception caught", ex); } return Mono.just(isLockAcquired); } else { return self.synchronizer.createMissingLeases() .then(self.leaseStore.markInitialized()); } }) .onErrorResume(throwable -> { logger.warn("Unexpected exception caught", throwable); return Mono.just(self.isLockAcquired); }) .flatMap(lockAcquired -> { if (self.isLockAcquired) { return self.leaseStore.releaseInitializationLock(); } return Mono.just(lockAcquired); }); } }) .repeat( () -> !self.isInitialized) .then(); }

Target:
public Mono<Void> initialize() { this.isInitialized = false; return Mono.just(this) .flatMap( value -> this.leaseStore.isInitialized()) .flatMap(initialized -> { this.isInitialized = initialized; if (initialized) { return Mono.empty(); } else { return this.leaseStore.acquireInitializationLock(this.lockTime) .flatMap(lockAcquired -> { this.isLockAcquired = lockAcquired; if (!this.isLockAcquired) { logger.info("Another instance is initializing the store"); return Mono.just(isLockAcquired).delayElement(this.sleepTime); } else { return this.synchronizer.createMissingLeases() .then(this.leaseStore.markInitialized()); } }) .onErrorResume(throwable -> { logger.warn("Unexpected exception caught", throwable); return Mono.just(this.isLockAcquired); }) .flatMap(lockAcquired -> { if (this.isLockAcquired) { return this.leaseStore.releaseInitializationLock(); } return Mono.just(lockAcquired); }); } }) .repeat( () -> !this.isInitialized) .then(); }
Source:
public static void main(String[] args) { if (args.length < 2) { System.err.println("Usage: FluoOracle <connectionPropsPath> <applicationName> args..."); System.exit(-1); } String connectionPropsPath = args[0]; String applicationName = args[1]; Objects.requireNonNull(connectionPropsPath); Objects.requireNonNull(applicationName); File connectionPropsFile = new File(connectionPropsPath); Preconditions.checkArgument(connectionPropsFile.exists(), connectionPropsPath + " does not exist"); String[] userArgs = Arrays.copyOfRange(args, 2, args.length); CommandOpts commandOpts = CommandOpts.parse("fluo oracle <app>", userArgs); FluoConfiguration config = new FluoConfiguration(connectionPropsFile); config.setApplicationName(applicationName); commandOpts.overrideConfig(config); CommandUtil.verifyAppInitialized(config); try { org.apache.fluo.api.service.FluoOracle oracle = FluoFactory.newOracle(config); oracle.start(); while (true) { UtilWaitThread.sleep(10000); } } catch (Exception e) { log.error("Exception running FluoOracle: ", e); } }

Target:
public static void main(String[] args) { CommonOpts opts = CommonOpts.parse("fluo oracle", args); FluoConfiguration config = CommandUtil.resolveFluoConfig(); config.setApplicationName(opts.getApplicationName()); opts.overrideFluoConfig(config); CommandUtil.verifyAppInitialized(config); try { org.apache.fluo.api.service.FluoOracle oracle = FluoFactory.newOracle(config); oracle.start(); while (true) { UtilWaitThread.sleep(10000); } } catch (Exception e) { log.error("Exception running FluoOracle: ", e); } }
Source:
private static UserAgent parseInternal(String userAgent, boolean lenient) { ImmutableUserAgent.Builder builder = ImmutableUserAgent.builder(); List<String> parts = COMMA_SPLITTER.splitToList(userAgent); checkArgument(!parts.isEmpty(), "Empty user agents are not allowed"); Map<String, String> primaryComments = Maps.newHashMap(); Optional<UserAgent.Agent> primaryAgent = tryParseSingleAgent(parts.get(0), primaryComments); if (primaryAgent.isPresent()) { builder.primary(primaryAgent.get()); } else { if (lenient) { builder.primary(UserAgent.Agent.of("unknown", UserAgent.Agent.DEFAULT_VERSION)); } else { throw new IllegalArgumentException("Agent string was malformed: " + parts.get(0)); } } if (primaryComments.containsKey("nodeId")) { builder.nodeId(primaryComments.get("nodeId")); } for (String part : parts.subList(1, parts.size())) { Optional<UserAgent.Agent> informationlAgent = tryParseSingleAgent(part, Maps.newHashMap()); if (informationlAgent.isPresent()) { builder.addInformational(informationlAgent.get()); } else { if (lenient) { log.warn("Cannot parse malformed user agent string", UnsafeArg.of("agent", part)); } else { throw new IllegalArgumentException("Agent string was malformed: " + part); } } } return builder.build(); }

Target:
private static UserAgent parseInternal(String userAgent, boolean lenient) { ImmutableUserAgent.Builder builder = ImmutableUserAgent.builder(); List<String> parts = COMMA_SPLITTER.splitToList(userAgent); if (parts.isEmpty()) { if (lenient) { log.warn("Empty user agent, falling back to default/unknown agent"); return builder.primary(UserAgent.Agent.of("unknown", UserAgent.Agent.DEFAULT_VERSION)).build(); } else { throw new IllegalArgumentException("Empty user agents are not allowed: " + userAgent); } } Map<String, String> primaryComments = Maps.newHashMap(); Optional<UserAgent.Agent> primaryAgent = tryParseSingleAgent(parts.get(0), primaryComments); if (primaryAgent.isPresent()) { builder.primary(primaryAgent.get()); } else { if (lenient) { log.warn("Malformed primary user agent", UnsafeArg.of("agent", parts.get(0))); builder.primary(UserAgent.Agent.of("unknown", UserAgent.Agent.DEFAULT_VERSION)); } else { throw new IllegalArgumentException("Agent string was malformed: " + parts.get(0)); } } if (primaryComments.containsKey("nodeId")) { builder.nodeId(primaryComments.get("nodeId")); } for (String part : parts.subList(1, parts.size())) { Optional<UserAgent.Agent> informationlAgent = tryParseSingleAgent(part, Maps.newHashMap()); if (informationlAgent.isPresent()) { builder.addInformational(informationlAgent.get()); } else { if (lenient) { log.warn("Cannot parse malformed user agent string", UnsafeArg.of("agent", part)); } else { throw new IllegalArgumentException("Agent string was malformed: " + part); } } } return builder.build(); }
Source:
public static void validateNDKVersion(int desiredVersion, String versionStr) throws MojoExecutionException { int version = 0; if (versionStr != null) { versionStr = versionStr.trim(); Pattern pattern = Pattern.compile("[r]([0-9]{1,3})([a-z]{0,1}).*"); Matcher m = pattern.matcher(versionStr); if (m.matches()) { final String group = m.group(1); version = Integer.parseInt(group); } } if (version < desiredVersion) { throw new MojoExecutionException("You are running an old NDK (version " + versionStr + "), please update to at least r7 or later"); } }

Target:
public static void validateNDKVersion(int desiredVersion, String versionStr) throws MojoExecutionException { int version = 0; if (versionStr != null) { versionStr = versionStr.trim(); Pattern pattern = Pattern.compile("[r]([0-9]{1,3})([a-z]{0,1}).*"); Matcher m = pattern.matcher(versionStr); if (m.matches()) { final String group = m.group(1); version = Integer.parseInt(group); } } if (version < desiredVersion) { throw new MojoExecutionException("You are running an old NDK (version " + versionStr + "), please update to at least r'" + desiredVersion + "' or later"); } }
Source:
public void onInteract(LivingEnchantmentLevelEvent event) { if (event.getEntityLiving().isSneaking()) { int oldLevel = event.getLevel(); int newLevel = (oldLevel + 1) * 10; event.setLevel(newLevel); System.out.println("Set fortune level from " + oldLevel + " to " + newLevel); } }

Target:
public static void onInteract(LivingEnchantmentLevelEvent event) { if (!ENABLED) { return; } if (event.getEntityLiving().isSneaking()) { int oldLevel = event.getLevel(); int newLevel = oldLevel * 10; event.setLevel(newLevel); logger.info("Set enchantment level from " + oldLevel + " to " + newLevel + " for " + event.getEnchantment().getName()); } }
Source:
public String getDisplayString(OrderGroup group) { if (group.isVoided()) return "[No Group]"; Patient patient = group.getPatient(); return patient.getPatientIdentifier().getIdentifier() + " - " + patient.getPersonName().getFullName() + " - " + group.getOrderSet().getName(); }

Target:
public String getDisplayString(OrderGroup group) { if (group.getOrders() == null) return "[No Orders]"; Patient patient = group.getPatient(); return patient.getPatientIdentifier().getIdentifier() + " - " + patient.getPersonName().getFullName() + " - " + group.getOrderSet().getName(); }
Source:
public Map<Long, Object> retrieveAllWindows() throws IOException { Map<Long, Object> artifactPerWindow = new HashMap<>(); FileSystemWAL.FileSystemWALReader reader = getWal().getReader(); reader.seek(getWal().getWalStartPointer()); Slice windowSlice = readNext(reader); while (reader.getCurrentPointer().compareTo(getWal().getWalEndPointerAfterRecovery()) < 0 && windowSlice != null) { long window = Longs.fromByteArray(windowSlice.toByteArray()); Object data = fromSlice(readNext(reader)); windowSlice = readNext(reader); if (windowSlice == DELETED) { windowSlice = readNext(reader); } else { artifactPerWindow.put(window, data); } } reader.seek(getWal().getWalStartPointer()); return artifactPerWindow; }

Target:
public Map<Long, Object> retrieveAllWindows() throws IOException { Map<Long, Object> artifactPerWindow = new HashMap<>(); FileSystemWAL.FileSystemWALReader reader = getWal().getReader(); reader.seek(getWal().getWalStartPointer()); Slice windowSlice = readNext(reader); while (reader.getCurrentPointer().compareTo(getWal().getWalEndPointerAfterRecovery()) < 0 && windowSlice != null) { long window = Longs.fromByteArray(windowSlice.toByteArray()); Object data = fromSlice(readNext(reader)); artifactPerWindow.put(window, data); windowSlice = readNext(reader); } reader.seek(getWal().getWalStartPointer()); return artifactPerWindow; }
Source:
protected boolean runKerberosLogin() { try { UserGroupInformation.AuthenticationMethod authType = JDBCSecurityImpl.getAuthtype(property); if (authType.equals(KERBEROS)) { if (UserGroupInformation.isLoginKeytabBased()) { UserGroupInformation.getLoginUser().reloginFromKeytab(); } else if (UserGroupInformation.isLoginTicketBased()) { UserGroupInformation.getLoginUser().reloginFromTicketCache(); } } } catch (Exception e) { logger.error("Unable to run kinit for zeppelin", e); return false; } return true; }

Target:
protected boolean runKerberosLogin() { try { if (UserGroupInformation.isLoginKeytabBased()) { UserGroupInformation.getLoginUser().reloginFromKeytab(); return true; } else if (UserGroupInformation.isLoginTicketBased()) { UserGroupInformation.getLoginUser().reloginFromTicketCache(); return true; } } catch (Exception e) { logger.error("Unable to run kinit for zeppelin", e); } return false; }
Source:
private void validateSchema(final EventTypeBase eventType) throws InvalidEventTypeException { try { final String eventTypeSchema = eventType.getSchema().getSchema(); checkJsonIsValid(eventTypeSchema); final JSONObject schemaAsJson = new JSONObject(eventTypeSchema); final Schema schema = SchemaLoader.load(schemaAsJson); if (eventType.getCategory() == EventCategory.BUSINESS && schema.definesProperty("#/metadata")) { throw new InvalidEventTypeException("\"metadata\" property is reserved"); } if (featureToggleService.isFeatureEnabled(CHECK_PARTITIONS_KEYS)) { validatePartitionKeys(schema, eventType); } if (eventType.getCompatibilityMode() == CompatibilityMode.COMPATIBLE) { validateJsonSchemaConstraints(schemaAsJson); } } catch (final JSONException e) { throw new InvalidEventTypeException("schema must be a valid json"); } catch (final SchemaException e) { throw new InvalidEventTypeException("schema must be a valid json-schema"); } }

Target:
private void validateSchema(final EventTypeBase eventType) throws InvalidEventTypeException { try { final String eventTypeSchema = eventType.getSchema().getSchema(); JsonUtils.checkEventTypeSchemaValid(eventTypeSchema); final JSONObject schemaAsJson = new JSONObject(eventTypeSchema); final Schema schema = SchemaLoader.load(schemaAsJson); if (eventType.getCategory() == EventCategory.BUSINESS && schema.definesProperty("#/metadata")) { throw new InvalidEventTypeException("\"metadata\" property is reserved"); } if (featureToggleService.isFeatureEnabled(CHECK_PARTITIONS_KEYS)) { validatePartitionKeys(schema, eventType); } if (eventType.getCompatibilityMode() == CompatibilityMode.COMPATIBLE) { validateJsonSchemaConstraints(schemaAsJson); } } catch (final JSONException e) { throw new InvalidEventTypeException("schema must be a valid json"); } catch (final SchemaException e) { throw new InvalidEventTypeException("schema must be a valid json-schema"); } }
Source:
public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller == null) { return false; } ExileZone exileZone = game.getExile().getExileZone(exileZoneId); Card enchantedCard = exileZone.get(enchantedCardId, game); Player owner = game.getPlayer(enchantedCard.getOwnerId()); if (enchantedCard != null) { owner.moveCards(enchantedCard, Zone.BATTLEFIELD, source, game); Permanent newPermanent = game.getPermanent(enchantedCardId); if (newPermanent != null) { Set<Card> toBattlefieldAttached = new HashSet<Card>(); for (Card enchantment : exileZone.getCards(game)) { if (filterAura.match(enchantment, game)) { boolean canTarget = false; for (Target target : enchantment.getSpellAbility().getTargets()) { Filter filter = target.getFilter(); if (filter.match(newPermanent, game)) { canTarget = true; break; } } if (!canTarget) { continue; } game.getState().setValue("attachTo:" + enchantment.getId(), newPermanent); } toBattlefieldAttached.add(enchantment); } if (!toBattlefieldAttached.isEmpty()) { controller.moveCards(toBattlefieldAttached, Zone.BATTLEFIELD, source, game); for (Card card : toBattlefieldAttached) { if (game.getState().getZone(card.getId()) == Zone.BATTLEFIELD) { newPermanent.addAttachment(card.getId(), game); } } } } return true; } return false; }

Target:
public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller == null) { return false; } ExileZone exileZone = game.getExile().getExileZone(exileZoneId); Card enchantedCard = exileZone.get(enchantedCardId, game); if (enchantedCard != null) { Player owner = game.getPlayer(enchantedCard.getOwnerId()); if (owner != null) { owner.moveCards(enchantedCard, Zone.BATTLEFIELD, source, game); Permanent newPermanent = game.getPermanent(enchantedCardId); if (newPermanent != null) { Set<Card> toBattlefieldAttached = new HashSet<Card>(); for (Card enchantment : exileZone.getCards(game)) { if (filterAura.match(enchantment, game)) { boolean canTarget = false; for (Target target : enchantment.getSpellAbility().getTargets()) { Filter filter = target.getFilter(); if (filter.match(newPermanent, game)) { canTarget = true; break; } } if (!canTarget) { continue; } game.getState().setValue("attachTo:" + enchantment.getId(), newPermanent); } toBattlefieldAttached.add(enchantment); } if (!toBattlefieldAttached.isEmpty()) { controller.moveCards(toBattlefieldAttached, Zone.BATTLEFIELD, source, game); for (Card card : toBattlefieldAttached) { if (game.getState().getZone(card.getId()) == Zone.BATTLEFIELD) { newPermanent.addAttachment(card.getId(), game); } } } } return true; } } return false; }
Source:
private void processHelloRequest(final HelloRequest helloRequest, final Connection connection) throws HandshakeException { if (connection.hasOngoingHandshake()) { LOGGER.debug("Ignoring received from while already in an ongoing handshake with peer", new Object[] { helloRequest.getMessageType(), helloRequest.getPeer() }); } else { DTLSSession session = connection.getEstablishedSession(); send(new AlertMessage(AlertLevel.WARNING, AlertDescription.NO_RENEGOTIATION, helloRequest.getPeer()), session); } }

Target:
private void processHelloRequest(final HelloRequest helloRequest, final Connection connection) throws HandshakeException { if (connection.hasOngoingHandshake()) { LOGGER.debug("Ignoring received from while already in an ongoing handshake with peer", helloRequest.getMessageType(), helloRequest.getPeer()); } else { DTLSSession session = connection.getEstablishedSession(); send(new AlertMessage(AlertLevel.WARNING, AlertDescription.NO_RENEGOTIATION, helloRequest.getPeer()), session); } }
Source:
public synchronized boolean deleteShardingKey(String realm, String shardingKey) { if (_leaderElection.isLeader()) { if (_zkClient.isClosed()) { throw new IllegalStateException("ZkClient is closed!"); } return deleteZkShardingKey(realm, shardingKey); } String urlSuffix = constructUrlSuffix(MetadataStoreRoutingConstants.MSDS_GET_ALL_REALMS_ENDPOINT, realm, MetadataStoreRoutingConstants.MSDS_GET_ALL_SHARDING_KEYS_ENDPOINT, shardingKey); return forwardRequestToLeader(urlSuffix, MetadataStoreRoutingConstants.HttpRequestForwardingVerbs.DELETE, "deleteShardingKey", Response.Status.OK.getStatusCode()); }

Target:
public synchronized boolean deleteShardingKey(String realm, String shardingKey) { if (_leaderElection.isLeader()) { if (_zkClient.isClosed()) { throw new IllegalStateException("ZkClient is closed!"); } return deleteZkShardingKey(realm, shardingKey); } String urlSuffix = constructUrlSuffix(MetadataStoreRoutingConstants.MSDS_GET_ALL_REALMS_ENDPOINT, realm, MetadataStoreRoutingConstants.MSDS_GET_ALL_SHARDING_KEYS_ENDPOINT, shardingKey); return forwardRequestToLeader(urlSuffix, HttpConstants.RestVerbs.DELETE, Response.Status.OK.getStatusCode()); }
Source:
@Override public ArrayList<VdcReturnValueBase> execute() { if (parameters == null || parameters.isEmpty()) { log.info("{} of type '{}' invoked with no actions", this.getClass().getSimpleName(), actionType); return new ArrayList<>(); } ArrayList<VdcReturnValueBase> returnValues = new ArrayList<>(); try { initCommandsAndReturnValues(returnValues); invokeCommands(returnValues); } catch (RuntimeException e) { log.error("Failed to execute multiple actions of type '{}': {}", actionType, e.getMessage()); log.error("Exception", e); } return returnValues; }

Target:
public ArrayList<VdcReturnValueBase> execute() { if (parameters == null || parameters.isEmpty()) { log.info("{} of type '{}' invoked with no actions", this.getClass().getSimpleName(), actionType); return new ArrayList<>(); } ArrayList<VdcReturnValueBase> returnValues = new ArrayList<>(); try { initCommandsAndReturnValues(returnValues); invokeCommands(returnValues); } catch (RuntimeException e) { log.error("Failed to execute multiple actions of type '{}': {}", actionType, e.getMessage()); log.error("Exception", e); } return returnValues; }