auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testSlotAllocationNoResourceManager() throws Exception { try (SlotPool pool = createAndSetUpSlotPool(false)) { final CompletableFuture<PhysicalSlot> future = testMainThreadExecutor.execute(() -> pool.requestNewAllocatedSlot( new SlotRequestId(), ResourceProfile.UNKNOWN, fastTimeout)); try { future.get(); fail("We expected an ExecutionException."); } catch (ExecutionException e) { assertTrue(ExceptionUtils.stripExecutionException(e) instanceof TimeoutException); } } }

Target:
public void testSlotAllocationNoResourceManager() throws Exception { try (SlotPool pool = createAndSetUpSlotPoolWithoutResourceManager()) { final CompletableFuture<PhysicalSlot> future = testMainThreadExecutor.execute(() -> pool.requestNewAllocatedSlot( new SlotRequestId(), ResourceProfile.UNKNOWN, fastTimeout)); try { future.get(); fail("We expected an ExecutionException."); } catch (ExecutionException e) { assertTrue(ExceptionUtils.stripExecutionException(e) instanceof TimeoutException); } } }
Source:
public int onStartCommand(Intent intent, int flags, int startId) { super.onStartCommand(intent, flags, startId); Log.d(TAG, "OnStartCommand called"); final int keycode = intent.getIntExtra(MediaButtonReceiver.EXTRA_KEYCODE, -1); final boolean castDisconnect = intent.getBooleanExtra(EXTRA_CAST_DISCONNECT, false); Playable playable = intent.getParcelableExtra(EXTRA_PLAYABLE); if (keycode == -1 && playable == null && !castDisconnect) { Log.d(TAG, "PlaybackService was started with no arguments."); return Service.START_NOT_STICKY; } if (keycode != -1) { Log.d(TAG, "Received media button event"); boolean handled = handleKeycode(keycode, true); if (!handled) { serviceManager.stopService(); return Service.START_NOT_STICKY; } } else if (!flavorHelper.castDisconnect(castDisconnect) && playable != null) { boolean stream = intent.getBooleanExtra(EXTRA_SHOULD_STREAM, true); boolean startWhenPrepared = intent.getBooleanExtra(EXTRA_START_WHEN_PREPARED, false); boolean prepareImmediately = intent.getBooleanExtra(EXTRA_PREPARE_IMMEDIATELY, false); sendNotificationBroadcast(NOTIFICATION_TYPE_RELOAD, 0); flavorHelper.castDisconnect(playable instanceof ExternalMedia); if (playable instanceof FeedMedia) { playable = DBReader.getFeedMedia(((FeedMedia) playable).getId()); } mediaPlayer.playMediaObject(playable, stream, startWhenPrepared, prepareImmediately); } return Service.START_NOT_STICKY; }

Target:
public int onStartCommand(Intent intent, int flags, int startId) { super.onStartCommand(intent, flags, startId); Log.d(TAG, "OnStartCommand called"); final int keycode = intent.getIntExtra(MediaButtonReceiver.EXTRA_KEYCODE, -1); final boolean castDisconnect = intent.getBooleanExtra(EXTRA_CAST_DISCONNECT, false); Playable playable = intent.getParcelableExtra(EXTRA_PLAYABLE); if (keycode == -1 && playable == null && !castDisconnect) { Log.d(TAG, "PlaybackService was started with no arguments."); return Service.START_NOT_STICKY; } if (keycode != -1) { Log.d(TAG, "Received media button event"); boolean handled = handleKeycode(keycode, true); if (!handled) { return Service.START_NOT_STICKY; } } else if (!flavorHelper.castDisconnect(castDisconnect) && playable != null) { boolean stream = intent.getBooleanExtra(EXTRA_SHOULD_STREAM, true); boolean startWhenPrepared = intent.getBooleanExtra(EXTRA_START_WHEN_PREPARED, false); boolean prepareImmediately = intent.getBooleanExtra(EXTRA_PREPARE_IMMEDIATELY, false); sendNotificationBroadcast(NOTIFICATION_TYPE_RELOAD, 0); flavorHelper.castDisconnect(playable instanceof ExternalMedia); if (playable instanceof FeedMedia) { playable = DBReader.getFeedMedia(((FeedMedia) playable).getId()); } mediaPlayer.playMediaObject(playable, stream, startWhenPrepared, prepareImmediately); } return Service.START_NOT_STICKY; }
Source:
public void doFilter(ServletRequest req, ServletResponse rsp, FilterChain chain) throws IOException, ServletException { X509Certificate[] certs = (X509Certificate[]) req.getAttribute("javax.servlet.request.X509Certificate"); String name = certs[0].getSubjectDN().getName(); Matcher m = REGEX_USERID.matcher(name); String userName = null; if (m.matches()) { userName = m.group(1); } else { throw new ServletException("Couldn't extract username from your certificate"); } final AuthRequest areq = AuthRequest.forUser(userName); final AuthResult arsp; try { arsp = accountManager.authenticate(areq); } catch (AccountException e) { String err = "Unable to authenticate user \"" + userName + "\""; log.error(err, e); throw new ServletException(err, e); } webSession.get().login(arsp, true); chain.doFilter(req, rsp); }

Target:
public void doFilter(ServletRequest req, ServletResponse rsp, FilterChain chain) throws IOException, ServletException { X509Certificate[] certs = (X509Certificate[]) req.getAttribute("javax.servlet.request.X509Certificate"); if (certs == null || certs.length == 0) { throw new ServletException( "Couldn't get the attribute javax.servlet.request.X509Certificate from the request"); } String name = certs[0].getSubjectDN().getName(); Matcher m = REGEX_USERID.matcher(name); String userName; if (m.matches()) { userName = m.group(1); } else { throw new ServletException("Couldn't extract username from your certificate"); } final AuthRequest areq = AuthRequest.forUser(userName); final AuthResult arsp; try { arsp = accountManager.authenticate(areq); } catch (AccountException e) { String err = "Unable to authenticate user \"" + userName + "\""; log.error(err, e); throw new ServletException(err, e); } webSession.get().login(arsp, true); chain.doFilter(req, rsp); }
Source:
protected void internalRefresh(Object element) { disableRedraw(); try { boolean layoutChanged = false; BreadcrumbItem item= (BreadcrumbItem) doFindItem(element); if (item == null || element != null && element.equals(getInput())) { for (BreadcrumbItem item1 : fBreadcrumbItems) { layoutChanged = refreshItem(item1) || layoutChanged; } } else { layoutChanged = refreshItem(item) || layoutChanged; } if (layoutChanged) { updateSize(); fContainer.layout(true, true); } } finally { enableRedraw(); } }

Target:
protected void internalRefresh(Object element) { disableRedraw(); try { boolean layoutChanged = false; BreadcrumbItem item= (BreadcrumbItem) doFindItem(element); if (item == null || element != null && element.equals(getInput())) { for (BreadcrumbItem currItem : fBreadcrumbItems) { layoutChanged = refreshItem(currItem) || layoutChanged; } } else { layoutChanged = refreshItem(item) || layoutChanged; } if (layoutChanged) { updateSize(); fContainer.layout(true, true); } } finally { enableRedraw(); } }
Source:
private List<ApplicableClass> fillApplicableClasses() { List<IConfigurationElement> ces = new ArrayList<>(); IConfigurationElement[] tracetypeCE = fCe.getChildren(TmfAnalysisModuleSourceConfigElement.TRACETYPE_ELEM); ces.addAll(Arrays.asList(tracetypeCE)); tracetypeCE = Platform.getExtensionRegistry().getConfigurationElementsFor(TmfAnalysisModuleSourceConfigElement.TMF_ANALYSIS_TYPE_ID); String id = getId(); for (IConfigurationElement element : tracetypeCE) { String elementName = element.getName(); if (elementName.equals(TmfAnalysisModuleSourceConfigElement.TRACETYPE_ELEM)) { String analysisId = element.getAttribute(TmfAnalysisModuleSourceConfigElement.ID_ATTR); if (id.equals(analysisId)) { ces.add(element); } } } List<ApplicableClass> list = new ArrayList<>(); ces.forEach(ce -> { ApplicableClass traceTypeApplies = parseTraceTypeElement(ce); if (traceTypeApplies != null) { list.add(traceTypeApplies); } }); return list; }

Target:
private List<ApplicableClass> fillApplicableClasses() { List<IConfigurationElement> ces = new ArrayList<>(); IConfigurationElement[] tracetypeCE = fCe.getChildren(TmfAnalysisModuleSourceConfigElement.TRACETYPE_ELEM); ces.addAll(Arrays.asList(tracetypeCE)); tracetypeCE = Platform.getExtensionRegistry().getConfigurationElementsFor(TmfAnalysisModuleSourceConfigElement.TMF_ANALYSIS_TYPE_ID); String id = getId(); for (IConfigurationElement element : tracetypeCE) { String elementName = element.getName(); if (elementName.equals(TmfAnalysisModuleSourceConfigElement.TRACETYPE_ELEM)) { String analysisId = element.getAttribute(TmfAnalysisModuleSourceConfigElement.ID_ATTR); if (id.equals(analysisId)) { ces.add(element); } } } Map<Class<?>, ApplicableClass> classMap = new HashMap<>(); ces.forEach(ce -> { ApplicableClass traceTypeApplies = parseTraceTypeElement(ce); if (traceTypeApplies != null) { classMap.put(traceTypeApplies.fClass, traceTypeApplies); } }); List<ApplicableClass> applicableClasses = new ArrayList<>(classMap.values()); applicableClasses.sort(APPLICABLE_CLASS_COMPARATOR); return applicableClasses; }
Source:
public Block getBlock(int[] positions, int positionCount) { checkArgument(outputPositionCount > 0, "outputPositionCount must be greater than zero"); checkState(outputRequired, "This stream reader doesn't produce output"); checkState(positionCount <= outputPositionCount, "Not enough values"); if (allNulls) { return new RunLengthEncodedBlock(new DictionaryBlock(1, dictionaryBlock, new int[] {dictionaryBlock.getPositionCount() - 1}), positionCount); } if (positionCount == outputPositionCount) { Block block = new DictionaryBlock(positionCount, dictionaryBlock, values); values = null; outputPositions = null; return block; } int[] valuesCopy = new int[positionCount]; int positionIndex = 0; int nextPosition = positions[positionIndex]; for (int i = 0; i < outputPositionCount; i++) { if (outputPositions[i] < nextPosition) { continue; } assert outputPositions[i] == nextPosition; valuesCopy[positionIndex] = this.values[i]; positionIndex++; if (positionIndex >= positionCount) { break; } nextPosition = positions[positionIndex]; } return new DictionaryBlock(positionCount, dictionaryBlock, valuesCopy); }

Target:
public Block getBlock(int[] positions, int positionCount) { checkArgument(outputPositionCount > 0, "outputPositionCount must be greater than zero"); checkState(outputRequired, "This stream reader doesn't produce output"); checkState(positionCount <= outputPositionCount, "Not enough values"); checkState(!valuesInUse, "BlockLease hasn't been closed yet"); if (allNulls) { return new RunLengthEncodedBlock(outputType.createBlockBuilder(null, 1).appendNull().build(), outputPositionCount); } if (positionCount == outputPositionCount) { return new DictionaryBlock(positionCount, dictionaryBlock, values); } int[] valuesCopy = new int[positionCount]; int positionIndex = 0; int nextPosition = positions[positionIndex]; for (int i = 0; i < outputPositionCount; i++) { if (outputPositions[i] < nextPosition) { continue; } assert outputPositions[i] == nextPosition; valuesCopy[positionIndex] = this.values[i]; positionIndex++; if (positionIndex >= positionCount) { break; } nextPosition = positions[positionIndex]; } return new DictionaryBlock(positionCount, dictionaryBlock, valuesCopy); }
Source:
private static void createCopy(SWTBotTreeItem traceItem, boolean copyAsLink) { traceItem.contextMenu().menu("Copy...").click(); final String COPY_TRACE_DIALOG_TITLE = "Copy Trace"; fBot.waitUntil(Conditions.shellIsActive(COPY_TRACE_DIALOG_TITLE)); SWTBotShell shell = fBot.shell(COPY_TRACE_DIALOG_TITLE); SWTBotText text = shell.bot().textWithLabel("New Trace name:"); text.setText(RENAMED_TRACE_NAME); if (!copyAsLink) { shell.bot().radio(COPY_AS_NEW_TRACE_OPTION).click(); text.setText(RENAMED_AS_NEW_TRACE_NAME); } shell.bot().button("OK").click(); fBot.waitUntil(Conditions.shellCloses(shell)); }

Target:
private static void createCopy(SWTBotTreeItem traceItem, boolean copyAsLink) { SWTBotView viewBot = fBot.viewByTitle("Project Explorer"); viewBot.setFocus(); traceItem.contextMenu().menu("Copy...").click(); final String COPY_TRACE_DIALOG_TITLE = "Copy Trace"; fBot.waitUntil(Conditions.shellIsActive(COPY_TRACE_DIALOG_TITLE)); SWTBotShell shell = fBot.shell(COPY_TRACE_DIALOG_TITLE); SWTBotText text = shell.bot().textWithLabel("New Trace name:"); text.setText(RENAMED_TRACE_NAME); if (!copyAsLink) { shell.bot().radio(COPY_AS_NEW_TRACE_OPTION).click(); text.setText(RENAMED_AS_NEW_TRACE_NAME); } shell.bot().button("OK").click(); fBot.waitUntil(Conditions.shellCloses(shell)); }
Source:
private StmtTargetTableScan simplifierForSubquery(AbstractParsedStmt subquery) { if (!(subquery instanceof ParsedSelectStmt)) { return null; } ParsedSelectStmt selectSubquery = (ParsedSelectStmt) subquery; if (selectSubquery.hasAggregateOrGroupby()) { return null; } if (selectSubquery.hasAggregateDistinct()) { return null; } if (selectSubquery.hasWindowFunctionExpression()) { return null; } if (selectSubquery.hasLimitOrOffset() || selectSubquery.hasLimitOrOffsetParameters()) { return null; } int tableCount = 0; StmtTargetTableScan simpler = null; for (Map.Entry<String, StmtTableScan> entry : selectSubquery.m_tableAliasMap.entrySet()) { if (entry.getKey().contains(AbstractParsedStmt.TEMP_TABLE_NAME)) { continue; } if (++tableCount > 1) { return null; } StmtTableScan scan = entry.getValue(); if (scan instanceof StmtTargetTableScan) { simpler = (StmtTargetTableScan) scan; } else { return null; } } return simpler; }

Target:
private StmtTargetTableScan simplifierForSubquery(AbstractParsedStmt subquery) { if (!(subquery instanceof ParsedSelectStmt)) { return null; } ParsedSelectStmt selectSubquery = (ParsedSelectStmt) subquery; if (selectSubquery.hasAggregateOrGroupby()) { return null; } if (selectSubquery.hasAggregateDistinct()) { return null; } if (selectSubquery.hasWindowFunctionExpression()) { return null; } if (selectSubquery.hasLimitOrOffset() || selectSubquery.hasLimitOrOffsetParameters()) { return null; } int tableCount = 0; StmtTargetTableScan simpler = null; for (Map.Entry<String, StmtTableScan> entry : selectSubquery.m_tableAliasMap.entrySet()) { if (entry.getKey().startsWith(AbstractParsedStmt.TEMP_TABLE_NAME)) { continue; } if (++tableCount > 1) { return null; } StmtTableScan scan = entry.getValue(); if (scan instanceof StmtTargetTableScan) { simpler = (StmtTargetTableScan) scan; } else { return null; } } return simpler; }
Source:
public EmbeddedPostgres start() throws IOException { if (builderPort == 0) { builderPort = detectPort(); } if (builderDataDirectory == null) { builderDataDirectory = Files.createTempDirectory("epg").toFile(); } if (pgDirectoryResolver == null) { pgDirectoryResolver = UncompressBundleDirectoryResolver.getDefault(); } return new EmbeddedPostgres(parentDirectory, builderDataDirectory, builderCleanDataDirectory, config, localeConfig, builderPort, connectConfig, pgDirectoryResolver, errRedirector, outRedirector, pgStartupWait, overrideWorkingDirectory); }

Target:
public EmbeddedPostgres start() throws IOException { if (builderPort == 0) { builderPort = detectPort(); } if (builderDataDirectory == null) { builderDataDirectory = Files.createTempDirectory("epg").toFile(); } if (pgDirectoryResolver == null) { LOG.trace("pgDirectoryResolver not overriden, using default (UncompressBundleDirectoryResolver)"); pgDirectoryResolver = UncompressBundleDirectoryResolver.getDefault(); } return new EmbeddedPostgres(parentDirectory, builderDataDirectory, builderCleanDataDirectory, config, localeConfig, builderPort, connectConfig, pgDirectoryResolver, errRedirector, outRedirector, pgStartupWait, overrideWorkingDirectory); }
Source:
public void addMetric(ReplicationMetric replicationMetric) throws SemanticException { if (metricMap.size() > maxSize) { throw new SemanticException("Metrics are not getting collected. "); } else { if (metricMap.size() > 0.8 * maxSize) { LOG.error("Metrics cache is 80 % full. Will start dropping metrics once full. "); } metricMap.put(replicationMetric.getScheduledExecutionId(), replicationMetric); } }

Target:
public synchronized void addMetric(ReplicationMetric replicationMetric) throws SemanticException { if (metricMap.size() >= maxSize) { throw new SemanticException("Metrics are not getting collected. "); } else { if (metricMap.size() > 0.8 * maxSize) { LOG.warn("Metrics cache is more than 80 % full. Will start dropping metrics once full. "); } metricMap.put(replicationMetric.getScheduledExecutionId(), replicationMetric); } }
Source:
abstract ServerLocator initLocator() throws Exception; abstract ClientSessionFactory initClientSessionFactory(ServerLocator locator) throws Exception; public ClientSessionFactory getFactory() { synchronized (lock) { try { if (this.locator == null) { this.locator = initLocator(); } if (this.factory == null || this.factory.isClosed()) { this.factory = initClientSessionFactory(this.locator); } } catch (Exception e) { log.error("Unable to create connection to message bus.", e); throw new RuntimeException(e); } return this.factory; } }

Target:
abstract ServerLocator initLocator() throws Exception; abstract ClientSessionFactory initClientSessionFactory(ServerLocator locator) throws Exception; abstract ClientSession createClientSession() throws ActiveMQException; synchronized ClientSessionFactory getFactory() { try { if (this.locator == null) { this.locator = initLocator(); } if (this.factory == null || this.factory.isClosed()) { this.factory = initClientSessionFactory(this.locator); } } catch (Exception e) { log.error("Unable to create connection to message bus.", e); throw new RuntimeException(e); } return this.factory; }
Source:
public void updateAlertTarget(Integer targetId, Map<String, Object> ambariAlertNotifications) { ImmutableMap<String, Map<String, Object>> alertTargetRequest = ImmutableMap.of("AlertTarget", ambariAlertNotifications); restAdapter.create(AlertTargetEndpoint.class).editAlertNotification(targetId, alertTargetRequest); }

Target:
protected void updateAlertTarget(Integer targetId, Map<String, Object> ambariAlertNotifications) { ImmutableMap<String, Map<String, Object>> alertTargetRequest = ImmutableMap.of("AlertTarget", ambariAlertNotifications); restAdapter.create(AlertTargetEndpoint.class).editAlertNotification(targetId, alertTargetRequest); }
Source:
private static RetrySettings buildIdempotentRetrySettings(RetrySettings retrySettings, BigtableOptions options) { RetryOptions retryOptions = options.getRetryOptions(); RetrySettings.Builder retryBuilder = retrySettings.toBuilder(); retryBuilder .setInitialRetryDelay(ofMillis(retryOptions.getInitialBackoffMillis())) .setRetryDelayMultiplier(retryOptions.getBackoffMultiplier()) .setMaxRetryDelay(ofMillis(retryOptions.getMaxElapsedBackoffMillis())) .setMaxAttempts(retryOptions.getMaxScanTimeoutRetries()); Duration shortRpcTimeout = ofMillis(options.getCallOptionsConfig().getShortRpcTimeoutMs()); retryBuilder .setInitialRpcTimeout(shortRpcTimeout) .setMaxRpcTimeout(shortRpcTimeout) .setTotalTimeout(ofMillis(options.getCallOptionsConfig().getLongRpcTimeoutMs())); if (retryOptions.allowRetriesWithoutTimestamp()) { LOG.warn("Retries without Timestamp does not support yet."); } return retryBuilder.build(); }

Target:
private static RetrySettings buildIdempotentRetrySettings(RetrySettings retrySettings, BigtableOptions options) { RetryOptions retryOptions = options.getRetryOptions(); CallOptionsConfig callOptions = options.getCallOptionsConfig(); RetrySettings.Builder retryBuilder = retrySettings.toBuilder(); if (retryOptions.allowRetriesWithoutTimestamp()) { throw new UnsupportedOperationException("Retries without Timestamp does not support yet."); } Duration rpcTimeout = ofMillis(callOptions.isUseTimeout() ? callOptions.getShortRpcTimeoutMs() : RPC_DEADLINE_MS); retryBuilder .setInitialRetryDelay(ofMillis(retryOptions.getInitialBackoffMillis())) .setRetryDelayMultiplier(retryOptions.getBackoffMultiplier()) .setMaxRetryDelay(ofMillis(MAX_RETRY_TIMEOUT_MS)) .setInitialRpcTimeout(rpcTimeout) .setMaxRpcTimeout(rpcTimeout) .setMaxAttempts(0) .setTotalTimeout(ofMillis(retryOptions.getMaxElapsedBackoffMillis())); return retryBuilder.build(); }
Source:
public Ordering(String field, SortItem.Ordering sortOrder, SortItem.NullOrdering nullOrder) { this.field = field; this.sortOrder = sortOrder; this.nullOrder = nullOrder; }

Target:
private Ordering(String field, SortItem.Ordering sortOrder, SortItem.NullOrdering nullOrder) { this.field = field; this.sortOrder = sortOrder; this.nullOrder = nullOrder; }
Source:
public void deleteIssues(){ issues.findAllIssues(group.getRepository()).forEach(x -> { Stream<? extends IssueComment> comments = issueComments.getMostRecentIssueComments(Lists.<GroupRepository>asList(group.getRepository(), new GroupRepository[0]),10); comments.forEach(comment -> issueComments.delete(comment)); issues.delete(x); }); }

Target:
public void deleteIssues(){ List<Issue> allIssues = issues.findAllIssues(group.getRepository()); allIssues.stream() .map(issues::refresh) .forEach(issues::delete); }
Source:
public void testCreateDefaultSession() throws OpenTokException { String sessionId = "SESSIONID"; stubFor(post(urlEqualTo("/session/create")) .willReturn(aResponse() .withStatus(200) .withHeader("Content-Type", "text/xml") .withBody("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><sessions><Session><" + "session_id>" + sessionId + "</session_id><partner_id>123456</partner_id><create_dt>" + "Mon Mar 17 00:41:31 PDT 2014</create_dt></Session></sessions>"))); Session session = sdk.createSession(); assertNotNull(session); assertEquals(this.apiKey, session.getApiKey()); assertEquals(sessionId, session.getSessionId()); assertFalse(session.getProperties().isP2p()); assertNull(session.getProperties().getLocation()); verify(postRequestedFor(urlMatching("/session/create")) .withHeader("X-TB-PARTNER-AUTH", matching(this.apiKey+":"+this.apiSecret)) .withHeader("User-Agent", matching(".*Opentok-Java-SDK/"+ Version.VERSION+".*"))); }

Target:
public void testCreateDefaultSession() throws OpenTokException { String sessionId = "SESSIONID"; stubFor(post(urlEqualTo("/session/create")) .willReturn(aResponse() .withStatus(200) .withHeader("Content-Type", "text/xml") .withBody("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><sessions><Session><" + "session_id>" + sessionId + "</session_id><partner_id>123456</partner_id><create_dt>" + "Mon Mar 17 00:41:31 PDT 2014</create_dt></Session></sessions>"))); Session session = sdk.createSession(); assertNotNull(session); assertEquals(this.apiKey, session.getApiKey()); assertEquals(sessionId, session.getSessionId()); assertEquals(MediaMode.ROUTED, session.getProperties().mediaMode()); assertNull(session.getProperties().getLocation()); verify(postRequestedFor(urlMatching("/session/create")) .withHeader("X-TB-PARTNER-AUTH", matching(this.apiKey+":"+this.apiSecret)) .withHeader("User-Agent", matching(".*Opentok-Java-SDK/"+ Version.VERSION+".*"))); }
Source:
public static void main(String[] args) { try { Map<String, Object> argMap = parseArgs(args); Map<String, ModuleService> moduleServices = load(ModuleService.class); if (argMap.containsKey(ARG_HELP)) { System.out.println("core help"); System.out.println("Modules: " + StringUtils.join(moduleServices.keySet(), ", ")); return; } List<String> others = (List<String>) argMap.get("__other__"); String module = others.remove(0); ModuleService moduleService = moduleServices.get(module); if (moduleService == null) { throw new IllegalArgumentException( String.format("No such '%1$s' module exists. To list existing modules use --help argument.", module) ); } Map<String, Object> moduleArgMap = moduleService.parseArguments(others); if(moduleArgMap.containsKey(ARG_HELP)) { System.out.println(module + " help"); return; } others = (List<String>)moduleArgMap.get("__other__"); if(others.size() > 1) { throw new IllegalArgumentException( String.format( "You've provided illegal arguments '%1$s' for module '%2$s' ", StringUtils.join(others, ", "), module ) ); } ExtensionsManager extensionsManager = new ExtensionsManager(); for(File f : CoreUtil.listFiles((String)argMap.get("extensions-dir"))) { extensionsManager.load(f); } for(ExtensionProxy proxy : extensionsManager.getLoadedExtensions()) { extensionsManager.initialize(proxy.getContext().<String>get(Base.ContextKeys.INSTANCE_NAME)); } ExtMap context = new ExtMap().mput(Base.GlobalContextKeys.EXTENSIONS, extensionsManager.getLoadedExtensions()); moduleService.setContext(context); moduleService.run(); } catch (IllegalArgumentException ex) { System.out.println(ex.getMessage()); } catch (Throwable t) { t.printStackTrace(); } }

Target:
public static void main(String[] args) { try { Map<String, Object> argMap = parseArgs(args); setupLogger(argMap); List<String> others = (List<String>) argMap.get("__other__"); Map<String, ModuleService> moduleServices = loadModules(ModuleService.class); if (argMap.containsKey(ARG_HELP) || others.isEmpty()) { List<String> modules = new ArrayList<>(moduleServices.keySet()); Collections.sort(modules); System.out.println("Modules: " + StringUtils.join(modules, ", ")); return; } String module = others.remove(0); ModuleService moduleService = moduleServices.get(module); if (moduleService == null) { throw new IllegalArgumentException( String.format("No such '%1$s' module exists. To list existing modules use --help argument.", module) ); } if(moduleService.parseArguments(others)) { System.out.println(module + " help"); return; } loadExtensions(moduleService, (String) argMap.get("extensions-dir")); moduleService.run(); } catch (IllegalArgumentException ex) { System.out.println(ex.getMessage()); logger.error(ex.getMessage()); } catch (Throwable t) { System.out.println(t.getMessage()); logger.error(t.getMessage()); logger.debug(t.getMessage(), t); } }
Source:
public static State convertToAcceptedState(State state, Item item) { if (state == null) { return UnDefType.NULL; } if (item != null && !isAccepted(item, state)) { for (Class<? extends State> acceptedType : item.getAcceptedDataTypes()) { State convertedState = state.as(acceptedType); if (convertedState != null) { LoggerFactory.getLogger(ItemUtil.class).debug("Converting '{}' to '{}' for item '{}'", state.getClass().getSimpleName(), state, convertedState.getClass().getSimpleName(), convertedState, item.getName()); return convertedState; } } } return state; }

Target:
public static State convertToAcceptedState(State state, Item item) { if (state == null) { LOGGER.error("A conversion of null was requested", new NullPointerException("state should not be null")); return UnDefType.NULL; } if (item != null && !isAccepted(item, state)) { for (Class<? extends State> acceptedType : item.getAcceptedDataTypes()) { State convertedState = state.as(acceptedType); if (convertedState != null) { LOGGER.debug("Converting '{}' to '{}' for item '{}'", state.getClass().getSimpleName(), state, convertedState.getClass().getSimpleName(), convertedState, item.getName()); return convertedState; } } } return state; }
Source:
public WsAgentHealthStateDto check(Machine machine) throws NotFoundException, ServerException, ForbiddenException, BadRequestException, UnauthorizedException, ConflictException { final Map<String, ? extends Server> servers = machine.getRuntime().getServers(); Server wsAgent = null; for (Server server : servers.values()) { if (WSAGENT_REFERENCE.equals(server.getRef())) { wsAgent = server; } } final WsAgentHealthStateDto agentHealthStateDto = newDto(WsAgentHealthStateDto.class); if (wsAgent == null) { return agentHealthStateDto.withCode(NOT_FOUND.getStatusCode()) .withReason("Workspace Agent not available if Dev machine are not RUNNING"); } try { final HttpJsonRequest pingRequest = createPingRequest(machine); final HttpJsonResponse response = pingRequest.request(); agentHealthStateDto.withCode(response.getResponseCode()) .withReason(response.asString()); } catch (IOException e) { agentHealthStateDto.withCode(SERVICE_UNAVAILABLE.getStatusCode()) .withReason(e.getMessage()); } return agentHealthStateDto; }

Target:
public WsAgentHealthStateDto check(Machine machine) throws ServerException { Server wsAgent = getWsAgent(machine); final WsAgentHealthStateDto agentHealthStateDto = newDto(WsAgentHealthStateDto.class); if (wsAgent == null) { return agentHealthStateDto.withCode(NOT_FOUND.getStatusCode()) .withReason("Workspace Agent not available"); } try { final HttpJsonRequest pingRequest = createPingRequest(machine); final HttpJsonResponse response = pingRequest.request(); return agentHealthStateDto.withCode(response.getResponseCode()); } catch (ApiException | IOException e) { return agentHealthStateDto.withCode(SERVICE_UNAVAILABLE.getStatusCode()) .withReason(e.getMessage()); } }
Source:
void doRestore() { final Context context = getContext(); ObaAnalytics.reportEventWithCategory(ObaAnalytics.ObaEventCategory.UI_ACTION.toString(), context.getString(R.string.analytics_action_button_press), context.getString(R.string.analytics_label_button_press_restore_preference)); try { Backup.restore(context); ObaRegionsTask task = new ObaRegionsTask(context, new ObaRegionsTask.Callback() { @Override public void onRegionTaskFinished(boolean currentRegionChanged) { Toast.makeText(context, context.getString(R.string.preferences_db_restored), Toast.LENGTH_LONG).show(); } }, true, true); task.setProgressDialogMessage(context.getString(R.string.preferences_restore_loading)); task.execute(); } catch (IOException e) { Toast.makeText(context, context.getString(R.string.preferences_db_restore_error, e.getMessage()), Toast.LENGTH_LONG).show(); } }

Target:
void doRestore() { final Context context = Application.get().getApplicationContext(); ObaAnalytics.reportEventWithCategory(ObaAnalytics.ObaEventCategory.UI_ACTION.toString(), context.getString(R.string.analytics_action_button_press), context.getString(R.string.analytics_label_button_press_restore_preference)); try { Backup.restore(context); Context activityContext = getContext(); if (activityContext != null) { ObaRegionsTask task = new ObaRegionsTask(activityContext, new ObaRegionsTask.Callback() { @Override public void onRegionTaskFinished(boolean currentRegionChanged) { Toast.makeText(context, R.string.preferences_db_restored, Toast.LENGTH_LONG).show(); } }, true, true); task.setProgressDialogMessage(context.getString(R.string.preferences_restore_loading)); task.execute(); } } catch (IOException e) { Toast.makeText(context, context.getString(R.string.preferences_db_restore_error, e.getMessage()), Toast.LENGTH_LONG).show(); } }
Source:
public synchronized static void hangupCall(Call call, int reasonCode, String reason) { if (logger.isDebugEnabled()) { logger.debug("Hanging up :" + call, new Throwable()); } HangupCallThread hangupCallThread = new HangupCallThread(call, false); hangupCallThread.reasonCode = reasonCode; hangupCallThread.reason = reason; if (!healthy && reasonCode > 400) { new Thread(hangupCallThread).start(); } else { submit(hangupCallThread); } }

Target:
public synchronized static void hangupCall(Call call, int reasonCode, String reason) { if (logger.isDebugEnabled()) { logger.debug("Hanging up :" + call, new Throwable()); } HangupCallThread hangupCallThread = new HangupCallThread(call, false); hangupCallThread.reasonCode = reasonCode; hangupCallThread.reason = reason; if (!healthy) { new Thread(hangupCallThread).start(); } else { submit(hangupCallThread); } }
Source:
private static String unquote(String text, char quoteChar) { if (!isQuoted(text, quoteChar)) return text; String search = emptyQuoted(quoteChar); int nbMatch = 0; int start = -2; do { start = text.indexOf(search, start + 2); if (start != -1 && start != text.length() - 2) ++nbMatch; } while (start != -1); int newLength = text.length() - nbMatch - 2; char[] result = new char[newLength]; int newIdx = 0; boolean firstFound = false; for (int i = 1; i < text.length() - 1; i++) { char c = text.charAt(i); if (c == quoteChar) { if (firstFound) { firstFound = false; } else { firstFound = true; result[newIdx++] = c; } } else { result[newIdx++] = c; firstFound = false; } } return new String(result); }

Target:
private static String unquote(String text, char quoteChar) { if (!isQuoted(text, quoteChar)) return text; if (text.length() == 2) return ""; String search = emptyQuoted(quoteChar); int nbMatch = 0; int start = -1; do { start = text.indexOf(search, start + 2); if (start != -1 && start != text.length() - 2) ++nbMatch; } while (start != -1); if (nbMatch == 0) return text.substring(1, text.length() - 1); int newLength = text.length() - nbMatch - 2; char[] result = new char[newLength]; int newIdx = 0; boolean firstFound = false; for (int i = 1; i < text.length() - 1; i++) { char c = text.charAt(i); if (c == quoteChar) { if (firstFound) { firstFound = false; } else { firstFound = true; result[newIdx++] = c; } } else { result[newIdx++] = c; firstFound = false; } } return new String(result); }
Source:
public Response createPair(Iterator<FileItem> formData) throws BadRequestException, ServerException, ConflictException { String service = null; String name = null; String privateKey = null; String publicKey = null; while (formData.hasNext()) { FileItem item = formData.next(); String fieldName = item.getFieldName(); switch (fieldName) { case "service": service = item.getString(); break; case "name": name = item.getString(); break; case "privateKey": privateKey = item.getString(); break; case "publicKey": publicKey = item.getString(); break; } } requiredNotNull(service, "Service name required"); requiredNotNull(name, "Name required"); if (privateKey == null && publicKey == null) { throw new BadRequestException("Key content was not provided."); } sshManager.createPair(getCurrentUserId(), new SshPairImpl(service, name, publicKey, privateKey)); return Response.ok("", MediaType.TEXT_HTML).build(); }

Target:
public Response createPair(Iterator<FileItem> formData) throws BadRequestException, ServerException, ConflictException { String service = null; String name = null; String privateKey = null; String publicKey = null; while (formData.hasNext()) { FileItem item = formData.next(); String fieldName = item.getFieldName(); switch (fieldName) { case "service": service = item.getString(); break; case "name": name = item.getString(); break; case "privateKey": privateKey = item.getString(); break; case "publicKey": publicKey = item.getString(); break; default: } } requiredNotNull(service, "Service name required"); requiredNotNull(name, "Name required"); if (privateKey == null && publicKey == null) { throw new BadRequestException("Key content was not provided."); } sshManager.createPair(getCurrentUserId(), new SshPairImpl(service, name, publicKey, privateKey)); return Response.ok("", MediaType.TEXT_HTML).build(); }
Source:
private boolean navigateBackToPeopleListFragment() { if (getFragmentManager().getBackStackEntryCount() > 0) { getFragmentManager().popBackStack(); FragmentManager fragmentManager = getFragmentManager(); PersonDetailFragment personDetailFragment = (PersonDetailFragment) fragmentManager .findFragmentByTag(KEY_PERSON_DETAIL_FRAGMENT); boolean shouldResetToolbarElevation = (personDetailFragment != null); ActionBar actionBar = getSupportActionBar(); if (shouldResetToolbarElevation && actionBar != null) { actionBar.setElevation(getResources().getDimension(R.dimen.appbar_elevation)); } return true; } return false; }

Target:
private boolean navigateBackToPeopleListFragment() { FragmentManager fragmentManager = getFragmentManager(); if (fragmentManager.getBackStackEntryCount() > 0) { fragmentManager.popBackStack(); ActionBar actionBar = getSupportActionBar(); if (actionBar != null) { actionBar.setTitle(R.string.people); } PersonDetailFragment personDetailFragment = getDetailFragment(); if (personDetailFragment != null && personDetailFragment.isAdded()) { resetToolbarElevation(); } return true; } return false; }
Source:
public void testPort8443() { String clientConfig = ResourceHelpers.resourceFilePath("oldClientConfig"); String[] command = { "--help", "--config", clientConfig }; Client.main(command); Assert.assertTrue("Should have warned about port 8443", systemOutRule.getLog().contains("deprecated port 8443")); }

Target:
public void testPort8443() { String clientConfig = ResourceHelpers.resourceFilePath("oldClientConfig"); String[] command = { "--help", "--config", clientConfig }; Client.main(command); Assert.assertTrue("Should have warned about port 8443", systemErrRule.getLog().contains(DEPRECATED_PORT_MESSAGE)); }
Source:
private InstructorResultsQuestionTable buildQuestionTableWithoutResponseRows( FeedbackQuestionAttributes question, List<FeedbackResponseAttributes> responses, String additionalInfoId) { return buildQuestionTableAndResponseRows( question, responses, additionalInfoId, null, false); }

Target:
private InstructorFeedbackResultsQuestionTable buildQuestionTableWithoutResponseRows( FeedbackQuestionAttributes question, List<FeedbackResponseAttributes> responses, String additionalInfoId) { return buildQuestionTableAndResponseRows(question, responses, additionalInfoId, null, false); }
Source:
private Optional<PojoIndexingProcessor<T>> doBuild(PojoIndexingDependencyCollectorTypeNode<T> dependencyCollector) { if ( boundRoutingKeyBridge != null ) { boundRoutingKeyBridge.contributeDependencies( dependencyCollector ); } Collection<PojoIndexingProcessorPropertyNode<? super T, ?>> immutablePropertyNodes = propertyNodeBuilders.isEmpty() ? Collections.emptyList() : new ArrayList<>( propertyNodeBuilders.size() ); try { Collection<BeanHolder<? extends TypeBridge>> immutableBridgeHolders = boundBridges.isEmpty() ? Collections.emptyList() : new ArrayList<>(); for ( BoundTypeBridge<T> boundBridge : boundBridges ) { immutableBridgeHolders.add( boundBridge.getBridgeHolder() ); boundBridge.contributeDependencies( dependencyCollector ); } propertyNodeBuilders.values().stream() .map( builder -> builder.build( dependencyCollector ) ) .filter( Optional::isPresent ) .map( Optional::get ) .forEach( immutablePropertyNodes::add ); if ( immutableBridgeHolders.isEmpty() && immutablePropertyNodes.isEmpty() ) { if ( parentIndexObjectReferences.isEmpty() ) { return Optional.empty(); } throw log.invalidIndexedEmbedded( modelPath.getParent().getParent().getPropertyModel().getName(), modelPath.getTypeModel().getName() ); } else { return Optional.of( new PojoIndexingProcessorTypeNode<>( parentIndexObjectReferences, immutableBridgeHolders, immutablePropertyNodes ) ); } } catch (RuntimeException e) { new SuppressingCloser( e ) .pushAll( PojoIndexingProcessor::close, immutablePropertyNodes ); throw e; } }

Target:
private Optional<PojoIndexingProcessor<T>> doBuild(PojoIndexingDependencyCollectorTypeNode<T> dependencyCollector) { if ( boundRoutingKeyBridge != null ) { boundRoutingKeyBridge.contributeDependencies( dependencyCollector ); } Collection<PojoIndexingProcessorPropertyNode<? super T, ?>> immutablePropertyNodes = propertyNodeBuilders.isEmpty() ? Collections.emptyList() : new ArrayList<>( propertyNodeBuilders.size() ); try { Collection<BeanHolder<? extends TypeBridge>> immutableBridgeHolders = boundBridges.isEmpty() ? Collections.emptyList() : new ArrayList<>(); for ( BoundTypeBridge<T> boundBridge : boundBridges ) { immutableBridgeHolders.add( boundBridge.getBridgeHolder() ); boundBridge.contributeDependencies( dependencyCollector ); } propertyNodeBuilders.values().stream() .map( builder -> builder.build( dependencyCollector ) ) .filter( Optional::isPresent ) .map( Optional::get ) .forEach( immutablePropertyNodes::add ); if ( parentIndexObjectReferences.isEmpty() && immutableBridgeHolders.isEmpty() && immutablePropertyNodes .isEmpty() ) { return Optional.empty(); } else { return Optional.of( new PojoIndexingProcessorTypeNode<>( parentIndexObjectReferences, immutableBridgeHolders, immutablePropertyNodes ) ); } } catch (RuntimeException e) { new SuppressingCloser( e ) .pushAll( PojoIndexingProcessor::close, immutablePropertyNodes ); throw e; } }
Source:
private QueryIterator variableSubject(Binding binding, Node s, Node score, StrMatch match, ExecutionContext execCxt) { Var sVar = Var.alloc(s) ; Var scoreVar = (score==null) ? null : Var.alloc(score) ; List<TextHit> r = query(match.getQueryString(), match.getLimit(), execCxt) ; Function<TextHit,Binding> converter = new TextHitConverter(binding, sVar, scoreVar); Iterator<Binding> bIter = new Map1Iterator<TextHit, Binding>(converter, r.iterator()); QueryIterator qIter = new QueryIterPlainWrapper(bIter, execCxt); return qIter ; }

Target:
private QueryIterator variableSubject(Binding binding, Node s, Node score, StrMatch match, ExecutionContext execCxt) { Var sVar = Var.alloc(s) ; Var scoreVar = (score==null) ? null : Var.alloc(score) ; List<TextHit> r = query(match.getQueryString(), match.getLimit(), execCxt) ; Function<TextHit,Binding> converter = new TextHitConverter(binding, sVar, scoreVar); Iterator<Binding> bIter = Iter.map(r.iterator(), converter); QueryIterator qIter = new QueryIterPlainWrapper(bIter, execCxt); return qIter ; }
Source:
public synchronized void foundError(URL url, String reason) { headlessResult.addElement( new HeadlessResult(url.getFile() + ":" + reason, -1, HeadlessResult.ERROR)); LOG.error(url.toString() + " - " + reason); }

Target:
public synchronized void foundError(URL url, String reason) { headlessResult.addElement( new HeadlessResult(url.getFile() + ":" + reason, -1, HeadlessResult.ERROR)); LOG.warn(url.toString() + " - " + reason); }
Source:
private Collection<V> valuesForPagingPredicate(Predicate predicate) { PagingPredicateImpl pagingPredicate = unwrapPagingPredicate(predicate); pagingPredicate.setIterationType(IterationType.VALUE); PagingPredicateHolder pagingPredicateHolder = PagingPredicateHolder.of(pagingPredicate, getSerializationService()); ClientMessage request = MapValuesWithPagingPredicateCodec.encodeRequest(name, pagingPredicateHolder); ClientMessage response = invokeWithPredicate(request, predicate); MapValuesWithPagingPredicateCodec.ResponseParameters resultParameters = MapValuesWithPagingPredicateCodec .decodeResponse(response); SerializationService serializationService = getSerializationService(); if (resultParameters.response.isEmpty()) { return (Collection<V>) new ResultSet(); } int size = resultParameters.response.size(); List<Map.Entry> entries = new ArrayList<>(size); for (int i = 0; i < size; i++) { K key = serializationService.toObject(resultParameters.response.get(i)); entries.add(new AbstractMap.SimpleImmutableEntry(key, null)); } pagingPredicate.setAnchorList(resultParameters.anchorDataList.asAnchorList(serializationService)); return (Set<V>) new ResultSet(entries, IterationType.VALUE); }

Target:
private Collection<V> valuesForPagingPredicate(Predicate predicate) { PagingPredicateImpl pagingPredicate = unwrapPagingPredicate(predicate); pagingPredicate.setIterationType(IterationType.VALUE); PagingPredicateHolder pagingPredicateHolder = PagingPredicateHolder.of(predicate, getSerializationService()); ClientMessage request = MapValuesWithPagingPredicateCodec.encodeRequest(name, pagingPredicateHolder); ClientMessage response = invokeWithPredicate(request, predicate); MapValuesWithPagingPredicateCodec.ResponseParameters resultParameters = MapValuesWithPagingPredicateCodec .decodeResponse(response); SerializationService serializationService = getSerializationService(); pagingPredicate.setAnchorList(resultParameters.anchorDataList.asAnchorList(serializationService)); return (Collection<V>) new UnmodifiableLazyList(resultParameters.response, serializationService); }
Source:
public void onOpenReply(String jobId, RCDeviceListener.RCConnectivityStatus connectivityStatus, RCClient.ErrorCodes status, String text) { RCLogger.i(TAG, "onOpenReply(): id: " + jobId + ", connectivityStatus: " + connectivityStatus + ", status: " + status + ", text: " + text); cachedConnectivityStatus = connectivityStatus; if (isServiceAttached) { listener.onInitialized(this, connectivityStatus, status.ordinal(), text); registerForPush(false); } else { RCLogger.w(TAG, "RCDeviceListener event suppressed since Restcomm Client Service not attached: onInitialized(): " + RCClient.errorText(status)); } if (status == RCClient.ErrorCodes.SUCCESS){ state = DeviceState.READY; } else { release(); return; } }

Target:
public void onOpenReply(String jobId, RCDeviceListener.RCConnectivityStatus connectivityStatus, RCClient.ErrorCodes status, String text) { RCLogger.i(TAG, "onOpenReply(): id: " + jobId + ", connectivityStatus: " + connectivityStatus + ", status: " + status + ", text: " + text); cachedConnectivityStatus = connectivityStatus; if (isServiceAttached) { listener.onInitialized(this, connectivityStatus, status.ordinal(), text); } else { RCLogger.w(TAG, "RCDeviceListener event suppressed since Restcomm Client Service not attached: onInitialized(): " + RCClient.errorText(status)); } registerForPush(false); if (status == RCClient.ErrorCodes.SUCCESS){ state = DeviceState.READY; } else { release(); } }
Source:
public static void trace(final String level, String s, Throwable t) { if (s == null) { return; } if (Trace.STRING_SEVERE.equals(level)) { if (!logged.contains(s)) { StacksCoreActivator.pluginLog().logError(s, t); logged.add(s); } } if (StacksCoreActivator.getDefault().isDebugging()) { final StringBuffer sb = new StringBuffer(StacksCoreActivator.PLUGIN_ID); sb.append(" "); sb.append(level); sb.append(" "); sb.append(sdf.format(new Date())); sb.append(" "); sb.append(s); System.out.println(sb.toString()); if (t != null) { t.printStackTrace(); } } }

Target:
public static void trace(final String level, String s, Throwable t) { if (s == null) { return; } if (Trace.STRING_SEVERE.equals(level)) { StacksCoreActivator.pluginLog().logError(s, t); } if (StacksCoreActivator.getDefault().isDebugging()) { final StringBuilder sb = new StringBuilder(StacksCoreActivator.PLUGIN_ID); sb.append(" "); sb.append(level); sb.append(" "); sb.append(formatDate()); sb.append(" "); sb.append(s); System.out.println(sb.toString()); if (t != null) { t.printStackTrace(); } } }
Source:
public void testUnmarshallSubprocessLevelEventWithEdgesEmptyProperties() throws Exception { Diagram<Graph, Metadata> diagram = unmarshall(marshaller, BPMN_CATCHING_INTERMEDIATE_EVENT_FILE_PATH); assertDiagram(diagram, AMOUNT_OF_NODES_IN_DIAGRAM); IntermediateConditionalEvent emptySubprocessEvent = getCatchingIntermediateNodeById(diagram, EMPTY_WITH_EDGES_SUBPROCESS_LEVEL_EVENT_ID, HAS_NO_INCOME_EDGE, HAS_OUTGOING_EDGE); assertGeneralSet(emptySubprocessEvent.getGeneral(), EMPTY_VALUE, EMPTY_VALUE); assertConditionalEventExecutionSet(emptySubprocessEvent.getExecutionSet(), CONDITION_EXPRESSION_SCRIPT_DEFAULT_VALUE, CONDITION_EXPRESSION_LANGUAGE, CONDITION_ERPRESSION_TYPE, NON_CANCELLING, ""); }

Target:
public void testUnmarshallSubprocessLevelEventWithEdgesEmptyProperties() throws Exception { Diagram<Graph, Metadata> diagram = unmarshall(marshaller, BPMN_CATCHING_INTERMEDIATE_EVENT_FILE_PATH); assertDiagram(diagram, AMOUNT_OF_NODES_IN_DIAGRAM); IntermediateConditionalEvent emptySubprocessEvent = getCatchingIntermediateNodeById(diagram, EMPTY_WITH_EDGES_SUBPROCESS_LEVEL_EVENT_ID, HAS_NO_INCOME_EDGE, HAS_OUTGOING_EDGE); assertGeneralSet(emptySubprocessEvent.getGeneral(), EMPTY_VALUE, EMPTY_VALUE); assertConditionalEventExecutionSet(emptySubprocessEvent.getExecutionSet(), CONDITION_EXPRESSION_SCRIPT_DEFAULT_VALUE, CONDITION_EXPRESSION_LANGUAGE, CONDITION_ERPRESSION_TYPE, NON_CANCELLING, EMPTY_VALUE); }
Source:
public void testGetAndAppendNoMappingExists() { ServerStore store = newStore(); Chain chain = store.getAndAppend(1, getPayload(1)); assertThat(chain.isEmpty(), is(true)); chain = store.get(1); for (Element element : chain) { assertThat(readPayLoad(element.getPayload()), is(Long.valueOf(1))); } }

Target:
public void testGetAndAppendNoMappingExists() { ServerStore store = newStore(); Chain chain = store.getAndAppend(1, createPayload(1)); assertThat(chain.isEmpty(), is(true)); chain = store.get(1); assertChainAndReverseChainOnlyHave(chain, 1); }
Source:
@Test public void fingerPrintTest() { findElementByText("Fingerprint").click(); clickNext(); enterPasswordAndContinue(); clickNext(); driver.fingerPrint(2); try { driver.findElementById("com.android.settings:id/next_button").click(); } catch (Exception e) { Assert.fail("fingerprint command fail to execute"); } }

Target:
@Test public void fingerPrintTest() { findElementByText("Fingerprint").click(); clickNext(); enterPasswordAndContinue(); clickNext(); driver.fingerPrint(2); try { clickNext(); } catch (Exception e) { Assert.fail("fingerprint command fail to execute"); } }
Source:
public void run() { topicMetadataLoadingRunner.refreshMetadata(); }

Target:
public void run() { try { topicMetadataLoadingRunner.refreshMetadata(); } catch (Exception e) { logger.error("An error occurred while refreshing topic metadata", e); } }