auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public <T> T retryOnRateLimit(Supplier<T> func) throws AmazonServiceException { final int baseIncrementalSecs = 10; for (int i = 0; i < rateLimitMaxRetry; i++) { try { return func.get(); } catch (AmazonServiceException ex) { if (RetryUtils.isThrottlingException(ex)) { logger.debug("Rate exceed: {}. Will be retried.", ex.toString()); final long baseWaitSecs = baseIncrementalSecs * i > rateLimitMaxBaseWaitSecs ? rateLimitMaxBaseWaitSecs: baseIncrementalSecs * i; waitWithRandomJitter(baseWaitSecs, rateLimitMaxJitterSecs); } else { throw ex; } } } logger.error("Failed to call EcsClient method after Retried times", rateLimitMaxRetry); throw new RuntimeException("Failed to call EcsClient method"); }

Target:
public <T> T retryOnRateLimit(Supplier<T> func) throws AmazonServiceException { for (int i = 0; i < rateLimitMaxRetry; i++) { try { return func.get(); } catch (AmazonServiceException ex) { if (RetryUtils.isThrottlingException(ex)) { logger.debug("Rate exceed: {}. Will be retried.", ex.toString()); final long baseWaitSecs = Math.min(rateLimitBaseIncrementalSecs * i, rateLimitMaxBaseWaitSecs); waitWithRandomJitter(baseWaitSecs, rateLimitMaxJitterSecs); } else { throw ex; } } } logger.error("Failed to call EcsClient method after Retried times", rateLimitMaxRetry); throw new RuntimeException("Failed to call EcsClient method"); }
Source:
public IFolder prepareTraceSupplementaryFolder(String supplFolderPath, boolean createFolder) { IFolder folder = getTraceSupplementaryFolder(supplFolderPath); try { ICoreRunnable runnable = monitor -> { if (createFolder) { IFolder propertiesFolder = folder.getFolder(TmfCommonConstants.TRACE_PROPERTIES_FOLDER); TraceUtils.createFolder(propertiesFolder, new NullProgressMonitor()); propertiesFolder.setHidden(true); } else { TraceUtils.createFolder((IFolder) folder.getParent(), new NullProgressMonitor()); } }; ResourcesPlugin.getWorkspace().run(runnable, folder.getProject(), IWorkspace.AVOID_UPDATE, new NullProgressMonitor()); } catch (CoreException e) { Activator.getDefault().logError("Error creating supplementary folder " + folder.getFullPath(), e); } return folder; }

Target:
public IFolder prepareTraceSupplementaryFolder(String supplFolderPath, boolean createFolder) { IFolder folder = getTraceSupplementaryFolder(supplFolderPath); try { ICoreRunnable runnable = monitor -> { if (createFolder) { IFolder propertiesFolder = folder.getFolder(TmfCommonConstants.TRACE_PROPERTIES_FOLDER); TraceUtils.createFolder(propertiesFolder, monitor); propertiesFolder.setHidden(true); } else { TraceUtils.createFolder((IFolder) folder.getParent(), monitor); } }; ResourcesPlugin.getWorkspace().run(runnable, folder.getProject(), IWorkspace.AVOID_UPDATE, new NullProgressMonitor()); } catch (CoreException e) { Activator.getDefault().logError("Error creating supplementary folder " + folder.getFullPath(), e); } return folder; }
Source:
public void test_getShowFocusedControl() { boolean defaultFlag = scrolledComposite.getShowFocusedControl(); boolean setFlag = !defaultFlag; scrolledComposite.setShowFocusedControl(setFlag); if (setFlag) assertTrue(scrolledComposite.getShowFocusedControl()); else assertFalse(scrolledComposite.getShowFocusedControl()); setFlag = !setFlag; scrolledComposite.setShowFocusedControl(setFlag); if (setFlag) assertTrue(scrolledComposite.getShowFocusedControl()); else assertFalse(scrolledComposite.getShowFocusedControl()); scrolledComposite.setShowFocusedControl(defaultFlag); }

Target:
public void test_getShowFocusedControl() { boolean defaultFlag = scrolledComposite.getShowFocusedControl(); boolean setFlag = !defaultFlag; scrolledComposite.setShowFocusedControl(setFlag); if (setFlag){ assertTrue(scrolledComposite.getShowFocusedControl()); } else{ assertFalse(scrolledComposite.getShowFocusedControl()); } setFlag = !setFlag; scrolledComposite.setShowFocusedControl(setFlag); if (setFlag){ assertTrue(scrolledComposite.getShowFocusedControl()); } else{ assertFalse(scrolledComposite.getShowFocusedControl()); } scrolledComposite.setShowFocusedControl(defaultFlag); }
Source:
public void initialize() { JavaFxUtil.fixScrollSpeed(tiledScrollPane); sortingListener = (observable, oldValue, newValue) -> { if (newValue == null) { return; } preferencesService.getPreferences().setGameTileSortingOrder(newValue); preferencesService.storeInBackground(); appliedComparator = newValue.getComparator(); sortNodes(); }; }

Target:
public void initialize() { JavaFxUtil.fixScrollSpeed(tiledScrollPane); }
Source:
public <B> Shrink<B> map(final F<A, B> f, final F<B, A> g) { return new Shrink<B>(b -> Shrink.this.f.f(g.f(b)).map(f)); }

Target:
public <B> Shrink<B> map(final F<A, B> f, final F<B, A> g) { return shrink(b -> Shrink.this.f.f(g.f(b)).map(f)); }
Source:
private void postConstruct() throws IOException { LOGGER.debug("Fedora staging: {}", fedoraOcflStaging); LOGGER.debug("Fedora OCFL root: {}", ocflRepoRoot); LOGGER.debug("Fedora OCFL temp: {}", ocflTemp); Files.createDirectories(fedoraOcflStaging); Files.createDirectories(ocflRepoRoot); Files.createDirectories(ocflTemp); }

Target:
private void postConstruct() throws IOException { LOGGER.info("Fedora staging: {}", fedoraOcflStaging); LOGGER.info("Fedora OCFL root: {}", ocflRepoRoot); LOGGER.info("Fedora OCFL temp: {}", ocflTemp); Files.createDirectories(fedoraOcflStaging); Files.createDirectories(ocflRepoRoot); Files.createDirectories(ocflTemp); }
Source:
public FeedbackSessionAttributes getFeedbackSession(String courseId, String feedbackSessionName) { Assumption.assertNotNull(Const.StatusCodes.DBLEVEL_NULL_INPUT, feedbackSessionName); Assumption.assertNotNull(Const.StatusCodes.DBLEVEL_NULL_INPUT, courseId); FeedbackSessionAttributes feedbackSession = makeAttributesOrNull(getFeedbackSessionEntity(feedbackSessionName, courseId)); if (feedbackSession != null && feedbackSession.isSessionDeleted()) { log.info("Trying to access soft-deleted session: " + feedbackSessionName + "/" + courseId); } if (feedbackSession == null || feedbackSession.isSessionDeleted()) { String errorMessage = ""; if (feedbackSession == null) { errorMessage = "Session not found."; } else { errorMessage = "Session is deleted."; } throw new EntityNotFoundException(new EntityDoesNotExistException(errorMessage)); } return feedbackSession; }

Target:
public FeedbackSessionAttributes getFeedbackSession(String courseId, String feedbackSessionName) { Assumption.assertNotNull(Const.StatusCodes.DBLEVEL_NULL_INPUT, feedbackSessionName); Assumption.assertNotNull(Const.StatusCodes.DBLEVEL_NULL_INPUT, courseId); FeedbackSessionAttributes feedbackSession = makeAttributesOrNull(getFeedbackSessionEntity(feedbackSessionName, courseId)); if (feedbackSession != null && feedbackSession.isSessionDeleted()) { log.info("Trying to access soft-deleted session: " + feedbackSessionName + "/" + courseId); return null; } return feedbackSession; }
Source:
public Date read(JsonReader in) throws IOException { String dateString = in.nextString(); for (SimpleDateFormat dateFormat : dateFormatters) { synchronized(dateFormat) { try { return dateFormat.parse(dateString); } catch (ParseException ignored) { } } } throw new JsonSyntaxException("Couldn't parse date: '" + dateString + "'"); }

Target:
public Date read(JsonReader in) throws IOException { String dateString = in.nextString(); synchronized(dateFormatter) { try { return dateFormatter.parse(dateString); } catch (ParseException ignored) { String withoutMicroseconds = dateString.replaceFirst("\\..*Z", "Z"); try { return dateFormatter.parse(withoutMicroseconds); } catch (ParseException e) { } } } throw new JsonSyntaxException("Couldn't parse date: '" + dateString + "'"); }
Source:
public void shouldFailToCommitWhenRunFailureIsConsumed() { Transaction tx = await( session.beginTransactionAsync() ); StatementResultCursor cursor = await( tx.runAsync( "RETURN Wrong" ) ); try { await( cursor.consumeAsync() ); fail( "Exception expected" ); } catch ( ClientException e ) { assertThat( e.code(), containsString( "SyntaxError" ) ); } try { await( tx.commitAsync() ); fail( "Exception expected" ); } catch ( ClientException e ) { assertThat( e.getMessage(), startsWith( "No current transaction to commit." ) ); } }

Target:
void shouldFailToCommitWhenRunFailureIsConsumed() { Transaction tx = await( session.beginTransactionAsync() ); StatementResultCursor cursor = await( tx.runAsync( "RETURN Wrong" ) ); ClientException e1 = assertThrows( ClientException.class, () -> await( cursor.consumeAsync() ) ); assertThat( e1.code(), containsString( "SyntaxError" ) ); ClientException e2 = assertThrows( ClientException.class, () -> await( tx.commitAsync() ) ); assertThat( e2.getMessage(), startsWith( "Transaction can't be committed" ) ); }
Source:
public <T> Page<T> query(Query query, Pager pager, Function<Element, T> conversion, Function<T, Boolean> filter) { HawkularPipeline<?, ? extends Element> q; if (query.getFragments()[0].getFilter() instanceof RelationFilter) { q = new HawkularPipeline<>(context.getGraph()).E(); } else { q = new HawkularPipeline<>(context.getGraph()).V(); } FilterApplicator.applyAll(query, q); HawkularPipeline<?, T> q2; if (filter == null) { q2 = q.counter("total").page(pager).transform(conversion::apply); } else { q2 = q.transform(conversion::apply).filter(filter::apply).counter("total") .page(pager, (e, p) -> { if (!(e instanceof AbstractElement)) { return null; } AbstractElement<?, ?> el = (AbstractElement<?, ?>) e; if (AbstractElement.ID_PROPERTY.equals(p)) { return el.getId(); } else { return (Comparable) el.getProperties().get(p); } }); } return new Page<>(q2, pager, q.getCount("total")); }

Target:
public <T> Page<T> query(Query query, Pager pager, Function<Element, T> conversion, Function<T, Boolean> filter) { HawkularPipeline<?, ? extends Element> q; if (query.getFragments()[0].getFilter() instanceof RelationFilter) { q = new HawkularPipeline<>(context.getGraph()).E(); } else { q = new HawkularPipeline<>(context.getGraph()).V(); } FilterApplicator.applyAll(query, q); HawkularPipeline<?, T> q2; if (filter == null) { q2 = q.counter("total").page(pager).transform(conversion::apply); } else { q2 = q.transform(conversion::apply).filter(filter::apply).counter("total") .page(pager, (e, p) -> { if (!(e instanceof AbstractElement)) { return null; } AbstractElement<?, ?> el = (AbstractElement<?, ?>) e; if (AbstractElement.ID_PROPERTY.equals(p)) { return el.getId(); } else { return (Comparable) el.getProperties().get(p); } }); } return new SizeAwarePage<>(q2, pager, () -> q.getCount("total")); }
Source:
public int append(Slice entry) throws IOException { if (outputStream == null) { outputStream = getOutputStream(currentPointer); } int entryLength = entry.length + 4; if (shouldRotate(entryLength)) { rotate(true); } outputStream.writeInt(entry.length); outputStream.write(entry.toByteArray()); currentPointer.offset += entryLength; if (currentPointer.offset == fileSystemWAL.maxLength) { rotate(false); } return entryLength; }

Target:
public int append(Slice entry) throws IOException { if (outputStream == null) { outputStream = getOutputStream(currentPointer); } int entryLength = entry.length + 4; if (shouldRotate(entryLength)) { rotate(true); } outputStream.writeInt(entry.length); outputStream.write(entry.buffer, entry.offset, entry.length); currentPointer.offset += entryLength; if (currentPointer.offset == fileSystemWAL.maxLength) { rotate(false); } return entryLength; }
Source:
protected boolean canDoAction() { boolean retValue=true; OVirtNodeInfo[] info = OVirtNodeInfo.get(); if (getVdsId() == null || getVdsId().equals(Guid.Empty)) { addCanDoActionMessage(VdcBllMessages.VDS_INVALID_SERVER_ID); retValue = false; } else if (getVds() == null) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_HOST_NOT_EXIST); retValue = false; } else if (isOvirtReInstallOrUpgrade()) { String isoFile = getParameters().getoVirtIsoFile(); if (getVds().getStatus() == VDSStatus.NonOperational) { addCanDoActionMessage(VdcBllMessages.VDS_CANNOT_INSTALL_STATUS_ILLEGAL); retValue = false; } if (!isIsoFileValid(isoFile, info)) { addCanDoActionMessage(VdcBllMessages.VDS_CANNOT_INSTALL_MISSING_IMAGE_FILE); retValue = false; } else { RpmVersion ovirtHostOsVersion = VdsHandler.getOvirtHostOsVersion(getVds()); if (ovirtHostOsVersion != null && !isIsoVersionCompatible(ovirtHostOsVersion, isoFile, info)) { addCanDoActionMessage(VdcBllMessages.VDS_CANNOT_UPGRADE_BETWEEN_MAJOR_VERSION); addCanDoActionMessage(String.format("$IsoVersion %1$s", ovirtHostOsVersion.getMajor())); retValue = false; } } } return retValue; }

Target:
protected boolean canDoAction() { boolean retValue=true; OVirtNodeInfo[] info = OVirtNodeInfo.get(); if (getVdsId() == null || getVdsId().equals(Guid.Empty)) { addCanDoActionMessage(VdcBllMessages.VDS_INVALID_SERVER_ID); retValue = false; } else if (getVds() == null) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_HOST_NOT_EXIST); retValue = false; } else if (isOvirtReInstallOrUpgrade()) { String isoFile = getParameters().getoVirtIsoFile(); if (getVds().getStatus() == VDSStatus.NonOperational) { addCanDoActionMessage(VdcBllMessages.VDS_CANNOT_INSTALL_STATUS_ILLEGAL); retValue = false; } RpmVersion ovirtHostOsVersion = VdsHandler.getOvirtHostOsVersion(getVds()); retValue = isIsoFileValid(isoFile, info, ovirtHostOsVersion); } return retValue; }
Source:
private String request(String json, String endpoint) throws IOException { Request request = new Request.Builder() .url(url(endpoint)) .post(RequestBody.create(MediaType.get("application/json"), json)) .build(); try (Response response = client.newCall(request).execute()) { return response.body().string(); } catch (InterruptedIOException e) { if ("timeout".equals(e.getMessage())) { String msg = "eslint-bridge Node.js process is unresponsive. This is most likely caused by process running out of memory." + " Consider setting sonar.javascript.node.maxspace to higher value (e.g. 4096)."; LOG.error(msg); } throw new IllegalStateException(e); } }

Target:
private String request(String json, String endpoint) throws IOException { Request request = new Request.Builder() .url(url(endpoint)) .post(RequestBody.create(MediaType.get("application/json"), json)) .build(); try (Response response = client.newCall(request).execute()) { return response.body().string(); } catch (InterruptedIOException e) { String msg = "eslint-bridge Node.js process is unresponsive. This is most likely caused by process running out of memory." + " Consider setting sonar.javascript.node.maxspace to higher value (e.g. 4096)."; LOG.error(msg); throw new IllegalStateException("eslint-bridge is unresponsive", e); } }
Source:
public CompletableFuture<TableDescriptor> getTableDescriptor(TableName tableName) { return listTables(Optional.of(Pattern.compile(tableName.getNameAsString())), false) .thenApply(r -> r.stream().findFirst().get()); }

Target:
public CompletableFuture<TableDescriptor> getTableDescriptor(TableName tableName) { if (tableName == null) { return CompletableFuture.completedFuture(null); } String bigtableTableName = bigtableInstanceName.toTableNameStr(tableName.getNameAsString()); GetTableRequest request = GetTableRequest.newBuilder().setName(bigtableTableName).build(); return FutureUtils.toCompletableFuture(bigtableTableAdminClient.getTableAsync(request)) .handle((resp, ex) -> { if (ex != null) { if (Status.fromThrowable(ex).getCode() == Status.Code.NOT_FOUND) { throw new CompletionException(new TableNotFoundException(tableName)); } } return tableAdapter2x.adapt(resp); }); }
Source:
public void removeEndpoint(InetAddressAndPort endpoint) { replicaList.removeIf(r -> r.getEndpoint().equals(endpoint)); }

Target:
public void removeEndpoint(InetAddressAndPort endpoint) { for (int i=replicaList.size()-1; i>=0; i--) { if (replicaList.get(i).getEndpoint().equals(endpoint)) { replicaList.remove(i); } } }
Source:
protected Object convertParsedObjectToVO(Object parsedContent) { try { return StaleCheckExtractCsvBuilder.buildStaleCheckExtract((List<Map<String,String>>) parsedContent); } catch (Exception e) { LOG.error(e.getMessage(), e); throw new RuntimeException(e.getMessage(), e); } }

Target:
protected List<StaleCheckBatchRow> convertParsedObjectToVO(Object parsedContent) { try { return StaleCheckExtractCsvBuilder.buildStaleCheckExtractList((List<Map<String,String>>) parsedContent); } catch (Exception e) { LOG.error("convertParsedObjectToVO: " + e.getMessage(), e); throw new RuntimeException(e.getMessage(), e); } }
Source:
public void updated(Dictionary config) throws ConfigurationException { if (config != null) { boolean properlyConfigured = true; long refreshInterval = DEFAULT_REFRESH_INTERVAL; int port = DEFAULT_PORT; String ip = null; try { String refreshIntervalString = (String) config.get("refresh"); refreshInterval = StringUtils.isNotBlank(refreshIntervalString) ? Long.parseLong(refreshIntervalString) : DEFAULT_REFRESH_INTERVAL; ip = (String) config.get("ip"); properlyConfigured = properlyConfigured && StringUtils.isNotBlank(ip); String portString = (String) config.get("port"); port = StringUtils.isNumeric(portString) ? Integer.parseInt(portString) : DEFAULT_PORT; } catch (NumberFormatException ex) { properlyConfigured = false; } if (properlyConfigured) { this.refreshInterval = refreshInterval; HeatPumpBinding.ip = ip; HeatPumpBinding.port = port; } setProperlyConfigured(properlyConfigured); } }

Target:
public void updated(Dictionary config) throws ConfigurationException { if (config != null) { boolean properlyConfigured = true; long refreshInterval = DEFAULT_REFRESH_INTERVAL; int port = DEFAULT_PORT; String ip = null; try { String refreshIntervalString = (String) config.get("refresh"); refreshInterval = isNotBlank(refreshIntervalString) ? Long.parseLong(refreshIntervalString) : DEFAULT_REFRESH_INTERVAL; ip = (String) config.get("ip"); properlyConfigured = properlyConfigured && isNotBlank(ip); String portString = (String) config.get("port"); port = isNumeric(portString) ? Integer.parseInt(portString) : DEFAULT_PORT; } catch (NumberFormatException ex) { properlyConfigured = false; } if (properlyConfigured) { this.refreshInterval = refreshInterval; HeatPumpBinding.ip = ip; HeatPumpBinding.port = port; } setProperlyConfigured(properlyConfigured); } }
Source:
public void exec(final MainRemote.Script script) throws Exception { final File file = File.createTempFile("takes-", ".txt"); if (!file.delete()) { file.deleteOnExit(); } final Method method = this.app.getDeclaredMethod( "main", String[].class ); final String[] passed = new String[1 + this.args.length]; passed[0] = String.format("--port=%s", file.getAbsoluteFile()); for (int idx = 0; idx < this.args.length; ++idx) { passed[idx + 1] = this.args[idx]; } final Thread thread = new Thread(new MainMethod(method, passed)); thread.start(); try { script.exec( URI.create( String.format( "http://localhost:%d", MainRemote.port(file) ) ) ); } finally { if (!file.delete()) { file.deleteOnExit(); } thread.interrupt(); } }

Target:
public void exec(final MainRemote.Script script) throws Exception { final File file = File.createTempFile("takes-", ".txt"); if (!file.delete()) { throw new IOException( String.format( "The temporary file '%s' could not be deleted before calling the exec method", file.getAbsolutePath() ) ); } final Method method = this.app.getDeclaredMethod( "main", String[].class ); final String[] passed = new String[1 + this.args.length]; passed[0] = String.format("--port=%s", file.getAbsoluteFile()); for (int idx = 0; idx < this.args.length; ++idx) { passed[idx + 1] = this.args[idx]; } final Thread thread = new Thread(new MainMethod(method, passed)); thread.start(); try { script.exec( URI.create( String.format( "http://localhost:%d", MainRemote.port(file) ) ) ); } catch (final IOException ex) { if (!file.delete()) { ex.addSuppressed( new IOException( String.format( "The temporary file '%s' could not be deleted while catching the error", file.getAbsolutePath() ) ) ); } throw ex; } finally { thread.interrupt(); } if (!file.delete()) { throw new IOException( String.format( "The temporary file '%s' could not be deleted after calling the exec method", file.getAbsolutePath() ) ); } }
Source:
public ContainerRequest filter(ContainerRequest request) { if (getAuthConfig().isEnabled()) { final String dataSourceName; if (request.getPath().startsWith("druid/coordinator/v1/rules/")) { dataSourceName = request.getPathSegments().get(4).getPath(); } else if ( request.getPath().startsWith("druid/coordinator/v1/datasources/") || request.getPath().startsWith("druid/coordinator/v1/metadata/datasources/") || request.getPath().startsWith("druid/v2/datasources/") ) { dataSourceName = request.getPathSegments() .get( Iterables.indexOf( request.getPathSegments(), new Predicate<PathSegment>() { @Override public boolean apply(PathSegment input) { return input.getPath().equals("datasources"); } } ) + 1 ).getPath(); } else { throw new WebApplicationException( Response.status(Response.Status.BAD_REQUEST) .entity( String.format("Do not know how to extract dataSource information " + "for authorization check for request path: [%s]", request.getPath() ) ).build() ); } Preconditions.checkNotNull(dataSourceName); final AuthorizationInfo authorizationInfo = (AuthorizationInfo) getReq().getAttribute(AuthConfig.DRUID_AUTH_TOKEN); Preconditions.checkNotNull( authorizationInfo, "Security is enabled but no authorization info found in the request" ); final Access authResult = authorizationInfo.isAuthorized( new Resource(dataSourceName, ResourceType.DATASOURCE), getAction(request) ); if (!authResult.isAllowed()) { throw new WebApplicationException( Response.status(Response.Status.FORBIDDEN) .entity(String.format("Access-Check-Result: %s", authResult.toString())) .build() ); } } return request; }

Target:
public ContainerRequest filter(ContainerRequest request) { if (getAuthConfig().isEnabled()) { final String dataSourceName = request.getPathSegments() .get( Iterables.indexOf( request.getPathSegments(), new Predicate<PathSegment>() { @Override public boolean apply(PathSegment input) { return input.getPath().equals("datasources"); } } ) + 1 ).getPath(); Preconditions.checkNotNull(dataSourceName); final AuthorizationInfo authorizationInfo = (AuthorizationInfo) getReq().getAttribute(AuthConfig.DRUID_AUTH_TOKEN); Preconditions.checkNotNull( authorizationInfo, "Security is enabled but no authorization info found in the request" ); final Access authResult = authorizationInfo.isAuthorized( new Resource(dataSourceName, ResourceType.DATASOURCE), getAction(request) ); if (!authResult.isAllowed()) { throw new WebApplicationException( Response.status(Response.Status.FORBIDDEN) .entity(String.format("Access-Check-Result: %s", authResult.toString())) .build() ); } } return request; }
Source:
public void deactivate() { logger.debug("deactivate discovery service for scene type remove thing tyspes {}", sceneType, super.getSupportedThingTypes().toString()); removeOlderResults(new Date().getTime()); }

Target:
public void deactivate() { logger.debug("deactivate discovery service for scene type remove thing tyspes {}", sceneType, super.getSupportedThingTypes()); removeOlderResults(new Date().getTime()); }
Source:
public static void closeQuietly(Closeable closeable) { if (closeable == null) { return; } try { closeable.close(); } catch (IOException ignored) { ignore(ignored); } }

Target:
public static void closeQuietly(Closeable closeable) { if (closeable == null) { return; } try { closeable.close(); } catch (IOException ignored) { EmptyStatement.ignore(ignored); } }
Source:
public static void assertAllGood(Cache cache) { SearchManager searchManager = Search.getSearchManager(cache); SearchIntegrator searchFactory = searchManager.unwrap(SearchIntegrator.class); ErrorHandler errorHandler = searchFactory.getErrorHandler(); Assert.assertNotNull(errorHandler); if(errorHandler instanceof WrappingErrorHandler) { errorHandler = ((WrappingErrorHandler) errorHandler).unwrap(); } Assert.assertTrue(errorHandler instanceof StaticTestingErrorHandler); StaticTestingErrorHandler instance = (StaticTestingErrorHandler) errorHandler; Object fault = instance.getAndReset(); if (fault!=null) { Assert.fail(fault.toString()); } }

Target:
public static void assertAllGood(Cache cache) { SearchManager searchManager = Search.getSearchManager(cache); SearchIntegrator searchFactory = searchManager.unwrap(SearchIntegrator.class); ErrorHandler errorHandler = searchFactory.getErrorHandler(); assertNotNull(errorHandler); if (errorHandler instanceof WrappingErrorHandler) { errorHandler = ((WrappingErrorHandler) errorHandler).unwrap(); } assertTrue(errorHandler instanceof StaticTestingErrorHandler); StaticTestingErrorHandler instance = (StaticTestingErrorHandler) errorHandler; Object fault = instance.getAndReset(); if (fault != null) { fail(fault.toString()); } }
Source:
private void sendLatency(long latency, String service, Throwable er) { connection.getClient().event() .description("This is a storm latency.") .metric(latency) .service(service) .tags("storm", "latency") .state(er == null ? "success" : "failure").send(); }

Target:
private void sendLatency(long latency, String service, Throwable er) { try { connection.getClient().event() .description("This is a storm latency.") .metric(latency) .service(service) .tags("storm", "latency") .state(er == null ? "success" : "failure").send(); } catch(Throwable t) { logger.warn("Riemann error during send : " + t.getStackTrace()); } }
Source:
public void start() { if (stepClassWithSpringContext == null) { throw new CucumberException("No glue class with @ContextConfiguration or " + "@ContextHierarcy annotation found in: " + stepClasses.toString()); } testContextManager = new CucumberTestContextManager(stepClassWithSpringContext); notifyContextManagerAboutTestClassStarted(); if (isFirstScenario() || isNewContextCreated()) { beanFactory = testContextManager.getBeanFactory(); for (Class<?> stepClass : stepClasses) { registerStepClassBeanDefinition(stepClass); } } GlueCodeContext.INSTANCE.start(); }

Target:
public void start() { if (stepClassWithSpringContext != null) { testContextManager = new CucumberTestContextManager(stepClassWithSpringContext); } else { if (beanFactory == null) { beanFactory = createFallbackContext(); } } notifyContextManagerAboutTestClassStarted(); if (beanFactory == null || isNewContextCreated()) { beanFactory = testContextManager.getBeanFactory(); for (Class<?> stepClass : stepClasses) { registerStepClassBeanDefinition(beanFactory, stepClass); } } GlueCodeContext.INSTANCE.start(); }
Source:
public APIResult getExtensionDescription( @PathParam("extension-name") String extensionName) { checkIfExtensionServiceIsEnabled(); validateExtensionName(extensionName); try { return new APIResult(APIResult.Status.SUCCEEDED, ExtensionStore.get().getResource(extensionName, README)); } catch (Throwable e) { throw FalconWebException.newAPIException(e, Response.Status.BAD_REQUEST); } }

Target:
public APIResult getExtensionDescription( @PathParam("extension-name") String extensionName) { checkIfExtensionServiceIsEnabled(); validateExtensionName(extensionName); try { return new APIResult(APIResult.Status.SUCCEEDED, ExtensionStore.get().getResource(extensionName, README)); } catch (FalconException e) { throw FalconWebException.newAPIException(e, Response.Status.BAD_REQUEST); } catch (Throwable e) { throw FalconWebException.newAPIException(e, Response.Status.INTERNAL_SERVER_ERROR); } }
Source:
protected int doWork() { IOUtil.assertFileIsReadable(INPUT); IOUtil.assertFileIsReadable(SEQUENCE_DICTIONARY); IOUtil.assertFileIsWritable(OUTPUT); final SAMSequenceDictionary samSequenceDictionary = SAMSequenceDictionaryExtractor.extractDictionary(SEQUENCE_DICTIONARY); final VCFFileReader fileReader = new VCFFileReader(INPUT, false); final VCFHeader fileHeader = fileReader.getFileHeader(); final VariantContextWriterBuilder builder = new VariantContextWriterBuilder() .setReferenceDictionary(samSequenceDictionary) .clearOptions(); if (CREATE_INDEX) builder.setOption(Options.INDEX_ON_THE_FLY); if ( OUTPUT.getPath().equals(STD_OUT) ) { builder.setOutputStream(System.out); } else { builder.setOutputFile(OUTPUT); } final VariantContextWriter vcfWriter = builder.build(); fileHeader.setSequenceDictionary(samSequenceDictionary); vcfWriter.writeHeader(fileHeader); final ProgressLogger progress = new ProgressLogger(log, 10000); final CloseableIterator<VariantContext> iterator = fileReader.iterator(); while (iterator.hasNext()) { final VariantContext context = iterator.next(); vcfWriter.add(context); progress.record(context.getContig(), context.getStart()); } CloserUtil.close(iterator); CloserUtil.close(fileReader); vcfWriter.close(); return 0; }

Target:
protected int doWork() { IOUtil.assertFileIsReadable(INPUT); IOUtil.assertFileIsReadable(SEQUENCE_DICTIONARY); IOUtil.assertFileIsWritable(OUTPUT); final SAMSequenceDictionary samSequenceDictionary = SAMSequenceDictionaryExtractor.extractDictionary(SEQUENCE_DICTIONARY); final VCFFileReader fileReader = new VCFFileReader(INPUT, false); final VCFHeader fileHeader = fileReader.getFileHeader(); final VariantContextWriterBuilder builder = new VariantContextWriterBuilder() .setReferenceDictionary(samSequenceDictionary) .clearOptions(); if (CREATE_INDEX) builder.setOption(Options.INDEX_ON_THE_FLY); try { builder.setOutputStream(new FileOutputStream(OUTPUT)); } catch (final FileNotFoundException ex ) { throw new PicardException("Could not open " + OUTPUT.getAbsolutePath() + ": " + ex.getMessage(), ex); } final VariantContextWriter vcfWriter = builder.build(); fileHeader.setSequenceDictionary(samSequenceDictionary); vcfWriter.writeHeader(fileHeader); final ProgressLogger progress = new ProgressLogger(log, 10000); final CloseableIterator<VariantContext> iterator = fileReader.iterator(); while (iterator.hasNext()) { final VariantContext context = iterator.next(); vcfWriter.add(context); progress.record(context.getContig(), context.getStart()); } CloserUtil.close(iterator); CloserUtil.close(fileReader); vcfWriter.close(); return 0; }
Source:
static void checkConfigGroupsHasServiceName() { Map<Long, ConfigGroup> configGroupMap = collectConfigGroupsWithoutServiceName(); if (MapUtils.isEmpty(configGroupMap)) return; StringBuilder output = new StringBuilder("[(ConfigGroup) => "); for (ConfigGroup configGroup : configGroupMap.values()) { output.append("( "); output.append(configGroup.getName()); output.append(" ), "); } output.replace(output.lastIndexOf(","), output.length(), "]"); warning("You have config groups present in the database with no " + "service name, {}. Run --auto-fix-database to fix " + "this automatically. Please backup Ambari Server database before running --auto-fix-database.", output.toString()); }

Target:
static void checkConfigGroupsHasServiceName() { Map<Long, ConfigGroup> configGroupMap = collectConfigGroupsWithoutServiceName(); if (MapUtils.isEmpty(configGroupMap)) return; String message = String.join(" ), ( ", configGroupMap.values().stream().map(ConfigGroup::getName).collect(Collectors.toList())); warning("You have config groups present in the database with no " + "service name, [(ConfigGroup) => ( )]. Run --auto-fix-database to fix " + "this automatically. Please backup Ambari Server database before running --auto-fix-database.", message); }
Source:
public void run() { try { int priority = getThreadPlatformPriority(); if (priority != initialPlatformPriority) { throw new Error("Expected " + maxPlatformPriority + ", got " + priority); } processStarted.countDown(); prioritySet.await(); priority = getThreadPlatformPriority(); if (priority != maxPlatformPriority) { throw new Error("Expected " + maxPlatformPriority + ", got " + priority); } } catch (Exception e) { throw new Error(e); } }

Target:
public void run() { try { int priority = getThreadPlatformPriority(); if (priority != initialPlatformPriority) { throw new Error("Expected " + initialPlatformPriority + ", got " + priority); } processStarted.countDown(); prioritySet.await(); priority = getThreadPlatformPriority(); if (priority != maxPlatformPriority) { throw new Error("Expected " + maxPlatformPriority + ", got " + priority); } } catch (Exception e) { throw new Error(e); } }
Source:
public static List<AccurevTransaction> getTransactionsAfterLastTransaction( final AccurevSCM scm, final AccurevServer server, final EnvVars accurevEnv, final FilePath workspace, final TaskListener listener, final Launcher launcher, final String stream, final int lastTransaction) throws IOException{ final ArgumentListBuilder cmd = new ArgumentListBuilder(); cmd.add("hist"); addServer(cmd, server); cmd.add("-fx"); cmd.add("-p"); cmd.add(scm.getDepot()); cmd.add("-s"); cmd.add(stream); if (lastTransaction > 0) { cmd.add("-t"); cmd.add("now-" + (lastTransaction+1)); } XmlPullParserFactory parser = XmlParserFactory.getFactory(); if (parser == null) throw new IOException("No XML Parser"); final List<AccurevTransaction> transactions = new ArrayList<AccurevTransaction>(); final Boolean transactionFound = AccurevLauncher.runCommand("History command", launcher, cmd, scm.getOptionalLock(), accurevEnv, workspace, listener, logger, parser, new ParseHistory(), transactions, true); if (transactionFound == null) { throw new IOException("History command failed when trying to get all the transactionse "); } return transactions; }

Target:
public static List<AccurevTransaction> getTransactionsAfterLastTransaction( final AccurevSCM scm, final AccurevServer server, final EnvVars accurevEnv, final FilePath workspace, final TaskListener listener, final Launcher launcher, final String stream, final int lastTransaction) throws IOException{ final ArgumentListBuilder cmd = new ArgumentListBuilder(); cmd.add("hist"); addServer(cmd, server); cmd.add("-fx"); cmd.add("-p"); cmd.add(scm.getDepot()); cmd.add("-s"); cmd.add(stream); if (lastTransaction > 0) { cmd.add("-t"); cmd.add("now-" + (lastTransaction+1)); } XmlPullParserFactory parser = XmlParserFactory.getFactory(); if (parser == null) throw new IOException("No XML Parser"); final List<AccurevTransaction> transactions = new ArrayList<AccurevTransaction>(); final Boolean transactionFound = AccurevLauncher.runHistCommandForAll("History command", scm.getAccurevTool(),launcher, cmd, scm.getOptionalLock(), accurevEnv, workspace, listener, logger, parser, new ParseHistory(), transactions); if (transactionFound == null) { throw new IOException("History command failed when trying to get all the transactionse "); } return transactions; }
Source:
public <K, V> BulkOperations.Cache<K, V> getCache(String cacheName, boolean preferAsync) { return getCache(cacheName); }

Target:
public <K, V> BulkOperations.Cache<K, V> getCache(String cacheName, boolean preferAsync) { if (cacheName == null) { cacheName = service.cacheName; } if (cacheName == null) { return new HotRodBulkOperationsCache<>((RemoteCache<K,V>) service.managerNoReturn.getCache(false), (RemoteCache<K,V>) service.managerForceReturn.getCache(true), preferAsync); } else { return new HotRodBulkOperationsCache<>((RemoteCache<K,V>) service.managerNoReturn.getCache(cacheName, false), (RemoteCache<K,V>) service.managerForceReturn.getCache(cacheName, true), preferAsync); } }
Source:
public String getHelpContextId(String commandId, IEclipseContext context) throws NotDefinedException { if (commandId == null || context == null) { return null; } Command command = commandService.getCommand(commandId); if (!command.isDefined()) { throw new NotDefinedException("The command is not defined. " + command.getId()); } IHandler handler = (IHandler) HandlerServiceImpl.lookUpHandler(context, commandId); if (handler instanceof E4HandlerProxy) { handler = ((E4HandlerProxy) handler).getHandler(); } String contextId = helpContextIdsByHandler.get(handler); if (contextId == null) { contextId = Util.getHelpContextId(command); } return contextId; }

Target:
public String getHelpContextId(String commandId, IEclipseContext context) { if (commandId == null || context == null) { return null; } Command command = commandService.getCommand(commandId); if (!command.isDefined()) { if (logger != null) { logger.error("The command " + commandId + " is not defined. Help context ID cannot be determined."); } return null; } IHandler handler = (IHandler) HandlerServiceImpl.lookUpHandler(context, commandId); if (handler instanceof E4HandlerProxy) { handler = ((E4HandlerProxy) handler).getHandler(); } String contextId = helpContextIdsByHandler.get(handler); if (contextId == null) { contextId = Util.getHelpContextId(command); } return contextId; }
Source:
public void testExecute_withNewStudent_shouldBeAddedToDatabase() { String courseId = typicalBundle.students.get("student1InCourse1").getCourse(); StudentAttributes newStudent = getTypicalNewStudent(courseId); StudentsEnrollRequest req = prepareRequest(Collections.singletonList(newStudent)); loginAsInstructor(typicalBundle.instructors.get("instructor1OfCourse1").getGoogleId()); List<StudentData> enrolledStudents = executeActionAndReturnResults(courseId, req); assertEquals(1, enrolledStudents.size()); verifyStudentInDatabase(newStudent, enrolledStudents.get(0).getCourseId(), enrolledStudents.get(0).getEmail()); verifyCorrectResponseData(req.getStudentEnrollRequests().get(0), enrolledStudents.get(0)); }

Target:
public void testExecute_withNewStudent_shouldBeAddedToDatabase() { String courseId = typicalBundle.students.get("student1InCourse1").getCourse(); StudentAttributes newStudent = getTypicalNewStudent(courseId); StudentsEnrollRequest req = prepareRequest(Arrays.asList(newStudent)); loginAsInstructor(typicalBundle.instructors.get("instructor1OfCourse1").getGoogleId()); List<StudentData> enrolledStudents = executeActionAndReturnResults(courseId, req); assertEquals(1, enrolledStudents.size()); verifyStudentInDatabase(newStudent, enrolledStudents.get(0).getCourseId(), enrolledStudents.get(0).getEmail()); verifyCorrectResponseData(req.getStudentEnrollRequests().get(0), enrolledStudents.get(0)); }
Source:
public static List<String> readFromClasspath(String filename) { List<String> lines = null; try { InputStream resource = IOUtils.lsResources(IllinoisLemmatizer.class, filename).get(0).openStream(); lines = LineIO.read(resource, Charset.defaultCharset().name(), new ITransformer<String, String>() { public String transform(String line) { return line; } }); } catch (IOException | URISyntaxException e) { logger.error("Error while trying to read " + filename + "."); System.exit(-1); } return lines; }

Target:
public static List<String> readFromClasspath(String filename) { List<String> lines = null; try { InputStream resource = IOUtils.lsResources(IllinoisLemmatizer.class, filename).get(0).openStream(); lines = LineIO.read(resource, Charset.defaultCharset().name(), new ITransformer<String, String>() { public String transform(String line) { return line; } }); } catch (IOException | URISyntaxException e) { System.err.println("Error while trying to read " + filename + "."); System.exit(-1); } return lines; }
Source:
private Action getAction(int position) { return detail.getCustomActions().get(position - (dividerPosition + 1)); }

Target:
private Action getAction(int position) { int baseActionPosition = dividerPosition + 1; return detail.getCustomActions().get(position - baseActionPosition); }
Source:
public boolean equals(Object obj) { if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final TeleportInfo other = (TeleportInfo) obj; try { if (!(world.equalsIgnoreCase(other.getWorld()) || (Bukkit.getWorld(UUID.fromString(world)).getName().equalsIgnoreCase(other.getWorld()) || Bukkit.getWorld(UUID.fromString(other.getWorld())).getName().equalsIgnoreCase(world)))) { return false; } } catch (Exception e) { return false; } return server.equalsIgnoreCase(other.getServer()) && x == other.getX() && y == other.getY() && z == other.getZ(); }

Target:
public boolean equals(Object obj) { if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final TeleportInfo other = (TeleportInfo) obj; return world.equals(other.getWorld()) && server.equalsIgnoreCase(other.getServer()) && x == other.getX() && y == other.getY() && z == other.getZ(); }
Source:
public static String buildString(@Nullable final MessageNumberSet[] msgsets) { if (msgsets == null || msgsets.length == 0) { return null; } int i = 0; final StringBuilder s = new StringBuilder(); int size = msgsets.length; long start, end; for (;;) { start = msgsets[i].start; end = msgsets[i].end; if (msgsets[i].seqType == SequenceType.LAST_MESSAGE_ONLY) { s.append('*'); } else if (msgsets[i].seqType == SequenceType.LAST_MESSAGE_END) { s.append(start).append(':').append('*'); } else if (end > start) { s.append(start).append(':').append(end); } else { s.append(start); } i++; if (i >= size) { break; } else { s.append(','); } } return s.toString(); }

Target:
public static String buildString(@Nullable final MessageNumberSet[] msgsets) { if (msgsets == null || msgsets.length == 0) { return null; } final Set<MessageNumberSet> elems = new LinkedHashSet<>(Arrays.asList(msgsets)); int i = 0; final StringBuilder s = new StringBuilder(); final int size = elems.size(); long start, end; for (final MessageNumberSet elem : elems) { start = elem.start; end = elem.end; if (elem.seqType == SequenceType.LAST_MESSAGE_ONLY) { s.append('*'); } else if (elem.seqType == SequenceType.LAST_MESSAGE_END) { s.append(start).append(':').append('*'); } else if (end > start) { s.append(start).append(':').append(end); } else { s.append(start); } i++; if (i >= size) { break; } else { s.append(','); } } return s.toString(); }
Source:
OCFileListFragment.class.getPackage().getName() : "com.owncloud.android.ui.fragment"; protected final static String ARG_ALLOW_CONTEXTUAL_MODE = MY_PACKAGE + ".ALLOW_CONTEXTUAL"; protected final static String ARG_HIDE_FAB = MY_PACKAGE + ".HIDE_FAB"; private static final String KEY_FILE = MY_PACKAGE + ".extra.FILE"; private static final String KEY_FAB_EVER_CLICKED = "FAB_EVER_CLICKED"; private static final String QUERY_TO_MOVE_DIALOG_TAG = "QUERY_TO_MOVE"; private static final int CAMERA_REQUEST = 1888; private static final int REQUEST_IMAGE_CAPTURE = 1; private static final int CAPTURED_IMAGE_CHECK = 80; private static final String GRID_IS_PREFERED_PREFERENCE = "gridIsPrefered"; private static String DIALOG_CREATE_FOLDER = "DIALOG_CREATE_FOLDER"; private FileFragment.ContainerActivity mContainerActivity; private OCFile mFile = null; private FileListListAdapter mAdapter; private LinearLayout filesLinearLayout; private LinearLayout cameraUploadLinearLayout; private int mStatusBarColorActionMode; private int mStatusBarColor; private boolean mHideFab = true; private boolean miniFabClicked = false; private ActionMode mActiveActionMode; private OCFileListFragment.MultiChoiceModeListener mMultiChoiceModeListener; public static OCFileListFragment newInstance( boolean justFolders, boolean hideFAB, boolean allowContextualMode ) { OCFileListFragment frag = new OCFileListFragment(); Bundle args = new Bundle(); args.putBoolean(ARG_JUST_FOLDERS, justFolders); args.putBoolean(ARG_HIDE_FAB, hideFAB); args.putBoolean(ARG_ALLOW_CONTEXTUAL_MODE, allowContextualMode); frag.setArguments(args); return frag; }

Target:
OCFileListFragment.class.getPackage().getName() : "com.owncloud.android.ui.fragment"; protected final static String ARG_ALLOW_CONTEXTUAL_MODE = MY_PACKAGE + ".ALLOW_CONTEXTUAL"; protected final static String ARG_HIDE_FAB = MY_PACKAGE + ".HIDE_FAB"; private static final String KEY_FILE = MY_PACKAGE + ".extra.FILE"; private static final String KEY_FAB_EVER_CLICKED = "FAB_EVER_CLICKED"; private static final String GRID_IS_PREFERED_PREFERENCE = "gridIsPrefered"; private static String DIALOG_CREATE_FOLDER = "DIALOG_CREATE_FOLDER"; private FileFragment.ContainerActivity mContainerActivity; private OCFile mFile = null; private FileListListAdapter mAdapter; private LinearLayout uploadFilesLinearLayout; private LinearLayout uploadFromCameraLinearLayout; private BottomSheetBehavior uploadBottomSheetBehavior; private int mStatusBarColorActionMode; private int mStatusBarColor; private boolean mHideFab = true; private boolean miniFabClicked = false; private ActionMode mActiveActionMode; private OCFileListFragment.MultiChoiceModeListener mMultiChoiceModeListener; public static OCFileListFragment newInstance( boolean justFolders, boolean hideFAB, boolean allowContextualMode ) { OCFileListFragment frag = new OCFileListFragment(); Bundle args = new Bundle(); args.putBoolean(ARG_JUST_FOLDERS, justFolders); args.putBoolean(ARG_HIDE_FAB, hideFAB); args.putBoolean(ARG_ALLOW_CONTEXTUAL_MODE, allowContextualMode); frag.setArguments(args); return frag; }
Source:
protected void executeCommand() { List<String> macsToRemove = getVmNetworkInterfaceDao().getAllMacsByDataCenter(getStoragePool().getId()); removeNetworks(); List<storage_domains> storageDomains = DbFacade.getInstance().getStorageDomainDao().getAllForStoragePool( getStoragePool().getId()); Collections.sort(storageDomains, new Comparator<storage_domains>() { @Override public int compare(storage_domains o1, storage_domains o2) { return o1.getstorage_domain_type().compareTo(o2.getstorage_domain_type()); } }); if (storageDomains.size() > 0) { if (!getParameters().getForceDelete() && getAllRunningVdssInPool().size() > 0) { if(!regularRemoveStorageDomains(storageDomains)) { setSucceeded(false); return; } } else if (getParameters().getForceDelete()) { forceRemoveStorageDomains(storageDomains); } else { return; } } getStoragePoolDAO().remove(getStoragePool().getId()); setSucceeded(true); if (macsToRemove != null && !macsToRemove.isEmpty()) { MacPoolManager.getInstance().freeMacs(macsToRemove); } }

Target:
protected void executeCommand() { List<String> macsToRemove = getVmNetworkInterfaceDao().getAllMacsByDataCenter(getStoragePool().getId()); removeNetworks(); List<storage_domains> storageDomains = DbFacade.getInstance().getStorageDomainDao().getAllForStoragePool( getStoragePool().getId()); Collections.sort(storageDomains, new Comparator<storage_domains>() { @Override public int compare(storage_domains o1, storage_domains o2) { return o1.getstorage_domain_type().compareTo(o2.getstorage_domain_type()); } }); if (storageDomains.size() > 0) { if (!getParameters().getForceDelete() && getAllRunningVdssInPool().size() > 0) { if(!regularRemoveStorageDomains(storageDomains)) { setSucceeded(false); return; } } else if (getParameters().getForceDelete()) { forceRemoveStorageDomains(storageDomains); } else { return; } } getStoragePoolDAO().remove(getStoragePool().getId()); MacPoolManager.getInstance().freeMacs(macsToRemove); setSucceeded(true); }
Source:
public void setArea(String area) throws ParseException { if (area.startsWith("CIRCLE")) { geometry = new GeofenceCircle(area); } else if (area.startsWith("POLYGON")) { geometry = new GeofencePolygon(area); } else if (area.startsWith("LINESTRING")) { final double distance = getDouble("polylineDistance"); geometry = new GeofencePolyline(area, distance >= 1 ? distance : Context.getConfig().getDouble("geofence.polylineDistance", 25)); } else { throw new ParseException("Unknown geometry type", 0); } this.area = area; }

Target:
public void setArea(String area) throws ParseException { if (area.startsWith("CIRCLE")) { geometry = new GeofenceCircle(area); } else if (area.startsWith("POLYGON")) { geometry = new GeofencePolygon(area); } else if (area.startsWith("LINESTRING")) { final double distance = getDouble("polylineDistance"); geometry = new GeofencePolyline(area, distance > 0 ? distance : Context.getConfig().getDouble("geofence.polylineDistance", 25)); } else { throw new ParseException("Unknown geometry type", 0); } this.area = area; }
Source:
public abstract void load(Connection conn) throws SQLException; public Connection getConn() { return conn; }

Target:
public abstract void load(Connection conn) throws SQLException; public Connection getConnection() { return conn; }