auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code><Info, Context, Handle extends AbstractChannelStateHandle<Info>> void readChunk( FSDataInputStream source, long sourceOffset, RecoveredChannelStateHandler<Info, Context> stateHandler, Info channelInfo) throws IOException { if (source.getPos() != sourceOffset) { source.seek(sourceOffset); } int length = serializer.readLength(source); while (length > 0) { Tuple2<ChannelStateByteBuffer, Context> bufferWithContext = stateHandler.getBuffer(channelInfo); try { while (length > 0 && bufferWithContext.f0.isWritable()) { length -= serializer.readData(source, bufferWithContext.f0, length); } } catch (Exception e) { <START> bufferWithContext.f0.recycle(); <END> throw e; } stateHandler.recover(channelInfo, bufferWithContext.f1); } }</code><technical_language>context cleaned matter failing anyways</technical_language>

Target:
<Info, Context, Handle extends AbstractChannelStateHandle<Info>> void readChunk( FSDataInputStream source, long sourceOffset, RecoveredChannelStateHandler<Info, Context> stateHandler, Info channelInfo) throws IOException, InterruptedException { if (source.getPos() != sourceOffset) { source.seek(sourceOffset); } int length = serializer.readLength(source); while (length > 0) { RecoveredChannelStateHandler.BufferWithContext<Context> bufferWithContext = stateHandler.getBuffer(channelInfo); try { while (length > 0 && bufferWithContext.buffer.isWritable()) { length -= serializer.readData(source, bufferWithContext.buffer, length); } } catch (Exception e) { bufferWithContext.buffer.recycle(); throw e; } stateHandler.recover(channelInfo, bufferWithContext.context); } }
Source:
<code><START> public long incrementCounter(final String key, final long value) { <END> long l = incAtomicLong(counterMap.get(key), value); LOG.debug("Incrementing counter by with final value {}", key, value, l); return l; }</code><technical_language>check if value>0 incrementing avoid negative values for counters</technical_language>

Target:
public long incrementCounter(final String key, final long value) { AtomicLong counter = counterMap.get(key); if (counter == null) { LOG.debug("Ignoring counter increment for unknown counter {}", key); return 0; } if (value < 0) { LOG.debug("Ignoring negative increment value for counter {}", value, key); return counter.get(); } else { long l = incAtomicLong(counter, value); LOG.debug("Incrementing counter by with final value {}", key, value, l); return l; } }
Source:
<code>public void testTextWrapBoundariesUpdates() { tested.refresh(); <START> verify(textDecorator).setTextBoundaries(any()); <END> }</code><technical_language>verify text boundaries correct? Verifying simply set boundaries text decorator is ascertain values set</technical_language>

Target:
public void testTextWrapBoundariesUpdates() { tested.refresh(); verify(textDecorator).setTextBoundaries(PATH.getBoundingBox()); }
Source:
<code>protected Response performAction(VdcActionType task, VdcActionParametersBase params, Action action) { try { if (QueryHelper.hasMatrixParam(getUriInfo(), ASYNC_CONSTRAINT) || expectNonBlocking()) { getCurrent().get(MetaData.class).set("async", true); <START> return performNonBlockingAction(task, params); <END> } else { doAction(task, params); if (action!=null) { return Response.ok().entity(action).build(); } else { return Response.ok().build(); } } } catch (Exception e) { return handleError(Response.class, e, false); } }</code><technical_language>covering this use-case</technical_language>

Target:
protected Response performAction(VdcActionType task, VdcActionParametersBase params, Action action) { try { if (QueryHelper.hasMatrixParam(getUriInfo(), ASYNC_CONSTRAINT) || expectNonBlocking()) { getCurrent().get(MetaData.class).set("async", true); return performNonBlockingAction(task, params); } else { doAction(task, params); if (action!=null) { action.setStatus(StatusUtils.create(CreationStatus.COMPLETE)); return Response.ok().entity(action).build(); } else { return Response.ok().build(); } } } catch (Exception e) { return handleError(Response.class, e, false); } }
Source:
<code>public static void instanceFieldTest2() { Foo f = new Foo(); int a = f.$inline$GetInstanceField(); <START> if (a != 42) { <END> throw new Error("Expected 42, got " + a); } f.iField = 43; a = f.$inline$GetInstanceField(); if (a != 43) { throw new Error("Expected 43, got " + a); } }</code><technical_language>get rid of this IF? field ops in basic block CHECK</technical_language>

Target:
public static void instanceFieldTest2() { Foo f = new Foo(); int a = f.$inline$GetInstanceField(); f.iField = 43; a = f.$inline$GetInstanceField(); if (a != 43) { throw new Error("Expected 43, got " + a); } }
Source:
<code>public void init() { jobNameLabel.addRequiredIndicator(); jobTypeLabel.addRequiredIndicator(); jobRetriesLabel.addRequiredIndicator(); jobRetriesInput.init(); <START> jobRetriesInput.getElement().setType("number"); <END> jobRetriesInput.getElement().setAttribute("min", "0"); jobRetriesInput.getElement().setDefaultValue("0"); myParametersGrid.setHeight("200px"); myParametersGrid.setEmptyTableWidget(new Label(constants.No_Parameters_added_yet())); initGridColumns(); initDateTimePicker(); Button button = GWT.create(Button.class); button.setText(Constants.INSTANCE.Add_Parameter()); button.addClickHandler(e -> addNewParameter()); advancedContent.add(myParametersGrid); advancedContent.add(button); inlineNotification.setType(InlineNotification.InlineNotificationType.DANGER); }</code><technical_language>This avoided is a number input already</technical_language>

Target:
public void init() { jobNameLabel.addRequiredIndicator(); jobTypeLabel.addRequiredIndicator(); jobRetriesLabel.addRequiredIndicator(); jobRetriesInput.init(); jobRetriesInput.getElement().setAttribute("min", "0"); jobRetriesInput.getElement().setDefaultValue("0"); myParametersGrid.setHeight("200px"); myParametersGrid.setEmptyTableWidget(new Label(constants.No_Parameters_added_yet())); initGridColumns(); initDateTimePicker(); Button button = GWT.create(Button.class); button.setText(Constants.INSTANCE.Add_Parameter()); button.addClickHandler(e -> addNewParameter()); advancedContent.add(myParametersGrid); advancedContent.add(button); inlineNotification.setType(InlineNotification.InlineNotificationType.DANGER); }
Source:
<code>private void updateWrittenAndUnread(AssignmentExpressionTree statementTree, String key, String variableName, Symbol variableSymbol) { <START> Map<String, AssignmentExpressionTree> keysToAssignmentMap; if (writtenAndUnread.containsKey(variableName)) { keysToAssignmentMap = writtenAndUnread.get(variableName); } else { keysToAssignmentMap = new HashMap<>(); } keysToAssignmentMap.put(key, statementTree); namesToSymbols.put(variableName, variableSymbol); writtenAndUnread.put(variableName, keysToAssignmentMap); <END> }</code><technical_language>suggestion writtenAndUnread.computeIfAbsent(variableName, -> new HashMap<>()).put(key, statementTree); namesToSymbols.put(variableName, variableSymbol);</technical_language>

Target:
private void updateWrittenAndUnread(AssignmentExpressionTree statementTree, String key, String variableName, Symbol variableSymbol) { writtenAndUnread.computeIfAbsent(variableName, k -> new HashMap<>()).put(key, statementTree); namesToSymbols.put(variableName, variableSymbol); }
Source:
<code>private Locale languageLocale(String languageCode) { if (TextUtils.isEmpty(languageCode)) return Locale.getDefault(); <START> if (languageCode.length() > 2) { <END> return new Locale(languageCode.substring(0, 2), languageCode.substring(3)); } return new Locale(languageCode); }</code><technical_language>set 2 3 constants magic numbers</technical_language>

Target:
private Locale languageLocale(String languageCode) { if (TextUtils.isEmpty(languageCode)) return Locale.getDefault(); if (languageCode.length() > NO_REGION_LANG_CODE_LEN) { return new Locale(languageCode.substring(0, NO_REGION_LANG_CODE_LEN), languageCode.substring(REGION_SUBSTRING_INDEX)); } return new Locale(languageCode); }
Source:
<code>public String getGuid() { <START> return String.valueOf(id); <END> }</code><technical_language>valueof? Id is a String</technical_language>

Target:
public String getGuid() { return id; }
Source:
<code>private static void setNot(Attributes atts, ITmfFilterTreeNode node) { String value = <START> atts.getValue(TmfFilterContainsNode.NOT_ATTR); <END> if (Boolean.TRUE.toString().equalsIgnoreCase(value)) { ((TmfFilterTreeNode) node).setNot(true); } }</code><technical_language>constant moved TmfFilterTreeNode. others removed/deprecated</technical_language>

Target:
private static void setNot(Attributes atts, ITmfFilterTreeNode node) { String value = atts.getValue(TmfFilterTreeNode.NOT_ATTRIBUTE); if (Boolean.TRUE.toString().equalsIgnoreCase(value)) { ((TmfFilterTreeNode) node).setNot(true); } }
Source:
<code>public int hashCode() { int result = _syncType != null ? _syncType.hashCode() : 0; result = 31 * result + (_nuageVspCmsId != null ? _nuageVspCmsId.hashCode() : 0); return result; <START> } <END></code><technical_language>Please implement toString() provide debugging state information for debugging purposes</technical_language>

Target:
public int hashCode() { int result = super.hashCode(); result = 31 * result + (_syncType != null ? _syncType.hashCode() : 0); result = 31 * result + (_nuageVspCmsId != null ? _nuageVspCmsId.hashCode() : 0); return result; }
Source:
<code>public PackagedProgram getPackagedProgram() throws FlinkException { try { if (PackagedProgramUtils.isPython(jobClassName) || PackagedProgramUtils.isPython(programArguments)){ String pythonJobClassName = PackagedProgramUtils.PYTHON_DRIVER_CLASS_NAME; <START> File pythonJarFile = new File(PackagedProgramUtils.getPythonJar().getPath()); <END> return PackagedProgram.newBuilder() .setUserClassPaths(new ArrayList<>(userClassPaths)) .setArguments(programArguments) .setJarFile(pythonJarFile) .setEntryPointClassName(pythonJobClassName) .build(); } if (jarFile != null) { return PackagedProgram.newBuilder() .setUserClassPaths(new ArrayList<>(userClassPaths)) .setArguments(programArguments) .setJarFile(jarFile) .setEntryPointClassName(jobClassName) .build(); } final String entryClass = getJobClassNameOrScanClassPath(); return PackagedProgram.newBuilder() .setUserClassPaths(new ArrayList<>(userClassPaths)) .setEntryPointClassName(entryClass) .setArguments(programArguments) .build(); } catch (ProgramInvocationException e) { throw new FlinkException("Could not load the provided entrypoint class.", e); } }</code><technical_language>get a correct pythonJarFile for Yarn perjob/application mode here? do ship $FLINK_HOME/opt directory set FLINK_OPT_DIR environment. is out of scope of this PR</technical_language>

Target:
public PackagedProgram getPackagedProgram() throws FlinkException { try { if (PackagedProgramUtils.isPython(jobClassName) || PackagedProgramUtils.isPython(programArguments)){ String pythonJobClassName = PackagedProgramUtils.getPythonDriverClassName(); File pythonJarFile = new File(PackagedProgramUtils.getPythonJar().getPath()); return PackagedProgram.newBuilder() .setUserClassPaths(new ArrayList<>(userClassPaths)) .setArguments(programArguments) .setJarFile(pythonJarFile) .setEntryPointClassName(pythonJobClassName) .build(); } if (jarFile != null) { return PackagedProgram.newBuilder() .setUserClassPaths(new ArrayList<>(userClassPaths)) .setArguments(programArguments) .setJarFile(jarFile) .setEntryPointClassName(jobClassName) .build(); } final String entryClass = getJobClassNameOrScanClassPath(); return PackagedProgram.newBuilder() .setUserClassPaths(new ArrayList<>(userClassPaths)) .setEntryPointClassName(entryClass) .setArguments(programArguments) .build(); } catch (ProgramInvocationException e) { throw new FlinkException("Could not load the provided entrypoint class.", e); } }
Source:
<code>public final Optional<SslConfiguration> getSslConfiguration(String serviceName) { checkArgument(!Strings.isNullOrEmpty(serviceName)); Optional<ServiceConfiguration> maybeServiceConfig = getServiceConfiguration(serviceName); <START> if (!maybeServiceConfig.isPresent()) { <END> return defaultSecurity(); } return maybeServiceConfig.get().security().or(defaultSecurity()); }</code><technical_language>is this symmetric getSslConfiguration</technical_language>

Target:
public final Optional<SslConfiguration> getSslConfiguration(String serviceName) { ServiceConfiguration serviceConfig = Preconditions.checkNotNull( getServices().get(serviceName), "Unable to find the configuration for " + serviceName + "."); return serviceConfig.security(); }
Source:
<code>public boolean include( Artifact artifact ) { for ( Exclusion exclusion : exclusions ) { <START> if ( "*".equals( exclusion.getGroupId() ) && "*".equals( exclusion.getArtifactId() ) ) <END> { return false; } if ( "*".equals( exclusion.getGroupId() ) ) { return !exclusion.getArtifactId().equals( artifact.getArtifactId() ); } if ( "*".equals( exclusion.getArtifactId() ) ) { return !exclusion.getGroupId().equals( artifact.getGroupId() ); } if ( exclusion.getGroupId().equals( artifact.getGroupId() ) && exclusion.getArtifactId().equals( artifact.getArtifactId() ) ) { return false; } } return true; }</code><technical_language>global constant for '*'</technical_language>

Target:
public boolean include( Artifact artifact ) { for ( Exclusion exclusion : exclusions ) { if ( WILDCARD.equals( exclusion.getGroupId() ) && WILDCARD.equals( exclusion.getArtifactId() ) ) { return false; } if ( WILDCARD.equals( exclusion.getGroupId() ) ) { return !exclusion.getArtifactId().equals( artifact.getArtifactId() ); } if ( WILDCARD.equals( exclusion.getArtifactId() ) ) { return !exclusion.getGroupId().equals( artifact.getGroupId() ); } if ( exclusion.getGroupId().equals( artifact.getGroupId() ) && exclusion.getArtifactId().equals( artifact.getArtifactId() ) ) { return false; } } return true; }
Source:
<code>public void setup() { metadata = createTestMetadataManager(); domainTranslator = new RowExpressionDomainTranslator(metadata); <START> columnExtractor = new SubfieldExtractor(new FunctionResolution(metadata.getFunctionManager()), new NoopExpressionOptimizer(), TestingSession.SESSION); <END> }</code><technical_language>a lambda here: (rowExpression, level, session) -> rowExpression</technical_language>

Target:
public void setup() { metadata = createTestMetadataManager(); domainTranslator = new RowExpressionDomainTranslator(metadata); columnExtractor = new SubfieldExtractor( new FunctionResolution(metadata.getFunctionManager()), (rowExpression, level, session) -> rowExpression, TestingSession.SESSION); }
Source:
<code>public void perform(Run build, FilePath workspace, Launcher launcher, TaskListener listener) throws InterruptedException, IOException { TestResultAction action = parseAndAttach(this, null, build, workspace, launcher, listener); if (action != null && action.getResult().getFailCount() > 0) <START> build.setResult(Result.UNSTABLE); <END> }</code><technical_language>This feel right -- people tend handle test results map build results in vastly ways, generally</technical_language>

Target:
public void perform(Run build, FilePath workspace, Launcher launcher, TaskListener listener) throws InterruptedException, IOException { TestResultAction action = parseAndAttach(this, null, null, build, workspace, launcher, listener); if (action != null && action.getResult().getFailCount() > 0) build.setResult(Result.UNSTABLE); }
Source:
<code>public void putCheckpoint(String replicatorIdentifier, String sequence) { <START> logger.entering(this.getClass().getCanonicalName(),"putCheckpoint",new Object[]{replicatorIdentifier,sequence}); <END> String checkpointDocumentId = getCheckpointDocumentId(replicatorIdentifier); BasicDocumentRevision doc = dbCore.getLocalDocument(checkpointDocumentId); Map<String, String> checkpointDoc = new HashMap<String, String>(); checkpointDoc.put("lastSequence", sequence); byte[] json = JSONUtils.serializeAsBytes(checkpointDoc); if(doc == null) { dbCore.createLocalDocument(checkpointDocumentId, DocumentBodyFactory.create(json)); } else { dbCore.updateLocalDocument(doc.getId(), doc.getRevision(), DocumentBodyFactory.create(json)); } }</code><technical_language>of this.getClass().getName</technical_language>

Target:
public void putCheckpoint(String replicatorIdentifier, String sequence) { logger.entering("DatastoreWrapper","putCheckpoint",new Object[]{replicatorIdentifier,sequence}); String checkpointDocumentId = getCheckpointDocumentId(replicatorIdentifier); BasicDocumentRevision doc = dbCore.getLocalDocument(checkpointDocumentId); Map<String, String> checkpointDoc = new HashMap<String, String>(); checkpointDoc.put("lastSequence", sequence); byte[] json = JSONUtils.serializeAsBytes(checkpointDoc); if(doc == null) { dbCore.createLocalDocument(checkpointDocumentId, DocumentBodyFactory.create(json)); } else { dbCore.updateLocalDocument(doc.getId(), doc.getRevision(), DocumentBodyFactory.create(json)); } }
Source:
<code>private AdColonyAppOptions buildAppOptions(MediationAdRequest adRequest, Bundle networkExtras) { <START> AdColonyAppOptions options; <END> if (appOptions != null) { options = appOptions; } else { options = new AdColonyAppOptions(); } if (networkExtras != null) { String userId = networkExtras.getString("user_id"); if (userId != null) { options.setUserID(userId); } } if (adRequest != null) { if (adRequest.isTesting()) { options.setTestModeEnabled(true); } AdColonyUserMetadata userMetadata = new AdColonyUserMetadata(); int genderVal = adRequest.getGender(); if (genderVal == AdRequest.GENDER_FEMALE) { userMetadata.setUserGender(AdColonyUserMetadata.USER_FEMALE); } else if (genderVal == AdRequest.GENDER_MALE) { userMetadata.setUserGender(AdColonyUserMetadata.USER_MALE); } Location location = adRequest.getLocation(); if (location != null) { userMetadata.setUserLocation(location); } Date birthday = adRequest.getBirthday(); if (birthday != null) { long currentTime = System.currentTimeMillis(); long birthdayTime = birthday.getTime(); long diff = currentTime - birthdayTime; if (diff > 0) { long day = (1000 * 60 * 60 * 24); long yearsPassed = diff / day / 365; userMetadata.setUserAge((int) yearsPassed); } } options.setUserMetadata(userMetadata); } return options; }</code><technical_language>AdColonyAppOptions options = AdColonyMediationAdapter.getAppOptions(); if (options == null) { optiions = new AdColonyAppOptions(); }</technical_language>

Target:
private AdColonyAppOptions buildAppOptions(MediationAdRequest adRequest, Bundle networkExtras) { AdColonyAppOptions options = AdColonyMediationAdapter.getAppOptions(); if (networkExtras != null) { String userId = networkExtras.getString("user_id"); if (userId != null) { options.setUserID(userId); } } if (adRequest != null) { if (adRequest.isTesting()) { options.setTestModeEnabled(true); } AdColonyUserMetadata userMetadata = new AdColonyUserMetadata(); int genderVal = adRequest.getGender(); if (genderVal == AdRequest.GENDER_FEMALE) { userMetadata.setUserGender(AdColonyUserMetadata.USER_FEMALE); } else if (genderVal == AdRequest.GENDER_MALE) { userMetadata.setUserGender(AdColonyUserMetadata.USER_MALE); } Location location = adRequest.getLocation(); if (location != null) { userMetadata.setUserLocation(location); } Date birthday = adRequest.getBirthday(); if (birthday != null) { long currentTime = System.currentTimeMillis(); long birthdayTime = birthday.getTime(); long diff = currentTime - birthdayTime; if (diff > 0) { long day = (1000 * 60 * 60 * 24); long yearsPassed = diff / day / 365; userMetadata.setUserAge((int) yearsPassed); } } options.setUserMetadata(userMetadata); } return options; }
Source:
<code>public void shouldSupportLimits() { final SObjectBatch batch = new SObjectBatch(version); batch.addLimits(); final SObjectBatchResponse response = testBatch(batch); final List<SObjectBatchResult> results = response.getResults(); final SObjectBatchResult batchResult = results.get(0); @SuppressWarnings("unchecked") final Map<String, Object> result = (Map<String, Object>) batchResult.getResult(); @SuppressWarnings("unchecked") final Map<String, Object> limits = (Map<String, Object>) result.getOrDefault("LimitsSnapshot", result); @SuppressWarnings("unchecked") final Map<String, String> apiRequests = (Map<String, String>) limits.get("DailyApiRequests"); <START> assert(Integer.valueOf(String.valueOf(apiRequests.get("Max"))) > 0); <END> }</code><technical_language>Please do Java **assert** keyword. Java Assertions disabled default in maven-surefire. I pretty test pass assert(false). JUnit method assertTrue instead</technical_language>

Target:
public void shouldSupportLimits() { final SObjectBatch batch = new SObjectBatch(version); batch.addLimits(); final SObjectBatchResponse response = testBatch(batch); final List<SObjectBatchResult> results = response.getResults(); final SObjectBatchResult batchResult = results.get(0); @SuppressWarnings("unchecked") final Map<String, Object> result = (Map<String, Object>) batchResult.getResult(); @SuppressWarnings("unchecked") final Map<String, Object> limits = (Map<String, Object>) result.getOrDefault("LimitsSnapshot", result); @SuppressWarnings("unchecked") final Map<String, String> apiRequests = (Map<String, String>) limits.get("DailyApiRequests"); assertTrue(Integer.valueOf(String.valueOf(apiRequests.get("Max"))) > 0); }
Source:
<code>private Builder addValue(String memberName, Object value) { if (value instanceof Class<?>) { return addMember(memberName, "$T.class", value); } if (value instanceof Enum) { return addMember(memberName, "$T.$L", value.getClass(), ((Enum<?>) value).name()); } if (value instanceof String) { return addMember(memberName, "$S", value); } if (value instanceof Float) { return addMember(memberName, "$Lf", value); } if (value instanceof Character) { <START> String format = Character.valueOf('\'').equals(value) ? "'\\\''" : "'$L'"; <END> return addMember(memberName, format, value); } return addMember(memberName, "$L", value); }</code><technical_language>need escape '\' in string, add readability</technical_language>

Target:
private Builder addValue(String memberName, Object value) { if (value instanceof Class<?>) { return addMember(memberName, "$T.class", value); } if (value instanceof Enum) { return addMember(memberName, "$T.$L", value.getClass(), ((Enum<?>) value).name()); } if (value instanceof String) { return addMember(memberName, "$S", value); } if (value instanceof Float) { return addMember(memberName, "$Lf", value); } if (value instanceof Character) { String literal = CodeWriter.stringLiteral(value.toString(), ""); literal = literal.substring(1, literal.length() - 1); if (literal.equals("\\\"")) literal = "\""; if (literal.equals("'")) literal = "\\'"; return addMember(memberName, "'$L'", literal); } return addMember(memberName, "$L", value); }
Source:
<code>public void testUnmarshallTopLevelEmptyEventProperties() throws Exception { Diagram<Graph, Metadata> diagram = unmarshall(marshaller, BPMN_CATCHING_INTERMEDIATE_EVENT_FILE_PATH); assertDiagram(diagram, AMOUNT_OF_NODES_IN_DIAGRAM); IntermediateSignalEventCatching emptyTopEvent = getCatchingIntermediateNodeById(diagram, EMPTY_TOP_LEVEL_EVENT_ID, HAS_NO_INCOME_EDGE, HAS_OUTGOING_EDGE); assertGeneralSet(emptyTopEvent.getGeneral(), EMPTY_VALUE, EMPTY_VALUE); <START> assertSignalEventExecutionSet(emptyTopEvent.getExecutionSet(), EMPTY_VALUE, CANCELLING, ""); <END> assertDataIOSet(emptyTopEvent.getDataIOSet(), EMPTY_VALUE); }</code><technical_language>suggestion assertSignalEventExecutionSet(emptyTopEvent.getExecutionSet(), EMPTY_VALUE, CANCELLING, EMPTY_VALUE);</technical_language>

Target:
public void testUnmarshallTopLevelEmptyEventProperties() throws Exception { Diagram<Graph, Metadata> diagram = unmarshall(marshaller, BPMN_CATCHING_INTERMEDIATE_EVENT_FILE_PATH); assertDiagram(diagram, AMOUNT_OF_NODES_IN_DIAGRAM); IntermediateSignalEventCatching emptyTopEvent = getCatchingIntermediateNodeById(diagram, EMPTY_TOP_LEVEL_EVENT_ID, HAS_NO_INCOME_EDGE, HAS_OUTGOING_EDGE); assertGeneralSet(emptyTopEvent.getGeneral(), EMPTY_VALUE, EMPTY_VALUE); assertSignalEventExecutionSet(emptyTopEvent.getExecutionSet(), EMPTY_VALUE, CANCELLING, EMPTY_VALUE); assertDataIOSet(emptyTopEvent.getDataIOSet(), EMPTY_VALUE); }
Source:
<code>private boolean parseLongFlag(CommandSource source, String longFlag, CommandArgs args, CommandContext context) throws ArgumentParseException { String[] flagSplit = longFlag.split("=", 2); CommandElement element = this.longFlags.get(flagSplit[0].toLowerCase()); if (element == null) { switch (this.unknownLongFlagBehavior) { case ERROR: throw args.createError(t("Unknown long flag %s specified", flagSplit[0])); case ACCEPT_NONVALUE: context.putArg(flagSplit[0], flagSplit.length == 2 ? flagSplit[1] : true); return true; case ACCEPT_VALUE: <START> context.putArg(flagSplit[0], flagSplit.length == 2 ? flagSplit[1] : args.next()); <END> return true; case IGNORE: return false; default: throw new Error("New UnknownFlagBehavior added without corresponding case clauses"); } } else if (flagSplit.length == 2) { args.insertArg(flagSplit[1]); } element.parse(source, args, context); return true; }</code><technical_language>For reference, string(Text.of(longFlag)).parse(source, args, context); args.next();</technical_language>

Target:
private boolean parseLongFlag(CommandSource source, String longFlag, CommandArgs args, CommandContext context) throws ArgumentParseException { String[] flagSplit = longFlag.split("=", 2); String flag = flagSplit[0].toLowerCase(); CommandElement element = this.longFlags.get(flag); if (element == null) { switch (this.unknownLongFlagBehavior) { case ERROR: throw args.createError(t("Unknown long flag %s specified", flagSplit[0])); case ACCEPT_NONVALUE: context.putArg(flag, flagSplit.length == 2 ? flagSplit[1] : true); return true; case ACCEPT_VALUE: context.putArg(flag, flagSplit.length == 2 ? flagSplit[1] : args.next()); return true; case IGNORE: return false; default: throw new Error("New UnknownFlagBehavior added without corresponding case clauses"); } } else if (flagSplit.length == 2) { args.insertArg(flagSplit[1]); } element.parse(source, args, context); return true; }
Source:
<code>BasicListBuilder(String delimiter, Transform<T> transform) { this.delimiter = delimiter; <START> this.transform = transform != null ? transform : (builder, input) -> builder.append(input); <END> }</code><technical_language>Nit: replace (builder, input) -> builder.append(input) ExpressionBuilder::append</technical_language>

Target:
BasicListBuilder(String delimiter, Transform<T> transform) { this.delimiter = delimiter; this.transform = transform != null ? transform : ExpressionBuilder::append; }
Source:
<code>private TransactionParser buildUserParser(KXmlParser parser) { return new UserXmlParser(parser) { @Override protected void commit(User parsed) throws IOException, UnfullfilledRequirementsException { if (!parsed.getUserType().equals(User.TYPE_DEMO)) { <START> throw new UnfullfilledRequirementsException( <END> "Demo user restore file must be for a user with user_type set to demo", CommCareElementParser.SEVERITY_PROMPT); } if ("".equals(parsed.getUsername()) || parsed.getUsername() == null) { throw new UnfullfilledRequirementsException( "Demo user restore file must specify a username in the Registration block", CommCareElementParser.SEVERITY_PROMPT); } else { OfflineUserRestore.this.username = parsed.getUsername(); } } @Override public User retrieve(String entityId) { return null; } }; }</code><technical_language>Traditionally UnfillfilledRequrements a signal for a configuration resource is currently invalid user valid some action (IE: "You need update CommCare proceeding"). I "InvalidStructureException" is more error here, means "The config file requested for processing created correctly, needs changed worlk</technical_language>

Target:
private TransactionParser buildUserParser(KXmlParser parser) { return new UserXmlParser(parser) { @Override protected void commit(User parsed) throws IOException, InvalidStructureException { if (!parsed.getUserType().equals(User.TYPE_DEMO)) { throw new InvalidStructureException( "Demo user restore file must be for a user with user_type set to demo"); } if ("".equals(parsed.getUsername()) || parsed.getUsername() == null) { throw new InvalidStructureException( "Demo user restore file must specify a username in the Registration block"); } else { OfflineUserRestore.this.username = parsed.getUsername(); } } @Override public User retrieve(String entityId) { return null; } }; }
Source:
<code>public final byte[] getByteArray(final Message message) { if (message == null) { throw new NullPointerException("message must not be null!"); } DatagramWriter messageWriter = new DatagramWriter(); if (message.getRawCode() == 0) { if (message.getType() == Type.NON) { throw new IllegalArgumentException("NON message must not use code 0 (empty message)!"); } if (!message.getToken().isEmpty()) { throw new IllegalArgumentException("Empty messages must not use a token!"); } MessageHeader header = new MessageHeader(CoAP.VERSION, message.getType(), message.getToken(), 0, <START> message.getMID(), 0); <END> serializeHeader(messageWriter, header); messageWriter.writeCurrentByte(); } else { DatagramWriter optionsAndPayloadWriter = new DatagramWriter(); serializeOptionsAndPayload(optionsAndPayloadWriter, message.getOptions(), message.getPayload()); optionsAndPayloadWriter.writeCurrentByte(); MessageHeader header = new MessageHeader(CoAP.VERSION, message.getType(), message.getToken(), message.getRawCode(), message.getMID(), optionsAndPayloadWriter.size()); serializeHeader(messageWriter, header); messageWriter.writeCurrentByte(); messageWriter.write(optionsAndPayloadWriter); } return messageWriter.toByteArray(); }</code><technical_language>@boaks , LOW: nice separate serializeHeader a new method :) duplicating in cases</technical_language>

Target:
public final byte[] getByteArray(final Message message) { if (message == null) { throw new NullPointerException("message must not be null!"); } DatagramWriter messageWriter = new DatagramWriter(); if (message.getRawCode() == 0) { if (message.getType() == Type.NON) { throw new IllegalArgumentException("NON message must not use code 0 (empty message)!"); } else if (!message.getToken().isEmpty()) { throw new IllegalArgumentException("Empty messages must not use a token!"); } else if (message.getPayloadSize() > 0) { throw new IllegalArgumentException("Empty messages must not contain payload!"); } MessageHeader header = new MessageHeader(CoAP.VERSION, message.getType(), message.getToken(), 0, message.getMID(), 0); serializeHeader(messageWriter, header); messageWriter.writeCurrentByte(); } else { DatagramWriter optionsAndPayloadWriter = new DatagramWriter(); serializeOptionsAndPayload(optionsAndPayloadWriter, message.getOptions(), message.getPayload()); optionsAndPayloadWriter.writeCurrentByte(); MessageHeader header = new MessageHeader(CoAP.VERSION, message.getType(), message.getToken(), message.getRawCode(), message.getMID(), optionsAndPayloadWriter.size()); serializeHeader(messageWriter, header); messageWriter.writeCurrentByte(); messageWriter.write(optionsAndPayloadWriter); } return messageWriter.toByteArray(); }
Source:
<code>public void testSTIsEmpty() throws Exception { <START> assertQuery("select st_is_empty(st_geometry_from_text('POINT (1.5 2.5)'))", "select false"); <END> }</code><technical_language>nit: consider testing empty shape</technical_language>

Target:
public void testSTIsEmpty() throws Exception { assertFunction("ST_IsEmpty(ST_GeometryFromText('POINT (1.5 2.5)'))", BOOLEAN, false); assertFunction("ST_IsEmpty(ST_GeometryFromText('POLYGON EMPTY'))", BOOLEAN, true); }
Source:
<code><START> public Boolean isNewUser() { <END> return newUser; }</code><technical_language>@lorobode In this scenario options: 1) primative boolean type. -> getter setter 2) If Boolean type: -> Getter (#getNewUser) returns Boolean... possibly null -> Additional helper method #isNewUser return boolean... return newUser != null && newUser;</technical_language>

Target:
public boolean isNewUser() { return newUser; }
Source:
<code>public void executeCommand(UICommand command) { super.executeCommand(command); if (command == getNewCommand()) { newSubnet(); <START> } <END> else if (command == getRemoveCommand()) { remove(); } else if ("Cancel".equals(command.getName())) { cancel(); } }</code><technical_language>Formatting</technical_language>

Target:
public void executeCommand(UICommand command) { super.executeCommand(command); if (command == getNewCommand()) { newSubnet(); } else if (command == getRemoveCommand()) { remove(); } }
Source:
<code>public void testCompletedFuturesContext() { waitFor(4); Thread testThread = Thread.currentThread(); ContextInternal context = (ContextInternal) vertx.getOrCreateContext(); Future.succeededFuture().onSuccess(v -> { assertSame(testThread, Thread.currentThread()); assertNull(Vertx.currentContext()); complete(); }); context.succeededFuture().onSuccess(v -> { <START> assertNotSame(testThread, Thread.currentThread()); <END> assertSame(context, Vertx.currentContext()); complete(); }); Future.failedFuture(new Exception()).onFailure(v -> { assertSame(testThread, Thread.currentThread()); assertNull(Vertx.currentContext()); complete(); }); context.failedFuture(new Exception()).onFailure(v -> { assertNotSame(testThread, Thread.currentThread()); assertSame(context, Vertx.currentContext()); complete(); }); await(); }</code><technical_language>replace this check event-loop thread instead of junit thread</technical_language>

Target:
public void testCompletedFuturesContext() throws Exception { waitFor(4); Thread testThread = Thread.currentThread(); ContextInternal context = (ContextInternal) vertx.getOrCreateContext(); CompletableFuture<Thread> cf = new CompletableFuture<>(); context.runOnContext(v -> cf.complete(Thread.currentThread())); Thread contextThread = cf.get(); Future.succeededFuture().onSuccess(v -> { assertSame(testThread, Thread.currentThread()); assertNull(Vertx.currentContext()); complete(); }); context.succeededFuture().onSuccess(v -> { assertNotSame(testThread, Thread.currentThread()); assertSame(context, Vertx.currentContext()); assertSame(contextThread, Thread.currentThread()); complete(); }); Future.failedFuture(new Exception()).onFailure(v -> { assertSame(testThread, Thread.currentThread()); assertNull(Vertx.currentContext()); complete(); }); context.failedFuture(new Exception()).onFailure(v -> { assertNotSame(testThread, Thread.currentThread()); assertSame(context, Vertx.currentContext()); assertSame(contextThread, Thread.currentThread()); complete(); }); await(); }
Source:
<code>public void redeployAll() { Map<String, String> wars = MutableMap.copyOf(getConfig(WARS_BY_CONTEXT)); String redeployPrefix = "Redeploy all WARs (count "+wars.size()+")"; log.debug("Redeplying all WARs across cluster "+this+": "+getConfig(WARS_BY_CONTEXT)); Iterable<CanDeployAndUndeploy> targets = Iterables.filter(getChildren(), CanDeployAndUndeploy.class); TaskBuilder<Void> tb = Tasks.<Void>builder().parallel(true).name(redeployPrefix+" across cluster (size "+Iterables.size(targets)+")"); for (Entity target: targets) { TaskBuilder<Void> redeployAllToTarget = Tasks.<Void>builder().name(redeployPrefix+" at "+target+" (after ready check)"); <START> for (String targetName: wars.keySet()) { <END> redeployAllToTarget.add(Effectors.invocation(target, DEPLOY, MutableMap.of("url", wars.get(targetName), "targetName", targetName))); } tb.add(whenServiceUp(target, redeployAllToTarget.build(), redeployPrefix+" at "+target+" when ready")); } DynamicTasks.queueIfPossible(tb.build()).orSubmitAsync(this).asTask().getUnchecked(); }</code><technical_language>Confusing variable names of target targetName. prefer webserver webservers some avoid confusion</technical_language>

Target:
public void redeployAll() { Map<String, String> wars = MutableMap.copyOf(getConfig(WARS_BY_CONTEXT)); String redeployPrefix = "Redeploy all WARs (count "+wars.size()+")"; log.debug("Redeplying all WARs across cluster "+this+": "+getConfig(WARS_BY_CONTEXT)); Iterable<CanDeployAndUndeploy> targetEntities = Iterables.filter(getChildren(), CanDeployAndUndeploy.class); TaskBuilder<Void> tb = Tasks.<Void>builder().parallel(true).name(redeployPrefix+" across cluster (size "+Iterables.size(targetEntities)+")"); for (Entity targetEntity: targetEntities) { TaskBuilder<Void> redeployAllToTarget = Tasks.<Void>builder().name(redeployPrefix+" at "+targetEntity+" (after ready check)"); for (String warContextPath: wars.keySet()) { redeployAllToTarget.add(Effectors.invocation(targetEntity, DEPLOY, MutableMap.of("url", wars.get(warContextPath), "targetName", warContextPath))); } tb.add(whenServiceUp(targetEntity, redeployAllToTarget.build(), redeployPrefix+" at "+targetEntity+" when ready")); } DynamicTasks.queueIfPossible(tb.build()).orSubmitAsync(this).asTask().getUnchecked(); }
Source:
<code>public FileBasedConfig openUserConfig(Config parent, FS fs) { final File home = fs.userHome(); File userConfig = new File(home, ".gitconfig"); try { userConfig.canRead(); } catch (AccessControlException e) { <START> return new FileBasedConfig(null, fs) { <END> public void load() { } public boolean isOutdated() { return false; } }; } return new FileBasedConfig(parent, userConfig, fs); }</code><technical_language>this lose parent Config</technical_language>

Target:
public FileBasedConfig openUserConfig(Config parent, FS fs) { final File home = fs.userHome(); File userConfig = new File(home, ".gitconfig"); try { userConfig.canRead(); } catch (AccessControlException e) { return new FileBasedConfig(parent, null, fs) { public void load() { } public boolean isOutdated() { return false; } }; } return new FileBasedConfig(parent, userConfig, fs); }
Source:
<code>protected void executeCommand() { updateQuotaCache(); copyUnchangedStoragePoolProperties(getStoragePool(), oldStoragePool); <START> TransactionSupport.executeInScope(TransactionScopeOption.RequiresNew, () -> { <END> getStoragePoolDao().updatePartial(getStoragePool()); moveMacsFromOldMacPoolToNewOne(); return null; }); updateStoragePoolFormatType(); setSucceeded(true); }</code><technical_language>'() ->' work backporting 3.6</technical_language>

Target:
protected void executeCommand() { Guid oldMacPoolId = getOldMacPoolId(); Guid newMacPoolId = getNewMacPoolId(); Objects.requireNonNull(oldMacPoolId); Objects.requireNonNull(newMacPoolId); boolean needToMigrateMacs = !oldMacPoolId.equals(newMacPoolId); updateQuotaCache(); copyUnchangedStoragePoolProperties(getStoragePool(), oldStoragePool); List<String> vmInterfaceMacs = null; if (needToMigrateMacs) { vmInterfaceMacs = vmNicDao.getAllMacsByDataCenter(getParameters().getStoragePoolId()); } getStoragePoolDao().updatePartial(getStoragePool()); if (needToMigrateMacs) { moveMacsOfUpdatedDataCenter(oldMacPoolId, newMacPoolId, vmInterfaceMacs); } updateStoragePoolFormatType(); setSucceeded(true); }
Source:
<code>public static ThrottleLimitDTO getThrottleLimitType(ThrottleLimitTypeDTO dto) throws UnsupportedThrottleLimitTypeException { if (dto.getBandwidth() != null && dto.getRequestCount() != null) { String msg = "Throttle limit types " + dto.getBandwidth().getClass().getName() + " and " + dto.getRequestCount().getClass().getName() + " cannot be specified at once"; <START> log.error(msg); <END> throw new UnsupportedThrottleLimitTypeException(msg); } else if (dto.getBandwidth() != null) { return dto.getBandwidth(); } else if (dto.getRequestCount() != null) { return dto.getRequestCount(); } else { String msg = "A Throttle limit type has not been specified"; log.error(msg); throw new UnsupportedThrottleLimitTypeException(msg); } }</code><technical_language>do log throw.. remove logging here</technical_language>

Target:
public static ThrottleLimitDTO getThrottleLimitType(ThrottleLimitTypeDTO dto) throws UnsupportedThrottleLimitTypeException { if (dto.getBandwidth() != null && dto.getRequestCount() != null) { String msg = "Throttle limit types " + dto.getBandwidth().getClass().getName() + " and " + dto.getRequestCount().getClass().getName() + " cannot be specified at once"; throw new UnsupportedThrottleLimitTypeException(msg); } else if (dto.getBandwidth() != null) { return dto.getBandwidth(); } else if (dto.getRequestCount() != null) { return dto.getRequestCount(); } else { throw new UnsupportedThrottleLimitTypeException("A Throttle limit type has not been specified"); } }
Source:
<code>XmlManifest(RepoCommand command, InputStream inputStream, String filename, String baseUrl, String groups) { this.command = command; this.inputStream = inputStream; this.filename = filename; <START> int lastIndex = baseUrl.length() - 1; <END> while (baseUrl.charAt(lastIndex) == '/') lastIndex--; this.baseUrl = baseUrl.substring(0, lastIndex + 1); remotes = new HashMap<String, String>(); projects = new ArrayList<Project>(); plusGroups = new HashSet<String>(); minusGroups = new HashSet<String>(); if (groups == null || groups.length() == 0 || groups.equals("default")) { minusGroups.add("notdefault"); } else { for (String group : groups.split(",")) { if (group.startsWith("-")) minusGroups.add(group.substring(1)); else plusGroups.add(group); } } }</code><technical_language>baseUrl empty string</technical_language>

Target:
XmlManifest(RepoCommand command, InputStream inputStream, String filename, String baseUrl, String groups) { this.command = command; this.inputStream = inputStream; this.filename = filename; int lastIndex = baseUrl.length() - 1; while (lastIndex >= 0 && baseUrl.charAt(lastIndex) == '/') lastIndex--; this.baseUrl = baseUrl.substring(0, lastIndex + 1); remotes = new HashMap<String, String>(); projects = new ArrayList<Project>(); plusGroups = new HashSet<String>(); minusGroups = new HashSet<String>(); if (groups == null || groups.length() == 0 || groups.equals("default")) { minusGroups.add("notdefault"); } else { for (String group : groups.split(",")) { if (group.startsWith("-")) minusGroups.add(group.substring(1)); else plusGroups.add(group); } } }
Source:
<code>public void changeUserPasswordUsingActivationKey_shouldNotUpdatePasswordIfActivationKeyIsIncorrect() { User u = new User(); u.setPerson(new Person()); u.addName(new PersonName("Benjamin", "A", "Wolfe")); u.setUsername("bwolfe"); u.getPerson().setGender("M"); User createdUser = userService.createUser(u, "Openmr5xy"); String key = "wrongactivationkeyin"; int validTime = 10 * 60 * 1000; Long tokenTime = System.currentTimeMillis() + validTime; LoginCredential credentials = dao.getLoginCredential(createdUser); <START> credentials.setActivationKey( <END> "b071c88d6d877922e35af2e6a90dd57d37ac61143a03bb986c5f353566f3972a86ce9b2604c31a22dfa467922dcfd54fa7d18b0a7c7648d94ca3d97a88ea2fd0:" + tokenTime); dao.updateLoginCredential(credentials); Context.authenticate(createdUser.getUsername(), "Openmr5xy"); expectedException.expect(UserNotFoundException.class); expectedException.expectMessage(messages.getMessage("activation.key.not.correct")); userService.changeUserPasswordUsingActivationKey(key, "Pa55w0rd"); }</code><technical_language>For this test, need set activation key anyways, if user activation key set is provided is incorrect</technical_language>

Target:
public void changeUserPasswordUsingActivationKey_shouldNotUpdatePasswordIfActivationKeyIsIncorrect() { User u = new User(); u.setPerson(new Person()); u.addName(new PersonName("Benjamin", "A", "Wolfe")); u.setUsername("bwolfe"); u.getPerson().setGender("M"); User createdUser = userService.createUser(u, "Openmr5xy"); String key = "wrongactivationkeyin"; Context.authenticate(createdUser.getUsername(), "Openmr5xy"); expectedException.expect(InvalidActivationKeyException.class); expectedException.expectMessage(messages.getMessage("activation.key.not.correct")); userService.changeUserPasswordUsingActivationKey(key, "Pa55w0rd"); }
Source:
<code>private static boolean overlaps(SAMRecord r, List<Locatable> intervals) { <START> if (intervals == null) { <END> return true; } for (Locatable interval : intervals) { if (r.getReadUnmappedFlag()) { if (r.getAlignmentStart() != SAMRecord.NO_ALIGNMENT_START && interval.getStart() <= r.getStart() && interval.getEnd() >= r.getStart()) { return true; } } else if (r.getContig().equals(interval.getContig()) && CoordMath.overlaps(r.getStart(), r.getEnd(), interval.getStart(), interval.getEnd())) { return true; } } return false; }</code><technical_language>switch condition <pre>intervals == null || (r.getReadUnmappedFlag() && r.getAlignmentStart() == SAMRecord.NO_ALIGNMENT_START)</pre>? check slightly simplified benefit completely skip interval checking for unmapped reads</technical_language>

Target:
private static boolean overlaps(SAMRecord r, List<Locatable> intervals) { if (intervals == null || (r.getReadUnmappedFlag() && r.getAlignmentStart() == SAMRecord.NO_ALIGNMENT_START)) { return true; } for (Locatable interval : intervals) { if (r.getReadUnmappedFlag()) { if (interval.getStart() <= r.getStart() && interval.getEnd() >= r.getStart()) { return true; } } else if (r.getContig().equals(interval.getContig()) && CoordMath.overlaps(r.getStart(), r.getEnd(), interval.getStart(), interval.getEnd())) { return true; } } return false; }
Source:
<code>public boolean repeatUntilResponseStatusIs(final int expectedStatus) { <START> doNotThrowExceptionOnHttpRequestFailure(); <END> return repeatUntil( new RepeatLastCall() { @Override public boolean isFinished() { return responseStatus() == expectedStatus; } }); }</code><technical_language>Changing of setting unexpected side effect of repeatUntil. Please ensure toggle is set previous setting 'repeat' I a user want repeat feature set 'do throw' setting call (before initial call is repeated calling of 'repeat' methods). toggling in code removed altogether</technical_language>

Target:
public boolean repeatUntilResponseStatusIs(final int expectedStatus) { return repeatUntil( new RepeatLastCall() { @Override public boolean isFinished() { return responseStatus() == expectedStatus; } }); }
Source:
<code>private PlatformSession platformLogin() throws BonitaException, IOException { <START> PlatformLoginAPI platformLoginAPI = PlatformAPIAccessor.getPlatformLoginAPI(); <END> if (isLocal()) { try { Class<?> api = Class.forName("org.bonitasoft.engine.api.impl.PlatformLoginAPIImpl"); return (PlatformSession) api.getDeclaredMethod("localLogin").invoke(api.newInstance()); } catch (Exception e) { throw new ServerAPIException("unable to do the local login", e); } } else { return platformLoginAPI.login(System.getProperty("org.bonitasoft.platform.username"), System.getProperty("org.bonitasoft.platform.password")); } }</code><technical_language>put this declaration 8 lines</technical_language>

Target:
private PlatformSession platformLogin() throws BonitaException, IOException { if (isLocal()) { try { Class<?> api = Class.forName("org.bonitasoft.engine.api.impl.PlatformLoginAPIImpl"); return (PlatformSession) api.getDeclaredMethod("localLogin").invoke(api.newInstance()); } catch (Exception e) { throw new ServerAPIException("unable to do the local login", e); } } else { return PlatformAPIAccessor.getPlatformLoginAPI().login(System.getProperty("org.bonitasoft.platform.username"), System.getProperty("org.bonitasoft.platform.password")); } }
Source:
<code>public @CheckForNull Permission getRequiredPermission() { <START> return Jenkins.ADMINISTER; <END> }</code><technical_language>This potentially breaking change impact plugins ecosystem. find analysis report in <LINK_0>, done tools (GitHub search "grep" search) persons. is expected</technical_language>

Target:
public @Nonnull Permission getRequiredPermission() { return Jenkins.ADMINISTER; }
Source:
<code>public static String sanitizeKey(final Contentlet vanityUrl) <START> throws DotDataException, DotRuntimeException, DotSecurityException { <END> Host host = hostAPI.find(vanityUrl.getStringProperty(VanityUrlContentType.SITE_FIELD_VAR), APILocator.systemUser(), false); return sanitizeKey(host.getIdentifier(), fixURI(vanityUrl.getStringProperty(VanityUrlContentType.URI_FIELD_VAR)), vanityUrl.getLanguageId()); }</code><technical_language>![MINOR](<LINK_2> 'Severity: MINOR') Remove redundant '!unknownSymbol!' thrown exception declaration(s). [![rule](<LINK_1>](<LINK_0></technical_language>

Target:
public static String sanitizeKey(final Contentlet vanityUrl) throws DotDataException, DotSecurityException { Host host = hostAPI.find(vanityUrl.getStringProperty(VanityUrlContentType.SITE_FIELD_VAR), APILocator.systemUser(), false); return sanitizeKey(host.getIdentifier(), fixURI(vanityUrl.getStringProperty(VanityUrlContentType.URI_FIELD_VAR)), vanityUrl.getLanguageId()); }