auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void shouldKeepDirAttribute() { String html = "<html><body>" + "<table><tbody><tr><td dir=\"rtl\"></td></tr></tbody></table>" + "</body></html>"; Document result = htmlSanitizer.sanitize(html); <START> assertEquals("<html><head></head><body>" + <END> "<table><tbody><tr><td dir=\"rtl\"></td></tr></tbody></table>" + "</body></html>", toCompactString(result)); }</code><technical_language>assertEquals(html, toCompactString(result)) communicate expectation? (I realize input needs changed then)</technical_language>

Target:
public void shouldKeepDirAttribute() { String html = "<html><head></head><body>" + "<table><tbody><tr><td dir=\"rtl\"></td></tr></tbody></table>" + "</body></html>"; Document result = htmlSanitizer.sanitize(html); assertEquals(html, toCompactString(result)); }
Source:
<code>public void init() throws Exception { createBaseContainer(RepositoryPathConstants.CONTENT_BASE); <START> repoObjLoader.init(); <END> }</code><technical_language>suggest calling this init method context file instead</technical_language>

Target:
public void init() throws Exception { createBaseContainer(RepositoryPathConstants.CONTENT_BASE); }
Source:
<code>private SessionInfo getSessionInfo(String sessionId) { SessionInfo sessionInfo = null; for (SessionInfo currentSessionInfo : sessionInfoMap.values()) { if (currentSessionInfo.sessionId.equals(sessionId)) { sessionInfo = currentSessionInfo; break; } } <START> return sessionInfo; <END> }</code><technical_language>key session id</technical_language>

Target:
private SessionInfo getSessionInfo(String sessionId) { return sessionInfoMap.get(sessionId); }
Source:
<code>public EventList(List<ITimeEvent> list, long startTime, long endTime) { if (list != null) { fEventList = Collections.unmodifiableList(list); <START> } <END> fStartTime = startTime; fEndTime = endTime; }</code><technical_language>If fields set final, do } else { fEventList = null; } fEventList = new ArrayList<>() for empty list</technical_language>

Target:
public EventList(List<ITimeEvent> list, long startTime, long endTime) { if (list != null) { fEventList = Collections.unmodifiableList(list); } else { fEventList = null; } fStartTime = startTime; fEndTime = endTime; }
Source:
<code>public void addEntryBadInputTest() throws StoreException { FileSpan fileSpan = state.log.getFileSpanForMessage(state.index.getStartOffset(), 1); IndexValue value = new IndexValue(1, state.index.getStartOffset(), IndexValue.FLAGS_DEFAULT_VALUE, Utils.Infinite_Time, <START> Utils.Infinite_Time, Account.UNKNOWN_ACCOUNT_ID, Container.UNKNOWN_CONTAINER_ID); <END> try { state.index.addToIndex(new IndexEntry(state.getUniqueId(), value), fileSpan); fail("Should have failed because filespan provided < currentIndexEndOffset"); } catch (IllegalArgumentException e) { } if (isLogSegmented) { Offset startOffset = state.index.getCurrentEndOffset(); String nextLogSegmentName = LogSegmentNameHelper.getNextPositionName(startOffset.getName()); Offset endOffset = new Offset(nextLogSegmentName, 0); fileSpan = new FileSpan(startOffset, endOffset); try { state.index.addToIndex(new IndexEntry(state.getUniqueId(), value), fileSpan); fail("Should have failed because fileSpan provided spanned across segments"); } catch (IllegalArgumentException e) { } } }</code><technical_language>Is Utils.Infinite_Time ok? add a valid time</technical_language>

Target:
public void addEntryBadInputTest() throws StoreException { FileSpan fileSpan = state.log.getFileSpanForMessage(state.index.getStartOffset(), 1); IndexValue value = new IndexValue(1, state.index.getStartOffset(), IndexValue.FLAGS_DEFAULT_VALUE, Utils.Infinite_Time, state.time.milliseconds(), Utils.getRandomShort(TestUtils.RANDOM), Utils.getRandomShort(TestUtils.RANDOM)); try { state.index.addToIndex(new IndexEntry(state.getUniqueId(), value), fileSpan); fail("Should have failed because filespan provided < currentIndexEndOffset"); } catch (IllegalArgumentException e) { } if (isLogSegmented) { Offset startOffset = state.index.getCurrentEndOffset(); String nextLogSegmentName = LogSegmentNameHelper.getNextPositionName(startOffset.getName()); Offset endOffset = new Offset(nextLogSegmentName, 0); fileSpan = new FileSpan(startOffset, endOffset); try { state.index.addToIndex(new IndexEntry(state.getUniqueId(), value), fileSpan); fail("Should have failed because fileSpan provided spanned across segments"); } catch (IllegalArgumentException e) { } } }
Source:
<code>protected boolean isDatasetOrViewUri(String uriOrName) { <START> return (uriOrName.startsWith("dataset:") || uriOrName.startsWith("view:")); <END> }</code><technical_language>Nit: delegate other methods avoid duplicating logic: isDatasetUri(uriOrName) || isViewUri(uriOrName)</technical_language>

Target:
protected static boolean isDatasetOrViewUri(String uriOrName) { return (isDatasetUri(uriOrName) || isViewUri(uriOrName)); }
Source:
<code>public ProgressiveDecoder( final Consumer<CloseableReference<CloseableImage>> consumer, final ProducerContext producerContext) { super(consumer); mProducerContext = producerContext; mProducerListener = producerContext.getListener(); mImageDecodeOptions = producerContext.getImageRequest().getImageDecodeOptions(); mIsFinished = false; JobRunnable job = new JobRunnable() { @Override public void run(EncodedImage encodedImage, boolean isLast) { if (encodedImage != null) { if (mDownsampleEnabled) { ImageRequest request = producerContext.getImageRequest(); if (mDownsampleEnabledForNetwork || !UriUtil.isNetworkUri(request.getSourceUri())) { <START> if (!EncodedImage.isMetaDataAvailable(encodedImage)) { <END> encodedImage.parseMetaData(); } encodedImage.setSampleSize(DownsampleUtil.determineSampleSize( request, encodedImage)); } } doDecode(encodedImage, isLast); } } }; mJobScheduler = new JobScheduler(mExecutor, job, mImageDecodeOptions.minDecodeIntervalMs); mProducerContext.addCallbacks( new BaseProducerContextCallbacks() { @Override public void onIsIntermediateResultExpectedChanged() { if (mProducerContext.isIntermediateResultExpected()) { mJobScheduler.scheduleJob(); } } }); }</code><technical_language>This is currently done in AddImageTransformMetaDataProducer is included in producer sequence for local images needed here</technical_language>

Target:
public ProgressiveDecoder( final Consumer<CloseableReference<CloseableImage>> consumer, final ProducerContext producerContext) { super(consumer); mProducerContext = producerContext; mProducerListener = producerContext.getListener(); mImageDecodeOptions = producerContext.getImageRequest().getImageDecodeOptions(); mIsFinished = false; JobRunnable job = new JobRunnable() { @Override public void run(EncodedImage encodedImage, boolean isLast) { if (encodedImage != null) { if (mDownsampleEnabled) { ImageRequest request = producerContext.getImageRequest(); if (mDownsampleEnabledForNetwork || !UriUtil.isNetworkUri(request.getSourceUri())) { encodedImage.setSampleSize(DownsampleUtil.determineSampleSize( request, encodedImage)); } } doDecode(encodedImage, isLast); } } }; mJobScheduler = new JobScheduler(mExecutor, job, mImageDecodeOptions.minDecodeIntervalMs); mProducerContext.addCallbacks( new BaseProducerContextCallbacks() { @Override public void onIsIntermediateResultExpectedChanged() { if (mProducerContext.isIntermediateResultExpected()) { mJobScheduler.scheduleJob(); } } }); }
Source:
<code>public void releaseAllListeners() { orderedListenerCount.set(0); aSyncListenersSet.clear(); <START> syncListenersSet.clear(); <END> }</code><technical_language>This care of eventThreadLocal also</technical_language>

Target:
public void releaseAllListeners() { orderedListenerCount.set(0); aSyncListenersSet.clear(); syncListenersSet.clear(); synchronized (this) { if (eventThreadLocal instanceof EventThreadLocalImpl) { eventThreadLocal = new NoOpEventThreadLocalImpl(); } } }
Source:
<code>public Optional<U> generate(final WebContext context, final U profile) { init(); final U linkedProfile = profileService.findByLinkedId(profile.getId()); if (linkedProfile != null) { return Optional.of(linkedProfile); } else { if (failIfLinkedUserNotFound) { throw new TechnicalException("No linked account found for: " + profile); } else { <START> return Optional.ofNullable(profile); <END> } } }</code><technical_language>ofNullable sense called profile.getId() beginning of method: if null arrived in code. profile parameter is meant non-null</technical_language>

Target:
public U generate(final WebContext context, final U profile) { init(); final U linkedProfile = profileService.findByLinkedId(profile.getId()); if (linkedProfile != null) { return linkedProfile; } else { if (failIfLinkedUserNotFound) { throw new TechnicalException("No linked account found for: " + profile); } else { return profile; } } }
Source:
<code>public CloudDestination getCloudDestination() throws IllegalStateException { try { AzureCloudDestination dest = new AzureCloudDestination(cloudConfig, azureCloudConfig, azureMetrics); dest.testAzureConnectivity(); return dest; } catch (Exception e) { <START> logger.error("Initializing Azure destination", e.getMessage()); <END> throw (e instanceof IllegalStateException) ? (IllegalStateException) e : new IllegalStateException(e); } }</code><technical_language>minor, change this logger.error("Error occurred initializing Azure destination : {}", e.getMessage());</technical_language>

Target:
public CloudDestination getCloudDestination() throws IllegalStateException { try { AzureCloudDestination dest = new AzureCloudDestination(cloudConfig, azureCloudConfig, azureMetrics); dest.testAzureConnectivity(); return dest; } catch (Exception e) { logger.error("Error initializing Azure destination: {}", e.getMessage()); throw (e instanceof IllegalStateException) ? (IllegalStateException) e : new IllegalStateException(e); } }
Source:
<code>protected boolean canThisBeBilledByBillingFrequency() { LOG.info("canThisBeBilledByBillingFrequency: Both must be TRUE to allow LOC billedByBillingFrequency: " + " currentDate and lastBilledDate !(isSameDay) = " + (!KfsDateUtils.isSameDay(currentDate, lastBilledDate)) + " AND lastBilledDate and calculatePreviousDate !(isSameDay) = " + !KfsDateUtils.isSameDay(lastBilledDate, calculatePreviousDate(currentDate))); <START> return (!KfsDateUtils.isSameDay(currentDate, lastBilledDate) && !KfsDateUtils.isSameDay(lastBilledDate, calculatePreviousDate(currentDate))); <END> }</code><technical_language>performance worth while capturing results ofKfsDateUtils.isSameDay variables, variables in log statements</technical_language>

Target:
protected boolean canThisBeBilledByBillingFrequency() { boolean currentDateisNotSameDayAsLastBilledDate = !KfsDateUtils.isSameDay(currentDate, lastBilledDate); boolean lastBilledDateIsNotSameDayAsCalculatedPreviousDayBasedOnCurrentDate = !KfsDateUtils.isSameDay(lastBilledDate, calculatePreviousDate(currentDate)); LOG.info("canThisBeBilledByBillingFrequency: Both must be TRUE to allow LOC billedByBillingFrequency: " + " currentDate and lastBilledDate NOT(isSameDay) = " + currentDateisNotSameDayAsLastBilledDate + " AND lastBilledDate and calculatePreviousDate !(isSameDay) = " + lastBilledDateIsNotSameDayAsCalculatedPreviousDayBasedOnCurrentDate); return (currentDateisNotSameDayAsLastBilledDate && lastBilledDateIsNotSameDayAsCalculatedPreviousDayBasedOnCurrentDate); }
Source:
<code>public void redraw() { if (fRelayoutRequired) { layout(true); return; } if (fCachedTextViewer != null && fCachedTextViewer.getTextWidget() <START> != null <END> && fCanvas != null && !fCanvas.isDisposed()) { if (VerticalRuler.AVOID_NEW_GC) { fCanvas.redraw(); fCanvas.update(); } else { GC gc= new GC(fCanvas); doubleBufferPaint(gc); gc.dispose(); } } }</code><technical_language>please wrap this long condition, readable</technical_language>

Target:
public void redraw() { if (fRelayoutRequired) { layout(true); return; } if (!isDisposed()) { if (VerticalRuler.AVOID_NEW_GC) { fCanvas.redraw(); fCanvas.update(); } else { GC gc= new GC(fCanvas); doubleBufferPaint(gc); gc.dispose(); } } }
Source:
<code>public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) { IProject project = SessionManager.getProject(request); IUserSession session = (IUserSession) request.getSession().getAttribute("UserSession"); AccountObject account = session.getAccount(); <START> String UserID = account.getUsername(); <END> String UserName = account.getNickName(); String userInfo = UserID + "(" + UserName + ")"; String projectInfo = ""; if (project != null) { projectInfo = project.getName(); } TopTitleInfoUI ttiui = new TopTitleInfoUI(userInfo, projectInfo); Gson gson = new Gson(); response.setContentType("text/html; charset=utf-8"); try { response.getWriter().write(gson.toJson(ttiui)); response.getWriter().close(); } catch (IOException e) { e.printStackTrace(); } return null; }</code><technical_language>String username = getUsername()</technical_language>

Target:
public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) { IProject project = SessionManager.getProject(request); IUserSession session = (IUserSession) request.getSession().getAttribute("UserSession"); AccountObject account = session.getAccount(); String userName = account.getUsername(); String nickName = account.getNickName(); String userInfo = userName + "(" + nickName + ")"; String projectInfo = ""; if (project != null) { projectInfo = project.getName(); } TopTitleInfoUI ttiui = new TopTitleInfoUI(userInfo, projectInfo); Gson gson = new Gson(); response.setContentType("text/html; charset=utf-8"); try { response.getWriter().write(gson.toJson(ttiui)); response.getWriter().close(); } catch (IOException e) { e.printStackTrace(); } return null; }
Source:
<code>public String[] extractPartitions(Message message) { JSONObject jsonObject = (JSONObject) JSONValue.parse(message.getPayload()); String result[] = { defaultDate }; if (jsonObject != null) { Object fieldValue = jsonObject.get(mConfig.getMessageTimestampName()); Object inputPattern = mConfig.getMessageTimestampInputPattern(); if (fieldValue != null && inputPattern != null) { try { <START> SimpleDateFormat inputFormatter = new SimpleDateFormat(inputPattern.toString()); <END> SimpleDateFormat outputFormatter = new SimpleDateFormat("yyyy-MM-dd"); result[0] = "dt=" + outputFormatter.format(inputFormatter.parse(fieldValue.toString())); return result; } catch (Exception e) { LOG.warn("Impossible to convert date = " + fieldValue.toString() + " for the input pattern = " + inputPattern.toString() + ". Using date default=" + result[0]); } } } return result; }</code><technical_language>else in Secor is UTC. change for consistency</technical_language>

Target:
public String[] extractPartitions(Message message) { JSONObject jsonObject = (JSONObject) JSONValue.parse(message.getPayload()); String result[] = { defaultDate }; if (jsonObject != null) { Object fieldValue = jsonObject.get(mConfig.getMessageTimestampName()); Object inputPattern = mConfig.getMessageTimestampInputPattern(); if (fieldValue != null && inputPattern != null) { try { SimpleDateFormat inputFormatter = new SimpleDateFormat(inputPattern.toString()); SimpleDateFormat outputFormatter = new SimpleDateFormat(defaultFormatter); Date dateFormat = inputFormatter.parse(fieldValue.toString()); result[0] = "dt=" + outputFormatter.format(dateFormat); return result; } catch (Exception e) { LOG.warn("Impossible to convert date = " + fieldValue.toString() + " for the input pattern = " + inputPattern.toString() + ". Using date default=" + result[0]); } } } return result; }
Source:
<code>public void show(final String value) { final String dataTypeName = extractItemDefinitionName(value); final Optional<ItemDefinition> itemDefinition = itemDefinitionUtils.findByName(dataTypeName); <START> if (itemDefinition.isPresent()) { <END> final DataType dataType = dataTypeFactory.makeDataType(itemDefinition.get()); treeGrid.setupItems(dataType); superShow(); } }</code><technical_language>I @jomarko is itemDefinition.ifPresent(id->{...})</technical_language>

Target:
public void show(final String value) { final String dataTypeName = extractItemDefinitionName(value); final Optional<ItemDefinition> itemDefinition = itemDefinitionUtils.findByName(dataTypeName); itemDefinition.ifPresent(i -> { final DataType dataType = dataTypeFactory.makeDataType(i); treeGrid.setupItems(dataType); superShow(); }); }
Source:
<code>private boolean isCandidateForRefactoring(String oldClassName, String newClassName, File file) { <START> return !Objects.equals(file.getName(), oldClassName + ".java") && !Objects.equals(file.getName(), newClassName + ".java"); <END> }</code><technical_language>put file.getName(), oldClassName + ".java" local variables. If properly named, obvious is condition is do</technical_language>

Target:
private boolean isCandidateForRefactoring(String oldClassName, String newClassName, File file) { final String fileName = file.getName(); final String sourceFileName = oldClassName + ".java"; final String targetFileName = newClassName + ".java"; return !Objects.equals(fileName, sourceFileName) && !Objects.equals(fileName, targetFileName); }
Source:
<code><START> public void init(Boolean flag) throws IOException { <END> conf = HBaseConfiguration.create(); conf.setBoolean(COPROCESSORS_ENABLED_CONF_KEY, true); conf.setBoolean(USER_COPROCESSORS_ENABLED_CONF_KEY, true); TableName tableName = TableName.valueOf(name.getMethodName()); regionInfo = RegionInfoBuilder.newBuilder(tableName).build(); TableDescriptor tableDesc = null; if (flag == null) { tableDesc = TableDescriptorBuilder.newBuilder(tableName) .setCoprocessor(SimpleRegionObserver.class.getName()).build(); } else if (flag) { tableDesc = TableDescriptorBuilder.newBuilder(tableName) .setCoprocessor(TempRegionObserver.class.getName()).build(); } else { conf.set(REGION_COPROCESSOR_CONF_KEY, TempRegionObserver.class.getName()); tableDesc = TableDescriptorBuilder.newBuilder(tableName) .setCoprocessor(SimpleRegionObserver.class.getName()).build(); } region = mock(HRegion.class); when(region.getRegionInfo()).thenReturn(regionInfo); when(region.getTableDescriptor()).thenReturn(tableDesc); rsServices = mock(RegionServerServices.class); }</code><technical_language>private here? I do this method needs called in other classes</technical_language>

Target:
private void init(Boolean flag) throws IOException { conf = HBaseConfiguration.create(); conf.setBoolean(COPROCESSORS_ENABLED_CONF_KEY, true); conf.setBoolean(USER_COPROCESSORS_ENABLED_CONF_KEY, true); TableName tableName = TableName.valueOf(name.getMethodName()); regionInfo = RegionInfoBuilder.newBuilder(tableName).build(); TableDescriptor tableDesc = null; if (flag == null) { tableDesc = TableDescriptorBuilder.newBuilder(tableName) .setCoprocessor(SimpleRegionObserver.class.getName()).build(); } else if (flag) { tableDesc = TableDescriptorBuilder.newBuilder(tableName) .setCoprocessor(TempRegionObserver.class.getName()).build(); } else { conf.set(REGION_COPROCESSOR_CONF_KEY, TempRegionObserver.class.getName()); tableDesc = TableDescriptorBuilder.newBuilder(tableName) .setCoprocessor(SimpleRegionObserver.class.getName()).build(); } region = mock(HRegion.class); when(region.getRegionInfo()).thenReturn(regionInfo); when(region.getTableDescriptor()).thenReturn(tableDesc); rsServices = mock(RegionServerServices.class); }
Source:
<code>public static void main(String[] args){ Server server = new Server(); boolean showHelp = false; if (args.length > 0) { switch (args[0]) { case "load": if (args.length == 2) { try { server.newGame(GridLoader.loadGrid(args[1])); } catch(NullPointerException e) { System.out.println("Error: Failed to locate json file."); showHelp = true; } } else { showHelp = true; } break; case "random": if (args.length == 5) { try { Dimension dimension = new Dimension(Integer.parseInt(args[1]), Integer.parseInt(args[2])); server.newGame(GridGenerator.createRandomGrid(dimension, Integer.parseInt(args[3]), Integer.parseInt(args[4]))); } catch(NumberFormatException e) { showHelp = true; } } else { showHelp = true; } break; case "help": showHelp = true; break; } } else { showHelp = true; } if (showHelp) { System.out.println("Usage: server <command>"); System.out.println("Available commands:"); System.out.println(" load <gridName> Load a predefined json grid"); <START> System.out.println(" random <width> <height> <# players> <seed> Generate a random grid"); <END> System.out.println(" help Show this help file"); System.exit(0); } else { System.out.println("Server now running with initial grid of: "); System.out.println(server.grid.toString()); } }</code><technical_language>In hindsight, passing number of players a randomly generated grid. push some changes this branch fix that</technical_language>

Target:
public static void main(String[] args){ Server server = new Server(); server.newGame(CLAParser.parse(args)); System.out.println("Server now running with initial grid of: "); System.out.println(server.grid.toString()); }
Source:
<code>CounterAddHandler() { <START> super(); <END> }</code><technical_language>advantage of AbstractAddStepHandler consutrctor takes a Collection<? extends AttributeDefinition> populateModel populate methods required</technical_language>

Target:
CounterAddHandler() { }
Source:
<code>private int sampleFromTerms(final double randomVar, final double[] terms, final List<Integer> nonzeroIndices) { double val = randomVar; <START> for (final Integer nonzeroIndex : nonzeroIndices) { <END> if (val < terms[nonzeroIndex]) { return nonzeroIndex; } val -= terms[nonzeroIndex]; } throw new RuntimeException("randomVar have to be smaller than summation of all nonzero terms"); }</code><technical_language>set nonzeroIndex a primitive integer</technical_language>

Target:
private int sampleFromTerms(final double randomVar, final double[] terms, final List<Integer> nonzeroIndices) { double val = randomVar; for (final int nonzeroIndex : nonzeroIndices) { if (val < terms[nonzeroIndex]) { return nonzeroIndex; } val -= terms[nonzeroIndex]; } throw new RuntimeException("randomVar has to be smaller than summation of all nonzero terms"); }
Source:
<code>public void onFieldResponse(@Observes FormEditorContextResponse response) { if(disabled) { return; } else if (!response.getFormId().equals(formId)) { return; <START> } else if (field != null && !response.getFieldId().equals(fieldId)) { <END> return; } editorHelper = response.getEditorHelper(); init(editorHelper.getRenderingContext(), editorHelper.getFormField(response.getFieldId())); renderContent(); if (showProperties) { propertiesRenderer.render(propertiesRendererHelper); } }</code><technical_language>This class is tested all. Also, maybe, good replace some fields Optional<String>. Like: java private Optional<String> fieldId; private Optional<String> formId;</technical_language>

Target:
public void onFieldResponse(@Observes FormEditorContextResponse response) { if(disabled) { return; } else if (!formId.filter(s -> response.getFormId().equals(s)).isPresent()) { return; } else if (field != null && !fieldId.filter(s->response.getFieldId().equals(s)).isPresent()) { return; } editorHelper = response.getEditorHelper(); init(editorHelper.getRenderingContext(), editorHelper.getFormField(response.getFieldId())); renderContent(); if (showProperties) { propertiesRenderer.render(propertiesRendererHelper); } }
Source:
<code>public void parse(String fileURL, String charset) { this.charset = charset; Reader reader = null; try { DefaultHandler hd = null; SAXParserFactory spf = SAXParserFactory.newInstance(); spf.setFeature(javax.xml.XMLConstants.FEATURE_SECURE_PROCESSING, Boolean.TRUE); <START> spf.setFeature(DISALLOW_DOCTYPE_DECL, true); <END> SAXParser saxParser = null; if (ignoreDTD) { spf.setFeature("<LINK_0>", false); } saxParser = spf.newSAXParser(); if (rootPath == null || rootPath.equals("")) { hd = newHandler(); } else { hd = newHandler2(); } saxParser.setProperty("<LINK_1>", hd); reader = new UnicodeReader(new java.io.FileInputStream(fileURL), this.charset); org.xml.sax.InputSource inSource = new org.xml.sax.InputSource(reader); saxParser.parse(inSource, hd); } catch (ParserConfigurationException e) { e.printStackTrace(); } catch (SAXException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } finally { if (reader != null) { try { reader.close(); } catch (IOException e) { e.printStackTrace(); } } } }</code><technical_language>This set instead in if (ignoreDTD) statement. If ignoreDTD is false, allow DTDs</technical_language>

Target:
public void parse(String fileURL, String charset) { this.charset = charset; Reader reader = null; try { DefaultHandler hd = null; SAXParser saxParser = createSaxParser(); if (rootPath == null || rootPath.equals("")) { hd = newHandler(); } else { hd = newHandler2(); } saxParser.setProperty("<LINK_1>", hd); reader = new UnicodeReader(new java.io.FileInputStream(fileURL), this.charset); org.xml.sax.InputSource inSource = new org.xml.sax.InputSource(reader); saxParser.parse(inSource, hd); } catch (ParserConfigurationException e) { e.printStackTrace(); } catch (SAXException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } finally { if (reader != null) { try { reader.close(); } catch (IOException e) { e.printStackTrace(); } } } }
Source:
<code><START> public synchronized RawPacket[] doReverseTransform(RawPacket[] pkts) <END> { Set<Integer> flexFecPacketsToRemove = new HashSet<>(); for (Map.Entry<Integer, RawPacket> entry : fecPackets.entrySet()) { FlexFec03Packet flexFecPacket = FlexFec03Packet.create(entry.getValue()); if (flexFecPacket == null) { continue; } reconstructor.setFecPacket(flexFecPacket); if (reconstructor.complete()) { flexFecPacketsToRemove.add(flexFecPacket.getSequenceNumber()); continue; } if (reconstructor.canRecover()) { logger.debug("Attemping recovery of missing sequence " + "number " + reconstructor.missingSequenceNumber); flexFecPacketsToRemove.add(flexFecPacket.getSequenceNumber()); RawPacket recovered = reconstructor.recover(); if (recovered != null) { logger.info("Recovered packet " + recovered.getSequenceNumber()); statistics.numRecoveredPackets++; saveMedia(recovered); pkts = ArrayUtils.insert(recovered, pkts, RawPacket.class); } else { logger.error("Recovery of packet " + reconstructor.missingSequenceNumber + " failed even" + " though it should have been possible"); statistics.failedRecoveries++; } } } for (Integer flexFecSeqNum : flexFecPacketsToRemove) { fecPackets.remove(flexFecSeqNum); } return pkts; }</code><technical_language>I this protected</technical_language>

Target:
protected synchronized RawPacket[] doReverseTransform(RawPacket[] pkts) { Set<Integer> flexFecPacketsToRemove = new HashSet<>(); for (Map.Entry<Integer, RawPacket> entry : fecPackets.entrySet()) { FlexFec03Packet flexFecPacket = FlexFec03Packet.create(entry.getValue()); if (flexFecPacket == null) { continue; } reconstructor.setFecPacket(flexFecPacket); if (reconstructor.complete()) { flexFecPacketsToRemove.add(flexFecPacket.getSequenceNumber()); continue; } if (reconstructor.canRecover()) { if (logger.isDebugEnabled()) { logger.debug("Attempting recovery of missing sequence " + "number " + reconstructor.missingSequenceNumber); } flexFecPacketsToRemove.add(flexFecPacket.getSequenceNumber()); RawPacket recovered = reconstructor.recover(); if (recovered != null) { logger.info("Recovered packet " + recovered.getSequenceNumber()); statistics.numRecoveredPackets++; saveMedia(recovered); pkts = ArrayUtils.insert(recovered, pkts, RawPacket.class); } else { logger.error("Recovery of packet " + reconstructor.missingSequenceNumber + " failed even" + " though it should have been possible"); statistics.failedRecoveries++; } } } for (Integer flexFecSeqNum : flexFecPacketsToRemove) { fecPackets.remove(flexFecSeqNum); } return pkts; }
Source:
<code>public void should_enable_schema_programmatically_when_disabled_in_config() { DriverConfigLoader loader = SessionUtils.configLoaderBuilder() .withBoolean(DefaultDriverOption.METADATA_SCHEMA_ENABLED, false) .build(); try (CqlSession session = SessionUtils.newSession(ccmRule, loader)) { assertThat(session.isSchemaMetadataEnabled()).isFalse(); assertThat(session.getMetadata().getKeyspaces()).isEmpty(); session.setSchemaMetadataEnabled(true); assertThat(session.isSchemaMetadataEnabled()).isTrue(); ConditionChecker.checkThat( () -> assertThat(session.getMetadata().getKeyspaces()).isNotEmpty()) .becomesTrue(); assertThat(session.getMetadata().getKeyspaces()) .containsKeys( CqlIdentifier.fromInternal("system"), CqlIdentifier.fromInternal("system_traces"), sessionRule.keyspace()); <START> assertThat(session.getMetadata().getClusterName().get()).isEqualTo("ccm_1"); <END> session.setSchemaMetadataEnabled(null); assertThat(session.isSchemaMetadataEnabled()).isFalse(); } }</code><technical_language>This feels out of place in this schema test. I else put it, create a separate class</technical_language>

Target:
public void should_enable_schema_programmatically_when_disabled_in_config() { DriverConfigLoader loader = SessionUtils.configLoaderBuilder() .withBoolean(DefaultDriverOption.METADATA_SCHEMA_ENABLED, false) .build(); try (CqlSession session = SessionUtils.newSession(ccmRule, loader)) { assertThat(session.isSchemaMetadataEnabled()).isFalse(); assertThat(session.getMetadata().getKeyspaces()).isEmpty(); session.setSchemaMetadataEnabled(true); assertThat(session.isSchemaMetadataEnabled()).isTrue(); ConditionChecker.checkThat( () -> assertThat(session.getMetadata().getKeyspaces()).isNotEmpty()) .becomesTrue(); assertThat(session.getMetadata().getKeyspaces()) .containsKeys( CqlIdentifier.fromInternal("system"), CqlIdentifier.fromInternal("system_traces"), sessionRule.keyspace()); session.setSchemaMetadataEnabled(null); assertThat(session.isSchemaMetadataEnabled()).isFalse(); } }
Source:
<code>private String findHostId(String hostName) throws DotDataException { String hostId = null; DotConnect dc = new DotConnect(); dc.setSQL(SELECT_HOSTID_BY_NAME_QUERY); dc.addParam(hostName); List<Map<String,String>> result = dc.loadResults(); if(!result.isEmpty()){ <START> hostId = result.get(0).get("identifier").toString(); <END> } return hostId; }</code><technical_language>![MINOR](<LINK_2> 'Severity: MINOR') "get" returns a string, need call "toString()". [![rule](<LINK_1>](<LINK_0></technical_language>

Target:
private String findHostId(String hostName) throws DotDataException { String hostId = null; DotConnect dc = new DotConnect(); dc.setSQL(SELECT_HOSTID_BY_NAME_QUERY); dc.addParam(hostName); List<Map<String, String>> result = dc.loadResults(); if (!result.isEmpty()) { hostId = result.get(0).get("identifier"); } return hostId; }
Source:
<code>public Enumeration<URL> getResources(String name) throws IOException { List<URL> result = new ArrayList<>(); for (ClassLoader classLoader : loaders) { result.addAll(Collections.list(classLoader.getResources(name))); } ClassLoader contextLoader = Thread.currentThread().getContextClassLoader(); if (contextLoader != null) { <START> result.addAll(Collections.list(contextLoader.getResources(name))); <END> } else { result.addAll(Collections.list(super.getResources(name))); } return Collections.enumeration(result); }</code><technical_language>result a LinkedHashSet. valid identical resources in it. for list of classloaders in this class</technical_language>

Target:
public Enumeration<URL> getResources(String name) throws IOException { Set<URL> result = new LinkedHashSet<>(); for (ClassLoader classLoader : loaders) { result.addAll(Collections.list(classLoader.getResources(name))); } ClassLoader contextLoader = Thread.currentThread().getContextClassLoader(); if (contextLoader != null) { result.addAll(Collections.list(contextLoader.getResources(name))); } else { result.addAll(Collections.list(super.getResources(name))); } return Collections.enumeration(result); }
Source:
<code><START> public Notification registerThresholdNotification(Category category) { <END> Notification notification = null; if (category.getThreshold() > 0) { Double totalAmountSpent = expenseDao.getTotalAmountByCategoryForCurrentMonth(category.getId()); if (totalAmountSpent != null && totalAmountSpent > 0) { if (totalAmountSpent >= category.getThreshold()) { String thresholdExceededMessage = this.createThresholdExceededMessage(category, totalAmountSpent); notification = this.createNotification(category, NotificationPriority.HIGH, thresholdExceededMessage); notification = notificationDao.save(notification); } } } return notification; }</code><technical_language>Update this method Medium priority notification (add argument for notification priority)</technical_language>

Target:
public Notification registerThresholdNotification(Category category) { Notification notification = null; if (category.getThreshold() > 0) { Double totalAmountSpent = expenseDao.getTotalAmountByCategoryForCurrentMonth(category.getId()); if (totalAmountSpent != null && totalAmountSpent > 0) { if (totalAmountSpent >= category.getThreshold()) { String thresholdExceededMessage = this.createThresholdExceededMessage(category, totalAmountSpent); notification = this.createNotification(category, NotificationPriority.HIGH, thresholdExceededMessage); notification = notificationDao.save(notification); } else { try { if (shouldCreateMediumPriorityNotification(category.getThreshold(), totalAmountSpent, thresholdMediumNotificationPercent)) { String thresholdWarningMessage = this.createThresholdPercentCloseToLimitMessage(category, totalAmountSpent); notification = this.createNotification(category, NotificationPriority.MEDIUM, thresholdWarningMessage); notification = notificationDao.save(notification); } } catch (ServiceException e) { LOGGER.warning(" ---- ERROR: " + e.getMessage()); } } } } return notification; }
Source:
<code>public boolean defaultNetworkRules(final Connect conn, final String vmName, final NicTO nic, final Long vmId, final String secIpStr) { if (!_canBridgeFirewall) { return false; } final List<InterfaceDef> intfs = getInterfaces(conn, vmName); if (intfs.size() == 0 || intfs.size() < nic.getDeviceId()) { return false; } final InterfaceDef intf = intfs.get(nic.getDeviceId()); final String brname = intf.getBrName(); final String vif = intf.getDevName(); <START> final Script cmd = new Script(_securityGroupPath, _timeout.getMillis(), s_logger); <END> cmd.add("default_network_rules"); cmd.add("--vmname", vmName); cmd.add("--vmid", vmId.toString()); if (nic.getIp() != null) { cmd.add("--vmip", nic.getIp()); } cmd.add("--vmmac", nic.getMac()); cmd.add("--vif", vif); cmd.add("--brname", brname); cmd.add("--nicsecips", secIpStr); final String result = cmd.execute(); if (result != null) { return false; } return true; }</code><technical_language>Please consider adding overridden version of Script(String, int, Logger) constructor accepts Duration encapsulate this type conversion</technical_language>

Target:
public boolean defaultNetworkRules(final Connect conn, final String vmName, final NicTO nic, final Long vmId, final String secIpStr) { if (!_canBridgeFirewall) { return false; } final List<InterfaceDef> intfs = getInterfaces(conn, vmName); if (intfs.size() == 0 || intfs.size() < nic.getDeviceId()) { return false; } final InterfaceDef intf = intfs.get(nic.getDeviceId()); final String brname = intf.getBrName(); final String vif = intf.getDevName(); final Script cmd = new Script(_securityGroupPath, _timeout, s_logger); cmd.add("default_network_rules"); cmd.add("--vmname", vmName); cmd.add("--vmid", vmId.toString()); if (nic.getIp() != null) { cmd.add("--vmip", nic.getIp()); } cmd.add("--vmmac", nic.getMac()); cmd.add("--vif", vif); cmd.add("--brname", brname); cmd.add("--nicsecips", secIpStr); final String result = cmd.execute(); if (result != null) { return false; } return true; }
Source:
<code>private DBOptions dataDbOptions() { <START> DBOptions options = new DBOptions() <END> .setCreateIfMissing(true) .setCreateMissingColumnFamilies(true); return options; }</code><technical_language>if DBOptions.getDBOptionsFromProps(configuration.properties()) able care of <LINK_0></technical_language>

Target:
private DBOptions dataDbOptions() { DBOptions dbOptions; if (databaseProperties != null) { dbOptions = DBOptions.getDBOptionsFromProps(databaseProperties); if (dbOptions == null) { throw log.rocksDBUnknownPropertiesSupplied(databaseProperties.toString()); } } else { dbOptions = new DBOptions(); } return dbOptions .setCreateIfMissing(true) .setCreateMissingColumnFamilies(true); }
Source:
<code>private String getRegistryPrefix(String propertyName) { String[] parts = propertyName.replaceFirst(CONFIG_PREFIX, "").split("\\."); if (parts.length < 2) { <START> throw new IllegalArgumentException(format("You missed '.' in property '%s'. Valid credential registry format is '%s'", <END> propertyName, VALID_DOCKER_PROPERTY_NAME_EXAMPLE)); } if (parts.length > 2) { throw new IllegalArgumentException(format("You set redundant '.' in property '%s'. Valid credential registry format is '%s'", propertyName, VALID_DOCKER_PROPERTY_NAME_EXAMPLE)); } String propertyIdentifier = parts[1]; if (!URL.equals(propertyIdentifier) && !USER_NAME.equals(propertyIdentifier) && !PASSWORD.equals(propertyIdentifier)) { LOG.warn("Set unused property: " + propertyName); } return CONFIG_PREFIX + parts[0] + "."; }</code><technical_language>of "You missed" style? User error configured property</technical_language>

Target:
private String getRegistryPrefix(String propertyName) { String[] parts = propertyName.replaceFirst(CONFIG_PREFIX, "").split("\\."); if (parts.length < 2) { throw new IllegalArgumentException(format("In the property '%s' is missing '.'. Valid credential registry format is '%s'", propertyName, VALID_DOCKER_PROPERTY_NAME_EXAMPLE)); } if (parts.length > 2) { throw new IllegalArgumentException(format("Property '%s' contains redundant '.'. Valid credential registry format is '%s'", propertyName, VALID_DOCKER_PROPERTY_NAME_EXAMPLE)); } String propertyIdentifier = parts[1]; if (!URL.equals(propertyIdentifier) && !USER_NAME.equals(propertyIdentifier) && !PASSWORD.equals(propertyIdentifier)) { LOG.warn("Set unused property: {}.", propertyName); } return CONFIG_PREFIX + parts[0] + "."; }
Source:
<code>private void login() { cookies = null; try { String url = "http://" + ip + "/cgi/login?username=" + URLEncoder.encode(username, "UTF-8") + "&password=" + URLEncoder.encode(password, "UTF-8"); URL loginurl = new URL(url); URLConnection connection = loginurl.openConnection(); cookies = connection.getHeaderFields().get("Set-Cookie"); } catch (Exception e) { <START> logger.debug("Cannot log into Waterkotte EcoTouch."); <END> } }</code><technical_language>kind of exceptions occur? Please add meaningful log statement in order debug more easily</technical_language>

Target:
private void login() { cookies = null; String url = null; try { url = "http://" + ip + "/cgi/login?username=" + URLEncoder.encode(username, "UTF-8") + "&password=" + URLEncoder.encode(password, "UTF-8"); URL loginurl = new URL(url); URLConnection connection = loginurl.openConnection(); cookies = connection.getHeaderFields().get("Set-Cookie"); } catch (MalformedURLException e) { logger.debug("The URL '" + url + "' is malformed: " + e.toString()); } catch (Exception e) { logger.debug("Cannot log into Waterkotte EcoTouch: " + e.toString()); } }
Source:
<code>private void assertQueryUsesIndex(final String baseTableName, final String viewName, Connection conn, boolean isChildView) throws SQLException { String sql = "SELECT A0, A1, A2, A4 FROM " + viewName +" WHERE A4 IN ('1', '2', '3') ORDER BY A4, A2"; ResultSet rs = conn.prepareStatement("EXPLAIN " + sql).executeQuery(); String childViewScanKey = isChildView ? ",'Y'" : ""; assertEquals( <START> "CLIENT PARALLEL 1-WAY SKIP SCAN ON 3 KEYS OVER _IDX_" + baseTableName + " [-32768,'1'" + childViewScanKey + "] - [-32768,'3'" + childViewScanKey + "]\n" + <END> " SERVER FILTER BY FIRST KEY ONLY", QueryUtil.getExplainPlan(rs)); rs = conn.createStatement().executeQuery(sql); assertTrue(rs.next()); assertEquals("1", rs.getString(1)); assertEquals("X", rs.getString(2)); assertEquals("Y", rs.getString(3)); assertEquals("1", rs.getString(4)); assertTrue(rs.next()); assertEquals("2", rs.getString(1)); assertEquals("X", rs.getString(2)); assertEquals("Y", rs.getString(3)); assertEquals("2", rs.getString(4)); assertFalse(rs.next()); }</code><technical_language>ditto putting this in terms of Short.MIN_VALUE</technical_language>

Target:
private void assertQueryUsesIndex(final String baseTableName, final String viewName, Connection conn, boolean isChildView) throws SQLException { String sql = "SELECT A0, A1, A2, A4 FROM " + viewName +" WHERE A4 IN ('1', '2', '3') ORDER BY A4, A2"; ResultSet rs = conn.prepareStatement("EXPLAIN " + sql).executeQuery(); String childViewScanKey = isChildView ? ",'Y'" : ""; assertEquals( "CLIENT PARALLEL 1-WAY SKIP SCAN ON 3 KEYS OVER _IDX_" + baseTableName + " ["+ Short.MIN_VALUE +",'1'" + childViewScanKey + "] - [" + Short.MIN_VALUE + ",'3'" + childViewScanKey + "]\n" + " SERVER FILTER BY FIRST KEY ONLY", QueryUtil.getExplainPlan(rs)); rs = conn.createStatement().executeQuery(sql); assertTrue(rs.next()); assertEquals("1", rs.getString(1)); assertEquals("X", rs.getString(2)); assertEquals("Y", rs.getString(3)); assertEquals("1", rs.getString(4)); assertTrue(rs.next()); assertEquals("2", rs.getString(1)); assertEquals("X", rs.getString(2)); assertEquals("Y", rs.getString(3)); assertEquals("2", rs.getString(4)); assertFalse(rs.next()); }
Source:
<code><START> @Test public void testCubeWithGroupBy() { <END> final String query = "select count(*) " + "from \"foodmart\".\"product\" " + "group by cube(\"product_id\",\"product_class_id\")"; final String expected = "SELECT COUNT(*)\n" + "FROM \"foodmart\".\"product\"\n" + "GROUP BY CUBE(\"product_id\", \"product_class_id\")"; final String expectedInSpark = "SELECT COUNT(*)\n" + "FROM foodmart.product\n" + "GROUP BY product_id, product_class_id WITH CUBE"; final String expectedPresto = "SELECT COUNT(*)\n" + "FROM \"foodmart\".\"product\"\n" + "GROUP BY CUBE(\"product_id\", \"product_class_id\")"; sql(query) .ok(expected) .withSpark() .ok(expectedInSpark) .withPresto() .ok(expectedPresto); }</code><technical_language>I remember a PR removed public. follow this style</technical_language>

Target:
@Test void testCubeWithGroupBy() { final String query = "select count(*) " + "from \"foodmart\".\"product\" " + "group by cube(\"product_id\",\"product_class_id\")"; final String expected = "SELECT COUNT(*)\n" + "FROM \"foodmart\".\"product\"\n" + "GROUP BY CUBE(\"product_id\", \"product_class_id\")"; final String expectedInSpark = "SELECT COUNT(*)\n" + "FROM foodmart.product\n" + "GROUP BY product_id, product_class_id WITH CUBE"; final String expectedPresto = "SELECT COUNT(*)\n" + "FROM \"foodmart\".\"product\"\n" + "GROUP BY CUBE(\"product_id\", \"product_class_id\")"; sql(query) .ok(expected) .withSpark() .ok(expectedInSpark) .withPresto() .ok(expectedPresto); }
Source:
<code>public static void setUp() { SWTBotUtils.initialize(); SWTBotPreferences.TIMEOUT = 10000; SWTBotPreferences.KEYBOARD_LAYOUT = "EN_US"; fBot = new SWTWorkbenchBot(); SWTBotUtils.closeView("Welcome", fBot); SWTBotUtils.createProject(TRACE_PROJECT_NAME); SWTBotUtils.switchToTracingPerspective(); WaitUtils.waitForJobs(); final CtfTestTrace cygProfile = CtfTestTrace.CYG_PROFILE; LttngUstTrace trace = LttngUstTestTraceUtils.getTrace(cygProfile); fStart = ((CtfTmfTrace) trace).getStartTime().toNanos(); fFullRange = new TmfTimeRange(TmfTimestamp.fromNanos(fStart), TmfTimestamp.fromNanos(fStart + 100l)); final File file = new File(trace.getPath()); LttngUstTestTraceUtils.dispose(cygProfile); SWTBotUtils.openTrace(TRACE_PROJECT_NAME, file.getAbsolutePath(), UST_ID); SWTBotUtils.openView(CallStackView.ID); fViewBot = fBot.viewByTitle("Call Stack"); WaitUtils.waitForJobs(); <START> MarkerConfigXmlParser.initMarkerSets(); <END> }</code><technical_language>necessary</technical_language>

Target:
public static void setUp() { SWTBotUtils.initialize(); SWTBotPreferences.TIMEOUT = 10000; SWTBotPreferences.KEYBOARD_LAYOUT = "EN_US"; fBot = new SWTWorkbenchBot(); SWTBotUtils.closeView("Welcome", fBot); SWTBotUtils.createProject(TRACE_PROJECT_NAME); SWTBotUtils.switchToTracingPerspective(); WaitUtils.waitForJobs(); final CtfTestTrace cygProfile = CtfTestTrace.CYG_PROFILE; LttngUstTrace trace = LttngUstTestTraceUtils.getTrace(cygProfile); fStart = ((CtfTmfTrace) trace).getStartTime().toNanos(); fFullRange = new TmfTimeRange(TmfTimestamp.fromNanos(fStart), TmfTimestamp.fromNanos(fStart + 100l)); final File file = new File(trace.getPath()); LttngUstTestTraceUtils.dispose(cygProfile); SWTBotUtils.openTrace(TRACE_PROJECT_NAME, file.getAbsolutePath(), UST_ID); SWTBotUtils.openView(CallStackView.ID); fViewBot = fBot.viewByTitle("Call Stack"); WaitUtils.waitForJobs(); }
Source:
<code>public void returnsCorrectPartLength() throws IOException { final int length = 5000; final String body = Joiner.on(RqMultipartTest.CRLF).join( "--zzz", "Content-Disposition: form-data; name=\"x-1\"", "", StringUtils.repeat("X", length), "--zzz--" ); final Request req = new RqFake( Arrays.asList( "POST /post?u=3 HTTP/1.1", "Host: www.example.com", contentLengthHeader(body.getBytes().length), "Content-Type: multipart/form-data; boundary=zzz" ), body ); <START> final RqMultipart.Smart regsmart = new RqMultipart.Smart( <END> new RqMultipart.Base(req) ); try { MatcherAssert.assertThat( regsmart.single("x-1").body().available(), Matchers.equalTo(length) ); } finally { req.body().close(); regsmart.part("x-1").iterator().next().body().close(); } }</code><technical_language>@raphaelln double space, please fix</technical_language>

Target:
public void returnsCorrectPartLength() throws IOException { final int length = 5000; final String part = "x-1"; final String body = Joiner.on(RqMultipartTest.CRLF).join( "--zzz", String.format(RqMultipartTest.CONTENT, part), "", StringUtils.repeat("X", length), "--zzz--" ); final Request req = new RqFake( Arrays.asList( "POST /post?u=3 HTTP/1.1", "Host: www.example.com", contentLengthHeader(body.getBytes().length), "Content-Type: multipart/form-data; boundary=zzz" ), body ); final RqMultipart.Smart regsmart = new RqMultipart.Smart( new RqMultipart.Base(req) ); try { MatcherAssert.assertThat( regsmart.single(part).body().available(), Matchers.equalTo(length) ); } finally { req.body().close(); regsmart.part(part).iterator().next().body().close(); } }
Source:
<code>public void setUp() { this.T_integer = new ConstT("Integer"); <START> this.T_float = new ConstT("Floating"); <END> this.T_string = new ConstT("String"); this.T_numeric = new TypeClass("Num", T_integer, T_float); this.T_a = new VarT("a", T_numeric); this.T_b = new VarT("b", T_numeric); this.T_c = new VarT("c", T_numeric, T_string); }</code><technical_language>Floating is a ConstT</technical_language>

Target:
public void setUp() { this.T_integer = new ConstT("Integer"); this.T_float = new ConstT("Float"); this.T_string = new ConstT("String"); this.T_numeric = new TypeClass("Num", T_integer, T_float); this.T_a = new VarT("a", T_numeric); this.T_b = new VarT("b", T_numeric); this.T_c = new VarT("c", T_numeric, T_string); }
Source:
<code>public void foo4() { int prog, user; prog = (int)(Math.random() * 10) + 1; Scanner input = new Scanner(System.in, "utf-8"); if( input.hasNextInt() ) { do { user = input.nextInt(); if(user == prog) { String.CASE_INSENSITIVE_ORDER.equals("Good!"); } else { if (user > 0 && user <= 10) { String.CASE_INSENSITIVE_ORDER.equals("Bad! "); if( prog < user ) { String.CASE_INSENSITIVE_ORDER.equals("My number is less than yours."); } else { String.CASE_INSENSITIVE_ORDER.equals("My number is greater than yours"); } } else { String.CASE_INSENSITIVE_ORDER.equals("Brrr!"); } } } while( user != prog ); } else { <START> String.CASE_INSENSITIVE_ORDER.equals("Brrr!"); <END> } String.CASE_INSENSITIVE_ORDER.equals("Goodbye!"); }</code><technical_language>Brrr? stick existing logic change "violation"</technical_language>

Target:
public void foo4() { int prog, user; prog = (int)(Math.random() * 10) + 1; Scanner input = new Scanner(System.in, "utf-8"); if( input.hasNextInt() ) { do { user = input.nextInt(); if(user == prog) { String.CASE_INSENSITIVE_ORDER.equals("Good!"); } else { if (user > 0 && user <= 10) { String.CASE_INSENSITIVE_ORDER.equals("Bad! "); if( prog < user ) { String.CASE_INSENSITIVE_ORDER.equals("My number is less than yours."); } else { String.CASE_INSENSITIVE_ORDER.equals("My number is greater than yours"); } } else { String.CASE_INSENSITIVE_ORDER.equals("Violation!"); } } } while( user != prog ); } else { String.CASE_INSENSITIVE_ORDER.equals("Violation!"); } String.CASE_INSENSITIVE_ORDER.equals("Goodbye!"); }