auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private void updateLabelStyle(View notationView, BasicLabelStyle labelStyle) { if (labelStyle != null) { final FontStyle fontStyle = (FontStyle) createOrFindStyle(notationView, NotationPackage.eINSTANCE.getFontStyle()); labelStyle.getLabelFormat().clear(); if (fontStyle.isBold()) { labelStyle.getLabelFormat().add(FontFormat.BOLD_LITERAL); } if (fontStyle.isItalic()) { labelStyle.getLabelFormat().add(FontFormat.ITALIC_LITERAL); } if (fontStyle.isUnderline()) { labelStyle.getLabelFormat().add(FontFormat.UNDERLINE_LITERAL); } if (fontStyle.isStrikeThrough()) { labelStyle.getLabelFormat().add(FontFormat.STRIKE_THROUGH_LITERAL); } <START> labelStyle.setLabelSize(fontStyle.getFontHeight()); <END> } }</code><technical_language>react notification system ? compute current list of label format, compare existing replace (clear addAll) this moment. Instead of calling clear() add values one</technical_language>

Target:
private void updateLabelStyle(View notationView, BasicLabelStyle labelStyle) { if (labelStyle != null) { List<FontFormat> newFontFormats = Lists.newArrayList(); final FontStyle fontStyle = (FontStyle) createOrFindStyle(notationView, NotationPackage.eINSTANCE.getFontStyle()); if (fontStyle.isBold()) { newFontFormats.add(FontFormat.BOLD_LITERAL); } if (fontStyle.isItalic()) { newFontFormats.add(FontFormat.ITALIC_LITERAL); } if (fontStyle.isUnderline()) { newFontFormats.add(FontFormat.UNDERLINE_LITERAL); } if (fontStyle.isStrikeThrough()) { newFontFormats.add(FontFormat.STRIKE_THROUGH_LITERAL); } labelStyle.getLabelFormat().clear(); labelStyle.getLabelFormat().addAll(newFontFormats); labelStyle.setLabelSize(fontStyle.getFontHeight()); } }
Source:
<code>public void add(PhaseResult phaseResult) { validIndexRowCount += phaseResult.validIndexRowCount; expiredIndexRowCount += phaseResult.expiredIndexRowCount; missingIndexRowCount += phaseResult.missingIndexRowCount; invalidIndexRowCount += phaseResult.invalidIndexRowCount; <START> expiredIndexRowCount += phaseResult.mismatchingNumberOfCellsCount; <END> }</code><technical_language>LHS is wrong</technical_language>

Target:
public void add(PhaseResult phaseResult) { validIndexRowCount += phaseResult.validIndexRowCount; expiredIndexRowCount += phaseResult.expiredIndexRowCount; missingIndexRowCount += phaseResult.missingIndexRowCount; invalidIndexRowCount += phaseResult.invalidIndexRowCount; indexHasExtraCellsCount += phaseResult.indexHasExtraCellsCount; indexHasMissingCellsCount += phaseResult.indexHasMissingCellsCount; }
Source:
<code>public int parseArguments(final Parameters params) throws CmdLineException { final String name = params.getParameter(0); if (new File(name).isDirectory()) { setter.addValue(new FileTreeIterator( new File(name), FS.DETECTED, clp.getRepository().getConfig().get(WorkingTreeOptions.KEY))); return 1; } if (new File(name).isFile()) { final DirCache dirc; try { dirc = DirCache.read(new File(name), FS.DETECTED); } catch (IOException e) { throw new CmdLineException(MessageFormat.format(CLIText.get().notAnIndexFile, name), e); } setter.addValue(new DirCacheIterator(dirc)); return 1; } final ObjectId id; try { id = clp.getRepository().resolve(name); } catch (IOException e) { throw new CmdLineException(e.getMessage()); } if (id == null) throw new CmdLineException(MessageFormat.format(CLIText.get().notATree, name)); final CanonicalTreeParser p = new CanonicalTreeParser(); <START> try (final ObjectReader curs = clp.getRepository().newObjectReader()) { <END> p.reset(curs, clp.getRevWalk().parseTree(id)); } catch (MissingObjectException e) { throw new CmdLineException(MessageFormat.format(CLIText.get().notATree, name)); } catch (IncorrectObjectTypeException e) { throw new CmdLineException(MessageFormat.format(CLIText.get().notATree, name)); } catch (IOException e) { throw new CmdLineException(MessageFormat.format(CLIText.get().cannotReadBecause, name, e.getMessage())); } setter.addValue(p); return 1; }</code><technical_language>(optional)</technical_language>

Target:
public int parseArguments(final Parameters params) throws CmdLineException { final String name = params.getParameter(0); if (new File(name).isDirectory()) { setter.addValue(new FileTreeIterator( new File(name), FS.DETECTED, clp.getRepository().getConfig().get(WorkingTreeOptions.KEY))); return 1; } if (new File(name).isFile()) { final DirCache dirc; try { dirc = DirCache.read(new File(name), FS.DETECTED); } catch (IOException e) { throw new CmdLineException(MessageFormat.format(CLIText.get().notAnIndexFile, name), e); } setter.addValue(new DirCacheIterator(dirc)); return 1; } final ObjectId id; try { id = clp.getRepository().resolve(name); } catch (IOException e) { throw new CmdLineException(e.getMessage()); } if (id == null) throw new CmdLineException(MessageFormat.format(CLIText.get().notATree, name)); final CanonicalTreeParser p = new CanonicalTreeParser(); try (ObjectReader curs = clp.getRepository().newObjectReader()) { p.reset(curs, clp.getRevWalk().parseTree(id)); } catch (MissingObjectException e) { throw new CmdLineException(MessageFormat.format(CLIText.get().notATree, name)); } catch (IncorrectObjectTypeException e) { throw new CmdLineException(MessageFormat.format(CLIText.get().notATree, name)); } catch (IOException e) { throw new CmdLineException(MessageFormat.format(CLIText.get().cannotReadBecause, name, e.getMessage())); } setter.addValue(p); return 1; }
Source:
<code>public Map<String, Object> getExportProperties() { <START> this.exportProperties.clear(); <END> if (!ObjectUtils.isEmpty(this.properties)) { Map<String, String> target = bindProperties(); BeanExpressionResolver beanExpressionResolver = ((ConfigurableApplicationContext) applicationContext) .getBeanFactory().getBeanExpressionResolver(); BeanExpressionContext expressionContext = new BeanExpressionContext( ((ConfigurableApplicationContext) applicationContext).getBeanFactory(), null); for (Entry<String, String> entry : target.entrySet()) { if (isMatch(entry.getKey(), this.properties, null)) { String stringValue = ObjectUtils.nullSafeToString(entry.getValue()); Object exportedValue = null; if (stringValue != null) { exportedValue = stringValue.startsWith("#{") ? beanExpressionResolver.evaluate( environment.resolvePlaceholders(stringValue), expressionContext) : environment.resolvePlaceholders(stringValue); } this.exportProperties.put(entry.getKey(), exportedValue); } } } return exportProperties; }</code><technical_language>this exportProperties array computed time send out a metrics message? inefficient, list change refresh operations. main reason done onApplicationEvent - based discussion @jvalkeal I had, some race condition issue, this is cached computed time</technical_language>

Target:
public Map<String, Object> getExportProperties() { if (this.exportProperties == null) { this.exportProperties = buildExportProperties(); } return this.exportProperties; }
Source:
<code>public void setUp() throws SQLException { super.setUp(); if (testType.equals(SQL_ONLY_EXECUTION)) { im = new MockSQLOnlyIndexManager(ds); } else if (testType.equals(MATCHER_EXECUTION)) { im = new MockMatcherIndexManager(ds); } else if (testType.equals(STANDARD_EXECUTION)) { im = new IndexManager(ds); } assertThat(im, is(notNullValue())); db = TestUtils.getDatabaseConnectionToExistingDb(im.getDatabase()); assertThat(db, is(notNullValue())); assertThat(im.getQueue(), is(notNullValue())); String[] metadataTableList = new String[] { IndexManager.INDEX_METADATA_TABLE_NAME }; SQLDatabaseTestUtils.assertTablesExist(TestUtils.getDatabaseConnectionToExistingDb(db), <START> metadataTableList); <END> }</code><technical_language>I do pass db in</technical_language>

Target:
public void setUp() throws SQLException { super.setUp(); if (testType.equals(SQL_ONLY_EXECUTION)) { im = new MockSQLOnlyIndexManager(ds); } else if (testType.equals(MATCHER_EXECUTION)) { im = new MockMatcherIndexManager(ds); } else if (testType.equals(STANDARD_EXECUTION)) { im = new IndexManager(ds); } assertThat(im, is(notNullValue())); db = TestUtils.getDatabaseConnectionToExistingDb(im.getDatabase()); assertThat(db, is(notNullValue())); assertThat(im.getQueue(), is(notNullValue())); String[] metadataTableList = new String[] { IndexManager.INDEX_METADATA_TABLE_NAME }; SQLDatabaseTestUtils.assertTablesExist(db, metadataTableList); }
Source:
<code>public void registerComponents(Context context, Glide glide, Registry registry) { registry.prepend(String.class, Drawable.class, new ApkImageModelLoaderFactory(context.getPackageManager())); <START> registry.prepend(String.class, String.class, new CloudIconModelFactory(context)); <END> }</code><technical_language>String.class Bitmap.class (also, check generic type inference missing in CloudIconModelLoader)</technical_language>

Target:
public void registerComponents(Context context, Glide glide, Registry registry) { registry.prepend(String.class, Drawable.class, new ApkImageModelLoaderFactory(context.getPackageManager())); registry.prepend(String.class, Bitmap.class, new CloudIconModelFactory(context)); }
Source:
<code>private static IStatistics<@NonNull BasicSegment> getDescriptiveStatistics(ISeries series) { double[] ySeries = series.getYSeries(); assertNotNull(ySeries); IStatistics<@NonNull BasicSegment> stats = new Statistics<>(s -> s.getLength()); for (double item : ySeries) { <START> stats.update(new BasicSegment(0, (long) (item - 1.0))); <END> } return stats; }</code><technical_language>IStatistics<Long></technical_language>

Target:
private static IStatistics<@NonNull Long> getDescriptiveStatistics(ISeries series) { double[] ySeries = series.getYSeries(); assertNotNull(ySeries); IStatistics<@NonNull Long> stats = new Statistics<>(); for (double item : ySeries) { stats.update((long) (item - 1.0)); } return stats; }
Source:
<code>public void testSamplesWhenReadingOne() throws IOException { <START> for (int i = 0; i < SAMPLE_BYTES.length; i++) { <END> input = new ByteArrayObjectDataInput(SAMPLE_BYTES[i], serializationService, DEFAULT_BYTE_ORDER); DataInputNavigableJsonAdapter.UTF8Reader reader = new DataInputNavigableJsonAdapter.UTF8Reader(input); assertReadOne(reader, SAMPLE_BYTES[i]); } }</code><technical_language>Nit-picky minor: other tests in this class for-each loops</technical_language>

Target:
public void testSamplesWhenReadingOne() throws IOException { for (byte[] sample : SAMPLE_BYTES) { input = new ByteArrayObjectDataInput(sample, serializationService, DEFAULT_BYTE_ORDER); DataInputNavigableJsonAdapter.UTF8Reader reader = new DataInputNavigableJsonAdapter.UTF8Reader(input); assertReadOne(reader, sample); } }
Source:
<code>private String extractColumn(PColumn column) { String colName = column.getName().getString(); if (column.getFamilyName() != null){ String colFamilyName = column.getFamilyName().getString(); colName = colFamilyName.equals(QueryConstants.DEFAULT_COLUMN_FAMILY)? colName : String.format("\"%s\".\"%s\"", colFamilyName, colName); } boolean isArrayType = column.getDataType().isArrayType(); String type = column.getDataType().getSqlTypeName(); Integer maxLength = column.getMaxLength(); Integer arrSize = column.getArraySize(); Integer scale = column.getScale(); StringBuilder buf = new StringBuilder(colName); buf.append(' '); if (isArrayType) { String arrayPrefix = type.split("\\s+")[0]; buf.append(arrayPrefix); <START> if (maxLength != null) { <END> buf.append('('); buf.append(maxLength); if (scale != null) { buf.append(','); buf.append(scale); } buf.append(')'); } buf.append(' '); buf.append("ARRAY"); if (arrSize != null) { buf.append('['); buf.append(arrSize); buf.append(']'); } } else { buf.append(type); if (maxLength != null) { buf.append('('); buf.append(maxLength); if (scale != null) { buf.append(','); buf.append(scale); } buf.append(')'); } } if (!column.isNullable()) { buf.append(' '); buf.append("NOT NULL"); } return buf.toString(); }</code><technical_language>nit: this if condition is duplicated in else part. Please refactor extracting common parts executing specific Array related logic if clause passes</technical_language>

Target:
private String extractColumn(PColumn column) { String colName = column.getName().getString(); if (column.getFamilyName() != null){ String colFamilyName = column.getFamilyName().getString(); colName = colFamilyName.equals(QueryConstants.DEFAULT_COLUMN_FAMILY)? colName : String.format("\"%s\".\"%s\"", colFamilyName, colName); } boolean isArrayType = column.getDataType().isArrayType(); String type = column.getDataType().getSqlTypeName(); Integer maxLength = column.getMaxLength(); Integer arrSize = column.getArraySize(); Integer scale = column.getScale(); StringBuilder buf = new StringBuilder(colName); buf.append(' '); if (isArrayType) { String arrayPrefix = type.split("\\s+")[0]; buf.append(arrayPrefix); appendMaxLengthAndScale(buf, maxLength, scale); buf.append(' '); buf.append("ARRAY"); if (arrSize != null) { buf.append('['); buf.append(arrSize); buf.append(']'); } } else { buf.append(type); appendMaxLengthAndScale(buf, maxLength, scale); } if (!column.isNullable()) { buf.append(' '); buf.append("NOT NULL"); } return buf.toString(); }
Source:
<code>LRESULT WM_MOUSEHOVER (long wParam, long lParam) { <START> System.out.println("hover"); <END> LRESULT result = super.WM_MOUSEHOVER (wParam, lParam); int bits = (int) OS.SendMessage (handle, OS.LVM_GETEXTENDEDLISTVIEWSTYLE, 0, 0); int mask = OS.LVS_EX_ONECLICKACTIVATE | OS.LVS_EX_TRACKSELECT | OS.LVS_EX_TWOCLICKACTIVATE; if ((bits & mask) != 0) return result; return LRESULT.ZERO; }</code><technical_language>remove system.out debugging is done</technical_language>

Target:
LRESULT WM_MOUSEHOVER (long wParam, long lParam) { LRESULT result = super.WM_MOUSEHOVER (wParam, lParam); int bits = (int) OS.SendMessage (handle, OS.LVM_GETEXTENDEDLISTVIEWSTYLE, 0, 0); int mask = OS.LVS_EX_ONECLICKACTIVATE | OS.LVS_EX_TRACKSELECT | OS.LVS_EX_TWOCLICKACTIVATE; if ((bits & mask) != 0) return result; return LRESULT.ZERO; }
Source:
<code>public void shutdown() { if (replicationManager != null) { replicationManager.stop(); } if(clusterManagerAdapter != null) { clusterManagerAdapter.shutdown(); } <START> if (lock != null) { <END> lock.shutdown(); } }</code><technical_language>cleaner call lock.shutdown in server shutdown call</technical_language>

Target:
public void shutdown() { if (replicationManager != null) { replicationManager.stop(); } if (clusterManagerAdapter != null) { clusterManagerAdapter.shutdown(); } if (lockClient != null) { lockClient.shutdown(); } }
Source:
<code>public ExpressionTree COMMON_SCALAR() { return b.<ExpressionTree>nonterminal(PHPLexicalGrammar.COMMON_SCALAR).is( b.firstOf( <START> f.nowdocLiteral(b.token(PHPLexicalGrammar.NOWDOC)), <END> NUMERIC_LITERAL(), STRING_LITERAL(), f.booleanLiteral(b.token(PHPLexicalGrammar.BOOLEAN_LITERAL)), f.nullLiteral(b.token(PHPLexicalGrammar.NULL)), f.magicConstantLiteral(b.firstOf( b.token(PHPLexicalGrammar.CLASS_CONSTANT), b.token(PHPLexicalGrammar.FILE_CONSTANT), b.token(PHPLexicalGrammar.DIR_CONSTANT), b.token(PHPLexicalGrammar.FUNCTION_CONSTANT), b.token(PHPLexicalGrammar.LINE_CONSTANT), b.token(PHPLexicalGrammar.METHOD_CONSTANT), b.token(PHPLexicalGrammar.NAMESPACE_CONSTANT), b.token(PHPLexicalGrammar.TRAIT_CONSTANT))))); }</code><technical_language>@vilchik-elena is nowdoc of STRING_LITERAL()</technical_language>

Target:
public ExpressionTree COMMON_SCALAR() { return b.<ExpressionTree>nonterminal(PHPLexicalGrammar.COMMON_SCALAR).is( b.firstOf( NUMERIC_LITERAL(), STRING_LITERAL(), f.booleanLiteral(b.token(PHPLexicalGrammar.BOOLEAN_LITERAL)), f.nullLiteral(b.token(PHPLexicalGrammar.NULL)), f.magicConstantLiteral(b.firstOf( b.token(PHPLexicalGrammar.CLASS_CONSTANT), b.token(PHPLexicalGrammar.FILE_CONSTANT), b.token(PHPLexicalGrammar.DIR_CONSTANT), b.token(PHPLexicalGrammar.FUNCTION_CONSTANT), b.token(PHPLexicalGrammar.LINE_CONSTANT), b.token(PHPLexicalGrammar.METHOD_CONSTANT), b.token(PHPLexicalGrammar.NAMESPACE_CONSTANT), b.token(PHPLexicalGrammar.TRAIT_CONSTANT))))); }
Source:
<code>public static <T extends IConnection> T getConnectionForExplorerSelection(Class<T> klass) { ISelection selection = getOpenShiftExplorerSelection(); if(selection != null) { if(selection != null <START> && !selection.isEmpty()) { <END> T result = UIUtils.getFirstElement(selection, klass); IViewPart part = getOpenShiftExplorer(); if(result == null && selection instanceof IStructuredSelection && part instanceof CommonNavigator) { Object selected = ((IStructuredSelection)selection).getFirstElement(); IContentProvider provider = ((CommonNavigator) part).getCommonViewer().getContentProvider(); if(provider instanceof ITreeContentProvider) { ITreeContentProvider tree = (ITreeContentProvider)provider; while(selected != null && result == null) { result = UIUtils.adapt(selected, klass); selected = tree.getParent(selected); } } } return result; } } return null; }</code><technical_language>Duplicate check. Line 180 is excess. 181-182 checks enough</technical_language>

Target:
public static <T extends IConnection> T getConnectionForExplorerSelection(Class<T> klass) { ISelection selection = getOpenShiftExplorerSelection(); if (selection != null && !selection.isEmpty()) { T result = UIUtils.getFirstElement(selection, klass); IViewPart part = getOpenShiftExplorer(); if (result == null && selection instanceof IStructuredSelection && part instanceof CommonNavigator) { Object selected = ((IStructuredSelection) selection).getFirstElement(); IContentProvider provider = ((CommonNavigator) part).getCommonViewer().getContentProvider(); if (provider instanceof ITreeContentProvider) { ITreeContentProvider tree = (ITreeContentProvider) provider; while (selected != null && result == null) { result = UIUtils.adapt(selected, klass); selected = tree.getParent(selected); } } } return result; } return null; }
Source:
<code>public void testServiceReplacedWithEmptySet() throws InterruptedException { discoveryClient.addDiscoveredService(APPLE_1_SERVICE); updater.start(); ArgumentCaptor<Multiset> captor = ArgumentCaptor.forClass(Multiset.class); verify(httpServiceBalancer).updateHttpUris(captor.capture()); discoveryClient.remove(APPLE_1_SERVICE.getId()); <START> Thread.sleep(10000); <END> verifyNoMoreInteractions(httpServiceBalancer); assertEqualsIgnoreOrder(captor.getValue(), ImmutableMultiset.of(URI.create("<LINK_0>"))); }</code><technical_language>Try replacing executor a SerialScheduledExecutorService call elapseTime() method advance time</technical_language>

Target:
public void testServiceReplacedWithEmptySet() throws InterruptedException { SerialScheduledExecutorService serialExecutor = new SerialScheduledExecutorService(); updater = new ServiceDescriptorsUpdater(new HttpServiceBalancerListenerAdapter(httpServiceBalancer), "apple", new ServiceSelectorConfig().setPool("pool"), nodeInfo, discoveryClient, serialExecutor); discoveryClient.addDiscoveredService(APPLE_1_SERVICE); updater.start(); ArgumentCaptor<Multiset> captor = ArgumentCaptor.forClass(Multiset.class); verify(httpServiceBalancer).updateHttpUris(captor.capture()); discoveryClient.remove(APPLE_1_SERVICE.getId()); serialExecutor.elapseTime(11, TimeUnit.SECONDS); verifyNoMoreInteractions(httpServiceBalancer); assertEqualsIgnoreOrder(captor.getValue(), ImmutableMultiset.of(URI.create("<LINK_0>"))); }
Source:
<code>public Action<?, ?> configUpdateFailedAction() { return new AbstractStackFailureAction<ClusterCreationState, ClusterCreationEvent>() { @Override protected void doExecute(StackFailureContext context, StackFailureEvent payload, Map<Object, Object> variables) { pillarConfigUpdateService .handleConfigUpdateFailure(context.getStackView(), payload.getException()); sendEvent(context); } <START> <END> @Override protected Selectable createRequest(StackFailureContext context) { return new StackEvent(PillarConfigurationUpdateEvent.PILLAR_CONFIG_UPDATE_FAILURE_HANDLED_EVENT .event(), context.getStackView().getId()); } }; }</code><technical_language>log nice</technical_language>

Target:
public Action<?, ?> configUpdateFailedAction() { return new AbstractStackFailureAction<ClusterCreationState, ClusterCreationEvent>() { @Override protected void doExecute(StackFailureContext context, StackFailureEvent payload, Map<Object, Object> variables) { LOGGER.warn("Pillar configuration update failed.", payload.getException()); pillarConfigUpdateService .handleConfigUpdateFailure(context.getStackView(), payload.getException()); sendEvent(context); } @Override protected Selectable createRequest(StackFailureContext context) { return new StackEvent(PillarConfigurationUpdateEvent.PILLAR_CONFIG_UPDATE_FAILURE_HANDLED_EVENT .event(), context.getStackView().getId()); } }; }
Source:
<code>protected void testAccessControl() throws Exception { InstructorAttributes instructor1OfCourse1 = typicalBundle.instructors.get("instructor1OfCourse1"); FeedbackSessionAttributes session1InCourse1 = typicalBundle.feedbackSessions.get("session1InCourse1"); loginAsInstructor(instructor1OfCourse1.googleId); <START> ______TS("non-existent feedback session"); <END> String[] nonExistParams = new String[] { Const.ParamsNames.COURSE_ID, session1InCourse1.getCourseId(), Const.ParamsNames.FEEDBACK_SESSION_NAME, "abcRandomSession", }; verifyCannotAccess(nonExistParams); ______TS("inaccessible without ModifySessionPrivilege"); String[] params = new String[] { Const.ParamsNames.COURSE_ID, session1InCourse1.getCourseId(), Const.ParamsNames.FEEDBACK_SESSION_NAME, session1InCourse1.getFeedbackSessionName(), }; verifyInaccessibleWithoutModifySessionPrivilege(params); ______TS("only instructors of the same course can access"); verifyOnlyInstructorsOfTheSameCourseCanAccess(params); }</code><technical_language>if courseId exist</technical_language>

Target:
protected void testAccessControl() throws Exception { InstructorAttributes instructor1OfCourse1 = typicalBundle.instructors.get("instructor1OfCourse1"); FeedbackSessionAttributes session1InCourse1 = typicalBundle.feedbackSessions.get("session1InCourse1"); loginAsInstructor(instructor1OfCourse1.googleId); ______TS("non-existent course"); String[] nonExistParams = new String[] { Const.ParamsNames.COURSE_ID, "abcRandomCourseId", Const.ParamsNames.FEEDBACK_SESSION_NAME, session1InCourse1.getFeedbackSessionName(), }; verifyCannotAccess(nonExistParams); ______TS("non-existent feedback session"); nonExistParams = new String[] { Const.ParamsNames.COURSE_ID, session1InCourse1.getCourseId(), Const.ParamsNames.FEEDBACK_SESSION_NAME, "abcRandomSession", }; verifyCannotAccess(nonExistParams); ______TS("inaccessible without ModifySessionPrivilege"); String[] params = new String[] { Const.ParamsNames.COURSE_ID, session1InCourse1.getCourseId(), Const.ParamsNames.FEEDBACK_SESSION_NAME, session1InCourse1.getFeedbackSessionName(), }; verifyInaccessibleWithoutModifySessionPrivilege(params); ______TS("only instructors of the same course can access"); verifyOnlyInstructorsOfTheSameCourseCanAccess(params); }
Source:
<code>protected void deleteAsyncQuery() { try { Date cleanupDate = dateUtil.calculateFilterDate(Calendar.DATE, queryCleanupDays); PathElement createdOnPathElement = new PathElement(AsyncQuery.class, Long.class, "createdOn"); FilterExpression fltDeleteExp = new LEPredicate(createdOnPathElement, cleanupDate); Collection<AsyncQuery> asyncQueryList = asyncQueryDao.deleteAsyncQueryAndResultCollection(fltDeleteExp); <START> resultStorageEngine.deleteResultsCollection(asyncQueryList); <END> } catch (Exception e) { log.error("Exception in scheduled cleanup: {}", e); } }</code><technical_language>this is a noop, remove this dependency result storage engine. For other storage engines S3, another mechanism remove objects (like auto expiration)</technical_language>

Target:
protected void deleteAsyncQuery() { try { Date cleanupDate = dateUtil.calculateFilterDate(Calendar.DATE, queryCleanupDays); PathElement createdOnPathElement = new PathElement(AsyncQuery.class, Long.class, "createdOn"); FilterExpression fltDeleteExp = new LEPredicate(createdOnPathElement, cleanupDate); asyncQueryDao.deleteAsyncQueryAndResultCollection(fltDeleteExp); } catch (Exception e) { log.error("Exception in scheduled cleanup: {}", e); } }
Source:
<code>protected void initializeArrays(int numCodes) { n = new int[numCodes][InfiniumVcfFields.GENOTYPE_VALUES.values().length]; devR = new float[numCodes][InfiniumVcfFields.GENOTYPE_VALUES.values().length]; meanR = new float[numCodes][InfiniumVcfFields.GENOTYPE_VALUES.values().length]; devTheta = new float[numCodes][InfiniumVcfFields.GENOTYPE_VALUES.values().length]; <START> meanTheta = new float[numCodes][InfiniumVcfFields.GENOTYPE_VALUES.values().length]; <END> totalScore = new float[numCodes]; rsNames = new String[numCodes]; rsNameToIndex = new HashMap<>(); }</code><technical_language>extract InfiniumVcfFields.GENOTYPE_VALUES.values().length a static constant</technical_language>

Target:
private void initializeArrays(int numCodes) { n = new int[numCodes][InfiniumVcfFields.NUM_GENOTYPE_VALUES]; devR = new float[numCodes][InfiniumVcfFields.NUM_GENOTYPE_VALUES]; meanR = new float[numCodes][InfiniumVcfFields.NUM_GENOTYPE_VALUES]; devTheta = new float[numCodes][InfiniumVcfFields.NUM_GENOTYPE_VALUES]; meanTheta = new float[numCodes][InfiniumVcfFields.NUM_GENOTYPE_VALUES]; totalScore = new float[numCodes]; rsNames = new String[numCodes]; rsNameToIndex = new HashMap<>(); }
Source:
<code>public SinglePassSamProgram makeInstance(final String outbase, final String outext, final File input, final File reference, final Set<MetricAccumulationLevel> metricAccumulationLevel, final File dbSnp, final File intervals) { final CollectRrbsMetrics program = new CollectRrbsMetrics(); <START> program.OUTPUT = new File(outbase + ".rrbc.detail_metrics" + outext); <END> program.SUMMARY_OUTPUT = new File(outbase + ".rrbc.summary_metrics" + outext); program.CHART_OUTPUT = new File(outbase + ".rrbc.pdf"); program.INPUT = input; program.METRIC_ACCUMULATION_LEVEL = metricAccumulationLevel; program.ASSUME_SORTED = false; program.setReferenceSequence(reference); return program; }</code><technical_language>rrbc->rrbs (x3)</technical_language>

Target:
public SinglePassSamProgram makeInstance(final String outbase, final String outext, final File input, final File reference, final Set<MetricAccumulationLevel> metricAccumulationLevel, final File dbSnp, final File intervals) { final CollectRrbsMetrics program = new CollectRrbsMetrics(); program.OUTPUT = new File(outbase + ".rrbs.detail_metrics" + outext); program.SUMMARY_OUTPUT = new File(outbase + ".rrbs.summary_metrics" + outext); program.CHART_OUTPUT = new File(outbase + ".rrbs.pdf"); program.INPUT = input; program.METRIC_ACCUMULATION_LEVEL = metricAccumulationLevel; program.ASSUME_SORTED = false; program.setReferenceSequence(reference); return program; }
Source:
<code>public WMTSGetCapabilitiesResponse(HTTPResponse response, Map<String, Object> hints) throws ServiceException, IOException { super(response); try { Object object; InputStream inputStream = null; try { inputStream = response.getResponseStream(); <START> Parser parser = new Parser(new WMTSConfiguration()); <END> object = parser.parse(new InputSource(inputStream)); } catch (SAXException |ParserConfigurationException e) { throw (ServiceException) new ServiceException("Error while parsing XML.") .initCause(e); } finally { IOUtils.closeQuietly(inputStream); } if (object instanceof ServiceException) { throw (ServiceException) object; } this.capabilities = new WMTSCapabilities( (CapabilitiesType)object); } finally { response.dispose(); } }</code><technical_language>parser is a throw away, configuration is shareable, please move a class field. (or least, be, in GeoServer configurations Spring singletons)</technical_language>

Target:
public WMTSGetCapabilitiesResponse(HTTPResponse response, Map<String, Object> hints) throws ServiceException, IOException { super(response); try { Object object; InputStream inputStream = null; try { inputStream = response.getResponseStream(); Parser parser = new Parser(WMTS_CONFIGURATION); object = parser.parse(new InputSource(inputStream)); } catch (SAXException | ParserConfigurationException e) { throw (ServiceException) new ServiceException("Error while parsing XML.") .initCause(e); } finally { IOUtils.closeQuietly(inputStream); } if (object instanceof ServiceException) { throw (ServiceException) object; } this.capabilities = new WMTSCapabilities((CapabilitiesType) object); } finally { response.dispose(); } }
Source:
<code><START> public final void setSendTimeoutExpression(Expression sendTimeoutExpression) { <END> Assert.notNull(sendTimeoutExpression, "'sendTimeoutExpression' must not be null"); this.sendTimeoutExpression = sendTimeoutExpression; }</code><technical_language>changed mind decided this setter in ctor. I is a justification for a final..</technical_language>

Target:
public void setSendTimeoutExpression(Expression sendTimeoutExpression) { Assert.notNull(sendTimeoutExpression, "'sendTimeoutExpression' must not be null"); this.sendTimeoutExpression = sendTimeoutExpression; }
Source:
<code>public String getElapsedTime(DashboardData data) { XPathXMLParser parser = getParser(data.getResponseXML()); if (null == parser) { <START> return ""; <END> } long elapsed = 0; String startTime = parser.getString(" final long startTimeInMillis = DatatypeConverter.parseDateTime(startTime).getTimeInMillis(); if (data.getOutputXML() == null) { elapsed = System.currentTimeMillis() - startTimeInMillis; } else { elapsed = Timestamp.valueOf(data.getCompletedTimestamp()).getTime() - startTimeInMillis; } StringBuilder elapsedTime = new StringBuilder(); long days = elapsed / MILLIS_PER_DAY; if (days > 0) { elapsed = elapsed - days * MILLIS_PER_DAY; elapsedTime.append(days).append("d "); } long hours = elapsed / MILLIS_PER_HOUR; if (hours > 0) { elapsed = elapsed - hours * MILLIS_PER_HOUR; elapsedTime.append(hours).append("h "); } long minutes = elapsed / MILLIS_PER_MIN; if (minutes > 0) { elapsed = elapsed - minutes * MILLIS_PER_MIN; elapsedTime.append(minutes).append("m "); } long seconds = elapsed / 1000; elapsedTime.append(seconds).append("s"); return elapsedTime.toString(); }</code><technical_language>Try exit point function, returning hard follow</technical_language>

Target:
public String getElapsedTime(DashboardData data) throws XPathExpressionException { XPathXMLParser parser = new XPathXMLParser(data.getResponseXML()); String startTime = parser.getString(CREATION_TIME_XPATH); final long startTimeInMillis = DatatypeConverter.parseDateTime(startTime).getTimeInMillis(); long elapsed = 0; if (data.getOutputXML() == null) { elapsed = System.currentTimeMillis() - startTimeInMillis; } else { elapsed = Timestamp.valueOf(data.getCompletedTimestamp()).getTime() - startTimeInMillis; } return convertMilliTimeToHumanReadable(elapsed); }
Source:
<code>public void testRefLocation() throws Exception { File target = new File(verifier.getBasedir(), "target"); File repository = new File(target, "repository"); File contentXml = new File(repository, "content.xml"); assertThat(contentXml, isFile()); File artifactXml = new File(repository, "artifacts.xml"); assertThat(artifactXml, isFile()); <START> assertThat(new File(target, "category.xml"), isFile()); <END> Map<String, String> expected = new HashMap<>(2, 1.f); expected.put("<LINK_0>", "false"); expected.put("<LINK_0>.else", "true"); Document artifactsDocument = XMLParser.parse(contentXml); artifactsDocument.getChild("repository").getChild("references").getChildren("repository").forEach(element -> { String location = element.getAttributeValue("uri"); if (expected.containsKey(location) && expected.get(location).equals(element.getAttributeValue("enabled"))) { expected.remove(location); } else { fail("Unexpected repository reference in artifact repository " + element); } }); assertEquals("Missing repository reference in artifact repository", Collections.emptyMap(), expected); }</code><technical_language>category.xml file is part of output repository. Trye removing this line</technical_language>

Target:
public void testRefLocation() throws Exception { File target = new File(verifier.getBasedir(), "target"); File repository = new File(target, "repository"); File contentXml = new File(repository, "content.xml"); assertThat(contentXml, isFile()); File artifactXml = new File(repository, "artifacts.xml"); assertThat(artifactXml, isFile()); assertThat(new File(target, "category.xml"), isFile()); Map<String, Boolean> expected = new HashMap<>(2, 1.f); expected.put("<LINK_0>", false); expected.put("<LINK_0>.else", true); Document artifactsDocument = XMLParser.parse(contentXml); artifactsDocument.getChild("repository").getChild("references").getChildren("repository").forEach(element -> { String location = element.getAttributeValue("uri"); if (expected.containsKey(location) && expected.get(location).equals(element.getAttributeValue("options").equals("1"))) { expected.remove(location); } else { System.out.println(location); System.out.println(expected.containsKey(location)); System.out.println(expected.get(location)); System.out.println(); fail("Unexpected repository reference in artifact repository " + element); } }); assertEquals("Missing repository reference in artifact repository", Collections.emptyMap(), expected); }
Source:
<code><START> private static boolean checkStyleGroupLoops(StyleInfo styleGroup, LayerGroupInfo group, Stack<LayerGroupInfo> path) { <END> try { Catalog catalog = getCatalogFromStyle(styleGroup); StyledLayerDescriptor sld = new GeoServerDataDirectory(catalog.getResourceLoader()).parsedSld(styleGroup); final boolean[] hasLoop = {false}; sld.accept(new GeoServerSLDVisitorAdapter(catalog, group.getBounds() == null ? null : group.getBounds().getCoordinateReferenceSystem()) { private final IllegalStateException recursionException = new IllegalStateException("Style group contains recursive structure"); @Override public void visit(StyledLayerDescriptor sld) { try { super.visit(sld); } catch (IllegalStateException e) { if (recursionException.equals(e)) { hasLoop[0] = true; } else { throw e; } } } @Override public PublishedInfo visitNamedLayerInternal(StyledLayer namedLayer) { if (namedLayer.getName() != null && namedLayer.getName().equals(group.getName())) { throw recursionException; } LayerGroupInfo child = catalog.getLayerGroupByName(namedLayer.getName()); if (child != null) { if (isGroupInStack(child, path)) { path.push(child); throw recursionException; } else if (checkLoops(child, path)) { throw recursionException; } return child; } return null; } }); return hasLoop[0]; } catch (IllegalStateException | IOException | ServiceException | UncheckedIOException | UnsupportedOperationException e) { LOGGER.log(Level.WARNING, "Error extracting layers from Style Group '" + styleGroup.getName() + "'. Skipping...", e); return false; } }</code><technical_language>checking for recursion, a java doc true false mean</technical_language>

Target:
private static boolean checkStyleGroupLoops(StyleInfo styleGroup, LayerGroupInfo group, Stack<LayerGroupInfo> path) { try { StyledLayerDescriptor sld = styleGroup.getSLD(); final boolean[] hasLoop = {false}; sld.accept(new GeoServerSLDVisitorAdapter((Catalog) GeoServerExtensions.bean("catalog"), group.getBounds() == null ? null : group.getBounds().getCoordinateReferenceSystem()) { private final IllegalStateException recursionException = new IllegalStateException("Style group contains recursive structure"); @Override public void visit(StyledLayerDescriptor sld) { try { super.visit(sld); } catch (IllegalStateException e) { if (recursionException.equals(e)) { hasLoop[0] = true; } else { throw e; } } } @Override public PublishedInfo visitNamedLayerInternal(StyledLayer namedLayer) { if (namedLayer.getName() != null && namedLayer.getName().equals(group.getName())) { throw recursionException; } LayerGroupInfo child = catalog.getLayerGroupByName(namedLayer.getName()); if (child != null) { if (isGroupInStack(child, path)) { path.push(child); throw recursionException; } else if (checkLoops(child, path)) { throw recursionException; } return child; } return null; } }); return hasLoop[0]; } catch (IllegalStateException | IOException | ServiceException | UncheckedIOException | UnsupportedOperationException e) { LOGGER.log(Level.WARNING, "Error extracting layers from Style Group '" + styleGroup.getName() + "'. Skipping...", e); return false; } }
Source:
<code>protected WebAppStatus getWebAppStatus(String tenantDomain, String webAppName) throws LazyLoadingTestException { String requestUrl = webAppURL + "/" + IS_WEB_APP_LOADED_METHOD_URL + "/" + tenantDomain + "/" + webAppName; WebAppStatus webAppStatus; try { HttpResponse response = HttpURLConnectionClient.sendGetRequest(requestUrl, null); JSONObject webAppStatusJSON = new JSONObject(response.getData()).getJSONObject("WebAppStatus"); boolean isTenantLoaded = webAppStatusJSON.getJSONObject("tenantStatus").getBoolean("tenantContextLoaded"); boolean isWebAppStarted = webAppStatusJSON.getBoolean("webAppStarted"); boolean isWebAppGhost = webAppStatusJSON.getBoolean("webAppGhost"); webAppStatus = new WebAppStatus(new TenantStatus(isTenantLoaded), isWebAppStarted, isWebAppGhost); } catch (IOException ioException) { <START> String customErrorMessage = "IOException when sending the Get request to:" + requestUrl + "\n" + <END> ioException.getMessage(); log.error(customErrorMessage); throw new LazyLoadingTestException(customErrorMessage, ioException); } catch (JSONException jsonException) { String customErrorMessage = "JSONException when retrieving the values from json object WebAppStatus" + requestUrl + "\n" + jsonException.getMessage(); log.error(customErrorMessage); throw new LazyLoadingTestException(customErrorMessage, jsonException); } return webAppStatus; }</code><technical_language>IMO need append exception message log again. adding exception object enough</technical_language>

Target:
protected WebAppStatusBean getWebAppStatus(String tenantDomain, String webAppName) throws LazyLoadingTestException { String requestUrl = supperTenantWebAppURL + "/" + IS_WEB_APP_LOADED_METHOD_URL + "/" + tenantDomain + "/" + webAppName; WebAppStatusBean webAppStatus; try { HttpResponse response = HttpURLConnectionClient.sendGetRequest(requestUrl, null); JSONObject webAppStatusJSON = new JSONObject(response.getData()).getJSONObject("WebAppStatus"); boolean isTenantLoaded = webAppStatusJSON.getJSONObject("tenantStatus").getBoolean("tenantContextLoaded"); boolean isWebAppStarted = webAppStatusJSON.getBoolean("webAppStarted"); boolean isWebAppGhost = webAppStatusJSON.getBoolean("webAppGhost"); webAppStatus = new WebAppStatusBean(new TenantStatusBean(isTenantLoaded), isWebAppStarted, isWebAppGhost); } catch (IOException ioException) { String customErrorMessage = "IOException when sending the Get request to:" + requestUrl; log.error(customErrorMessage, ioException); throw new LazyLoadingTestException(customErrorMessage, ioException); } catch (JSONException jsonException) { String customErrorMessage = "JSONException when retrieving the values from json object WebAppStatus" + requestUrl; log.error(customErrorMessage, jsonException); throw new LazyLoadingTestException(customErrorMessage, jsonException); } return webAppStatus; }
Source:
<code>public String format(LoggingEvent event) { if (maskPattern == null || !(event.getMessage() instanceof String)) { return super.format(event); } String message = event.getRenderedMessage(); Matcher matcher = maskPattern.matcher(message); if (matcher.find()) { String maskedMessage = ""; for(int i = 0; i <= matcher.groupCount(); i++) { int start; int end; if (i == 0) { start = 0; } else { start = matcher.end(i); <START> maskedMessage += MASK; <END> } if (i == matcher.groupCount()) { end = message.length()-1; } else { end = matcher.start(i+1) - 1; } if (start > end || end >= message.length()) { continue; } for (int j = start; j <= end; j++) { maskedMessage += message.charAt(j); } } Throwable throwable = event.getThrowableInformation() != null ? event.getThrowableInformation().getThrowable() : null; LoggingEvent maskedEvent = new LoggingEvent(event.fqnOfCategoryClass, Logger.getLogger(event.getLoggerName()), event.timeStamp, event.getLevel(), maskedMessage, throwable); return super.format(maskedEvent); } return super.format(event); }</code><technical_language>Please StringBuffer for performance</technical_language>

Target:
public String format(LoggingEvent event) { if (maskPattern == null || !(event.getMessage() instanceof String)) { return super.format(event); } String message = event.getRenderedMessage(); String maskedMessage = maskMessage(message, maskPattern, maskString); Throwable throwable = event.getThrowableInformation() != null ? event.getThrowableInformation().getThrowable() : null; LoggingEvent maskedEvent = new LoggingEvent(event.fqnOfCategoryClass, Logger.getLogger(event.getLoggerName()), event.timeStamp, event.getLevel(), maskedMessage, throwable); return super.format(maskedEvent); }
Source:
<code>public Mono<Void> writeWith(Publisher<? extends DataBuffer> publisher) { String contentType = jettyRequest.getHeaders().contains(HttpHeader.CONTENT_TYPE) ? jettyRequest.getHeaders().getField(HttpHeader.CONTENT_TYPE).getValue(): MediaType.APPLICATION_OCTET_STREAM_VALUE; <START> Publisher<ContentChunk> chunks = Flux.from(publisher).map(DataBuffer::asByteBuffer).map(ContentChunk::new); <END> ReactiveRequest.Content requestContent = ReactiveRequest.Content.fromPublisher(chunks, contentType); this.reactiveRequest = ReactiveRequest.newBuilder(jettyRequest).content(requestContent).build(); return doCommit(this::completes); }</code><technical_language>this class is DefaultDataBuffer, require releasing, I a good idea release anyway, especially if data buffer factory configurable. I release implemented ContentChunk callback (I assuming callback called data written, that). I releasing in callback work for response, for request</technical_language>

Target:
public Mono<Void> writeWith(Publisher<? extends DataBuffer> publisher) { Flux<ContentChunk> chunks = Flux.from(publisher).map(this::toContentChunk); MediaType contentType = getHeaders().getContentType(); ReactiveRequest.Content requestContent = ReactiveRequest.Content.fromPublisher(chunks, (contentType != null ? contentType.toString() : MediaType.APPLICATION_OCTET_STREAM_VALUE)); this.reactiveRequest = ReactiveRequest.newBuilder(jettyRequest).content(requestContent).build(); return doCommit(this::completes); }
Source:
<code>protected void init(final ImmutableMap<String, Object> execEnvVars) throws DbException { final Operator child = getChild(); Preconditions.checkNotNull(child, "Child operator cannot be null"); final Schema inputSchema = child.getSchema(); Preconditions.checkNotNull(inputSchema, "Child schema cannot be null"); splitColIdx = inputSchema.columnNameToIndex(columnName); final Type colType = inputSchema.getColumnType(splitColIdx); Preconditions.checkState(colType == Type.STRING_TYPE, "Column to split \"" + columnName <START> + "\" must have type STRING_TYPE but has type " + colType); <END> inputColIndexToOutputColIndex = new int[inputSchema.numColumns()]; int[] colsToKeep = new int[inputSchema.numColumns() - 1]; for (int colIdx = 0; colIdx < inputSchema.numColumns(); ++colIdx) { if (colIdx == splitColIdx) { inputColIndexToOutputColIndex[colIdx] = -1; } else if (colIdx > splitColIdx) { inputColIndexToOutputColIndex[colIdx] = colIdx - 1; colsToKeep[colIdx - 1] = colIdx; } else { inputColIndexToOutputColIndex[colIdx] = colIdx; colsToKeep[colIdx] = colIdx; } } final Schema subSchema = inputSchema.getSubSchema(colsToKeep); outputSchema = Schema.appendColumn(subSchema, Type.STRING_TYPE, "_splits"); }</code><technical_language>in guava functions Preconditions, is more efficient write follows: java Preconditions.checkState(colType == Type.STRING_TYPE, "Column split \"%s\" (%s) type STRING_TYPE", columnName, colType); This avoids unnecessary string construction, in case check passes, is easier read</technical_language>

Target:
protected void init(final ImmutableMap<String, Object> execEnvVars) throws DbException { final Operator child = getChild(); Preconditions.checkNotNull(child); final Schema inputSchema = child.getSchema(); Preconditions.checkNotNull(inputSchema); final Type colType = inputSchema.getColumnType(splitColumnIndex); Preconditions.checkState(colType == Type.STRING_TYPE, "Column to split at index %d (%s) must have type STRING_TYPE", splitColumnIndex, colType); outputBuffer = new TupleBatchBuffer(getSchema()); }
Source:
<code>public Mono<MsalToken> authenticateWithMsalAccount(TokenRequestContext request, IAccount account) { SilentParameters parameters; SilentParameters forceParameters; if (account != null) { parameters = SilentParameters.builder(new HashSet<>(request.getScopes()), account).build(); forceParameters = SilentParameters.builder(new HashSet<>(request.getScopes()), account) .forceRefresh(true).build(); } else { parameters = SilentParameters.builder(new HashSet<>(request.getScopes())).build(); forceParameters = SilentParameters.builder(new HashSet<>(request.getScopes())).forceRefresh(true).build(); } return Mono.defer(() -> { try { return Mono.fromFuture(getPublicClientApplication(false).acquireTokenSilently(parameters)) .map(ar -> new MsalToken(ar, options)) .filter(t -> !t.isExpired()) <START> .switchIfEmpty(Mono.defer(() -> Mono.fromFuture(() -> { <END> try { return getPublicClientApplication(false).acquireTokenSilently(forceParameters); } catch (MalformedURLException e) { throw logger.logExceptionAsWarning(new RuntimeException(e)); } } ).map(result -> new MsalToken(result, options)))); } catch (MalformedURLException e) { return Mono.error(e); } }); }</code><technical_language>defer needed here</technical_language>

Target:
public Mono<MsalToken> authenticateWithMsalAccount(TokenRequestContext request, IAccount account) { return Mono.defer(() -> Mono.fromFuture(() -> { SilentParameters.SilentParametersBuilder parametersBuilder = SilentParameters.builder( new HashSet<>(request.getScopes())); if (account != null) { parametersBuilder = parametersBuilder.account(account); } try { return getPublicClientApplication(false) .acquireTokenSilently(parametersBuilder.build()); } catch (MalformedURLException e) { throw logger.logExceptionAsError(Exceptions.propagate(e)); } }).map(ar -> new MsalToken(ar, options)) .filter(t -> !t.isExpired()) .switchIfEmpty(Mono.fromFuture(() -> { SilentParameters.SilentParametersBuilder forceParametersBuilder = SilentParameters.builder( new HashSet<>(request.getScopes())).forceRefresh(true); if (account != null) { forceParametersBuilder = forceParametersBuilder.account(account); } try { return getPublicClientApplication(false).acquireTokenSilently(forceParametersBuilder.build()); } catch (MalformedURLException e) { throw logger.logExceptionAsError(Exceptions.propagate(e)); } }).map(result -> new MsalToken(result, options)))); }
Source:
<code>void prepareView(final String type, final String constraintValue, final ConstraintType constraintType) { getView().setType(type); <START> if (!isEmpty(constraintValue)) { <END> getView().loadComponent(constraintType); } else { getView().setupEmptyContainer(); } }</code><technical_language>constraintType , need change this this: suggestion if (!isEmpty(constraintValue) || constraintType != null) { Otherwise, user selects "Expression" type leaves expression blank, _Expression component_ wont loaded</technical_language>

Target:
void prepareView(final String type, final String constraintValue, final ConstraintType constraintType) { getView().setType(type); if (!isEmpty(constraintValue) || constraintType != null) { getView().loadComponent(constraintType); } else { getView().setupEmptyContainer(); } }
Source:
<code>public void readBadlyDistributedFileTest() throws Exception { HPCCFile file = new HPCCFile("~benchmark::all_types::200kb", connString , hpccUser, hpccPass); file.setProjectList(""); List<HPCCRecord> records = readFile(file, connTO); <START> assertEquals("Not all records loaded",expectedCounts[1], records.size()); <END> }</code><technical_language>Good catch here, update line 64 reference datasets[1]</technical_language>

Target:
public void readBadlyDistributedFileTest() throws Exception { HPCCFile file = new HPCCFile(datasets[1], connString , hpccUser, hpccPass); file.setProjectList(""); List<HPCCRecord> records = readFile(file, connTO); assertEquals("Not all records loaded",expectedCounts[1], records.size()); }