auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public static NIC map(VmNetworkInterface entity, NIC template) { NIC model = template != null ? template : new NIC(); if (entity.getVmId() != null) { model.setVm(new VM()); model.getVm().setId(entity.getVmId().toString()); } if (entity.getId() != null) { model.setId(entity.getId().toString()); } if (entity.getName() != null) { model.setName(entity.getName()); } if (entity.getMacAddress() != null) { model.setMac(new MAC()); model.getMac().setAddress(entity.getMacAddress()); } if (entity.getNetworkName() != null) { model.setNetwork(new Network()); model.getNetwork().setName(entity.getNetworkName()); } model.setLinked(entity.isLinked()); model.setInterface(map(entity.getType())); model.setActive(entity.isPlugged()); model.setPlugged(entity.isPlugged()); <START> if (!StringUtils.isEmpty(entity.getCustomProperties())) { <END> CustomProperties hooks = new CustomProperties(); hooks.getCustomProperty().addAll(CustomPropertiesParser.parse(entity.getCustomProperties(), false)); model.setCustomProperties(hooks); } return model; }</code><technical_language>please replace !StringUtils.isEmpty StringUtils.isNotEmpty</technical_language>

Target:
public static NIC map(VmNetworkInterface entity, NIC template) { NIC model = template != null ? template : new NIC(); if (entity.getVmId() != null) { model.setVm(new VM()); model.getVm().setId(entity.getVmId().toString()); } if (entity.getId() != null) { model.setId(entity.getId().toString()); } if (entity.getName() != null) { model.setName(entity.getName()); } if (entity.getMacAddress() != null) { model.setMac(new MAC()); model.getMac().setAddress(entity.getMacAddress()); } if (entity.getNetworkName() != null) { model.setNetwork(new Network()); model.getNetwork().setName(entity.getNetworkName()); } model.setLinked(entity.isLinked()); model.setInterface(map(entity.getType())); model.setActive(entity.isPlugged()); model.setPlugged(entity.isPlugged()); if (entity.getCustomProperties() != null && !entity.getCustomProperties().isEmpty()) { CustomProperties hooks = new CustomProperties(); hooks.getCustomProperty().addAll(CustomPropertiesParser.parse( DevicePropertiesUtils.getInstance().convertProperties(entity.getCustomProperties()), false)); model.setCustomProperties(hooks); } return model; }
Source:
<code>public void initialise() { List<AssetUri> uris = Lists.newArrayList(); for (AssetUri uri : assetManager.listAssets(AssetType.SOUND)) { uris.add(uri); } BehaviorTree defaultTree = null; for (AssetUri uri : assetManager.listAssets(AssetType.BEHAVIOR)) { BehaviorTree asset = assetManager.loadAsset(uri, BehaviorTree.class); if (asset != null) { trees.add(asset); if (asset.getURI().getAssetName().equals("default")) { defaultTree = asset; } } } <START> createGlobalEntity(defaultTree); <END> }</code><technical_language>check global entity exists, set persist</technical_language>

Target:
public void initialise() { List<AssetUri> uris = Lists.newArrayList(); for (AssetUri uri : assetManager.listAssets(AssetType.SOUND)) { uris.add(uri); } for (AssetUri uri : assetManager.listAssets(AssetType.BEHAVIOR)) { BehaviorTree asset = assetManager.loadAsset(uri, BehaviorTree.class); if (asset != null) { trees.add(asset); } } }
Source:
<code>void foo1() <START> throws InvalidKeyException, InvalidAlgorithmParameterException, NoSuchAlgorithmException, NoSuchPaddingException, UnsupportedEncodingException, IllegalBlockSizeException, <END> BadPaddingException { byte[] bytes = "111".getBytes("UTF-8"); random.nextBytes(bytes); IvParameterSpec iv = new IvParameterSpec(bytes); }</code><technical_language>this list of exceptions bring test? replace throws Exception</technical_language>

Target:
void foo1() throws Exception { byte[] bytes = "111".getBytes("UTF-8"); random.nextBytes(bytes); IvParameterSpec iv = new IvParameterSpec(bytes); }
Source:
<code>public SerializedPage serialize(Slice slice, int positionCount) { int uncompressedSize = slice.length(); byte markers = PageCodecMarker.none(); if (compressor.isPresent()) { ByteBuffer compressionBuffer = ByteBuffer.allocate(compressor.get().maxCompressedLength(uncompressedSize)); compressor.get().compress(slice.toByteBuffer(), compressionBuffer); compressionBuffer.flip(); if ((((double) compressionBuffer.remaining()) / uncompressedSize) <= MINIMUM_COMPRESSION_RATIO) { slice = Slices.wrappedBuffer(compressionBuffer); markers = COMPRESSED.set(markers); } } if (spillCipher.isPresent()) { slice = Slices.wrappedBuffer(spillCipher.get().encrypt(slice.toByteBuffer())); markers = ENCRYPTED.set(markers); } else { <START> if (slice.length() < uncompressedSize) { <END> slice = Slices.copyOf(slice); } } return new SerializedPage(slice, markers, positionCount, uncompressedSize); }</code><technical_language>This change unrelated. Perhaps, extract a separate PR</technical_language>

Target:
public SerializedPage serialize(Slice slice, int positionCount) { checkArgument(slice.isCompact(), "slice is not compact"); int uncompressedSize = slice.length(); byte markers = PageCodecMarker.none(); if (compressor.isPresent()) { int maxCompressedSize = compressor.get().maxCompressedLength(uncompressedSize); ensureCompressionBufferCapacity(maxCompressedSize); int compressedSize = compressor.get().compress((byte[]) slice.getBase(), 0, uncompressedSize, compressionBuffer, 0, maxCompressedSize); if ((((double) compressedSize) / uncompressedSize) <= MINIMUM_COMPRESSION_RATIO) { slice = Slices.copyOf(Slices.wrappedBuffer(compressionBuffer, 0, compressedSize)); markers = COMPRESSED.set(markers); } } if (spillCipher.isPresent()) { slice = Slices.wrappedBuffer(spillCipher.get().encrypt(slice.toByteBuffer())); markers = ENCRYPTED.set(markers); } return new SerializedPage(slice, markers, positionCount, uncompressedSize); }
Source:
<code>public MulePackageBuilder withTestClasses(File folder) { checkArgument(folder != null, "The folder must not be null"); <START> checkArgument(folder.exists(), "The folder must must exists"); <END> testClassesFolder = folder; return this; }</code><technical_language>exists -> exist</technical_language>

Target:
public MulePackageBuilder withTestClasses(File folder) { checkArgument(folder != null, "The folder must not be null"); checkArgument(folder.exists(), "The folder must exists"); testClassesFolder = folder; return this; }
Source:
<code>public void removeMeta(Session session, int id) { <START> if (id > 0 && !starting) { <END> SearchRow r = meta.getTemplateSimpleRow(false); r.setValue(0, ValueInt.get(id)); boolean wasLocked = lockMeta(session); try { Cursor cursor = metaIdIndex.find(session, r, r); if (cursor.next()) { if (SysProperties.CHECK) { if (lockMode != Constants.LOCK_MODE_OFF && !wasLocked) { throw DbException.throwInternalError(); } } Row found = cursor.get(); meta.removeRow(session, found); if (SysProperties.CHECK) { checkMetaFree(session, id); } } } finally { if (!wasLocked) { unlockMeta(session); } } if (isMVStore()) { session.releaseDatabaseObjectId(id); } else { synchronized (this) { objectIds.clear(id); } } } }</code><technical_language>starting is volatile atomic, is this safe touching a lock</technical_language>

Target:
public void removeMeta(Session session, int id) { if (id > 0 && !starting) { SearchRow r = meta.getTemplateSimpleRow(false); r.setValue(0, ValueInt.get(id)); boolean wasLocked = lockMeta(session); try { Cursor cursor = metaIdIndex.find(session, r, r); if (cursor.next()) { if (SysProperties.CHECK) { if (lockMode != Constants.LOCK_MODE_OFF && !wasLocked) { throw DbException.throwInternalError(); } } Row found = cursor.get(); meta.removeRow(session, found); if (SysProperties.CHECK) { checkMetaFree(session, id); } } } finally { if (!wasLocked) { unlockMeta(session); } } if (isMVStore()) { session.scheduleDatabaseObjectIdForRelease(id); } else { synchronized (this) { objectIds.clear(id); } } } }
Source:
<code>public void testEvtOpenChannelEnum() throws Exception { EVT_HANDLE channelHandle = null; List<String> channelList = new ArrayList<String>(); try { channelHandle = Wevtapi.INSTANCE.EvtOpenChannelEnum(null, 0); if (channelHandle == null) { throw new Win32Exception(Kernel32.INSTANCE.GetLastError()); } <START> Memory buff = new Memory(1024); <END> IntByReference buffUsed = new IntByReference(); while (true) { buff.clear(); if (!Wevtapi.INSTANCE.EvtNextChannelPath(channelHandle, (int) buff.size(), buff, buffUsed)) { if (Kernel32.INSTANCE.GetLastError() == WinError.ERROR_NO_MORE_ITEMS) { break; } else if (Kernel32.INSTANCE.GetLastError() == WinError.ERROR_INSUFFICIENT_BUFFER) { buff = new Memory(buffUsed.getValue()); if (!Wevtapi.INSTANCE.EvtNextChannelPath(channelHandle, (int) buff.size(), buff, buffUsed)) { throw new Win32Exception(Kernel32.INSTANCE.GetLastError()); } } } channelList.add(buff.getWideString(0)); } assertThat(channelList.size() > 0, is(true)); } finally { if (channelHandle != null) { Wevtapi.INSTANCE.EvtClose(channelHandle); } } }</code><technical_language>This needs adjusted if switch char[] in Wevtapi. 245 for reason</technical_language>

Target:
public void testEvtOpenChannelEnum() throws Exception { EVT_HANDLE channelHandle = null; List<String> channelList = new ArrayList<String>(); try { channelHandle = Wevtapi.INSTANCE.EvtOpenChannelEnum(null, 0); if (channelHandle == null) { throw new Win32Exception(Kernel32.INSTANCE.GetLastError()); } char[] buff = new char[1024]; IntByReference buffUsed = new IntByReference(); while (true) { if (!Wevtapi.INSTANCE.EvtNextChannelPath(channelHandle, buff.length, buff, buffUsed)) { if (Kernel32.INSTANCE.GetLastError() == WinError.ERROR_NO_MORE_ITEMS) { break; } else if (Kernel32.INSTANCE.GetLastError() == WinError.ERROR_INSUFFICIENT_BUFFER) { buff = new char[buffUsed.getValue()]; if (!Wevtapi.INSTANCE.EvtNextChannelPath(channelHandle, buff.length, buff, buffUsed)) { throw new Win32Exception(Kernel32.INSTANCE.GetLastError()); } } } channelList.add(Native.toString(buff)); } assertThat(channelList.size() > 0, is(true)); } finally { if (channelHandle != null) { Wevtapi.INSTANCE.EvtClose(channelHandle); } } }
Source:
<code>public ConfigurationClientBuilder pipeline(HttpPipeline pipeline) { this.pipeline = pipeline; <START> return this; <END> }</code><technical_language>question</technical_language>

Target:
public ConfigurationClientBuilder pipeline(HttpPipeline pipeline) { if (this.pipeline != null && pipeline == null) { logger.info("HttpPipeline is being set to 'null' when it was previously configured."); } this.pipeline = pipeline; return this; }
Source:
<code>public void start() { CacheMode mode = configuration.clustering().cacheMode(); isFetchEnabled = (mode.isDistributed() || mode.isReplicated()) && (configuration.clustering().stateTransfer().fetchInMemoryState() || configuration.persistence().fetchPersistentState()); <START> initRpcOptions(); <END> configuration.clustering().attributes().attribute(ClusteringConfiguration.REMOTE_TIMEOUT) .addListener((a, o) -> initRpcOptions()); stateRequestExecutor = new LimitedExecutor("StateRequest-" + cacheName, stateTransferExecutor, 1); }</code><technical_language>this is remote timeout. is state transfer timeout</technical_language>

Target:
public void start() { CacheMode mode = configuration.clustering().cacheMode(); isFetchEnabled = (mode.isDistributed() || mode.isReplicated()) && (configuration.clustering().stateTransfer().fetchInMemoryState() || configuration.persistence().fetchPersistentState()); synchronousRpcOptions = rpcManager.getRpcOptionsBuilder(ResponseMode.SYNCHRONOUS) .timeout(timeout, TimeUnit.MILLISECONDS).build(); synchronousIgnoreLeaversRpcOptions = rpcManager.getRpcOptionsBuilder(ResponseMode.SYNCHRONOUS_IGNORE_LEAVERS) .timeout(timeout, TimeUnit.MILLISECONDS).build(); stateRequestExecutor = new LimitedExecutor("StateRequest-" + cacheName, stateTransferExecutor, 1); }
Source:
<code><START> public void configurePipeline(PipelineConfigurer pipelineConfigurer) throws IllegalArgumentException { <END> super.configurePipeline(pipelineConfigurer); Preconditions.checkArgument(!Strings.isNullOrEmpty(tableSinkConfig.getRowField()), "Row field must be given as a property."); Schema inputSchema = pipelineConfigurer.getStageConfigurer().getInputSchema(); if (inputSchema != null) { validateInputAndOutputSchemaFields(inputSchema); boolean rowFieldPresent = false; for (Schema.Field field : inputSchema.getFields()) { if (!field.getSchema().getType().isSimpleType()) { throw new IllegalArgumentException( String.format("Field '%s' is not of simple type, All fields for table sink should of simple type", field.getName())); } if (field.getName().equals(tableSinkConfig.getRowField())) { rowFieldPresent = true; } } if (!rowFieldPresent) { throw new IllegalArgumentException( String.format("Row field key : '%s' is not present in the input schema", tableSinkConfig.getRowField())); } } }</code><technical_language>dont need this throws statement</technical_language>

Target:
public void configurePipeline(PipelineConfigurer pipelineConfigurer) { super.configurePipeline(pipelineConfigurer); Preconditions.checkArgument(!Strings.isNullOrEmpty(tableSinkConfig.getRowField()), "Row field must be given as a property."); Schema outputSchema = SchemaValidator.validateOutputSchemaAndInputSchemaIfPresent(tableSinkConfig.getSchemaStr(), tableSinkConfig.getRowField(), pipelineConfigurer); pipelineConfigurer.getStageConfigurer().setOutputSchema(outputSchema); }
Source:
<code>private static void parseFlags(@NotNull FormatState state) { String knownFlags = "#0+- "; StringBuilder flags = new StringBuilder(state.flags); while (state.nBytes < state.format.length()) { <START> if (knownFlags.indexOf(state.format.charAt(state.nBytes)) != -1) { <END> flags.append(state.format.charAt(state.nBytes)); } else { state.flags = flags.toString(); return; } state.nBytes++; } state.flags = flags.toString(); }</code><technical_language>StringUtil.containsChar</technical_language>

Target:
private static void parseFlags(@NotNull FormatState state) { String knownFlags = "#0+- "; StringBuilder flags = new StringBuilder(state.flags); while (state.nBytes < state.format.length()) { if (StringUtil.containsChar(knownFlags, state.format.charAt(state.nBytes))) { flags.append(state.format.charAt(state.nBytes)); } else { state.flags = flags.toString(); return; } state.nBytes++; } state.flags = flags.toString(); }
Source:
<code>public static void deleteSshKeys(String account, Set<Integer> sequenceNumbers, AsyncCallback<VoidResult> cb) { <START> CountingCallback ccb = new CountingCallback(sequenceNumbers.size(), cb); <END> for (int seq : sequenceNumbers) { new RestApi("/accounts/").id(account).view("sshkeys").id(seq) .delete(ccb); } }</code><technical_language>This a CallbackGroup instead: CallbackGroup group = new CallbackGroup(); for (int seq : sequenceNumbers) { new RestApi("/accounts/") .id(account) .view("sshkeys") .id(seq) .delete(group.add(cb)); cb = CallbackGroup.emptyCallback(); } define emptyCallback(): <T> static AsyncCallback<T> emptyCallback() { return new AsyncCallback<T>() { public void onSuccess(T result) public void onError(Throwable err) }; } another place in CodeMirror loading path needs this empty callback code. I net-negative if refactoring this emptyCallback method is defined, instead of adding 49 lines project CountingCallback</technical_language>

Target:
public static void deleteSshKeys(String account, Set<Integer> sequenceNumbers, AsyncCallback<VoidResult> cb) { CallbackGroup group = new CallbackGroup(); for (int seq : sequenceNumbers) { new RestApi("/accounts/").id(account).view("sshkeys").id(seq) .delete(group.add(cb)); cb = CallbackGroup.emptyCallback(); } }
Source:
<code>public synchronized void onResponseComplete(Exception exception) { if (requestComplete.compareAndSet(false, true)) { this.exception = exception; try { if (!responseMetadataFinalized.get() && exception != null) { String allow = getHeader(RestUtils.Headers.ALLOW); responseMetadata.put(RESPONSE_HEADERS_KEY, new JSONObject()); <START> if (allow != null && !allow.isEmpty()) { <END> setHeader(RestUtils.Headers.ALLOW, allow); } setHeader(RestUtils.Headers.CONTENT_TYPE, "text/plain; charset=UTF-8"); ResponseStatus status = ResponseStatus.InternalServerError; if (exception instanceof RestServiceException) { status = ResponseStatus.getResponseStatus(((RestServiceException) exception).getErrorCode()); } responseMetadata.put(RESPONSE_STATUS_KEY, status); bodyBytes.write(exception.toString().getBytes()); responseMetadataFinalized.set(true); } close(); if (restRequest != null) { restRequest.getMetricsTracker().nioMetricsTracker.markRequestCompleted(); restRequest.close(); } onEventComplete(Event.OnRequestComplete); } catch (Exception e) { } } }</code><technical_language>Minor: if import guava nice utilities Strings.isNullOrEmpty(), good implement somewhere</technical_language>

Target:
public synchronized void onResponseComplete(Exception exception) { if (requestComplete.compareAndSet(false, true)) { this.exception = exception; try { if (!responseMetadataFinalized.get() && exception != null) { String allow = getHeader(RestUtils.Headers.ALLOW); responseMetadata.put(RESPONSE_HEADERS_KEY, new JSONObject()); if (!Utils.isNullOrEmpty(allow)) { setHeader(RestUtils.Headers.ALLOW, allow); } setHeader(RestUtils.Headers.CONTENT_TYPE, "text/plain; charset=UTF-8"); ResponseStatus status = ResponseStatus.InternalServerError; if (exception instanceof RestServiceException) { status = ResponseStatus.getResponseStatus(((RestServiceException) exception).getErrorCode()); } responseMetadata.put(RESPONSE_STATUS_KEY, status); bodyBytes.write(exception.toString().getBytes()); responseMetadataFinalized.set(true); } close(); if (restRequest != null) { restRequest.getMetricsTracker().nioMetricsTracker.markRequestCompleted(); restRequest.close(); } onEventComplete(Event.OnRequestComplete); } catch (Exception e) { } } }
Source:
<code>public void mamTest() throws Exception { if (!mamManager.isSupportedByServer()) { return; } <START> Jid userOne = JidCreate.from(conOne.getUser().toString().split("/")[0]); <END> Jid userTwo = JidCreate.from(conTwo.getUser().toString().split("/")[0]); MamQueryResult mamQueryResult = mamManager.queryArchive(userTwo); if (mamQueryResult.forwardedMessages.isEmpty()) { Message message = new Message(); message.setBody("test-message"); message.setFrom(userOne); message.setTo(userTwo); conOne.sendStanza(message); mamQueryResult = mamManager.queryArchive(userTwo); } Assert.assertFalse(mamQueryResult.forwardedMessages.isEmpty()); }</code><technical_language>If want bare JID EntityFullJid.asEntityBareJid() instead, is type safe, more efficient string parsing error prone. correct type for userOne, is EntityBareJid</technical_language>

Target:
public void mamTest() throws Exception { Jid userOne = conOne.getUser().asEntityBareJid(); Jid userTwo = conTwo.getUser().asEntityBareJid(); String messageId = UUID.randomUUID().toString(); String messageBody = "test message"; Message message = prepareMessage(userTwo, messageId, messageBody); conOne.sendStanza(message); Message mamMessage = getConTwoLastMessageSentFrom(userOne); Assert.assertEquals(messageId, mamMessage.getStanzaId()); Assert.assertEquals(messageBody, mamMessage.getBody()); Assert.assertEquals(conOne.getUser(), mamMessage.getFrom()); Assert.assertEquals(userTwo, mamMessage.getTo()); }
Source:
<code>public boolean validatePanel() { <START> errorLabel.setVisible(false); <END> String path = getImageFilePath(); if (path == null || path.isEmpty()) { return false; } warnIfPathIsInvalid(path); boolean isExist = new File(path).exists(); return (isExist); }</code><technical_language>this method need public</technical_language>

Target:
boolean validatePanel() { errorLabel.setVisible(false); String path = getImageFilePath(); if (path == null || path.isEmpty()) { return false; } warnIfPathIsInvalid(path); boolean isExist = new File(path).exists(); return (isExist); }
Source:
<code>protected String getProjectLocation() { IProject createdProject = projectProvider.getProject(); return <START> createdProject.getLocation().toOSString(); <END> }</code><technical_language>need OSString</technical_language>

Target:
protected String getProjectLocation() { IProject createdProject = projectProvider.getProject(); return createdProject.getLocation().toString(); }
Source:
<code>public TransferFormsTableView(TransferFormsTableViewModel model, String[] headers) { super(model); this.headers = headers; setName("forms"); addMouseListener(new MouseAdapterBuilder().onClick(this::relayClickToButton).build()); <START> Dimension formNameDims = TableCustomizer.getHeaderDimension(getHeader(FORM_NAME_COL), this); <END> Dimension statusDims = TableCustomizer.getHeaderDimension(getHeader(STATUS_COL), this); TableCustomizer.customizeHeader(getTableHeader()); TableCustomizer.customizeTable(this); TableColumnModel columns = getColumnModel(); columns.getColumn(SELECTED_CHECKBOX_COL).setMinWidth(40); columns.getColumn(SELECTED_CHECKBOX_COL).setMaxWidth(40); columns.getColumn(SELECTED_CHECKBOX_COL).setPreferredWidth(40); columns.getColumn(FORM_NAME_COL).setMinWidth(formNameDims.width + 25); columns.getColumn(FORM_NAME_COL).setPreferredWidth(formNameDims.width + 25); columns.getColumn(STATUS_COL).setMinWidth(statusDims.width + 25); columns.getColumn(STATUS_COL).setPreferredWidth(statusDims.width + 25); columns.getColumn(DETAIL_BUTTON_COL).setCellRenderer(UI::cellWithButton); columns.getColumn(DETAIL_BUTTON_COL).setMinWidth(40); columns.getColumn(DETAIL_BUTTON_COL).setMaxWidth(40); columns.getColumn(DETAIL_BUTTON_COL).setPreferredWidth(40); setFillsViewportHeight(true); TableRowSorter<TransferFormsTableViewModel> sorter = sortBy(getModel(), FORM_NAME_COL, ASCENDING); setRowSorter(sorter); sorter.sort(); }</code><technical_language>Same: static import</technical_language>

Target:
public TransferFormsTableView(TransferFormsTableViewModel model, String[] headers) { super(model); this.headers = headers; setName("forms"); addMouseListener(new MouseAdapterBuilder().onClick(this::relayClickToButton).build()); Dimension formNameDims = getHeaderDimension(this, getHeader(FORM_NAME_COL)); Dimension statusDims = getHeaderDimension(this, getHeader(STATUS_COL)); customizeHeader(getTableHeader()); customizeTable(this); TableColumnModel columns = getColumnModel(); columns.getColumn(SELECTED_CHECKBOX_COL).setMinWidth(40); columns.getColumn(SELECTED_CHECKBOX_COL).setMaxWidth(40); columns.getColumn(SELECTED_CHECKBOX_COL).setPreferredWidth(40); columns.getColumn(FORM_NAME_COL).setMinWidth(formNameDims.width + 25); columns.getColumn(FORM_NAME_COL).setPreferredWidth(formNameDims.width + 25); columns.getColumn(STATUS_COL).setMinWidth(statusDims.width + 25); columns.getColumn(STATUS_COL).setPreferredWidth(statusDims.width + 25); columns.getColumn(DETAIL_BUTTON_COL).setCellRenderer(UI::cellWithButton); columns.getColumn(DETAIL_BUTTON_COL).setMinWidth(40); columns.getColumn(DETAIL_BUTTON_COL).setMaxWidth(40); columns.getColumn(DETAIL_BUTTON_COL).setPreferredWidth(40); setFillsViewportHeight(true); TableRowSorter<TransferFormsTableViewModel> sorter = sortBy(getModel(), FORM_NAME_COL, ASCENDING); setRowSorter(sorter); sorter.sort(); }
Source:
<code>public void testRenameNewNameExists() throws Exception { typeContext = new LabelClientTypeContext(store, LabelType.METRIC, metrics, eventBus, MAX_CACHE_SIZE); typeContext.createId("newName"); <START> typeContext.rename("oldName", "newName"); <END> }</code><technical_language>This test pass not. need block calling #get result of #createId #rename</technical_language>

Target:
public void testRenameNewNameExists() throws Exception { typeContext = new LabelClientTypeContext(store, LabelType.METRIC, metrics, eventBus, MAX_CACHE_SIZE); typeContext.createId("newName").get(); try { typeContext.rename("oldName", "newName").get(); fail("Should have thrown an exception, can not rename to a name that is already taken."); } catch (ExecutionException exception) { assertTrue(exception.getCause() instanceof IllegalArgumentException); } }
Source:
<code>public void stop(boolean stopGracefully) { synchronized (stateChangeLock) { Preconditions.checkState(started, "not started"); log.info("Beginning shutdown of KafkaSupervisor[%s]", dataSource); try { scheduledExec.shutdownNow(); Optional<TaskRunner> taskRunner = taskMaster.getTaskRunner(); if (taskRunner.isPresent()) { taskRunner.get().unregisterListener(supervisorId); } synchronized (stopLock) { if (stopGracefully) { log.info("Posting GracefulShutdownNotice, signalling managed tasks to complete and publish"); notices.add(new GracefulShutdownNotice()); } else { log.info("Posting ShutdownNotice"); notices.add(new ShutdownNotice()); } long shutdownTimeoutMillis = tuningConfig.getShutdownTimeout().getMillis(); long endTime = System.currentTimeMillis() + shutdownTimeoutMillis; while (!stopped) { long sleepTime = endTime - System.currentTimeMillis(); if (sleepTime <= 0) { <START> log.info("Timed out while waiting for shutdown (timeout [%dms])", shutdownTimeoutMillis); <END> stopped = true; break; } stopLock.wait(sleepTime); } } log.info("Shutdown notice handled"); taskClient.close(); workerExec.shutdownNow(); exec.shutdownNow(); started = false; log.info("KafkaSupervisor[%s] has stopped", dataSource); } catch (Exception e) { log.makeAlert(e, "Exception stopping KafkaSupervisor[%s]", dataSource) .emit(); } } }</code><technical_language>[nit] %,d is more readable for potentially long values</technical_language>

Target:
public void stop(boolean stopGracefully) { synchronized (stateChangeLock) { Preconditions.checkState(started, "not started"); log.info("Beginning shutdown of KafkaSupervisor[%s]", dataSource); try { scheduledExec.shutdownNow(); Optional<TaskRunner> taskRunner = taskMaster.getTaskRunner(); if (taskRunner.isPresent()) { taskRunner.get().unregisterListener(supervisorId); } synchronized (stopLock) { if (stopGracefully) { log.info("Posting GracefulShutdownNotice, signalling managed tasks to complete and publish"); notices.add(new GracefulShutdownNotice()); } else { log.info("Posting ShutdownNotice"); notices.add(new ShutdownNotice()); } long shutdownTimeoutMillis = tuningConfig.getShutdownTimeout().getMillis(); long endTime = System.currentTimeMillis() + shutdownTimeoutMillis; while (!stopped) { long sleepTime = endTime - System.currentTimeMillis(); if (sleepTime <= 0) { log.info("Timed out while waiting for shutdown (timeout [%,dms])", shutdownTimeoutMillis); stopped = true; break; } stopLock.wait(sleepTime); } } log.info("Shutdown notice handled"); taskClient.close(); workerExec.shutdownNow(); exec.shutdownNow(); started = false; log.info("KafkaSupervisor[%s] has stopped", dataSource); } catch (Exception e) { log.makeAlert(e, "Exception stopping KafkaSupervisor[%s]", dataSource) .emit(); } } }
Source:
<code>public void checkIndentation() { final DetailAST firstChild = getMainAst().getFirstChild(); final DetailAST parent = getMainAst().getParent(); if (parent.getType() != TokenTypes.SWITCH_RULE && getLineStart(firstChild) == expandedTabsColumnNo(firstChild)) { final IndentLevel level = getIndent(); if (isAcceptableIndent(firstChild, level)) { isLambdaCorrectlyIndented = false; <START> logError(firstChild, "arguments", expandedTabsColumnNo(firstChild), level); <END> } } if (getLineStart(getMainAst()) == expandedTabsColumnNo(getMainAst())) { final IndentLevel level = new IndentLevel(getIndent(), getIndentCheck().getLineWrappingIndentation()); if (isAcceptableIndent(getMainAst(), level)) { isLambdaCorrectlyIndented = false; logError(getMainAst(), "", expandedTabsColumnNo(getMainAst()), level); } } }</code><technical_language>Field name sense me. set lambda correctly idented indent is acceptable... I other instances is set false of parent do indentation</technical_language>

Target:
public void checkIndentation() { final DetailAST firstChild = getMainAst().getFirstChild(); final DetailAST parent = getMainAst().getParent(); if (parent.getType() != TokenTypes.SWITCH_RULE && getLineStart(firstChild) == expandedTabsColumnNo(firstChild)) { final int firstChildColumnNo = expandedTabsColumnNo(firstChild); final IndentLevel level = getIndent(); if (isNonAcceptableIndent(firstChildColumnNo, level)) { isLambdaCorrectlyIndented = false; logError(firstChild, "arguments", firstChildColumnNo, level); } } final int mainAstColumnNo = expandedTabsColumnNo(getMainAst()); if (mainAstColumnNo == getLineStart(getMainAst())) { final IndentLevel level = new IndentLevel(getIndent(), getIndentCheck().getLineWrappingIndentation()); if (isNonAcceptableIndent(mainAstColumnNo, level)) { isLambdaCorrectlyIndented = false; logError(getMainAst(), "", mainAstColumnNo, level); } } }
Source:
<code>public void testGetInternalUrlServiceEndpoint() throws Exception { Iterable<Module> modules = ImmutableSet.<Module> of(getLoggingModule(), new InternalUrlModule()); <START> NovaApi novaApi = ContextBuilder.newBuilder(provider).modules(modules).overrides(setupProperties()).buildApi(NovaApi.class); <END> String zone = novaApi.getConfiguredZones().iterator().next(); try { novaApi.getServerApiForZone(zone).list().concat().toList(); } catch (Exception e) { Assert.fail("Could not retrieve servers list", e); } }</code><technical_language>if, creating API here, override [setupModules](<LINK_1> [api](<LINK_0> test harness creates? this initially change much, "standard" context setup for live tests</technical_language>

Target:
public void testGetInternalUrlServiceEndpoint() throws Exception { String zone = api.getConfiguredZones().iterator().next(); try { api.getServerApiForZone(zone).list().concat().toList(); } catch (Exception e) { Assert.fail("Could not retrieve servers list using the internalUrl", e); } }
Source:
<code>public void testOpenAndCloseInSinkFunction() throws Exception { @SuppressWarnings("unchecked") <START> ElasticsearchSinkFunction<String> sinkFunction = (ElasticsearchSinkFunction<String>) mock(ElasticsearchSinkFunction.class); final DummyElasticsearchSink<String> sink = new DummyElasticsearchSink<>( new HashMap<>(), sinkFunction, new DummyRetryFailureHandler()); sink.open(mock(Configuration.class)); sink.close(); verify(sinkFunction, times(1)).open(); verify(sinkFunction, times(1)).close(); verifyNoMoreInteractions(sinkFunction); <END> }</code><technical_language>I this reflects design adheres principles of dependency injection. If design is good enough, constructor in test</technical_language>

Target:
public void testOpenAndCloseInSinkFunction() throws Exception { SimpleClosableSinkFunction<String> sinkFunction = new SimpleClosableSinkFunction<>(); final DummyElasticsearchSink<String> sink = new DummyElasticsearchSink<>( new HashMap<>(), sinkFunction, new DummyRetryFailureHandler()); sink.open(mock(Configuration.class)); sink.close(); Assert.assertTrue(sinkFunction.openCalled); Assert.assertTrue(sinkFunction.closeCalled); }
Source:
<code>public List<LunModel> getLunsToRemove() { if (getIsGrouppedByTarget()) { <START> List<LunModel> luns = new ArrayList<>(); List<SanTargetModel> sanTargetModels = (List<SanTargetModel>) getItems(); for (SanTargetModel sanTargetModel : sanTargetModels) { luns.addAll(sanTargetModel.getLuns().stream() .filter(LunModel::getIsIncluded) .filter(LunModel::isRemoveLunSelected) .distinct() .collect(Collectors.toList())); } return luns; <END> } return ((List<LunModel>) getItems()).stream() .filter(LunModel::getIsIncluded) .filter(LunModel::isRemoveLunSelected) .distinct() .collect(Collectors.toList()); }</code><technical_language>Consider replace with: return ((List<SanTargetModel>) getItems()).stream() .map(SanTargetModel::getLuns) .flatMap(List::stream) .filter(LunModel::getIsIncluded) .filter(LunModel::isRemoveLunSelected) .distinct() .collect(Collectors.toList()); do need filter included luns? enough filter luns selected removed</technical_language>

Target:
public List<LunModel> getLunsToRemove() { if (getIsGrouppedByTarget()) { return ((List<SanTargetModel>) getItems()).stream() .map(SanTargetModel::getLuns) .flatMap(List::stream) .filter(LunModel::isRemoveLunSelected) .distinct() .collect(Collectors.toList()); } return ((List<LunModel>) getItems()).stream() .filter(LunModel::isRemoveLunSelected) .distinct() .collect(Collectors.toList()); }
Source:
<code>default void referenceOriginalMessage(final Message original, String originalQueue) { String originalQueueOnMessage = original.getAnnotationString(Message.HDR_ORIGINAL_QUEUE); if (originalQueueOnMessage != null) { setBreadcrumb(Message.HDR_ORIGINAL_QUEUE, originalQueueOnMessage); } setAnnotation(Message.HDR_ORIGINAL_QUEUE, originalQueue); Object originalID = original.getAnnotation(Message.HDR_ORIG_MESSAGE_ID); <START> if (originalID != null) { <END> setBreadcrumb(Message.HDR_ORIGINAL_ADDRESS, original.getAnnotationString(Message.HDR_ORIGINAL_ADDRESS)); setBreadcrumb(Message.HDR_ORIG_MESSAGE_ID, originalID); } setAnnotation(Message.HDR_ORIGINAL_ADDRESS, original.getAddress()); setAnnotation(Message.HDR_ORIG_MESSAGE_ID, original.getMessageID()); setExpiration(0); }</code><technical_language>code suggests, setBreadcrumb happen for Message.HDR_ORIGINAL_QUEUE for Message.HDR_ORIGINAL_ADDRESS Message.HDR_ORIG_MESSAGE_ID if for example originalID is null. mentioned in past, I expert in Artemis I judge if situation happen, analysing this code only, is a chance breadcrumbs run out of sync, set separate conditions. a problem however</technical_language>

Target:
default void referenceOriginalMessage(final Message original, String originalQueue) { Object originalQueueOnMessage = original.getBrokerProperty(Message.HDR_ORIGINAL_QUEUE); if (originalQueueOnMessage != null) { setBreadcrumb(Message.HDR_ORIGINAL_QUEUE, originalQueueOnMessage); } setBrokerProperty(Message.HDR_ORIGINAL_QUEUE, originalQueue); Object originalID = original.getBrokerProperty(Message.HDR_ORIG_MESSAGE_ID); if (originalID != null) { setBreadcrumb(Message.HDR_ORIGINAL_ADDRESS, original.getBrokerProperty(Message.HDR_ORIGINAL_ADDRESS)); setBreadcrumb(Message.HDR_ORIG_MESSAGE_ID, originalID); } setBrokerProperty(Message.HDR_ORIGINAL_ADDRESS, original.getAddress()); setBrokerProperty(Message.HDR_ORIG_MESSAGE_ID, original.getMessageID()); setExpiration(0); }
Source:
<code>public KnoxShellTable select(String cols) { KnoxShellTable table = new KnoxShellTable(); List<List<Comparable<? extends Object>>> columns = new ArrayList<>(); <START> String[] colnames = cols.split(",\\s*"); <END> for (String colName : colnames) { table.header(colName); columns.add(values(headers.indexOf(colName))); } for (int i = 0; i < rows.size(); i++) { table.row(); for (List<Comparable<? extends Object>> col : columns) { table.value(col.get(i)); } } return table; }</code><technical_language>this work if Column A Column C trailing whitespace? split comma do a colName.trim() lines</technical_language>

Target:
public KnoxShellTable select(String cols) { KnoxShellTable table = new KnoxShellTable(); List<List<Comparable<? extends Object>>> columns = new ArrayList<>(); cols = cols.trim(); String[] colnames = cols.split("\\s*,\\s*"); for (String colName : colnames) { table.header(colName); columns.add(values(headers.indexOf(colName))); } for (int i = 0; i < rows.size(); i++) { table.row(); for (List<Comparable<? extends Object>> col : columns) { table.value(col.get(i)); } } return table; }
Source:
<code>public Collection<TreeNode> getTreeNodes(Diff diff) { final Collection<EStructuralFeature.Setting> settings = treeNodeToDiffCrossReferencer .getNonNavigableInverseReferences(diff, false); <START> final Set<TreeNode> nodes = new LinkedHashSet<TreeNode>(settings.size()); <END> for (EStructuralFeature.Setting setting : settings) { final EObject referencing = setting.getEObject(); if (referencing instanceof TreeNode) { nodes.add((TreeNode)referencing); } } return nodes; }</code><technical_language>Is a Set necessary here? A treenode wrap a single eobject treenode returned #getNonNavigableInverseReferences()</technical_language>

Target:
public Collection<TreeNode> getTreeNodes(Diff diff) { final Collection<EStructuralFeature.Setting> settings = treeNodeToDiffCrossReferencer .getNonNavigableInverseReferences(diff, false); final List<TreeNode> nodes = new ArrayList<TreeNode>(settings.size()); for (EStructuralFeature.Setting setting : settings) { final EObject referencing = setting.getEObject(); if (referencing instanceof TreeNode) { nodes.add((TreeNode)referencing); } } return nodes; }
Source:
<code>public MatchResult match(FilterNode filterNode, SymbolAliases symbolAliases) { <START> checkState(this.filterNode == null, "joinNode must be null at this point"); <END> this.filterNode = filterNode; this.symbolAliases = symbolAliases; return new MatchResult(match()); }</code><technical_language>filterNode null ..</technical_language>

Target:
public MatchResult match(FilterNode filterNode, SymbolAliases symbolAliases) { checkState(this.filterNode == null, "filterNode must be null at this point"); this.filterNode = filterNode; this.symbolAliases = symbolAliases; return new MatchResult(match()); }
Source:
<code>private boolean internalReceiveCommand(DiyOnXBeeBindingProvider provider, String itemName, Command command) { final String remote = provider.getRemote(itemName); final int[] remoteAddress = FormatUtil.fromReadableAddress(remote); Item item; try { item = itemRegistry.getItem(itemName); } catch (ItemNotFoundException e1) { <START> logger.error("unable to get item " + itemName, e1); <END> return false; } final String commandValue = createCommand(item, command); if(commandValue == null) { logger.warn("unable to create command " + commandValue + " for item " + itemName); return false; } else { logger.debug("created command for item {}", commandValue, itemName); } final String commandString = new StringBuilder().append(provider.getId(itemName)).append('=').append(commandValue).append('\n').toString(); final ZNetTxRequest request = new ZNetTxRequest(new XBeeAddress64(remoteAddress), createPayload(commandString)); xbeeUsageLock.lock(); try { if(xbee == null) { logger.error("cannot send command to " + itemName + " as the XBee module isn't initialized"); return false; } else { final XBeeResponse response = xbee.sendSynchronous(request); return true; } } catch (XBeeTimeoutException e) { logger.error("failed sending " + command + " to " + itemName, e); } catch (XBeeException e) { logger.error("failed sending " + command + " to " + itemName, e); } finally { xbeeUsageLock.unlock(); } return false; }</code><technical_language>parameterized logging instead of string concatenation</technical_language>

Target:
private boolean internalReceiveCommand(DiyOnXBeeBindingProvider provider, String itemName, Command command) { final String remote = provider.getRemote(itemName); final int[] remoteAddress = FormatUtil.fromReadableAddress(remote); Item item; try { item = itemRegistry.getItem(itemName); } catch (ItemNotFoundException e1) { logger.error("unable to get item {}", itemName, e1); return false; } final String commandValue = createCommand(item, command); if (commandValue == null) { logger.warn("unable to create command for item {}", commandValue, itemName); return false; } else { logger.debug("created command for item {}", commandValue, itemName); } final String commandString = new StringBuilder().append(provider.getId(itemName)).append('=') .append(commandValue).append('\n').toString(); final ZNetTxRequest request = new ZNetTxRequest(new XBeeAddress64(remoteAddress), createPayload(commandString)); xbeeUsageLock.lock(); try { if (xbee == null) { logger.error("cannot send command to as the XBee module isn't initialized", itemName); return false; } else { final XBeeResponse response = xbee.sendSynchronous(request); return true; } } catch (XBeeTimeoutException e) { logger.error("failed sending to {}", command, itemName, e); } catch (XBeeException e) { logger.error("failed sending to {}", command, itemName, e); } finally { xbeeUsageLock.unlock(); } return false; }
Source:
<code>public ScmChangedFiles provide(@Nullable ScmConfiguration scmConfiguration, BranchConfiguration branchConfiguration, InputModuleHierarchy inputModuleHierarchy) { if (scmBranchChangedFiles == null) { if (scmConfiguration == null) { <START> scmBranchChangedFiles = new ScmChangedFiles(null); <END> } else { Path rootBaseDir = inputModuleHierarchy.root().getBaseDir(); Collection<Path> changedFiles = loadChangedFilesIfNeeded(scmConfiguration, branchConfiguration, rootBaseDir); scmBranchChangedFiles = new ScmChangedFiles(changedFiles); } } return scmBranchChangedFiles; }</code><technical_language>![MAJOR](<LINK_1> 'Severity: MAJOR') Change this condition evaluate "false" [![rule](<LINK_2>](<LINK_0></technical_language>

Target:
public ScmChangedFiles provide(@Nullable ScmConfiguration scmConfiguration, BranchConfiguration branchConfiguration, InputModuleHierarchy inputModuleHierarchy) { if (scmBranchChangedFiles == null) { if (scmConfiguration == null) { scmBranchChangedFiles = new ScmChangedFiles(null); } else { Path rootBaseDir = inputModuleHierarchy.root().getBaseDir(); Collection<Path> changedFiles = loadChangedFilesIfNeeded(scmConfiguration, branchConfiguration, rootBaseDir); validatePaths(changedFiles); scmBranchChangedFiles = new ScmChangedFiles(changedFiles); } } return scmBranchChangedFiles; }
Source:
<code>public void setEntity(EntityLocal entity) { super.setEntity(entity); this.producer = getConfig(PRODUCER) == null ? entity: getConfig(PRODUCER); this.sourceSensor = (Sensor<T>) getRequiredConfig(SOURCE_SENSOR); Sensor<?> targetSensorSpecified = getConfig(TARGET_SENSOR); this.targetSensor = targetSensorSpecified!=null ? (Sensor<U>) targetSensorSpecified : (Sensor<U>) this.sourceSensor; if (producer.equals(entity) && targetSensorSpecified==null) { <START> LOG.error("Refusing to add an enricher which reads and publishes on the same sensor: "+ <END> producer+"."+sourceSensor+" (computing transformation)"); return; } subscribe(producer, sourceSensor, this); if (sourceSensor instanceof AttributeSensor) { Object value = producer.getAttribute((AttributeSensor<?>)sourceSensor); if (value!=null) { onEvent(new BasicSensorEvent(sourceSensor, producer, value, -1)); } } }</code><technical_language>log details of transformer ? useful i debug</technical_language>

Target:
public void setEntity(EntityLocal entity) { super.setEntity(entity); this.producer = getConfig(PRODUCER) == null ? entity: getConfig(PRODUCER); this.sourceSensor = (Sensor<T>) getRequiredConfig(SOURCE_SENSOR); Sensor<?> targetSensorSpecified = getConfig(TARGET_SENSOR); this.targetSensor = targetSensorSpecified!=null ? (Sensor<U>) targetSensorSpecified : (Sensor<U>) this.sourceSensor; if (producer.equals(entity) && targetSensorSpecified==null) { LOG.error("Refusing to add an enricher which reads and publishes on the same sensor: "+ producer+"."+sourceSensor+" (computing transformation)"); return; } subscriptions().subscribe(producer, sourceSensor, this); if (sourceSensor instanceof AttributeSensor) { Object value = producer.getAttribute((AttributeSensor<?>)sourceSensor); if (value!=null) { onEvent(new BasicSensorEvent(sourceSensor, producer, value, -1)); } } }
Source:
<code>private static boolean shouldReactToChildVisibilityChanges(MUIElement theElement) { <START> return (theElement instanceof MPartSashContainer || theElement instanceof MPartStack); <END> }</code><technical_language>this check include MCompositePart? MPart container. sure, however, MCompositePart children's visibility is treated independently</technical_language>

Target:
private static boolean shouldReactToChildVisibilityChanges(MUIElement theElement) { return (theElement instanceof MPartSashContainer || theElement instanceof MPartStack || theElement instanceof MCompositePart) && !theElement.getTags().contains(IPresentationEngine.HIDDEN_EXPLICITLY); }
Source:
<code><START> public void consumeOnceForEachLeaderPair() { <END> leaderElectionResultsWithDurationInRandomOrder(LEADER_1, LEADER_2, 5, 10); leaderElectionResultsWithDurationInRandomOrder(LEADER_2, LEADER_3, 5, 15); leaderElectionResultsWithDurationInRandomOrder(LEADER_1, LEADER_2, 5, 1); leaderElectionResultsWithDurationInRandomOrder(LEADER_1, LEADER_3, 5, 7); verify(mockConsumer).accept(10L); verify(mockConsumer).accept(15L); verify(mockConsumer).accept(7L); verifyNoMoreInteractions(mockConsumer); }</code><technical_language>I if range of values for pair (other repeated ones) non-intersecting - i.e. for leader (2,3) set min 200 100% a spurious result</technical_language>

Target:
public void consumeOnceForEachLeaderPair() { leaderElectionResultsWithDurationInRandomOrder(LEADER_1, LEADER_2, 5, 10); leaderElectionResultsWithDurationInRandomOrder(LEADER_2, LEADER_3, 5, 25); leaderElectionResultsWithDurationInRandomOrder(LEADER_1, LEADER_2, 5, 1); leaderElectionResultsWithDurationInRandomOrder(LEADER_1, LEADER_3, 5, 37); verify(mockConsumer).accept(10L); verify(mockConsumer).accept(25L); verify(mockConsumer).accept(37L); verifyNoMoreInteractions(mockConsumer); }
Source:
<code>public Set<SwaggerError> validate(JsonDocument document, URI baseURI) { Set<SwaggerError> errors = Sets.newHashSet(); JsonNode jsonContent = null; try { jsonContent = document.asJson(); } catch (Exception e) { <START> System.out.println("Loggg"); <END> YEditLog.logException(e); } if (jsonContent != null) { Node yaml = document.getYaml(); if (yaml != null) { errors.addAll(validateAgainstSchema( new ErrorProcessor(yaml, document.getSchema().getRootType().getContent()), document)); errors.addAll(validateModel(document.getModel())); errors.addAll(checkDuplicateKeys(yaml)); errors.addAll(referenceValidator.validate(baseURI, document)); } } return errors; }</code><technical_language>here, people forget remove debugging logs</technical_language>

Target:
public Set<SwaggerError> validate(JsonDocument document, URI baseURI) { Set<SwaggerError> errors = Sets.newHashSet(); JsonNode jsonContent = null; try { jsonContent = document.asJson(); } catch (Exception e) { YEditLog.logException(e); } if (jsonContent != null) { Node yaml = document.getYaml(); if (yaml != null) { errors.addAll(validateAgainstSchema( new ErrorProcessor(yaml, document.getSchema().getRootType().getContent()), document)); errors.addAll(validateModel(document.getModel())); errors.addAll(checkDuplicateKeys(yaml)); errors.addAll(referenceValidator.validate(baseURI, document)); } } return errors; }
Source:
<code>public static boolean isBinary(byte[] raw) { <START> final int size = raw.length > FIRST_FEW_BYTES ? FIRST_FEW_BYTES <END> : raw.length; return isBinary(raw, size); }</code><technical_language>write this shorter: int size = Math.min(raw.length, FIRST_FEW_BYTES);</technical_language>

Target:
public static boolean isBinary(byte[] raw) { final int size = Math.min(raw.length, FIRST_FEW_BYTES); return isBinary(raw, size); }
Source:
<code><START> public GdbTerminalConnector(Process process) { <END> fProcess = process; }</code><technical_language>Add IllegalArgumentException fail-fast process is null</technical_language>

Target:
public GdbTerminalConnector(Process process) { if (process == null) { throw new IllegalArgumentException("Invalid Process"); } fProcess = process; }
Source:
<code>public ApexDangerousMethodsRule() { setProperty(CODECLIMATE_CATEGORIES, new String[] { "Security" }); setProperty(CODECLIMATE_REMEDIATION_MULTIPLIER, 100); setProperty(CODECLIMATE_BLOCK_HIGHLIGHTING, false); <START> <END> }</code><technical_language>if interested in visiting ASTUserClass, add a call super.addRuleChainVisit(ASTUserClass.class);. This allow rule part of a rule chain, minimizing overhead of visiting Abstract Syntax Tree allowing a single transversal of tree shared multiple rules; making application of this rule faster. I realizing this apply other rules in security ruleset. thought of earlier</technical_language>

Target:
public ApexDangerousMethodsRule() { super.addRuleChainVisit(ASTUserClass.class); setProperty(CODECLIMATE_CATEGORIES, new String[] { "Security" }); setProperty(CODECLIMATE_REMEDIATION_MULTIPLIER, 100); setProperty(CODECLIMATE_BLOCK_HIGHLIGHTING, false); }