auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private void threadSummary() { List<String> prefixes = Lists.newArrayList("HTTP", "IntraLineDiff", "ReceiveCommits", "SSH git-receive-pack", "SSH git-upload-pack", "SSH-Interactive-Worker", "SSH-Stream-Worker", "SshCommandStart"); Runtime r = Runtime.getRuntime(); ThreadMXBean threadMXBean = ManagementFactory.getThreadMXBean(); stdout.format("Threads: %d CPUs available, %d threads\n", r.availableProcessors(), threadMXBean.getThreadCount()); if (showThreads) { Table<String, Thread.State, Integer> count = HashBasedTable.create(); for (long id : threadMXBean.getAllThreadIds()) { ThreadInfo info = threadMXBean.getThreadInfo(id); if (info == null) { continue; } String name = info.getThreadName(); for (String p : prefixes) { <START> if (name.startsWith(p)) { <END> Thread.State state = info.getThreadState(); Integer c = count.get(p, state); count.put(p, info.getThreadState(), c != null ? c++ : 1); } } } stdout.print(String.format(" %22s", "")); for (Thread.State s : Thread.State.values()) { stdout.print(String.format(" %14s", s.name())); } stdout.print('\n'); for (String p : prefixes) { stdout.print(String.format(" %-22s", p)); for (Thread.State s : Thread.State.values()) { stdout.print(String.format(" %14d", nullToZero(count.get(p, s)))); } stdout.print('\n'); } } stdout.print('\n'); }</code><technical_language>Do else a miscellaneous category put other threads start prefix? I asking thread counts some number sum numbers in detailed table, add total number of threads</technical_language>

Target:
private void threadSummary() { List<String> prefixes = Lists.newArrayList("HTTP", "IntraLineDiff", "ReceiveCommits", "SSH git-receive-pack", "SSH git-upload-pack", "SSH-Interactive-Worker", "SSH-Stream-Worker", "SshCommandStart"); String other = "Other"; Runtime r = Runtime.getRuntime(); ThreadMXBean threadMXBean = ManagementFactory.getThreadMXBean(); stdout.format("Threads: %d CPUs available, %d threads\n", r.availableProcessors(), threadMXBean.getThreadCount()); if (showThreads) { Table<String, Thread.State, Integer> count = HashBasedTable.create(); threadLoop: for (long id : threadMXBean.getAllThreadIds()) { ThreadInfo info = threadMXBean.getThreadInfo(id); if (info == null) { continue; } String name = info.getThreadName(); Thread.State state = info.getThreadState(); for (String p : prefixes) { if (name.startsWith(p)) { Integer c = count.get(p, state); count.put(p, info.getThreadState(), c != null ? c + 1 : 1); continue threadLoop; } } Integer c = count.get(other, state); count.put(other, info.getThreadState(), c != null ? c + 1 : 1); } stdout.print(String.format(" %22s", "")); for (Thread.State s : Thread.State.values()) { stdout.print(String.format(" %14s", s.name())); } stdout.print('\n'); for (String p : prefixes) { stdout.print(String.format(" %-22s", p)); for (Thread.State s : Thread.State.values()) { stdout.print(String.format(" %14d", nullToZero(count.get(p, s)))); } stdout.print('\n'); } stdout.print(String.format(" %-22s", other)); for (Thread.State s : Thread.State.values()) { stdout.print(String.format(" %14d", nullToZero(count.get(other, s)))); } stdout.print('\n'); } stdout.print('\n'); }
Source:
<code>public void getApplicationByCandidateIdShouldReturnOneElementListOfApplicationDTOWhenCandidateIdExists() { List<ApplicationEntity> applicationEntities = Collections.singletonList(applicationEntity); List<CandidateApplicationDTO> candidateApplicationDTOs = Collections.singletonList(dummyCandidateApplicationDTO); given(candidateRepository.findOne(CANDIDATE_ID)).willReturn(candidateEntity); given(applicationsRepository.findByCandidateEntity(candidateEntity, DEFAULT_PAGE_REQUEST)) .willReturn(new PageImpl<ApplicationEntity>(applicationEntities)); given(converterService.convert(applicationEntities, CandidateApplicationDTO.class)) .willReturn(candidateApplicationDTOs); PagingResponse<CandidateApplicationDTO> <START> result = <END> applicationsService .getApplicationsByCandidateId(CANDIDATE_ID, PAGE_NUMBER_ZERO, PAGE_SIZE_TEN); assertThat(result.getTotal(), is(1L)); assertThat(result.getRows(), equalTo(candidateApplicationDTOs)); }</code><technical_language>This final</technical_language>

Target:
public void getApplicationByCandidateIdShouldReturnOneElementListOfApplicationDTOWhenCandidateIdExists() { final List<ApplicationEntity> applicationEntities = Collections.singletonList(applicationEntity); final List<CandidateApplicationDTO> candidateApplicationDTOs = Collections.singletonList(dummyCandidateApplicationDTO); given(candidateRepository.findOne(CANDIDATE_ID)).willReturn(candidateEntity); given(applicationsRepository.findByCandidateEntity(candidateEntity, DEFAULT_PAGE_REQUEST)) .willReturn(new PageImpl<ApplicationEntity>(applicationEntities)); given(converterService.convert(applicationEntities, CandidateApplicationDTO.class)) .willReturn(candidateApplicationDTOs); final PagingResponse<CandidateApplicationDTO> result = applicationsService .getApplicationsByCandidateId(CANDIDATE_ID, PAGE_NUMBER_ZERO, PAGE_SIZE_TEN); assertThat(result.getTotal(), is(1L)); assertThat(result.getRows(), equalTo(candidateApplicationDTOs)); }
Source:
<code>private Metacard generateMetacard(MimeType mimeType, InputStream message) throws MetacardCreationException { LOGGER.trace("ENTERING: generateMetacard"); TransformResponse transformResponse = transform.transform(mimeType, null, null, message, null, Collections.emptyMap()); Optional<Metacard> optionalMetacard = transformResponse.getParentMetacard(); <START> if (!optionalMetacard.isPresent()) { <END> throw new MetacardCreationException("Could not create metacard with mimeType " + mimeType); } return optionalMetacard.get(); }</code><technical_language>Another option: return optionalMetacard.orElseThrow(() -> new MetacardCreationException("Could create metacard mimeType " + mimeType));</technical_language>

Target:
private Metacard generateMetacard(MimeType mimeType, InputStream message) throws MetacardCreationException { LOGGER.trace("ENTERING: generateMetacard"); TransformResponse transformResponse = transform.transform(mimeType, null, null, message, null, Collections.emptyMap()); Optional<Metacard> optionalMetacard = transformResponse.getParentMetacard(); return optionalMetacard.orElseThrow( () -> new MetacardCreationException("Could not create metacard with mimeType " + mimeType)); }
Source:
<code>private static void heapHistogramDump(int numLines, boolean liveObjectsOnly, PrintStream printStream, String jmapPath) { try { String args = liveObjectsOnly ? LIVE_HISTO_OPTION : ARGS; <START> String cmd = jmapPath.isEmpty() ? CMD : (jmapPath + CMD); <END> Process p = Runtime.getRuntime().exec(cmd + args + getProcessId()); BufferedReader in = new BufferedReader( new InputStreamReader(p.getInputStream(), Charset.defaultCharset())); printStream.println("JMap " + (liveObjectsOnly ? "histo:live" : "histo") + " dump at " + new Date()); String line = in.readLine(); for (int i = 0; i < numLines && line != null; ++i) { printStream.println("--\t" + line); line = in.readLine(); } in.close(); } catch (IOException e) { e.printStackTrace(); } }</code><technical_language>Nit: conf option JMAP_LOCATION default "jmap"</technical_language>

Target:
private static void heapHistogramDump(int numLines, boolean liveObjectsOnly, PrintStream printStream, String jmapPath) { try { String args = liveObjectsOnly ? LIVE_HISTO_OPTION : ARGS; Process p = Runtime.getRuntime().exec(jmapPath + args + getProcessId()); BufferedReader in = new BufferedReader( new InputStreamReader(p.getInputStream(), Charset.defaultCharset())); printStream.println("JMap " + (liveObjectsOnly ? "histo:live" : "histo") + " dump at " + new Date()); String line = in.readLine(); for (int i = 0; i < numLines && line != null; ++i) { printStream.println("--\t" + line); line = in.readLine(); } in.close(); } catch (IOException e) { e.printStackTrace(); } }
Source:
<code>public void run(PresentationConfiguration configuration, Environment environment) throws Exception { DBIFactory dbiFactory = new DBIFactory(); DBI jdbi = dbiFactory.build(environment, configuration.getDatabase(), "postgres"); RecentEntryIndexUpdateDAO updateDAO = jdbi.onDemand(RecentEntryIndexUpdateDAO.class); RecentEntryIndexQueryDAO queryDAO = jdbi.onDemand(RecentEntryIndexQueryDAO.class); ExecutorService executorService = Executors.newSingleThreadExecutor(); executorService.execute(new ConsumerRunnable(configuration, updateDAO)); DropwizardResourceConfig resourceConfig = environment.jersey().getResourceConfig(); ImmutableMap<String, MediaType> representations = ImmutableMap.of( "csv", ExtraMediaType.TEXT_CSV_TYPE, "tsv", ExtraMediaType.TEXT_TSV_TYPE, "ttl", ExtraMediaType.TEXT_TTL_TYPE, <START> "html", MediaType.TEXT_HTML_TYPE, <END> "json", MediaType.APPLICATION_JSON_TYPE ); resourceConfig.property(ServerProperties.MEDIA_TYPE_MAPPINGS, representations); environment.jersey().register(new CsvWriter()); environment.jersey().register(new TsvWriter()); environment.jersey().register(new TurtleWriter()); JerseyEnvironment jersey = environment.jersey(); jersey.register(new DataResource(queryDAO)); jersey.register(new HomePageResource()); jersey.register(new SearchResource(queryDAO)); MutableServletContextHandler applicationContext = environment.getApplicationContext(); setCorsPreflight(applicationContext); }</code><technical_language>removed (discussed IRL -- this is a separate concern thymeleaf support)</technical_language>

Target:
public void run(PresentationConfiguration configuration, Environment environment) throws Exception { DBIFactory dbiFactory = new DBIFactory(); DBI jdbi = dbiFactory.build(environment, configuration.getDatabase(), "postgres"); RecentEntryIndexUpdateDAO updateDAO = jdbi.onDemand(RecentEntryIndexUpdateDAO.class); RecentEntryIndexQueryDAO queryDAO = jdbi.onDemand(RecentEntryIndexQueryDAO.class); ExecutorService executorService = Executors.newSingleThreadExecutor(); executorService.execute(new ConsumerRunnable(configuration, updateDAO)); DropwizardResourceConfig resourceConfig = environment.jersey().getResourceConfig(); ImmutableMap<String, MediaType> representations = ImmutableMap.of( "csv", ExtraMediaType.TEXT_CSV_TYPE, "tsv", ExtraMediaType.TEXT_TSV_TYPE, "ttl", ExtraMediaType.TEXT_TTL_TYPE, "json", MediaType.APPLICATION_JSON_TYPE ); resourceConfig.property(ServerProperties.MEDIA_TYPE_MAPPINGS, representations); environment.jersey().register(new CsvWriter()); environment.jersey().register(new TsvWriter()); environment.jersey().register(new TurtleWriter()); JerseyEnvironment jersey = environment.jersey(); jersey.register(new DataResource(queryDAO)); jersey.register(new HomePageResource()); jersey.register(new SearchResource(queryDAO)); MutableServletContextHandler applicationContext = environment.getApplicationContext(); setCorsPreflight(applicationContext); }
Source:
<code>public static Map<String, String> maskPasswordInPropertyMap(Map<String, String> propertyMap) { if (null == propertyMap) { return null; } final Map<String, String> maskedMap = new HashMap<>(); for (Map.Entry<String, String> property : propertyMap.entrySet()) { <START> String value = property.getKey().toLowerCase().contains(PASSWORD_TEXT) || property.getKey().toLowerCase().contains(PASSWD_TEXT) ? secretPrefix <END> : property.getValue(); maskedMap.put(property.getKey(), value); } return maskedMap; }</code><technical_language>move property.getKey().toLowerCase() separate variable restrict string length</technical_language>

Target:
public static Map<String, String> maskPasswordInPropertyMap(Map<String, String> propertyMap) { if (null == propertyMap) { return null; } final Map<String, String> maskedMap = new HashMap<>(); for (Map.Entry<String, String> property : propertyMap.entrySet()) { String value = isPassword(property.getKey()) ? secretPrefix : property.getValue(); maskedMap.put(property.getKey(), value); } return maskedMap; }
Source:
<code>void listEntitiesWithTopAsync() { final String partitionKeyValue = testResourceNamer.randomName("partitionKey", 20); final String rowKeyValue = testResourceNamer.randomName("rowKey", 20); final String rowKeyValue2 = testResourceNamer.randomName("rowKey", 20); final String rowKeyValue3 = testResourceNamer.randomName("rowKey", 20); ListEntitiesOptions options = new ListEntitiesOptions().setTop(2); <START> tableClient.createEntity(new TableEntity(partitionKeyValue, rowKeyValue)).block(TIMEOUT); <END> tableClient.createEntity(new TableEntity(partitionKeyValue, rowKeyValue2)).block(TIMEOUT); tableClient.createEntity(new TableEntity(partitionKeyValue, rowKeyValue3)).block(TIMEOUT); StepVerifier.create(tableClient.listEntities(options)) .expectNextCount(2) .thenConsumeWhile(x -> true) .expectComplete() .verify(); }</code><technical_language>following, this is Task.whenAll completes done. java Mono.when( tableClient.createEntity(new TableEntity(partitionKeyValue, rowKeyValue)), tableClient.createEntity(new TableEntity(partitionKeyValue, rowKeyValue2)), tableClient.createEntity(new TableEntity(partitionKeyValue, rowKeyValue3))).block(TIMEOUT);</technical_language>

Target:
void listEntitiesWithTopAsync() { final String partitionKeyValue = testResourceNamer.randomName("partitionKey", 20); final String rowKeyValue = testResourceNamer.randomName("rowKey", 20); final String rowKeyValue2 = testResourceNamer.randomName("rowKey", 20); final String rowKeyValue3 = testResourceNamer.randomName("rowKey", 20); ListEntitiesOptions options = new ListEntitiesOptions().setTop(2); Mono.when( tableClient.createEntity(new TableEntity(partitionKeyValue, rowKeyValue)), tableClient.createEntity(new TableEntity(partitionKeyValue, rowKeyValue2)), tableClient.createEntity(new TableEntity(partitionKeyValue, rowKeyValue3)) ).block(TIMEOUT); StepVerifier.create(tableClient.listEntities(options)) .expectNextCount(2) .thenConsumeWhile(x -> true) .expectComplete() .verify(); }
Source:
<code>private void visitSymbol(Symbol symbol) { Usage firstDeclaration = null; for (Usage usage : symbol.usages()) { if (firstDeclaration == null) { <START> if ((usage.isDeclaration() || usage.kind() == Usage.Kind.LEXICAL_DECLARATION)) { <END> firstDeclaration = usage; } } else if (usage.isDeclaration()) { getContext().addIssue(this, usage.symbolTree(), String.format(MESSAGE, symbol.name(), ((JavaScriptTree) firstDeclaration.symbolTree()).getLine())); } } }</code><technical_language>![MAJOR](<LINK_1> Remove useless parentheses. [![rule](<LINK_2>](<LINK_0></technical_language>

Target:
private void visitSymbol(Symbol symbol) { Usage firstDeclaration = null; for (Usage usage : symbol.usages()) { if (firstDeclaration == null) { if ((usage.isDeclaration() || usage.kind() == Usage.Kind.LEXICAL_DECLARATION)) { firstDeclaration = usage; } } else if (usage.isDeclaration()) { getContext().addIssue(this, usage.identifierTree(), String.format(MESSAGE, symbol.name(), ((JavaScriptTree) firstDeclaration.identifierTree()).getLine())); } } }
Source:
<code>public void sendRequest(Exchange exchange, Request request) { Request req = request; if (shouldProtectRequest(request)) { try { String uri = request.getURI(); final OSCoreCtxDB db = HashMapCtxDB.getInstance(); if (uri == null) { LOGGER.error(Error.URI_NULL); throw new OSException(Error.URI_NULL); } if (db == null) { LOGGER.error(Error.DB_NULL); throw new OSException(Error.DB_NULL); } final OSCoreCtx ctx = db.getContext(uri); if (ctx == null) { LOGGER.error(Error.CTX_NULL); throw new OSException(Error.CTX_NULL); } exchange.setCryptographicContextID(ctx.getRecipientId()); final int seqByToken = ctx.getSenderSeq(); final Request preparedRequest = prepareSend(request, ctx); preparedRequest.addMessageObserver(new MessageObserverAdapter() { @Override public void onReadyToSend() { Token token = preparedRequest.getToken(); db.addContext(token, ctx); db.addSeqByToken(token, seqByToken); } }); req = preparedRequest; <START> if (req.getToken() != null) { <END> db.addContext(request.getToken(), ctx); db.addSeqByToken(request.getToken(), seqByToken); } } catch (OSException e) { LOGGER.error("Error sending request: " + e.getMessage()); return; } catch (IllegalArgumentException e) { LOGGER.error("Unable to send request because of illegal argument: " + e.getMessage()); return; } } LOGGER.info("Request: " + exchange.getRequest().toString()); super.sendRequest(exchange, req); }</code><technical_language>This added in onReadyToSend callback. Please remove lines 142-145</technical_language>

Target:
public void sendRequest(Exchange exchange, Request request) { Request req = request; if (shouldProtectRequest(request)) { try { String uri = request.getURI(); final OSCoreCtxDB db = HashMapCtxDB.getInstance(); if (uri == null) { LOGGER.error(ErrorDescriptions.URI_NULL); throw new OSException(ErrorDescriptions.URI_NULL); } if (db == null) { LOGGER.error(ErrorDescriptions.DB_NULL); throw new OSException(ErrorDescriptions.DB_NULL); } final OSCoreCtx ctx = db.getContext(uri); if (ctx == null) { LOGGER.error(ErrorDescriptions.CTX_NULL); throw new OSException(ErrorDescriptions.CTX_NULL); } exchange.setCryptographicContextID(ctx.getRecipientId()); final int seqByToken = ctx.getSenderSeq(); final Request preparedRequest = prepareSend(request, ctx); preparedRequest.addMessageObserver(new MessageObserverAdapter() { @Override public void onReadyToSend() { Token token = preparedRequest.getToken(); db.addContext(token, ctx); db.addSeqByToken(token, seqByToken); } }); req = preparedRequest; } catch (OSException e) { LOGGER.error("Error sending request: " + e.getMessage()); return; } catch (IllegalArgumentException e) { LOGGER.error("Unable to send request because of illegal argument: " + e.getMessage()); return; } } LOGGER.info("Request: " + exchange.getRequest().toString()); super.sendRequest(exchange, req); }
Source:
<code>private static Double attemptDateConversion(String s) { if (s.length() == 0) { throw new XPathTypeMismatchException(); } <START> return toNumeric(toDate(s)); <END> }</code><technical_language>Hm, toDate() guaranteed return a date, I manually check return type. caught of special cases above, others added toDate() method mirrored here, a tough infinite loop catch</technical_language>

Target:
private static Double attemptDateConversion(String s) { Object o = toDate(s); if (o instanceof Date) { return toNumeric(o); } else { throw new XPathTypeMismatchException(); } }
Source:
<code>public static List<JavaFileScannerContext.Location> flow(ExplodedGraph.Node currentNode, SymbolicValue currentVal ) { <START> List<JavaFileScannerContext.Location> flow = new ArrayList<>(); <END> ExplodedGraph.Node node = currentNode; Symbol lastEvaluated = currentNode.programState.getLastEvaluated(); while (node != null) { ExplodedGraph.Node finalNode = node; if(finalNode.programPoint.syntaxTree() != null) { node.getLearnedConstraints().stream() .map(lc->lc.sv) .filter(sv -> sv.equals(currentVal)) .findFirst() .ifPresent(sv -> flow.add(new JavaFileScannerContext.Location("", finalNode.parent.programPoint.syntaxTree()))); if (lastEvaluated != null) { Symbol finalLastEvaluated = lastEvaluated; Optional<Symbol> learnedSymbol = node.getLearnedSymbols().stream() .map(ls -> ls.symbol) .filter(sv -> sv.equals(finalLastEvaluated)) .findFirst(); if (learnedSymbol.isPresent()) { lastEvaluated = finalNode.parent.programState.getLastEvaluated(); flow.add(new JavaFileScannerContext.Location("", finalNode.parent.programPoint.syntaxTree())); } } } node = node.parent; } return flow; }</code><technical_language>I if flow passed argument (i.e. accumulator) avoid unnecessary allocations? premature optimization</technical_language>

Target:
public static List<JavaFileScannerContext.Location> flow(ExplodedGraph.Node currentNode, SymbolicValue currentVal) { List<JavaFileScannerContext.Location> flow = new ArrayList<>(); if (currentVal instanceof BinarySymbolicValue) { Set<JavaFileScannerContext.Location> locations = new HashSet<>(); locations.addAll(SECheck.flow(currentNode.parent, ((BinarySymbolicValue) currentVal).getLeftOp())); locations.addAll(SECheck.flow(currentNode.parent, ((BinarySymbolicValue) currentVal).getRightOp())); flow.addAll(locations); } ExplodedGraph.Node node = currentNode; Symbol lastEvaluated = currentNode.programState.getLastEvaluated(); while (node != null) { ExplodedGraph.Node finalNode = node; if (finalNode.programPoint.syntaxTree() == null) { continue; } node.getLearnedConstraints().stream() .map(ExplodedGraph.Node.LearnedConstraint::getSv) .filter(sv -> sv.equals(currentVal)) .findFirst() .ifPresent(sv -> flow.add(new JavaFileScannerContext.Location("", finalNode.parent.programPoint.syntaxTree()))); if (lastEvaluated != null) { Symbol finalLastEvaluated = lastEvaluated; Optional<Symbol> learnedSymbol = node.getLearnedSymbols().stream() .map(ExplodedGraph.Node.LearnedValue::getSymbol) .filter(sv -> sv.equals(finalLastEvaluated)) .findFirst(); if (learnedSymbol.isPresent()) { lastEvaluated = finalNode.parent.programState.getLastEvaluated(); flow.add(new JavaFileScannerContext.Location("", finalNode.parent.programPoint.syntaxTree())); } } node = node.parent; } return Lists.reverse(flow); }
Source:
<code>public void initialize() { mentionPattern = Pattern.compile("\\b(" + Pattern.quote(userService.getUsername()) + ")\\b", CASE_INSENSITIVE); channelPattern = Pattern.compile("#([a-z][^#]+)\\b", CASE_INSENSITIVE); Platform.runLater(this::initChatView); <START> <END> addFocusListeners(); addImagePasteListener(); unreadMessagesCount.addListener((observable, oldValue, newValue) -> chatService.incrementUnreadMessagesCount(newValue.intValue() - oldValue.intValue()) ); StageHolder.getStage().focusedProperty().addListener(new WeakChangeListener<>(resetUnreadMessagesListener)); getRoot().selectedProperty().addListener(new WeakChangeListener<>(resetUnreadMessagesListener)); autoCompletionHelper.bindTo(messageTextField()); }</code><technical_language>Constant well. mentionPattern needs built runtime information is case for channelPattern Also, expect this pattern equal in channelUrlPattern: (#[a-z].+) (or other around)</technical_language>

Target:
public void initialize() { mentionPattern = Pattern.compile("\\b(" + Pattern.quote(userService.getUsername()) + ")\\b", CASE_INSENSITIVE); initChatView(); addFocusListeners(); addImagePasteListener(); unreadMessagesCount.addListener((observable, oldValue, newValue) -> chatService.incrementUnreadMessagesCount(newValue.intValue() - oldValue.intValue())); JavaFxUtil.addListener(StageHolder.getStage().focusedProperty(), new WeakChangeListener<>(resetUnreadMessagesListener)); JavaFxUtil.addListener(getRoot().selectedProperty(), new WeakChangeListener<>(resetUnreadMessagesListener)); getRoot().setOnClosed(this::onClosed); }
Source:
<code>public void updateDRepresentation(DRepresentation newDRepresentation) { this.dRepresentation = newDRepresentation; tableViewerListener.setdTable((DTable) dRepresentation); getTreeViewer().getTree().removeAll(); getTreeViewer().getTree().clearAll(true); while (getTreeViewer().getTree().getColumnCount() > 0) { <START> getTreeViewer().getTree().getColumns()[0].dispose(); <END> } treeLayout = new TreeColumnLayout(); composite.setLayout(treeLayout); dRepresentationChanged = true; initializeColumnsAndComponentsRelatedToDRepresentation(treeLayout); }</code><technical_language>dispose column . Is expected</technical_language>

Target:
public void updateDRepresentation(DRepresentation newDRepresentation) { this.dRepresentation = newDRepresentation; tableViewerListener.resetDTable((DTable) dRepresentation); getTreeViewer().getTree().removeAll(); getTreeViewer().getTree().clearAll(true); while (getTreeViewer().getTree().getColumnCount() > 0) { getTreeViewer().getTree().getColumns()[0].dispose(); } treeLayout = new TreeColumnLayout(); composite.setLayout(treeLayout); dRepresentationReplaced = true; initializeColumnsAndComponentsRelatedToDRepresentation(treeLayout); }
Source:
<code>private ChargeStatus internalChargeStatus(String code) { if(code == null) { return AUTHORISATION_SUCCESS; <START> } else if (code.equals("P0010")) { <END> return AUTHORISATION_REJECTED; } else { return AUTHORISATION_ERROR; } }</code><technical_language>Codacy says, literal in this. Admittedly in this case checked null first, good habit get in</technical_language>

Target:
private ChargeStatus internalChargeStatus(String code) { if(code == null) { return AUTHORISATION_SUCCESS; } else if ("P0010".equals(code)) { return AUTHORISATION_REJECTED; } else { return AUTHORISATION_ERROR; } }
Source:
<code>public void handleEvent(EventBundle events) { if (!events.containsEventName(ThumbnailConstants.EventNames.scheduleThumbnailUpdate.name())) { return; } Set<String> processedDocs = new HashSet<>(); for (Event event : events) { if (!ThumbnailConstants.EventNames.scheduleThumbnailUpdate.name().equals(event.getName())) { continue; } DocumentEventContext context = (DocumentEventContext) event.getContext(); DocumentModel doc = context.getSourceDocument(); if (Boolean.TRUE.equals(context.getProperty(ThumbnailConstants.DISABLE_THUMBNAIL_COMPUTATION))) { <START> log.trace("Thumbnail computation is disabled for document {}", doc.getId()); <END> continue; } if (doc instanceof DeletedDocumentModel) { continue; } if (doc.isProxy()) { continue; } if (processedDocs.contains(doc.getId())) { continue; } CoreSession repo = context.getCoreSession(); processDoc(repo, doc); processedDocs.add(doc.getId()); } }</code><technical_language>a log.trace here, in VideoChangedListener</technical_language>

Target:
public void handleEvent(EventBundle events) { if (!events.containsEventName(ThumbnailConstants.EventNames.scheduleThumbnailUpdate.name())) { return; } Set<String> processedDocs = new HashSet<>(); for (Event event : events) { if (!ThumbnailConstants.EventNames.scheduleThumbnailUpdate.name().equals(event.getName())) { continue; } DocumentEventContext context = (DocumentEventContext) event.getContext(); DocumentModel doc = context.getSourceDocument(); if (Boolean.TRUE.equals(context.getProperty(ThumbnailConstants.DISABLE_THUMBNAIL_COMPUTATION))) { log.trace("Thumbnail computation is disabled for document {}", doc::getId); continue; } if (doc instanceof DeletedDocumentModel) { continue; } if (doc.isProxy()) { continue; } if (processedDocs.contains(doc.getId())) { continue; } CoreSession repo = context.getCoreSession(); processDoc(repo, doc); processedDocs.add(doc.getId()); } }
Source:
<code><START> private void flatten(Map<String, Serializable> map, State state, String prefix) { <END> for (Entry<String, Serializable> en : state.entrySet()) { String key = en.getKey(); Serializable value = en.getValue(); String name; String realName = keyMappings.get(key); if (realName != null) { name = realName; } else if (key.startsWith(KEY_PREFIX)) { name = DBSSession.convToNXQL(key); if (name == null) { continue; } } else { name = key; } name = prefix == null ? name : prefix + name; if (value instanceof State) { flatten(map, (State) value, name + '/'); } else if (value instanceof List) { String nameSlash = name + '/'; int i = 0; for (Object v : (List<?>) value) { if (v instanceof State) { flatten(map, (State) v, nameSlash + i + '/'); } else { map.put(nameSlash + i, (Serializable) v); } i++; } } else if (value instanceof Object[]) { String nameSlash = name + '/'; int i = 0; for (Object v : (Object[]) value) { map.put(nameSlash + i, (Serializable) v); i++; } } else { map.put(name, value); } } }</code><technical_language>private for methods protected</technical_language>

Target:
protected void flatten(Map<String, Serializable> map, State state, String prefix) { for (Entry<String, Serializable> en : state.entrySet()) { String key = en.getKey(); Serializable value = en.getValue(); String name; String realName = keyMappings.get(key); if (realName != null) { name = realName; } else if (key.startsWith(KEY_PREFIX)) { name = DBSSession.convToNXQL(key); if (name == null) { continue; } } else { name = key; } name = prefix == null ? name : prefix + name; if (value instanceof State) { flatten(map, (State) value, name + '/'); } else if (value instanceof List) { String nameSlash = name + '/'; int i = 0; for (Object v : (List<?>) value) { if (v instanceof State) { flatten(map, (State) v, nameSlash + i + '/'); } else { map.put(nameSlash + i, (Serializable) v); } i++; } } else if (value instanceof Object[]) { String nameSlash = name + '/'; int i = 0; for (Object v : (Object[]) value) { map.put(nameSlash + i, (Serializable) v); i++; } } else { map.put(name, value); } } }
Source:
<code>public String get(final String key, final long languageId, final User user, final boolean respectFrontendRoles) { if(!UtilMethods.isSet(key)) { return null; } String languageValue = null; try { final ContentType languageVariableContentType = APILocator.getContentTypeAPI(user).find(LANGUAGEVARIABLE); languageValue = this.getValueFromUserLanguage(key, languageId, user, respectFrontendRoles, languageVariableContentType); if (null == languageValue) { languageValue = this.getValueFromUserFallbackLanguage(key, languageId, user, respectFrontendRoles, languageVariableContentType); if (null == languageValue && languageVariableContentType instanceof MultilinguableFallback && MultilinguableFallback.class.cast(languageVariableContentType).fallback()) { languageValue = this.getValueFromDefaultLanguage(key, user, respectFrontendRoles, languageVariableContentType); } } } catch (DotDataException | DotSecurityException e) { <START> Logger.debug(this, String.format("Could not retrieve Language Variable '%s': %s", key, e.getMessage()), e); <END> } return (null != languageValue)? languageValue:key; }</code><technical_language>debug a supplier Logger.debug(this, ()-> String.format("Could retrieve Language Variable '%s': %s", key, e.getMessage()), e);</technical_language>

Target:
public String get(final String key, final long languageId, final User user, final boolean respectFrontendRoles) { if(!UtilMethods.isSet(key)) { return null; } String languageValue = null; try { final ContentType languageVariableContentType = APILocator.getContentTypeAPI(user).find(LANGUAGEVARIABLE); languageValue = this.getValueFromUserLanguage(key, languageId, user, respectFrontendRoles, languageVariableContentType); if (null == languageValue) { languageValue = this.getValueFromUserFallbackLanguage(key, languageId, user, respectFrontendRoles, languageVariableContentType); if (null == languageValue && languageVariableContentType instanceof MultilinguableFallback && MultilinguableFallback.class.cast(languageVariableContentType).fallback()) { languageValue = this.getValueFromDefaultLanguage(key, user, respectFrontendRoles, languageVariableContentType); } } } catch (DotDataException | DotSecurityException e) { Logger.debug(this, ()-> String.format("Could not retrieve Language Variable '%s': %s", key, e.getMessage(), e)); } return (null != languageValue)? languageValue:key; }
Source:
<code>private Navigator getNavigator() { <START> return BaseUI.getCurrent().getNavigator(); <END> }</code><technical_language>getCurrentNavigator</technical_language>

Target:
private Navigator getNavigator() { return BaseUI.getCurrentNavigator(); }
Source:
<code>public ListApplicationJson list( @QueryParam("query") final String query ) { Applications applications = this.applicationService.getInstalledApplications(); <START> <END> applications = this.sortApplications( applications ); applications = this.filterApplications( applications, query ); final ListApplicationJson json = new ListApplicationJson(); for ( final Application application : applications ) { final ApplicationKey applicationKey = application.getKey(); if ( !ApplicationKey.from( "com.enonic.xp.admin.ui" ).equals( applicationKey ) && !ApplicationKey.from( "com.enonic.xp.app.standardidprovider" ).equals( applicationKey ) ) { final SiteDescriptor siteDescriptor = this.siteService.getDescriptor( applicationKey ); final AuthDescriptor authDescriptor = this.authDescriptorService.getDescriptor( applicationKey ); final boolean localApplication = this.applicationService.isLocalApplication( applicationKey ); final ApplicationDescriptor appDescriptor = this.applicationDescriptorService.get( applicationKey ); json.add( application, localApplication, appDescriptor, siteDescriptor, authDescriptor, iconUrlResolver ); } } return json; }</code><technical_language>If sorting is done filtering items sort</technical_language>

Target:
public ListApplicationJson list( @QueryParam("query") final String query ) { Applications applications = this.applicationService.getInstalledApplications(); applications = this.filterApplications( applications, query ); applications = this.sortApplications( applications ); final ListApplicationJson json = new ListApplicationJson(); for ( final Application application : applications ) { final ApplicationKey applicationKey = application.getKey(); if ( !ApplicationKey.from( "com.enonic.xp.admin.ui" ).equals( applicationKey ) && !ApplicationKey.from( "com.enonic.xp.app.standardidprovider" ).equals( applicationKey ) ) { final SiteDescriptor siteDescriptor = this.siteService.getDescriptor( applicationKey ); final AuthDescriptor authDescriptor = this.authDescriptorService.getDescriptor( applicationKey ); final boolean localApplication = this.applicationService.isLocalApplication( applicationKey ); final ApplicationDescriptor appDescriptor = this.applicationDescriptorService.get( applicationKey ); json.add( application, localApplication, appDescriptor, siteDescriptor, authDescriptor, iconUrlResolver ); } } return json; }
Source:
<code>private boolean updateIsUsingScsiReservationRequested(LunDisk lunDisk) { <START> return getVmDeviceForVm().isUsingScsiReservation() != Boolean.TRUE.equals(lunDisk.isUsingScsiReservation()); <END> }</code><technical_language>this work. assume get null in lunDisk.isUsingScsiReservation() while getVmDeviceForVm().isUsingScsiReservation() is true. this method return true in line 411 get a NPE. code kind of similar code of updateReadOnlyRequested()</technical_language>

Target:
private boolean updateIsUsingScsiReservationRequested(LunDisk lunDisk) { Boolean isUsingScsiReservationNewValue = lunDisk.isUsingScsiReservation(); return isUsingScsiReservationNewValue != null && getVmDeviceForVm().isUsingScsiReservation() != isUsingScsiReservationNewValue; }
Source:
<code>KafkaBasedLog<String, byte[]> setupAndCreateKafkaBasedLog(String topic, final WorkerConfig config) { Map<String, Object> originals = config.originals(); Map<String, Object> producerProps = new HashMap<>(originals); producerProps.put(ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG, StringSerializer.class.getName()); producerProps.put(ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG, ByteArraySerializer.class.getName()); producerProps.put(ProducerConfig.DELIVERY_TIMEOUT_MS_CONFIG, Integer.MAX_VALUE); Map<String, Object> consumerProps = new HashMap<>(originals); consumerProps.put(ConsumerConfig.KEY_DESERIALIZER_CLASS_CONFIG, StringDeserializer.class.getName()); consumerProps.put(ConsumerConfig.VALUE_DESERIALIZER_CLASS_CONFIG, ByteArrayDeserializer.class.getName()); Map<String, Object> adminProps = new HashMap<>(originals); <START> Map<String, Object> topicSettings = null; if (config instanceof DistributedConfig) { topicSettings = ((DistributedConfig) config).configStorageTopicSettings(); } <END> NewTopic topicDescription = TopicAdmin.defineTopic(topic) .config(topicSettings) .compacted() .partitions(1) .replicationFactor(config.getShort(DistributedConfig.CONFIG_STORAGE_REPLICATION_FACTOR_CONFIG)) .build(); return createKafkaBasedLog(topic, producerProps, consumerProps, new ConsumeCallback(), topicDescription, adminProps); }</code><technical_language>suggestion Map<String, Object> topicSettings = config instanceof DistributedConfig ? ((DistributedConfig) config).configStorageTopicSettings() : Collections.emptyMap(); I TopicAdmin#defineTopic checks for null, I null collections is do optimization matters. Wdyt? (btw ternary operator, I added suggestion clear). Also, if change here, please change in other files too</technical_language>

Target:
KafkaBasedLog<String, byte[]> setupAndCreateKafkaBasedLog(String topic, final WorkerConfig config) { Map<String, Object> originals = config.originals(); Map<String, Object> producerProps = new HashMap<>(originals); producerProps.put(ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG, StringSerializer.class.getName()); producerProps.put(ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG, ByteArraySerializer.class.getName()); producerProps.put(ProducerConfig.DELIVERY_TIMEOUT_MS_CONFIG, Integer.MAX_VALUE); Map<String, Object> consumerProps = new HashMap<>(originals); consumerProps.put(ConsumerConfig.KEY_DESERIALIZER_CLASS_CONFIG, StringDeserializer.class.getName()); consumerProps.put(ConsumerConfig.VALUE_DESERIALIZER_CLASS_CONFIG, ByteArrayDeserializer.class.getName()); Map<String, Object> adminProps = new HashMap<>(originals); Map<String, Object> topicSettings = config instanceof DistributedConfig ? ((DistributedConfig) config).configStorageTopicSettings() : Collections.emptyMap(); NewTopic topicDescription = TopicAdmin.defineTopic(topic) .config(topicSettings) .compacted() .partitions(1) .replicationFactor(config.getShort(DistributedConfig.CONFIG_STORAGE_REPLICATION_FACTOR_CONFIG)) .build(); return createKafkaBasedLog(topic, producerProps, consumerProps, new ConsumeCallback(), topicDescription, adminProps); }
Source:
<code>public SAMRecord next() { final SAMRecord result = wrappedIterator.next(); if (checker != null) { final SAMRecord previous = checker.getPreviousRecord(); if (!checker.isSorted(result)) { throw new IllegalStateException(String.format( "Records %s should come after %s when sorting with %s", <START> checker.getSortKey(previous), <END> checker.getSortKey(result), checker.getSortOrder())); } } return result; }</code><technical_language>call toString SAMRecords here</technical_language>

Target:
public SAMRecord next() { final SAMRecord result = wrappedIterator.next(); if (checker != null) { final SAMRecord previous = checker.getPreviousRecord(); if (!checker.isSorted(result)) { throw new IllegalStateException(String.format( "Record %s should come after %s when sorting with %s ordering.", previous.getSAMString().trim(), result.getSAMString().trim(), checker.getSortOrder())); } } return result; }
Source:
<code>private EventData setSpanContext(EventData event, Context parentContext) { Context eventSpanContext = tracerProvider.startSpan(parentContext, ProcessKind.MESSAGE); if (eventSpanContext != null) { Optional<Object> eventDiagnosticIdOptional = eventSpanContext.getData(DIAGNOSTIC_ID_KEY); if (eventDiagnosticIdOptional.isPresent()) { <START> event.addProperty(DIAGNOSTIC_ID_KEY, eventDiagnosticIdOptional.get().toString()); <END> tracerProvider.endSpan(eventSpanContext, Signal.complete()); event.addContext(SPAN_CONTEXT_KEY, eventSpanContext); } } return event; }</code><technical_language>if message diagnostic-id? create message span stamp context message</technical_language>

Target:
private EventData setSpanContext(EventData event, Context parentContext) { Optional<Object> eventContextData = event.getContext().getData(SPAN_CONTEXT_KEY); if (eventContextData.isPresent()) { return event; } else { Context eventSpanContext = tracerProvider.startSpan(parentContext, ProcessKind.MESSAGE); if (eventSpanContext != null) { Optional<Object> eventDiagnosticIdOptional = eventSpanContext.getData(DIAGNOSTIC_ID_KEY); if (eventDiagnosticIdOptional.isPresent()) { event.addProperty(DIAGNOSTIC_ID_KEY, eventDiagnosticIdOptional.get().toString()); tracerProvider.endSpan(eventSpanContext, Signal.complete()); event.addContext(SPAN_CONTEXT_KEY, eventSpanContext); } } } return event; }
Source:
<code>private String getYearCharacters(String label) { if (label != null) { int labelCPCount = label.codePointCount(0, label.length()); if (labelCPCount >= 4) { return label.substring(0, label.offsetByCodePoints(0, 4)); <START> } <END> } return null; }</code><technical_language>need change here, is for Date type</technical_language>

Target:
private String getYearCharacters(String label) { if (label != null && label.length() >= 4) { return label.substring(0, 4); } return null; }
Source:
<code>private int getKeepAliveTimeout(String keepAlive) { int keepAliveTimeout = -1; <START> String timeout = keepAlive.split(KEEP_ALIVE_TIMEOUT)[1]; <END> int commaIndex = timeout.indexOf(','); if (commaIndex != -1) { timeout = timeout.substring(0, commaIndex); } try { keepAliveTimeout = Integer.parseInt(timeout) * 1000; } catch (NumberFormatException e) { log.error("Error parsing value " + timeout + " as connection keep-alive timeout.", e); } return keepAliveTimeout; }</code><technical_language>happen if is "timeout=" ? [1] element give array index out of bound exception, it</technical_language>

Target:
private int getKeepAliveTimeout(String keepAlive) { int keepAliveTimeout = -1; String timeout; try { timeout = keepAlive.split(KEEP_ALIVE_TIMEOUT)[1]; } catch (ArrayIndexOutOfBoundsException ex) { log.error("Value is not specified in KeepAlive Timeout header."); return -1; } int commaIndex = timeout.indexOf(','); if (commaIndex != -1) { timeout = timeout.substring(0, commaIndex); } try { keepAliveTimeout = Integer.parseInt(timeout) * 1000; } catch (NumberFormatException e) { log.error("Error parsing value " + timeout + " as connection keep-alive timeout.", e); } return keepAliveTimeout; }
Source:
<code>private void addGroundOverlayToMap(String groundOverlayUrl, HashMap<KmlGroundOverlay, GroundOverlay> groundOverlays, boolean containerVisibility) { BitmapDescriptor groundOverlayBitmap = BitmapDescriptorFactory .fromBitmap(getImagesCache().get(groundOverlayUrl)); for (KmlGroundOverlay kmlGroundOverlay : groundOverlays.keySet()) { if (kmlGroundOverlay.getImageUrl().equals(groundOverlayUrl)) { GroundOverlayOptions groundOverlayOptions = kmlGroundOverlay.getGroundOverlayOptions() .image(groundOverlayBitmap); GroundOverlay mapGroundOverlay = attachGroundOverlay(groundOverlayOptions); <START> if (containerVisibility == false) { <END> mapGroundOverlay.setVisible(false); } groundOverlays.put(kmlGroundOverlay, mapGroundOverlay); } } }</code><technical_language>for code style, match other places this !containerVisibility</technical_language>

Target:
private void addGroundOverlayToMap(String groundOverlayUrl, HashMap<KmlGroundOverlay, GroundOverlay> groundOverlays, boolean containerVisibility) { BitmapDescriptor groundOverlayBitmap = BitmapDescriptorFactory .fromBitmap(getImagesCache().get(groundOverlayUrl)); for (KmlGroundOverlay kmlGroundOverlay : groundOverlays.keySet()) { if (kmlGroundOverlay.getImageUrl().equals(groundOverlayUrl)) { GroundOverlayOptions groundOverlayOptions = kmlGroundOverlay.getGroundOverlayOptions() .image(groundOverlayBitmap); GroundOverlay mapGroundOverlay = attachGroundOverlay(groundOverlayOptions); if (!containerVisibility) { mapGroundOverlay.setVisible(false); } groundOverlays.put(kmlGroundOverlay, mapGroundOverlay); } } }
Source:
<code>public void loadPreviewImage(JLabel bp, Entity entity, IPlayer player) { Image camo = CamoManager.getPlayerCamoImage(player); <START> if (entity.getCamoCategory() != null && !entity.getCamoCategory().equals(IPlayer.NO_CAMO)) { <END> camo = CamoManager.getEntityCamoImage(entity); } int tint = PlayerColors.getColorRGB(player.getColorIndex()); bp.setIcon(new ImageIcon(bv.getTilesetManager().loadPreviewImage( entity, camo, tint, bp))); }</code><technical_language>suggestion if ((entity.getCamoCategory() != null) && !entity.getCamoCategory().equals(IPlayer.NO_CAMO)) {</technical_language>

Target:
public void loadPreviewImage(JLabel bp, Entity entity, IPlayer player) { Image camo = CamoManager.getPlayerCamoImage(player); if ((entity.getCamoCategory() != null) && !entity.getCamoCategory().equals(IPlayer.NO_CAMO)) { camo = CamoManager.getEntityCamoImage(entity); } int tint = PlayerColors.getColorRGB(player.getColorIndex()); bp.setIcon(new ImageIcon(bv.getTilesetManager().loadPreviewImage( entity, camo, tint, bp))); }
Source:
<code>protected String buildLargeQuery() { StringBuilder qb = new StringBuilder(); qb.append("SELECT"); qb.append(" '"); for (int i = 0; i < BYTES_PER_ROW; i++) { qb.append('a'); } qb.append("' "); qb.append("FROM generate_series(1, "); qb.append(LARGE_QUERY_ROW_COUNT); qb.append(") s(i)"); <START> log.info( <END> "Large query will generate " + MAX_MEMORY + " bytes across " + LARGE_QUERY_ROW_COUNT + " rows" ); return qb.toString(); }</code><technical_language>This is a silly log message, i i left in</technical_language>

Target:
protected String buildLargeQuery() { StringBuilder qb = new StringBuilder(); qb.append("SELECT"); qb.append(" '"); for (int i = 0; i < BYTES_PER_ROW; i++) { qb.append('a'); } qb.append("' "); qb.append("FROM generate_series(1, "); qb.append(LARGE_QUERY_ROW_COUNT); qb.append(") s(i)"); return qb.toString(); }
Source:
<code>private void onConfigChanged(@SuppressWarnings("unused") ConfigChangeEvent event) { boolean schemaEnabledBefore = isSchemaEnabled(); boolean tokenMapEnabledBefore = tokenMapEnabled; List<String> keyspacesBefore = this.refreshedKeyspaces; this.schemaEnabledInConfig = config.getBoolean(DefaultDriverOption.METADATA_SCHEMA_ENABLED); this.refreshedKeyspaces = config.getStringList( DefaultDriverOption.METADATA_SCHEMA_REFRESHED_KEYSPACES, Collections.emptyList()); this.tokenMapEnabled = config.getBoolean(DefaultDriverOption.METADATA_TOKEN_MAP_ENABLED); if ((!schemaEnabledBefore || !keyspacesBefore.equals(refreshedKeyspaces) || (!tokenMapEnabledBefore && tokenMapEnabled)) && isSchemaEnabled()) { refreshSchema(null, false, true) .whenComplete( (metadata, error) -> { if (error != null) { Loggers.warnWithException( LOG, <START> "[{}] Unexpected error while refreshing schema after it was re-enabled " <END> + "in the configuration, keeping the previous version", logPrefix, error); } }); } }</code><technical_language>Nit: call sites Unexpected error while... CqlRequestHandler Error while...</technical_language>

Target:
private void onConfigChanged(@SuppressWarnings("unused") ConfigChangeEvent event) { boolean schemaEnabledBefore = isSchemaEnabled(); boolean tokenMapEnabledBefore = tokenMapEnabled; List<String> keyspacesBefore = this.refreshedKeyspaces; this.schemaEnabledInConfig = config.getBoolean(DefaultDriverOption.METADATA_SCHEMA_ENABLED); this.refreshedKeyspaces = config.getStringList( DefaultDriverOption.METADATA_SCHEMA_REFRESHED_KEYSPACES, Collections.emptyList()); this.tokenMapEnabled = config.getBoolean(DefaultDriverOption.METADATA_TOKEN_MAP_ENABLED); if ((!schemaEnabledBefore || !keyspacesBefore.equals(refreshedKeyspaces) || (!tokenMapEnabledBefore && tokenMapEnabled)) && isSchemaEnabled()) { refreshSchema(null, false, true) .whenComplete( (metadata, error) -> { if (error != null) { Loggers.warnWithException( LOG, "[{}] Unexpected error while refreshing schema after it was re-enabled " + "in the configuration, keeping previous version", logPrefix, error); } }); } }
Source:
<code><START> public int hashCode() { <END> final int prime = 31; int result = 1; result = prime * result + ((attributeName == null) ? 0 : attributeName.hashCode()); return result; }</code><technical_language>hashCode() equals() consider super. codegen correctly in Eclipse, apply codegen AbstractQuery, save file, apply codegen AttributeQuery. find generated methods AbstractQuery correctly includes super</technical_language>

Target:
public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + ((attributeName == null) ? 0 : attributeName.hashCode()); return result; }
Source:
<code>private static void removeExistingData() { try { for (int i = 0; i < TEST_DATA_KEYS.length; i++) { voltClient.delete(TABLE_NAME, TEST_DATA_KEYS[i]); } for (int i = 0; i < SCAN_RECORD_COUNT; i++) { voltClient.delete(TABLE_NAME, SCAN_KEY_PREFIX + i); } } catch (Exception e) { <START> e.printStackTrace(); <END> fail("Failed removeExistingData"); } }</code><technical_language>a logger instead of calling printStackTrace directly</technical_language>

Target:
private static void removeExistingData() { try { for (int i = 0; i < TEST_DATA_KEYS.length; i++) { voltClient.delete(TABLE_NAME, TEST_DATA_KEYS[i]); } for (int i = 0; i < SCAN_RECORD_COUNT; i++) { voltClient.delete(TABLE_NAME, SCAN_KEY_PREFIX + i); } } catch (Exception e) { Logger logger = LoggerFactory.getLogger(VoltDBClientTest.class); logger.error("Error while calling 'removeExistingData()'", e); fail("Failed removeExistingData"); } }