auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private static void submitTopologyToFile(TopologyAPI.Topology fTopology, Map<String, String> heronCmdOptions) { String dirName = heronCmdOptions.get(CMDLINE_TOPOLOGY_DEFINITION_TMP_DIRECTORY); if (dirName == null || dirName.isEmpty()) { throw new TopologySubmissionException("Topology definition temp directory not specified. " + "Please set cmdline option: " + CMDLINE_TOPOLOGY_DEFINITION_TMP_DIRECTORY); } String fileName = dirName + "/" + fTopology.getName() + TOPOLOGY_DEFINITION_SUFFIX; try (FileOutputStream fos = new FileOutputStream(new File(fileName)); BufferedOutputStream bos = new BufferedOutputStream(fos)) { byte[] topEncoding = fTopology.toByteArray(); bos.write(topEncoding); } catch (IOException e) { throw new TopologySubmissionException("Error writing topology definition to temp directory: " + dirName, e); } }

Target:
private static void submitTopologyToFile(TopologyAPI.Topology fTopology, Map<String, String> heronCmdOptions) { String dirName = heronCmdOptions.get(CMD_TOPOLOGY_DEFN_TEMPDIR); if (dirName == null || dirName.isEmpty()) { throw new TopologySubmissionException("Topology definition temp directory not specified. " + "Please set cmdline option: " + CMD_TOPOLOGY_DEFN_TEMPDIR); } String fileName = Paths.get(dirName, fTopology.getName() + TOPOLOGY_DEFINITION_SUFFIX).toString(); try (FileOutputStream fos = new FileOutputStream(new File(fileName)); BufferedOutputStream bos = new BufferedOutputStream(fos)) { byte[] topEncoding = fTopology.toByteArray(); bos.write(topEncoding); } catch (IOException e) { throw new TopologySubmissionException("Error writing topology definition to temp directory: " + dirName, e); } }
Source:
public void tearDown() { if (realm.isInTransaction()) { realm.cancelTransaction(); } realm.close(); }

Target:
public void tearDown() { realm.cancelTransaction(); realm.close(); }
Source:
private static Map<String, String> flattenParams(Map<String, Object> params) throws InvalidRequestException { if (params == null) { return new HashMap<String, String>(); } Map<String, String> flatParams = new LinkedHashMap<String, String>(); for (Map.Entry<String, Object> entry : params.entrySet()) { String key = entry.getKey(); Object value = entry.getValue(); if (value instanceof Map<?, ?>) { Map<String, Object> flatNestedMap = new LinkedHashMap<String, Object>(); Map<?, ?> nestedMap = (Map<?, ?>) value; for (Map.Entry<?, ?> nestedEntry : nestedMap.entrySet()) { flatNestedMap.put( String.format("%s[%s]", key, nestedEntry.getKey()), nestedEntry.getValue()); } flatParams.putAll(flattenParams(flatNestedMap)); } else if (value instanceof List<?>) { Map<String, Object> flatNestedMap = new LinkedHashMap<String, Object>(); int index = 0; for (Object element : (List<?>) value) { flatNestedMap.put(String.format("%s[%s]", key, index), element); index += 1; } flatParams.putAll(flattenParams(flatNestedMap)); } else if ("".equals(value)) { throw new InvalidRequestException("You cannot set '"+key+"' to an empty string. "+ "We interpret empty strings as null in requests. "+ "You may set '"+key+"' to null to delete the property.", key, null); } else if (value == null) { flatParams.put(key, ""); } else { flatParams.put(key, value.toString()); } } return flatParams; }

Target:
private static Map<String, String> flattenParams(Map<String, Object> params) throws InvalidRequestException { if (params == null) { return new HashMap<String, String>(); } Map<String, String> flatParams = new LinkedHashMap<String, String>(); for (Map.Entry<String, Object> entry : params.entrySet()) { String key = entry.getKey(); Object value = entry.getValue(); if (value instanceof Map<?, ?>) { Map<String, Object> flatNestedMap = new LinkedHashMap<String, Object>(); Map<?, ?> nestedMap = (Map<?, ?>) value; for (Map.Entry<?, ?> nestedEntry : nestedMap.entrySet()) { flatNestedMap.put( String.format("%s[%s]", key, nestedEntry.getKey()), nestedEntry.getValue()); } flatParams.putAll(flattenParams(flatNestedMap)); } else if (value instanceof List<?>) { Map<String, Object> flatNestedMap = new LinkedHashMap<String, Object>(); Iterator<?> it = ((List<?>)value).iterator(); for (int index = 0; it.hasNext(); ++index) { flatNestedMap.put(String.format("%s[%s]", key, index), it.next()); } flatParams.putAll(flattenParams(flatNestedMap)); } else if ("".equals(value)) { throw new InvalidRequestException("You cannot set '"+key+"' to an empty string. "+ "We interpret empty strings as null in requests. "+ "You may set '"+key+"' to null to delete the property.", key, null); } else if (value == null) { flatParams.put(key, ""); } else { flatParams.put(key, value.toString()); } } return flatParams; }
Source:
public void setText(final String text) { if (this.text != null) { this.text.setText(text); return; } this.text = new Text(text); add(this.text, (Element) getElement()); }

Target:
public void setText(final String text) { this.text = new Text(text); add(this.text, (Element) getElement()); }
Source:
private void getEditorSetting(NotebookSocket conn, Message fromMessage) throws IOException { String paragraphId = (String) fromMessage.get("paragraphId"); String replName = (String) fromMessage.get("magic"); String noteId = getOpenNoteId(conn); String user = SecurityUtils.getPrincipal(); Message resp = new Message(OP.EDITOR_SETTING); resp.put("paragraphId", paragraphId); resp.put("editor", notebook().getInterpreterFactory().getEditorSetting(user, noteId, replName)); conn.send(serializeMessage(resp)); return; }

Target:
private void getEditorSetting(NotebookSocket conn, Message fromMessage) throws IOException { String paragraphId = (String) fromMessage.get("paragraphId"); String replName = (String) fromMessage.get("magic"); String noteId = getOpenNoteId(conn); String user = fromMessage.principal; Message resp = new Message(OP.EDITOR_SETTING); resp.put("paragraphId", paragraphId); resp.put("editor", notebook().getInterpreterFactory().getEditorSetting(user, noteId, replName)); conn.send(serializeMessage(resp)); return; }
Source:
public void reproduceIssue(XmlSuite.FailurePolicy policy, String[] expectedMsgs) { TestNG testNG = create(ExampleClassSample.class); testNG.setConfigFailurePolicy(policy); ExampleClassListener listener = new ExampleClassListener(); testNG.addListener((ITestNGListener) listener); testNG.run(); assertThat(listener.messages.size()).isEqualTo(4); String[] expected = new String[]{ "beforeInvocation:_test_method: test1", "afterInvocation:_test_method: test1", "beforeInvocation:_test_method: test2", "afterInvocation:_test_method: test2" }; assertThat(listener.messages).containsExactly(expected); assertThat(listener.configMsgs.size()).isEqualTo(expectedMsgs.length); assertThat(listener.configMsgs).containsExactly(expectedMsgs); }

Target:
public void reproduceIssue(XmlSuite.FailurePolicy policy, String[] expectedMsgs) { TestNG testNG = create(ExampleClassSample.class); testNG.setConfigFailurePolicy(policy); ExampleClassListener listener = new ExampleClassListener(); testNG.addListener((ITestNGListener) listener); testNG.run(); String[] expected = new String[]{ "beforeInvocation:_test_method: test1", "afterInvocation:_test_method: test1", "beforeInvocation:_test_method: test2", "afterInvocation:_test_method: test2" }; assertThat(listener.messages).containsExactly(expected); assertThat(listener.configMsgs).containsExactly(expectedMsgs); }
Source:
public void checkReservedUnixGroupNames(Attribute groupNameAttribute) throws InternalErrorException, WrongAttributeValueException { if(groupNameAttribute == null) return; if (perunNamespaces == null) { perunNamespaces = BeansUtils.getAllPropertiesFromCustomConfiguration("perun-namespaces.properties"); } String reservedNames; if ((reservedNames = perunNamespaces.get(groupNameAttribute.getFriendlyName() + ":reservedNames")) != null) { List<String> reservedNamesList = Arrays.asList(reservedNames.split("\\s*,\\s*")); if (reservedNamesList.contains(groupNameAttribute.getValue())) throw new WrongAttributeValueException(groupNameAttribute, "This groupName is reserved."); } else { if (reservedNamesForUnixGroups.contains(groupNameAttribute.getValue())) throw new WrongAttributeValueException(groupNameAttribute, "This groupName is reserved."); } }

Target:
public void checkReservedUnixGroupNames(Attribute groupNameAttribute) throws InternalErrorException, WrongAttributeValueException { if(groupNameAttribute == null) return; checkPerunNamespacesMap(); String reservedNames = perunNamespaces.get(groupNameAttribute.getFriendlyName() + ":reservedNames"); if (reservedNames != null) { List<String> reservedNamesList = Arrays.asList(reservedNames.split("\\s*,\\s*")); if (reservedNamesList.contains(groupNameAttribute.getValue())) throw new WrongAttributeValueException(groupNameAttribute, "This groupName is reserved."); } else { if (reservedNamesForUnixGroups.contains(groupNameAttribute.getValue())) throw new WrongAttributeValueException(groupNameAttribute, "This groupName is reserved."); } }
Source:
private Promise<Breakpoint> toBreakpointPromise(Promise<Optional<File>> filePromise, BreakpointDto dto) { return filePromise.then(new Function<Optional<File>, Breakpoint>() { @Override public Breakpoint apply(Optional<File> file) throws FunctionException { return file.isPresent() ? new Breakpoint(BREAKPOINT, dto.getLocation().getLineNumber(), dto.getLocation().getTarget(), file.get(), false) : null; } }).catchError(new Function<PromiseError, Breakpoint>() { @Override public Breakpoint apply(PromiseError arg) throws FunctionException { return null; } }); }

Target:
private Promise<Breakpoint> toBreakpointPromise(Promise<Optional<File>> filePromise, BreakpointDto dto) { return filePromise.then((Function<Optional<File>, Breakpoint>)file -> createBreakpoint(file.get(), dto)).catchError(error -> null); }
Source:
private void handleVmOnDown(VM cacheVm, VmDynamic vmDynamic) { VmExitStatus exitStatus = vmDynamic.getExitStatus(); if (cacheVm != null) { auditVmOnDownEvent(exitStatus, vmDynamic.getExitMessage(), vmDynamic.getId()); } if (exitStatus != VmExitStatus.Normal) { if (cacheVm != null) { if (vmsMonitoring.getResourceManager().isVmInAsyncRunningList(vmDynamic.getId())) { log.info("Running on vds during rerun failed vm: '{}'", vmDynamic.getRunOnVds()); rerun = true; } else if (cacheVm.isAutoStartup()) { autoVmToRun = true; } } else { ResourceManager.getInstance().removeAsyncRunningVm(vmDynamic.getId()); saveDynamic(vdsmVm.getVmDynamic()); } } else { vmsMonitoring.getResourceManager().removeAsyncRunningVm(vmDynamic.getId()); } }

Target:
private void handleVmOnDown(VM cacheVm, VmDynamic vmDynamic) { VmExitStatus exitStatus = vmDynamic.getExitStatus(); if (cacheVm != null) { auditVmOnDownEvent(exitStatus, vmDynamic.getExitMessage(), vmDynamic.getId()); } if (exitStatus != VmExitStatus.Normal) { if (cacheVm != null) { if (vmsMonitoring.getResourceManager().isVmInAsyncRunningList(vmDynamic.getId())) { log.info("Running on vds during rerun failed vm: '{}'", vmDynamic.getRunOnVds()); rerun = true; } else if (cacheVm.isAutoStartup()) { autoVmToRun = true; } } else { ResourceManager.getInstance().removeAsyncRunningVm(vmDynamic.getId()); saveDynamic(vdsmVm.getVmDynamic()); } } else { vmsMonitoring.getResourceManager().removeAsyncRunningVm(vmDynamic.getId()); if (getVmManager().isColdReboot()) { setColdRebootFlag(); } } }
Source:
private void doCreateTable(Exchange exchange, String tableName) throws KuduException { KuduClient connection = endpoint.getKuduClient(); LOG.debug("Creating table {}", tableName); Schema schema = (Schema) exchange.getIn().getHeader("Schema"); CreateTableOptions builder = (CreateTableOptions) exchange.getIn().getHeader("TableOptions"); connection.createTable(tableName, schema, builder); }

Target:
private void doCreateTable(Exchange exchange, String tableName) throws KuduException { LOG.trace("Creating table {}", tableName); KuduClient connection = endpoint.getKuduClient(); Schema schema = (Schema) exchange.getIn().getHeader(KuduConstants.CAMEL_KUDU_SCHEMA); CreateTableOptions builder = (CreateTableOptions) exchange.getIn() .getHeader(KuduConstants.CAMEL_KUDU_TABLE_OPTIONS); connection.createTable(tableName, schema, builder); }
Source:
public void refreshRoutingData(String namespace) { if (!_routingZkAddressMap.containsKey(namespace)) { LOG.error("Failed to refresh internally-cached routing data! Namespace not found: " + namespace); } try { _realmToShardingKeysMap.put(namespace, _routingDataReaderMap.get(namespace).getRoutingData()); } catch (InvalidRoutingDataException e) { LOG.error("Failed to get routing data for namespace: " + namespace + "!"); } if (_routingDataMap != null) { } }

Target:
public void refreshRoutingData(String namespace) { if (_routingZkAddressMap == null || _routingDataMap == null || _realmToShardingKeysMap == null) { LOG.error("Construction is not completed! "); return; } if (!_routingZkAddressMap.containsKey(namespace)) { LOG.error("Failed to refresh internally-cached routing data! Namespace not found: {}", namespace); return; } try { Map<String, List<String>> rawRoutingData = _routingDataReaderMap.get(namespace).getRoutingData(); _realmToShardingKeysMap.put(namespace, rawRoutingData); MetadataStoreRoutingData routingData = new TrieRoutingData(rawRoutingData); _routingDataMap.put(namespace, routingData); } catch (InvalidRoutingDataException e) { LOG.error("Failed to refresh cached routing data for namespace {}", namespace, e); } }
Source:
protected @Nullable String createToolTipText(Parameter param) { ISeries[] series = getChart().getSeriesSet().getSeries(); int seriesIndex = param.getSeriesIndex(); int dataIndex = param.getDataIndex(); if ((series != null) && (seriesIndex < series.length)) { ISeries serie = series[seriesIndex]; double[] xS = serie.getXSeries(); double[] yS = serie.getYSeries(); if ((xS != null) && (yS != null) && (dataIndex < xS.length) && (dataIndex < yS.length)) { StringBuffer buffer = new StringBuffer(); buffer.append(checkNotNull(Messages.SegmentStoreScatterGraphViewer_xAxis) + '='); buffer.append(new TmfTimestamp((long) xS[dataIndex] + getChartViewer().getTimeOffset(), ITmfTimestamp.NANOSECOND_SCALE).toString()); buffer.append('\n'); buffer.append(Messages.SegmentStoreScatterGraphViewer_yAxis + '='); buffer.append((long) yS[dataIndex]); return buffer.toString(); } } return null; }

Target:
protected @Nullable String createToolTipText(Parameter param) { ISeries[] series = getChart().getSeriesSet().getSeries(); int seriesIndex = param.getSeriesIndex(); int dataIndex = param.getDataIndex(); if ((series != null) && (seriesIndex < series.length)) { ISeries serie = series[seriesIndex]; double[] xS = serie.getXSeries(); double[] yS = serie.getYSeries(); if ((xS != null) && (yS != null) && (dataIndex < xS.length) && (dataIndex < yS.length)) { StringBuffer buffer = new StringBuffer(); buffer.append(checkNotNull(Messages.SegmentStoreScatterGraphViewer_xAxis)).append('='); buffer.append(new TmfTimestamp((long) xS[dataIndex] + getChartViewer().getTimeOffset(), ITmfTimestamp.NANOSECOND_SCALE).toString()); buffer.append('\n'); buffer.append(Messages.SegmentStoreScatterGraphViewer_yAxis).append('='); buffer.append((long) yS[dataIndex]); return buffer.toString(); } } return null; }
Source:
public void testCompressionSkipForBinaryFrame() { EmbeddedChannel encoderChannel = new EmbeddedChannel(new PerMessageDeflateEncoder(9, 15, false, ALWAYS_SKIP)); EmbeddedChannel decoderChannel = new EmbeddedChannel( ZlibCodecFactory.newZlibDecoder(ZlibWrapper.NONE)); byte[] payload = new byte[300]; random.nextBytes(payload); WebSocketFrame binaryFrame = new BinaryWebSocketFrame(Unpooled.copiedBuffer(payload)); encoderChannel.writeOutbound(binaryFrame.copy()); WebSocketFrame outboundFrame = encoderChannel.readOutbound(); assertEquals(0, outboundFrame.rsv()); assertArrayEquals(payload, ByteBufUtil.getBytes(outboundFrame.content())); assertTrue(outboundFrame.release()); decoderChannel.writeInbound(binaryFrame); WebSocketFrame inboundFrame = decoderChannel.readInbound(); assertEquals(0, inboundFrame.rsv()); assertArrayEquals(payload, ByteBufUtil.getBytes(inboundFrame.content())); assertTrue(inboundFrame.release()); assertEquals(0, binaryFrame.refCnt()); }

Target:
public void testCompressionSkipForBinaryFrame() { EmbeddedChannel encoderChannel = new EmbeddedChannel(new PerMessageDeflateEncoder(9, 15, false, ALWAYS_SKIP)); byte[] payload = new byte[300]; random.nextBytes(payload); WebSocketFrame binaryFrame = new BinaryWebSocketFrame(Unpooled.wrappedBuffer(payload)); assertTrue(encoderChannel.writeOutbound(binaryFrame.copy())); WebSocketFrame outboundFrame = encoderChannel.readOutbound(); assertEquals(0, outboundFrame.rsv()); assertArrayEquals(payload, ByteBufUtil.getBytes(outboundFrame.content())); assertTrue(outboundFrame.release()); assertFalse(encoderChannel.finish()); }
Source:
public void rewriteAST(CompilationUnitRewrite cuRewrite, LinkedProposalModelCore model) throws CoreException { TextEditGroup group= createTextEditGroup(FixMessages.TypeParametersFix_insert_inferred_type_arguments_description, cuRewrite); ASTRewrite rewrite= cuRewrite.getASTRewrite(); ImportRewrite importRewrite= cuRewrite.getImportRewrite(); AST ast= cuRewrite.getRoot().getAST(); for (int i= 0; i < fCreatedTypes.length; i++) { ParameterizedType createdType= fCreatedTypes[i]; ITypeBinding[] typeArguments= createdType.resolveBinding().getTypeArguments(); ContextSensitiveImportRewriteContext importContext= new ContextSensitiveImportRewriteContext(cuRewrite.getRoot(), createdType.getStartPosition(), importRewrite); ListRewrite argumentsRewrite= rewrite.getListRewrite(createdType, ParameterizedType.TYPE_ARGUMENTS_PROPERTY); for (int j= 0; j < typeArguments.length; j++) { ITypeBinding typeArgument= typeArguments[j]; Type argumentNode= importRewrite.addImport(typeArgument, ast, importContext, TypeLocation.TYPE_ARGUMENT); argumentsRewrite.insertLast(argumentNode, group); } } }

Target:
public void rewriteAST(CompilationUnitRewrite cuRewrite, LinkedProposalModelCore model) throws CoreException { TextEditGroup group= createTextEditGroup(FixMessages.TypeParametersFix_insert_inferred_type_arguments_description, cuRewrite); ASTRewrite rewrite= cuRewrite.getASTRewrite(); ImportRewrite importRewrite= cuRewrite.getImportRewrite(); AST ast= cuRewrite.getRoot().getAST(); for (ParameterizedType createdType : fCreatedTypes) { ITypeBinding[] typeArguments= createdType.resolveBinding().getTypeArguments(); ContextSensitiveImportRewriteContext importContext= new ContextSensitiveImportRewriteContext(cuRewrite.getRoot(), createdType.getStartPosition(), importRewrite); ListRewrite argumentsRewrite= rewrite.getListRewrite(createdType, ParameterizedType.TYPE_ARGUMENTS_PROPERTY); for (ITypeBinding typeArgument : typeArguments) { Type argumentNode= importRewrite.addImport(typeArgument, ast, importContext, TypeLocation.TYPE_ARGUMENT); argumentsRewrite.insertLast(argumentNode, group); } } }
Source:
public static ResponseDefinitionBuilder unauthorizedJson(String body) { return aResponse().withStatus(401).withHeader(CONTENT_TYPE, "application/json").withBody(body); }

Target:
public static ResponseDefinitionBuilder unauthorizedJson(String body) { return aResponse().withStatus(401).withJsonBody(body); }
Source:
public static <K, V> Map<V, K> invertMap(final Map<K, V> map) { Objects.requireNonNull(map, "The map must not be null"); final Map<V, K> out = new HashMap<>(map.size()); for (final Entry<K, V> entry : map.entrySet()) { out.put(entry.getValue(), entry.getKey()); } return out; }

Target:
public static <K, V> Map<V, K> invertMap(final Map<K, V> map) { Objects.requireNonNull(map, "The map to invert must not be null."); final Map<V, K> out = new HashMap<>(map.size()); for (final Entry<K, V> entry : map.entrySet()) { out.put(entry.getValue(), entry.getKey()); } return out; }
Source:
public boolean checkAndSetDefaultVersion(String newDefaultVersion) { if (newDefaultVersion == null) { return true; } for (Version version : this.getVersions()) { if (Objects.equals(newDefaultVersion, version.getName())) { this.setDefaultVersion(newDefaultVersion); return true; } } return false; }

Target:
public boolean checkAndSetDefaultVersion(String newDefaultVersion) { for (Version version : this.getVersions()) { if (Objects.equals(newDefaultVersion, version.getName())) { this.setDefaultVersion(newDefaultVersion); return true; } } return false; }
Source:
public void testEmpty() throws IOException { MatcherAssert.assertThat( new PsAll(new ArrayList<Pass>(0), 0).enter(new RqFake()).has(), Matchers.is(false) ); }

Target:
public void testEmpty() throws Exception { MatcherAssert.assertThat( new PsAll(new ArrayList<Pass>(0), 0).enter(new RqFake()).has(), Matchers.is(false) ); }
Source:
private void makeActions() { boolean hideAvailableCustomizationsDialog = viewerDescriptor .getBooleanConfigProperty(INavigatorViewerDescriptor.PROP_HIDE_AVAILABLE_CUSTOMIZATIONS_DIALOG); if (!hideAvailableCustomizationsDialog) { selectFiltersAction = new SelectFiltersAction(commonViewer, this); ImageDescriptor selectFiltersIcon = NavigatorPlugin.getImageDescriptor("icons/full/elcl16/filter_ps.gif"); selectFiltersAction.setImageDescriptor(selectFiltersIcon); selectFiltersAction.setHoverImageDescriptor(selectFiltersIcon); filtersMenu = new MenuManager(CommonNavigatorMessages.FilterActionGroup_Filters); menuListener = new IMenuListener() { @Override public void menuAboutToShow(IMenuManager manager) { filtersMenu.removeAll(); addLRUFilterActions(filtersMenu); } }; } }

Target:
private void makeActions() { boolean hideAvailableCustomizationsDialog = viewerDescriptor .getBooleanConfigProperty(INavigatorViewerDescriptor.PROP_HIDE_AVAILABLE_CUSTOMIZATIONS_DIALOG); if (!hideAvailableCustomizationsDialog) { selectFiltersAction = new SelectFiltersAction(commonViewer, this); ImageDescriptor selectFiltersIcon = NavigatorPlugin.getImageDescriptor("icons/full/elcl16/filter_ps.png"); selectFiltersAction.setImageDescriptor(selectFiltersIcon); selectFiltersAction.setHoverImageDescriptor(selectFiltersIcon); filtersMenu = new MenuManager(CommonNavigatorMessages.FilterActionGroup_Filters); menuListener = new IMenuListener() { @Override public void menuAboutToShow(IMenuManager manager) { filtersMenu.removeAll(); addLRUFilterActions(filtersMenu); } }; } }
Source:
static Socket connectToWatchdogWithTimeout(final String host, final int port, final long timeout, final TimeUnit timeUnit, final SoloWatchdogConnector connector) { final Socket socket; try { socket = Polling.awaitUnchecked(timeout, timeUnit, new Callable<Socket>() { @Override public Socket call() throws Exception { final Socket socket = new Socket(); try { connector.connect(socket, host, port); return socket; } catch (IOException e) { return null; } } }); } catch (TimeoutException e) { throw Throwables.propagate(e); } log.info("Connecting to helios-solo watchdog at {}:{}", host, port); return socket; }

Target:
static Socket connectToWatchdogWithTimeout(final String host, final int port, final long timeout, final TimeUnit timeUnit, final SoloWatchdogConnector connector) { final Socket socket; log.info("Connecting to helios-solo watchdog at {}:{}", host, port); try { socket = Polling.awaitUnchecked(timeout, timeUnit, new Callable<Socket>() { @Override public Socket call() throws Exception { final Socket socket = new Socket(); try { connector.connect(socket, host, port); return socket; } catch (IOException e) { log.debug("Failed to connect to helios-solo watchdog"); return null; } } }); } catch (TimeoutException e) { throw Throwables.propagate(e); } return socket; }
Source:
private void getMRelations(Entity entity, MClassWrapper graph) { Collection<MRelationEntry> relationAttrs = registry.getRelations( entity.getClass()); for (MRelationEntry relEntry : relationAttrs) { for(Entity other : relEntry.getConnectedEntities(entity)) { if (!other.getIsEndPoint()) { getAllMClasses(other, graph); } } graph.addRelation(relEntry.buildRelation(entity, config.getNamespace())); } }

Target:
private void getMRelations(Entity entity, MClassWrapper graph) { Collection<MRelationEntry> relationAttrs = registry.getRelations( entity.getClass()); for (MRelationEntry relEntry : relationAttrs) { for(Entity other : relEntry.getConnectedEntities(entity)) { if (!(other instanceof EndPointProxy)) { getAllMClasses(other, graph); } } graph.addRelation(relEntry.buildRelation(entity, config.getNamespace())); } }
Source:
private List<String> fetchPathwaysFromFile (String experimentAccession, Contrast comparison) { Map<String, Double> result = new HashMap<>(); List<String[]> lines = dataFileHub.getReactomePathwaysCFiles(experimentAccession, comparison.getId()).reactomePathways.get().readAll(); for(int i = 1; i < lines.size(); i++) { String[] strings = lines.get(i); String pathway = strings[0]; Double pvalue = Double.valueOf(strings[4]); if (pvalue < 0.05) { result.put(pathway, pvalue); } } Map<String, Double> ordered = result.entrySet() .stream() .sorted(Map.Entry.comparingByValue()) .limit(10) .collect(toMap(Map.Entry::getKey, Map.Entry::getValue, (e1, e2) -> e1, LinkedHashMap::new)); return new ArrayList<>(ordered.keySet()); }

Target:
private List<String> fetchPathwaysFromFile (String experimentAccession, Contrast comparison) { Map<String, Double> result = new HashMap<>(); List<String[]> lines = dataFileHub.getReactomePathwaysFiles(experimentAccession, comparison.getId()).get().readAll(); for(int i = 1; i < lines.size(); i++) { String[] strings = lines.get(i); String pathway = strings[0]; Double pvalue = Double.valueOf(strings[4]); if (pvalue < 0.05) { result.put(pathway, pvalue); } } return result.entrySet() .stream() .sorted(Map.Entry.comparingByValue()) .limit(10) .map(Map.Entry::getKey) .collect(Collectors.toList()); }
Source:
public void onActivityCreated(Bundle savedInstanceState) { ThemeBrowserActivity themeBrowserActivity = (ThemeBrowserActivity) getActivity(); super.onActivityCreated(savedInstanceState); if (this instanceof ThemeSearchFragment) { (themeBrowserActivity).setThemeSearchFragment((ThemeSearchFragment) this); } else { (themeBrowserActivity).setThemeBrowserFragment(this); } Cursor cursor = fetchThemes(getSpinnerPosition()); if (cursor == null) { return; } mAdapter = new ThemeBrowserAdapter(themeBrowserActivity, cursor, false, mCallback); setEmptyViewVisible(mAdapter.getCount() == 0); mGridView.setAdapter(mAdapter); restoreState(savedInstanceState); }

Target:
public void onActivityCreated(Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); if (this instanceof ThemeSearchFragment) { mThemeBrowserActivity.setThemeSearchFragment((ThemeSearchFragment) this); } else { mThemeBrowserActivity.setThemeBrowserFragment(this); } Cursor cursor = fetchThemes(getSpinnerPosition()); if (cursor == null) { return; } mAdapter = new ThemeBrowserAdapter(mThemeBrowserActivity, cursor, false, mCallback); setEmptyViewVisible(mAdapter.getCount() == 0); mGridView.setAdapter(mAdapter); restoreState(savedInstanceState); }
Source:
private TradeInfo calculateSettlementDate(ReferenceData refData) { if (info.getSettlementDate().isPresent()) { return info; } if (info.getTradeDate().isPresent()) { LocalDate tradeDate = info.getTradeDate().get(); LocalDate settlementDate = product.getSettlementDateOffset().adjust(tradeDate, refData); return info.toBuilder().settlementDate(settlementDate).build(); } throw new IllegalStateException("FixedCouponBondTrade.resolve() requires either trade date or settlement date"); }

Target:
private TradeInfo calculateSettlementDate(ReferenceData refData) { if (info.getSettlementDate().isPresent()) { return info; } if (info.getTradeDate().isPresent()) { LocalDate tradeDate = info.getTradeDate().get(); LocalDate settlementDate = product.getSettlementDateOffset().adjust(tradeDate, refData); return info.toBuilder().settlementDate(settlementDate).build(); } throw new IllegalStateException("CapitalIndexedBondTrade.resolve() requires either trade date or settlement date"); }
Source:
public void createClientMessageTracker(String name, boolean fromActive) { this.messageTrackers.put(name, new DefaultClientMessageTracker(fromActive)); }

Target:
public void createClientMessageTracker(String name, boolean fromActive) { if (!fromActive) { this.messageTrackers.put(name, new DefaultClientMessageTracker()); } }
Source:
protected void onResume() { if (PhoneFactory.getDefaultPhone().getPhoneType() != Phone.PHONE_TYPE_CDMA) { mButtonCdmaRoam.setEnabled(false); mButtonCdmaSubscription.setEnabled(false); } else { mButtonCdmaRoam.setEnabled(true); mButtonCdmaSubscription.setEnabled(true); } super.onResume(); }

Target:
protected void onResume() { if (PhoneFactory.getDefaultPhone().getPhoneType() != Phone.PHONE_TYPE_CDMA) { mButtonCdmaRoam.setEnabled(false); mButtonCdmaSubscription.setEnabled(false); } else { mButtonCdmaRoam.setEnabled(true); if(deviceSupportsNvAndRuim()) { mButtonCdmaSubscription.setEnabled(true); } else { mButtonCdmaSubscription.setEnabled(false); } } super.onResume(); }
Source:
public void start() throws Exception { logger.info("Starting Gerrit-Trigger Plugin"); doXStreamRegistrations(); logger.trace("Loading configs"); load(); if (servers == null) { servers = new ArrayList<GerritServer>(); if (config != null) { GerritServer defaultServer = new GerritServer(DEFAULT_SERVER_NAME); defaultServer.setConfig(config); servers.add(defaultServer); } } for (GerritServer s : servers) { s.start(); } }

Target:
public void start() throws Exception { logger.info("Starting Gerrit-Trigger Plugin"); doXStreamRegistrations(); logger.trace("Loading configs"); load(); for (GerritServer s : servers) { s.start(); } }
Source:
public void handle(EquivalenceResult<T> result) { try { sender.sendMessage(messageFrom(result));; } catch (Exception e) { log.error("Failed to send equiv update message: " + result.subject(), e); } }

Target:
public void handle(EquivalenceResult<T> result) { try { sender.sendMessage(messageFrom(result)); } catch (Exception e) { log.error("Failed to send equiv update message: " + result.subject(), e); } }
Source:
private void extractCigarFromCGAttribute(final Cigar sentinelCigar) { int[] cigarFromCG = (int[]) getAttribute(CG.name()); if (cigarFromCG == null) return; final ByteBuffer byteBuffer = ByteBuffer.allocate(cigarFromCG.length * CIGAR_SIZE_MULTIPLIER) .order(ByteOrder.LITTLE_ENDIAN); byteBuffer.asIntBuffer().put(cigarFromCG); final Cigar decodedCigar = BinaryCigarCodec.decode(byteBuffer); if (decodedCigar.getCigarElements().size() <= MAX_CIGAR_OPERATORS) { throw new IllegalStateException(String.format( "Only Cigar with > 65535 operators should be placed in CG tag. Found %d operators.", decodedCigar.getCigarElements().size())); } if (decodedCigar.getReferenceLength() != sentinelCigar.getReferenceLength()) { throw new IllegalStateException(String.format( "Sentinel cigar and CG cigar should have the same reference length. Found %d and %d.", sentinelCigar.getReferenceLength(), decodedCigar.getReferenceLength())); } if (decodedCigar.getReadLength() != sentinelCigar.getReadLength()) { throw new IllegalStateException(String.format( "Sentinel cigar and CG cigar should have the same read length. Found %d and %d.", sentinelCigar.getReadLength(), decodedCigar.getReadLength())); } setCigar(decodedCigar); setAttribute(CG.name(), null); }

Target:
private void extractCigarFromCGAttribute(final Cigar sentinelCigar) throws IllegalStateException { final int[] cigarFromCG = (int[]) getAttribute(SAMTagUtil.getSingleton().CG); if (cigarFromCG == null) return; final ByteBuffer byteBuffer = ByteBuffer.allocate(cigarFromCG.length * CIGAR_SIZE_MULTIPLIER) .order(ByteOrder.LITTLE_ENDIAN); byteBuffer.asIntBuffer().put(cigarFromCG); final Cigar decodedCigar = BinaryCigarCodec.decode(byteBuffer); if (decodedCigar.numCigarElements() <= MAX_CIGAR_OPERATORS) { throw new IllegalStateException(String.format( "Only Cigar with > %d operators should be placed in CG tag. Found %d operators. \n Here's the Cigar:\n%s", MAX_CIGAR_OPERATORS, decodedCigar.getCigarElements().size(), decodedCigar.toString())); } if (decodedCigar.getReferenceLength() != sentinelCigar.getReferenceLength()) { throw new IllegalStateException(String.format( "Sentinel cigar and %s cigar should have the same reference length. Found %d and %d.\n Here's the Cigar:\n%s", CG.name(), sentinelCigar.getReferenceLength(), decodedCigar.getReferenceLength(), decodedCigar.toString())); } if (decodedCigar.getReadLength() != sentinelCigar.getReadLength() ) { throw new IllegalStateException(String.format( "Sentinel cigar and %s cigar should have the same read length. Found %d and %d.\n Here's the Cigar:\n%s", CG.name(), sentinelCigar.getReadLength(), decodedCigar.getReadLength(), decodedCigar.toString())); } initializeCigar(decodedCigar); setAttribute(SAMTagUtil.getSingleton().CG, null); }
Source:
private static Map<String, String> getSuperCategoryMap() { if (groupToSuperCategory == null) { groupToSuperCategory = new HashMap<>(); groupToSuperCategory.put(DOC_CAT_FASTA, DOC_SUPERCAT_TOOLS); groupToSuperCategory.put(DOC_CAT_READS, DOC_SUPERCAT_TOOLS); groupToSuperCategory.put(DOC_CAT_VARIANT, DOC_SUPERCAT_TOOLS); groupToSuperCategory.put(DOC_CAT_TEST, DOC_SUPERCAT_EXCLUDE); } return groupToSuperCategory; }

Target:
public static Map<String, String> getSuperCategoryMap() { if (groupToSuperCategory == null) { groupToSuperCategory = new HashMap<>(); groupToSuperCategory.put(DOC_CAT_FASTA, DOC_SUPERCAT_TOOLS); groupToSuperCategory.put(DOC_CAT_READS, DOC_SUPERCAT_TOOLS); groupToSuperCategory.put(DOC_CAT_VARIANT, DOC_SUPERCAT_TOOLS); groupToSuperCategory.put(DOC_CAT_TEST, DOC_SUPERCAT_EXCLUDE); } return groupToSuperCategory; }
Source:
public void onLoadFinished(Loader<Cursor> loader,Cursor cursor) { if(eventListAdapter!=null && cursor!=null) eventListAdapter.swapCursor(cursor); else Log.v(TAG, "OnLoadFinished: mAdapter is null"); }

Target:
public void onLoadFinished(Loader<Cursor> loader,Cursor cursor) { if(eventListAdapter!=null && cursor!=null) { eventListAdapter.swapCursor(cursor); } else { Log.v(TAG, "OnLoadFinished: eventListAdapter is null"); } }
Source:
public String toString() { String resourceId = myPayloadId; if (resourceId == null) { resourceId = myId; } return "ResourceModified Message { " + myOperationType + ", " + resourceId + "}"; }

Target:
public String toString() { return new ToStringBuilder(this) .append("myId", myId) .append("myOperationType", myOperationType) .append("mySubscriptionId", mySubscriptionId) .append("myPayloadId", myPayloadId) .toString(); }
Source:
private String variableName(Node node, int level) { String label = node.label(); char name = (label != null) ? label.charAt(0) : 'x'; return "" + Character.toLowerCase(name) + level; }

Target:
private String variableName(Node node, int level) { String label = node.label().orElse("x"); char name = label.charAt(0); return "" + Character.toLowerCase(name) + level; }
Source:
private void setupTabs() { tabsList.clear(); tabsList.addAll(tabsManager.getTabs()); boolean wasAdapterNull = pagerAdapter == null; if (pagerAdapter == null || !pagerAdapter.sameTabs(tabsList)) { pagerAdapter = new SelectedTabsPagerAdapter(requireContext(), getChildFragmentManager(), tabsList); } viewPager.setAdapter(pagerAdapter); if (!wasAdapterNull) { viewPager.setOffscreenPageLimit(tabsList.size()); } updateTabsIconAndDescription(); updateTitleForTab(viewPager.getCurrentItem()); hasTabsChanged = false; }

Target:
private void setupTabs() { tabsList.clear(); tabsList.addAll(tabsManager.getTabs()); if (pagerAdapter == null || !pagerAdapter.sameTabs(tabsList)) { pagerAdapter = new SelectedTabsPagerAdapter(requireContext(), getChildFragmentManager(), tabsList); } viewPager.setAdapter(null); viewPager.setOffscreenPageLimit(tabsList.size()); viewPager.setAdapter(pagerAdapter); updateTabsIconAndDescription(); updateTitleForTab(viewPager.getCurrentItem()); hasTabsChanged = false; }
Source:
public boolean isValid(Object[] array, ConstraintValidatorContext constraintValidatorContext) { if ( array == null ) { return false; } return Array.getLength( array ) > 0; }

Target:
public boolean isValid(Object[] array, ConstraintValidatorContext constraintValidatorContext) { if ( array == null ) { return false; } return array.length > 0; }
Source:
public void testSingletonMap(){ IgniteCache<Integer, Map<TestObject,TestObject>> c = jcache(0); TestObject obj = new TestObject(123); c.put(0, Collections.singletonMap(obj,obj)); checkSingleElement(c.get(0).entrySet(), entry -> { assertEquals(123, entry.getKey().val); assertEquals(123, entry.getValue().val); }); IgniteCache<Integer, Map<BinaryObject,BinaryObject>> kpc = keepBinaryCache(); Map<?,?> cBinary = kpc.get(0); assertEquals(Collections.singletonMap(null,null).getClass(), cBinary.getClass()); checkSingleElement(cBinary.entrySet(), entry -> { assertTrue(entry.getKey() instanceof BinaryObject); assertTrue(entry.getValue() instanceof BinaryObject); assertEquals(Integer.valueOf(123), ((BinaryObject)entry.getKey()).field("val")); assertEquals(Integer.valueOf(123), ((BinaryObject)entry.getValue()).field("val")); }); }

Target:
public void testSingletonMap() { IgniteCache<Integer, Map<TestObject, TestObject>> c = jcache(0); TestObject obj = new TestObject(123); c.put(0, Collections.singletonMap(obj, obj)); c.put(1, Collections.singletonMap(null, null)); assertEquals(1, c.get(0).size()); Map.Entry<TestObject, TestObject> entry = c.get(0).entrySet().iterator().next(); assertEquals(123, entry.getKey().val); assertEquals(123, entry.getValue().val); IgniteCache<Integer, Map<BinaryObject, BinaryObject>> kpc = keepBinaryCache(); Map<?, ?> cBinary = kpc.get(0); assertEquals(Collections.singletonMap(null, null).getClass(), cBinary.getClass()); Map.Entry<?, ?> binaryEntry = kpc.get(0).entrySet().iterator().next(); assertTrue(binaryEntry.getKey() instanceof BinaryObject); assertTrue(binaryEntry.getValue() instanceof BinaryObject); assertEquals(Integer.valueOf(123), ((BinaryObject)binaryEntry.getKey()).field("val")); assertEquals(Integer.valueOf(123), ((BinaryObject)binaryEntry.getValue()).field("val")); Map.Entry<?, ?> nullEntry = kpc.get(1).entrySet().iterator().next(); assertNull(nullEntry.getKey()); assertNull(nullEntry.getValue()); }
Source:
public Response getVendor(@PathParam(PurapPropertyConstants.VENDOR_NUMBER) String vendorNumber, @Context HttpHeaders headers) { try { HashMap<String, String> vendorCombinedPk = parseVendorNumber(vendorNumber); VendorDetail vendorDetail = getLookupDao().findObjectByMap(VendorDetail.class.newInstance(), vendorCombinedPk); if (ObjectUtils.isNull(vendorDetail)) { return respondNotFound(); } String responseBody = gson.toJson(getVendorProperties(vendorDetail)); return Response.ok(responseBody).build(); } catch (BadRequestException ex) { return respondGetVendorBadRequest(); } catch (Exception ex) { LOG.error(ex); return respondInternalServerError(ex); } }

Target:
public Response getVendor(@PathParam(PurapPropertyConstants.VENDOR_NUMBER) String vendorNumber, @Context HttpHeaders headers) { try { HashMap<String, String> vendorCombinedPk = parseVendorNumber(vendorNumber); VendorDetail vendorDetail = getLookupDao().findObjectByMap(VendorDetail.class.newInstance(), vendorCombinedPk); if (ObjectUtils.isNull(vendorDetail)) { return respondNotFound(); } String responseBody = gson.toJson(getVendorProperties(vendorDetail)); return Response.ok(responseBody).build(); } catch (Exception ex) { LOG.error("getVendor", ex); return ex instanceof BadRequestException ? respondGetVendorBadRequest() : respondInternalServerError(ex); } }
Source:
private boolean exportToProvider(Intent intent, boolean deleteAfterExport) { if ((intent == null) || (intent.getData() == null)) { Timber.e("exportToProvider() provided with insufficient intent data %s", intent); return false; } Uri uri = intent.getData(); Timber.d("Exporting from file to ContentProvider URI: %s/%s", mExportFileName, uri.toString()); FileOutputStream fileOutputStream; ParcelFileDescriptor pfd; try { pfd = getContentResolver().openFileDescriptor(uri, "w"); if (pfd != null) { fileOutputStream = new FileOutputStream(pfd.getFileDescriptor()); CompatHelper.getCompat().copyFile(mExportFileName, fileOutputStream); fileOutputStream.close(); pfd.close(); } if (deleteAfterExport && !new File(mExportFileName).delete()) { Timber.i("Failed to delete temporary export file %s", mExportFileName); } } catch (Exception e) { Timber.e(e, "Unable to export file to Uri: %s/%s", mExportFileName, uri.toString()); return false; } return true; }

Target:
private boolean exportToProvider(Intent intent, boolean deleteAfterExport) { if ((intent == null) || (intent.getData() == null)) { Timber.e("exportToProvider() provided with insufficient intent data %s", intent); return false; } Uri uri = intent.getData(); Timber.d("Exporting from file to ContentProvider URI: %s/%s", mExportFileName, uri.toString()); FileOutputStream fileOutputStream; ParcelFileDescriptor pfd; try { pfd = getContentResolver().openFileDescriptor(uri, "w"); if (pfd != null) { fileOutputStream = new FileOutputStream(pfd.getFileDescriptor()); CompatHelper.getCompat().copyFile(mExportFileName, fileOutputStream); fileOutputStream.close(); pfd.close(); } else { Timber.w("exportToProvider() failed - ContentProvider returned null file descriptor for %s", uri); return false; } if (deleteAfterExport && !new File(mExportFileName).delete()) { Timber.w("Failed to delete temporary export file %s", mExportFileName); } } catch (Exception e) { Timber.e(e, "Unable to export file to Uri: %s/%s", mExportFileName, uri.toString()); return false; } return true; }
Source:
public void testNoLeaksAfterShutdown() { withRemoteCacheManager(new RemoteCacheManagerCallable(getRemoteCacheManager()) { @Override public void call() { RemoteCache<Integer, String> remote = rcm.getCache(cacheName); EventLogListener<Integer> eventListener = new EventLogListener<>(); remote.addClientListener(eventListener); eventListener.expectNoEvents(); remote.put(1, "one"); eventListener.expectOnlyCreatedEvent(1, cache(cacheName)); } }); WaitFor .condition(() -> listThreadsMatchingRegexp(".*Client-Listener-ClientListenerLeakTest-.*").size() == 0) .atMost(10, TimeUnit.MILLISECONDS) .await(); }

Target:
public void testNoLeaksAfterShutdown() { withRemoteCacheManager(new RemoteCacheManagerCallable(getRemoteCacheManager()) { @Override public void call() { RemoteCache<Integer, String> remote = rcm.getCache(cacheName); EventLogListener<Integer> eventListener = new EventLogListener<>(); remote.addClientListener(eventListener); eventListener.expectNoEvents(); remote.put(1, "one"); eventListener.expectOnlyCreatedEvent(1, cache(cacheName)); } }); detectThreadLeaks(".*Client-Listener-ClientListenerLeakTest-.*"); }
Source:
private void collectPluginCapabilities(Map<String, CapabilityInfo> output) { for (String pluginName : pluginCapabilities.plugins()) { for (Map.Entry<String, Provider<CapabilityDefinition>> entry : pluginCapabilities.byPlugin(pluginName).entrySet()) { if (isPluginNameSane(pluginName)) { String id = String.format("%s-%s", pluginName, entry.getKey()); output.put(id, new CapabilityInfo( id, entry.getValue().get().getDescription())); } else { log.warn(String.format("Plugin name is not sane: <%s> " + "dropping plugin owned capability %s; " + "consider changing the plugin filename.", pluginName, entry.getKey())); } } } }

Target:
private void collectPluginCapabilities(Map<String, CapabilityInfo> output) { for (String pluginName : pluginCapabilities.plugins()) { if (!isPluginNameSane(pluginName)) { log.warn(String.format("Plugin name is not sane: <%s> " + "dropping all plugin owned capabilities; " + "consider changing the plugin filename.", pluginName)); continue; } for (Map.Entry<String, Provider<CapabilityDefinition>> entry : pluginCapabilities.byPlugin(pluginName).entrySet()) { String id = String.format("%s-%s", pluginName, entry.getKey()); output.put(id, new CapabilityInfo( id, entry.getValue().get().getDescription())); } } }
Source:
public Boolean getKeepNullColumns() { return keepNullColumns; }

Target:
public boolean getKeepNullColumns() { return keepNullColumns; }
Source:
public void testHeaderBar() { fTableBot.click(0, TIMESTAMP_COLUMN); fBot.text().typeText("2"); fBot.text().pressShortcut(Keystrokes.LF); fTableBot.click(0, MESSAGE_COLUMN); fBot.text().typeText("F"); fBot.text().pressShortcut(Keystrokes.CTRL, Keystrokes.LF); fBot.waitUntil(ConditionHelpers.isTableCellFilled(fTableBot, "2/22", 1, 1)); fBot.waitUntil(ConditionHelpers.isTableCellFilled(fTableBot, "Message F", 3, MESSAGE_COLUMN)); waitForHighlightState(3, TIMESTAMP_COLUMN, true); waitForHighlightState(3, MESSAGE_COLUMN, true); fTableBot.pressShortcut(Keystrokes.DELETE); waitForHighlightState(3, TIMESTAMP_COLUMN, false); waitForHighlightState(3, MESSAGE_COLUMN, false); SWTBotCLabel filterCLabel = fBot.clabel("Message matches \"F\""); SWTBotCanvas filterCanvas = new SWTBotCanvas(filterCLabel.widget); filterCanvas.click(); waitForHighlightState(3, TIMESTAMP_COLUMN, false); waitForHighlightState(3, MESSAGE_COLUMN, true); Rectangle imageBounds = filterCLabel.image().getBounds(); filterCanvas.click(filterCLabel.widget.getLeftMargin() + imageBounds.width / 2, filterCLabel.widget.getTopMargin() + imageBounds.height / 2); fBot.waitUntil(ConditionHelpers.isTableCellFilled(fTableBot, "5/22", 1, 1)); }

Target:
public void testHeaderBar() { fTableBot.click(0, TIMESTAMP_COLUMN); fBot.text().typeText("2"); fBot.text().pressShortcut(Keystrokes.CR); fTableBot.click(0, MESSAGE_COLUMN); fBot.text().typeText("F"); fBot.text().pressShortcut(Keystrokes.CTRL, Keystrokes.CR); fBot.waitUntil(ConditionHelpers.isTableCellFilled(fTableBot, "2/22", 1, 1)); fBot.waitUntil(ConditionHelpers.isTableCellFilled(fTableBot, "Message F", 3, MESSAGE_COLUMN)); fBot.clabel("Timestamp matches \"2\""); fBot.clabel("Message matches \"F\""); waitForHighlightState(3, TIMESTAMP_COLUMN, true); waitForHighlightState(3, MESSAGE_COLUMN, true); fTableBot.pressShortcut(Keystrokes.DELETE); waitForHighlightState(3, TIMESTAMP_COLUMN, false); waitForHighlightState(3, MESSAGE_COLUMN, false); SWTBotCLabel filterCLabel = fBot.clabel("Message matches \"F\""); SWTBotCanvas filterCanvas = new SWTBotCanvas(filterCLabel.widget); filterCanvas.click(); waitForHighlightState(3, TIMESTAMP_COLUMN, false); waitForHighlightState(3, MESSAGE_COLUMN, true); Rectangle imageBounds = filterCLabel.image().getBounds(); filterCanvas.click(filterCLabel.widget.getLeftMargin() + imageBounds.width / 2, filterCLabel.widget.getTopMargin() + imageBounds.height / 2); fBot.waitUntil(ConditionHelpers.isTableCellFilled(fTableBot, "5/22", 1, 1)); }
Source:
public final void run(T configuration, Environment environment) throws Exception { final PooledDataSourceFactory dbConfig = getDataSourceFactory(configuration); this.sessionFactory = sessionFactoryFactory.build(this, environment, dbConfig, entities, name()); registerUnitOfWorkListerIfAbsent(environment).registerSessionFactory(name(), sessionFactory); environment.healthChecks().register(name(), new SessionFactoryHealthCheck( environment.getHealthCheckExecutorService(), dbConfig.getValidationQueryTimeout().orElseGet(() -> Duration.seconds(5)), sessionFactory, dbConfig.getValidationQuery())); }

Target:
public final void run(T configuration, Environment environment) throws Exception { final PooledDataSourceFactory dbConfig = getDataSourceFactory(configuration); this.sessionFactory = sessionFactoryFactory.build(this, environment, dbConfig, entities, name()); registerUnitOfWorkListerIfAbsent(environment).registerSessionFactory(name(), sessionFactory); environment.healthChecks().register(name(), new SessionFactoryHealthCheck( environment.getHealthCheckExecutorService(), dbConfig.getValidationQueryTimeout().orElse(Duration.seconds(5)), sessionFactory, dbConfig.getValidationQuery())); }