auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private HashMap<String, Container> createIDTable(List<EmailMessage> emailMessages) { HashMap<String, Container> id_table = new HashMap<>(); for (EmailMessage message : emailMessages) { String messageID = message.getMessageID(); Container container = id_table.get(messageID); if (container != null) { <START> if (container.hasMessage()) { <END> messageID = String.format("<Bogus-id: %d >", bogus_id_count++); container = null; } else { container.setMessage(message); } } if (container == null) { container = new Container(message); id_table.put(messageID, container); } processMessageReferences(message, container, id_table); } return id_table; }</code><technical_language>In scenario a Container in map a message</technical_language>

Target:
private Map<String, EmailContainer> createIDTable(List<EmailMessage> emailMessages) { HashMap<String, EmailContainer> id_table = new HashMap<>(); for (EmailMessage message : emailMessages) { String messageID = message.getMessageID(); EmailContainer container = id_table.get(messageID); if (container != null) { if (container.hasMessage()) { messageID = String.format("<Bogus-id: %d >", bogus_id_count++); container = null; } else { container.setMessage(message); } } if (container == null) { container = new EmailContainer(message); id_table.put(messageID, container); } processMessageReferences(message, container, id_table); } return id_table; }
Source:
<code>private void printPrincipalRecord(ExtMap extMap) { if (extMap != null) { <START> logger.info(String.format("PrincipalRecord: ID %s, name: %s, display name: %s, email: %s, first name: %s, last name: %s, department: %s, title: %s", <END> extMap.get(Authz.PrincipalRecord.ID, ""), extMap.get(Authz.PrincipalRecord.NAME, ""), extMap.get(Authz.PrincipalRecord.DISPLAY_NAME, ""), extMap.get(Authz.PrincipalRecord.EMAIL, ""), extMap.get(Authz.PrincipalRecord.FIRST_NAME, ""), extMap.get(Authz.PrincipalRecord.LAST_NAME, ""), extMap.get(Authz.PrincipalRecord.DEPARTMENT, ""), extMap.get(Authz.PrincipalRecord.TITLE, "") )); logger.info("Groups of PrincipalRecord: "); for (ExtMap group : extMap.get(Authz.PrincipalRecord.GROUPS, Collections.<ExtMap> emptyList())) { printGroupRecord(group); } logger.info("End of groups of PrincipalRecord: "); } }</code><technical_language>missing NAMESPACE</technical_language>

Target:
private void printPrincipalRecord(ExtMap extMap) { if (extMap != null) { logger.info( String.format( "PrincipalRecord: ID '%s', name: '%s', principal: '%s', namespace: '%s', display name: '%s', email: '%s', first name: '%s', last name: '%s', department: '%s', title: '%s'", extMap.get(Authz.PrincipalRecord.ID, ""), extMap.get(Authz.PrincipalRecord.NAME, ""), extMap.get(Authz.PrincipalRecord.PRINCIPAL, ""), extMap.get(Authz.PrincipalRecord.NAMESPACE, ""), extMap.get(Authz.PrincipalRecord.DISPLAY_NAME, ""), extMap.get(Authz.PrincipalRecord.EMAIL, ""), extMap.get(Authz.PrincipalRecord.FIRST_NAME, ""), extMap.get(Authz.PrincipalRecord.LAST_NAME, ""), extMap.get(Authz.PrincipalRecord.DEPARTMENT, ""), extMap.get(Authz.PrincipalRecord.TITLE, "") ) ) ; logger.info("Groups of PrincipalRecord: "); for (ExtMap group : extMap.get(Authz.PrincipalRecord.GROUPS, Collections.<ExtMap> emptyList())) { printGroupRecord(group); } logger.info("End of groups of PrincipalRecord: "); } }
Source:
<code>public void initialize(Context context) { context.registerSyntaxNodeConsumer(Tree.Kind.CLASSDEF, ctx -> { <START> PyClassDefTree pyClassDefTree = ((PyClassDefTree) ctx.syntaxNode()); <END> PyNameTree classNameTree = pyClassDefTree.name(); String className = classNameTree.name(); if(!pattern().matcher(className).matches()) { String message = String.format(MESSAGE, className, format); ctx.addIssue(classNameTree, message); } }); }</code><technical_language>unecessary parentheses</technical_language>

Target:
public void initialize(Context context) { context.registerSyntaxNodeConsumer(Tree.Kind.CLASSDEF, ctx -> { PyClassDefTree pyClassDefTree = (PyClassDefTree) ctx.syntaxNode(); PyNameTree classNameTree = pyClassDefTree.name(); String className = classNameTree.name(); if(!pattern().matcher(className).matches()) { String message = String.format(MESSAGE, className, format); ctx.addIssue(classNameTree, message); } }); }
Source:
<code>private static boolean isOptionalProperty(Class beanClass, PropertyDescriptor beanProp) { Field field = getField(beanClass, beanProp.getName()); if (field == null) { <START> throw new ConfigException.BadBean("Bean property '" + beanProp + "' of class " + beanClass.getName() + " does not exist"); <END> } return (field.getAnnotationsByType(Optional.class).length > 0); }</code><technical_language>this this exception possible? get beanProp if field</technical_language>

Target:
private static boolean isOptionalProperty(Class beanClass, PropertyDescriptor beanProp) { Field field = getField(beanClass, beanProp.getName()); return (field.getAnnotationsByType(Optional.class).length > 0); }
Source:
<code>public void drawLevel(Graphics g2) { g2.setColor(new Color(200, 200, 255)); g2.fillRect(3 * CELL_NUMBER + 1, 11 * CELL_NUMBER + 1, 14 * CELL_NUMBER - 1, CELL_NUMBER - 1); g2.setColor(new Color(0, 100, 20)); g2.drawString("levels", 170, 236); g2.setColor(new Color(200, 100, 255)); g2.fillRect(3 * CELL_NUMBER + 1, 12 * CELL_NUMBER + 1, 5 * CELL_NUMBER - 1, CELL_NUMBER - 1); g2.setColor(new Color(100, 100, 255)); g2.fillRect(8 * CELL_NUMBER + 1, 12 * CELL_NUMBER + 1, 4 * CELL_NUMBER - 1, CELL_NUMBER - 1); g2.setColor(new Color(50, 100, 255)); g2.fillRect(12 * CELL_NUMBER + 1, 12 * CELL_NUMBER + 1, 5 * CELL_NUMBER - 1, CELL_NUMBER - 1); addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent e) { if (status == 0) { if (e.getButton() == MouseEvent.BUTTON1) { int x = e.getX(); int y = e.getY(); if (x > 3 * CELL_NUMBER & y > 12 * CELL_NUMBER & x < 8 * CELL_NUMBER & y < <START> 13 * <END> CELL_NUMBER) { first.start(); level = Level.first; status = 2; auto = 0; } if (x > 8 * CELL_NUMBER & y > 12 * CELL_NUMBER & x < 12 * CELL_NUMBER & y < 13 * CELL_NUMBER) { second.start(); level = Level.second; status = 2; auto = 0; } if (x > 12 * CELL_NUMBER & y > 12 * CELL_NUMBER & x < 17 * CELL_NUMBER & y < 13 * CELL_NUMBER) { third.start(); level = Level.third; status = 2; auto = 0; } } } } }); }</code><technical_language>define this magic numbers</technical_language>

Target:
public void drawLevel(Graphics g2) { g2.setColor(new Color(200, 200, 255)); g2.fillRect(LEFT_SIDE * CELL_NUMBER + 1, 11 * CELL_NUMBER + 1, 14 * CELL_NUMBER - 1, CELL_NUMBER - 1); g2.setColor(new Color(0, 100, 20)); g2.drawString("levels", 170, 236); g2.setColor(new Color(200, 100, 255)); g2.fillRect(LEFT_SIDE * CELL_NUMBER + 1, FOR_DRAW * CELL_NUMBER + 1, 5 * CELL_NUMBER - 1, CELL_NUMBER - 1); g2.setColor(new Color(100, 100, 255)); g2.fillRect(8 * CELL_NUMBER + 1, FOR_DRAW * CELL_NUMBER + 1, 4 * CELL_NUMBER - 1, CELL_NUMBER - 1); g2.setColor(new Color(50, 100, 255)); g2.fillRect(FOR_DRAW * CELL_NUMBER + 1, FOR_DRAW * CELL_NUMBER + 1, 5 * CELL_NUMBER - 1, CELL_NUMBER - 1); addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent e) { if (status == DISPLAYED_MENU) { if (e.getButton() == MouseEvent.BUTTON1) { int x = e.getX(); int y = e.getY(); if (x > LEFT_SIDE * CELL_NUMBER & y > FOR_DRAW * CELL_NUMBER & x < 8 * CELL_NUMBER & y < FOR_DRAW_LEVEL * CELL_NUMBER) { first.start(); level = Level.first; status = DISPLAYED_GAME; auto = false; } if (x > 8 * CELL_NUMBER & y > FOR_DRAW * CELL_NUMBER & x < FOR_DRAW * CELL_NUMBER & y < FOR_DRAW_LEVEL * CELL_NUMBER) { second.start(); level = Level.second; status = DISPLAYED_GAME; auto = false; } if (x > FOR_DRAW * CELL_NUMBER & y > FOR_DRAW * CELL_NUMBER & x < 17 * CELL_NUMBER & y < FOR_DRAW_LEVEL * CELL_NUMBER) { third.start(); level = Level.third; status = DISPLAYED_GAME; auto = false; } } } } }); }
Source:
<code>public FilterRegistrationBean corsFilter() { UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource(); CorsConfiguration config = new CorsConfiguration(); config.setAllowCredentials(true); <START> config.addAllowedOrigin("http://localhost:8888"); <END> config.addAllowedHeader("*"); config.addAllowedMethod("*"); source.registerCorsConfiguration("/*", config); FilterRegistrationBean bean = new FilterRegistrationBean(new CorsFilter(source)); bean.setOrder(0); return bean; }</code><technical_language>double check richard if want port number hardcoded? problem related specific port number</technical_language>

Target:
public FilterRegistrationBean corsFilter() { UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource(); CorsConfiguration config = new CorsConfiguration(); config.setAllowCredentials(true); config.addAllowedOrigin("http://localhost:8052"); config.addAllowedHeader("*"); config.addAllowedMethod("*"); source.registerCorsConfiguration("/*", config); FilterRegistrationBean bean = new FilterRegistrationBean(new CorsFilter(source)); bean.setOrder(0); return bean; }
Source:
<code>public void getJobsBySessionSeqIdAndStatus() { List<Job> jobsList = dao.getJobsBySessionSeqIdAndStatus(ENGINE_SESSION_SEQ_ID, JobExecutionStatus.STARTED); <START> assertTrue("Verify <END> jobs are associated with the engine-session-seq-ID and status", jobsList.size() == NUMBER_OF_JOBS_FOR_ENGINE_SESSION_SEQ_ID_AND_STATUS); }</code><technical_language>assertEquals("...", NUMBER_OF_JOBS_FOR_ENGINE_SESSION_SEQ_ID_AND_STATUS, jobsList.size()) a fit for asserting equal result</technical_language>

Target:
public void getJobsBySessionSeqIdAndStatus() { List<Job> jobsList = dao.getJobsBySessionSeqIdAndStatus(ENGINE_SESSION_SEQ_ID, JobExecutionStatus.STARTED); assertEquals("Verify jobs are associated with the engine-session-seq-ID and status", NUMBER_OF_JOBS_FOR_ENGINE_SESSION_SEQ_ID_AND_STATUS, jobsList.size()); }
Source:
<code>public void testInt32AnnotationsRejectNonInt32() { OriginalType[] types = new OriginalType[] { DATE, TIME_MILLIS, UINT_8, UINT_16, UINT_32, INT_8, INT_16, INT_32}; for (final OriginalType logicalType : types) { <START> PrimitiveTypeName[] nonBinary = new PrimitiveTypeName[]{ <END> BOOLEAN, INT64, INT96, DOUBLE, FLOAT, BINARY }; for (final PrimitiveTypeName type : nonBinary) { assertThrows("Should reject non-int32 type: " + type, IllegalStateException.class, new Callable<Type>() { @Override public Type call() throws Exception { return Types.required(type).as(logicalType).named("col"); } }); } assertThrows("Should reject non-int32 type: FIXED_LEN_BYTE_ARRAY", IllegalStateException.class, new Callable<Type>() { @Override public Type call() throws Exception { return Types.required(FIXED_LEN_BYTE_ARRAY).length(1) .as(logicalType).named("col"); } }); } }</code><technical_language>called nonInt32, in testInt64AnnotationsRejectNonInt64() below</technical_language>

Target:
public void testInt32AnnotationsRejectNonInt32() { OriginalType[] types = new OriginalType[] { DATE, TIME_MILLIS, UINT_8, UINT_16, UINT_32, INT_8, INT_16, INT_32}; for (final OriginalType logicalType : types) { PrimitiveTypeName[] nonInt32 = new PrimitiveTypeName[]{ BOOLEAN, INT64, INT96, DOUBLE, FLOAT, BINARY }; for (final PrimitiveTypeName type : nonInt32) { assertThrows("Should reject non-int32 type: " + type, IllegalStateException.class, new Callable<Type>() { @Override public Type call() throws Exception { return Types.required(type).as(logicalType).named("col"); } }); } assertThrows("Should reject non-int32 type: FIXED_LEN_BYTE_ARRAY", IllegalStateException.class, new Callable<Type>() { @Override public Type call() throws Exception { return Types.required(FIXED_LEN_BYTE_ARRAY).length(1) .as(logicalType).named("col"); } }); } }
Source:
<code>protected FlatFileSpecificationForProcessingPreSplitLines getFlatFileSpecificationForPreSplitLines() { if (flatFileSpecification == null) { throw new IllegalStateException("The flat file specification cannot be null"); } else if (!(flatFileSpecification instanceof FlatFileSpecificationForProcessingPreSplitLines)) { <START> throw new IllegalStateException("The given flat file specification does not support processing pre-split file lines"); <END> } return (FlatFileSpecificationForProcessingPreSplitLines) flatFileSpecification; }</code><technical_language>I exception include class type of flatFileSpecification instance of FlatFileSpecificationForProcessingPreSplitLines. extra detail future debugging</technical_language>

Target:
protected FlatFileSpecificationForProcessingPreSplitLines getFlatFileSpecificationForPreSplitLines() { if (flatFileSpecification == null) { throw new IllegalStateException("The flat file specification cannot be null"); } else if (!(flatFileSpecification instanceof FlatFileSpecificationForProcessingPreSplitLines)) { throw new IllegalStateException("The flat file specification of type " + flatFileSpecification.getClass().getName() + " is not an implementation of " + FlatFileSpecificationForProcessingPreSplitLines.class.getName()); } return (FlatFileSpecificationForProcessingPreSplitLines) flatFileSpecification; }
Source:
<code>protected boolean canDoAction() { if (getDisk() == null) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_DISK_NOT_EXIST); } if (getDiskType() == DiskStorageType.IMAGE) { <START> if (((DiskImage) getDisk()).getImageStatus() != ImageStatus.OK) { <END> return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_DISKS_LOCKED); } } if (getVm() == null) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_DISK_IS_NOT_VM_DISK); } if (isImageLockNeeded() && getVm().isRunningOrPaused()) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_VM_IS_RUNNING); } if (getVdsIdInPool() == null) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_NO_VDS_IN_POOL); } if (!validate(new StoragePoolValidator(getStoragePoolDao().get(getStoragePoolId())).isUp())) { return false; } return true; }</code><technical_language>nested "if" is part of upper "if" (the checks type) a && condition them? is safe cast DiskImage? if casting fails</technical_language>

Target:
protected boolean canDoAction() { if (getDisk() == null) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_DISK_NOT_EXIST); } if (getDiskType() == DiskStorageType.IMAGE) { if (((DiskImage) getDisk()).getImageStatus() != ImageStatus.OK) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_DISKS_LOCKED); } } if (getVm() == null) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_DISK_IS_NOT_VM_DISK); } if (isImageExclusiveLockNeeded() && getVm().isRunningOrPaused()) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_VM_IS_RUNNING); } if (getVdsIdInPool() == null) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_NO_VDS_IN_POOL); } if (!validate(new StoragePoolValidator(getStoragePoolDao().get(getStoragePoolId())).isUp())) { return false; } return true; }
Source:
<code>public HostVO findOneRandomRunningHostByHypervisor(HypervisorType type) { final QueryBuilder<HostVO> sc = QueryBuilder.create(HostVO.class); sc.and(sc.entity().getHypervisorType(), Op.EQ, type); sc.and(sc.entity().getType(),Op.EQ, Type.Routing); sc.and(sc.entity().getStatus(), Op.EQ, Status.Up); sc.and(sc.entity().getResourceState(), Op.EQ, ResourceState.Enabled); sc.and(sc.entity().getRemoved(), Op.NULL); List<HostVO> hosts = sc.list(); <START> if (hosts == null || hosts.isEmpty()) { <END> return null; } else { Collections.shuffle(hosts, new Random(System.currentTimeMillis())); return hosts.get(0); } }</code><technical_language>CollectionUtils.isEmpty</technical_language>

Target:
public HostVO findOneRandomRunningHostByHypervisor(HypervisorType type) { final QueryBuilder<HostVO> sc = QueryBuilder.create(HostVO.class); sc.and(sc.entity().getHypervisorType(), Op.EQ, type); sc.and(sc.entity().getType(),Op.EQ, Type.Routing); sc.and(sc.entity().getStatus(), Op.EQ, Status.Up); sc.and(sc.entity().getResourceState(), Op.EQ, ResourceState.Enabled); sc.and(sc.entity().getRemoved(), Op.NULL); List<HostVO> hosts = sc.list(); if (CollectionUtils.isEmpty(hosts)) { return null; } else { Collections.shuffle(hosts, new Random(System.currentTimeMillis())); return hosts.get(0); } }
Source:
<code>private AccessToken validateAccessToken(String token) { AccessToken accessToken; try { accessToken = connector.validateAccessToken(new AccessToken.Builder(token).build()); } catch (ConnectionInitializationException e) { LOGGER.warn(String.format("Unable to retrieve access token from auth-server %s: %s", authServerHome, e.getMessage())); throw e; } catch (UnauthorizedException e) { <START> LOGGER.warn("Error validating access token", e); <END> throw new InvalidTokenException("The provided access token is not valid", e); } return accessToken; }</code><technical_language>if in this commti I e consistent logging</technical_language>

Target:
private AccessToken validateAccessToken(String token) { AccessToken accessToken; try { accessToken = connector.validateAccessToken(new AccessToken.Builder(token).build()); } catch (ConnectionInitializationException e) { LOGGER.warn(String.format("Unable to retrieve access token from auth-server %s: %s", authServerHome, e.getMessage())); throw e; } catch (UnauthorizedException e) { LOGGER.warn(String.format("Unable to retrieve access token from auth-server: %s", e.getMessage())); throw new InvalidTokenException("The provided access token is not valid", e); } return accessToken; }
Source:
<code>public OutputWriter createOutputWriter() { List<String> headers = new ArrayList<String>(); for (int i = 0; i < columns.length; i++) { String columnName = getColumnHeader(i); headers.add(columnName); if (columnToBeSortedOn != null) { <START> if (columns[i].getName().equals(columnToBeSortedOn.getName())) { <END> indexOfColumnToBeSortedOn = i; } } } if (columnToBeSortedOn != null) { if (indexOfColumnToBeSortedOn == -1) { this.isColumnToBeSortedOnPresentInInput = false; indexOfColumnToBeSortedOn = columns.length; headers.add(columnToBeSortedOn.getName()); InputColumn<?>[] newColumns = new InputColumn<?>[columns.length + 1]; for (int i = 0; i < columns.length; i++) { newColumns[i] = columns[i]; } newColumns[columns.length] = columnToBeSortedOn; columns = newColumns; } } if (_targetFile == null) { try { initTempFile(); } catch (Exception e) { throw new RuntimeException(e); } } return CsvOutputWriterFactory.getWriter(_targetFile.getPath(), headers.toArray(new String[0]), separatorChar, quoteChar, escapeChar, includeHeader, columns); }</code><technical_language>I argue compare names, actual columns. I this is new in this PR, I bad :-P</technical_language>

Target:
public OutputWriter createOutputWriter() { List<String> headers = new ArrayList<String>(); for (int i = 0; i < columns.length; i++) { String columnName = getColumnHeader(i); headers.add(columnName); if (columnToBeSortedOn != null) { if (columns[i].equals(columnToBeSortedOn)) { indexOfColumnToBeSortedOn = i; } } } if (columnToBeSortedOn != null) { if (indexOfColumnToBeSortedOn == -1) { this.isColumnToBeSortedOnPresentInInput = false; indexOfColumnToBeSortedOn = columns.length; headers.add(columnToBeSortedOn.getName()); InputColumn<?>[] newColumns = new InputColumn<?>[columns.length + 1]; for (int i = 0; i < columns.length; i++) { newColumns[i] = columns[i]; } newColumns[columns.length] = columnToBeSortedOn; columns = newColumns; } } if (_targetFile == null) { try { initTempFile(); } catch (Exception e) { throw new RuntimeException(e); } } return CsvOutputWriterFactory.getWriter(_targetFile.getPath(), headers.toArray(new String[0]), separatorChar, quoteChar, escapeChar, includeHeader, columns); }
Source:
<code>public void memberRemoved(MemberEvent event) { <START> ILock hazelcastLock = Globals.getDefaultBaseServiceLocator().getService(HazelcastCore.class).getInstance().getLock("EJB-TIMER-LOCK"); <END> hazelcastLock.lock(); try { Collection<HZTimer> allTimers = pkCache.values(); Collection<HZTimer> removedTimers = new HashSet<>(); for (HZTimer timer : allTimers) { if (timer.getMemberName().equals(event.getServer())) { removedTimers.add(timer); } } if (!removedTimers.isEmpty()) { logger.log(Level.INFO, "==> Restoring Timers ... "); Collection<HZTimer> restored = _restoreTimers(removedTimers); for (HZTimer timer : restored) { pkCache.putAsync(timer.getKey().getTimerId(), timer); } logger.log(Level.INFO, "<== ... Timers Restored."); } } finally { hazelcastLock.unlock(); } }</code><technical_language>a field holding HazelcastCore passed constructor</technical_language>

Target:
public void memberRemoved(MemberEvent event) { ILock hazelcastLock = hazelcast.getLock("EJB-TIMER-LOCK"); hazelcastLock.lock(); try { Collection<HZTimer> allTimers = pkCache.values(); Collection<HZTimer> removedTimers = new HashSet<>(); for (HZTimer timer : allTimers) { if (timer.getMemberName().equals(event.getServer())) { removedTimers.add(timer); } } if (!removedTimers.isEmpty()) { logger.log(Level.INFO, "==> Restoring Timers ... "); Collection<HZTimer> restored = _restoreTimers(removedTimers); for (HZTimer timer : restored) { pkCache.put(timer.getKey().getTimerId(), timer); } logger.log(Level.INFO, "<== ... Timers Restored."); } } finally { hazelcastLock.unlock(); } }
Source:
<code>private void display() throws Failure { final PrintWriter stdout = toPrintWriter(out); try { for (final Project p : db.projects().all()) { if (p.getNameKey().equals(wildProject)) { continue; } final ProjectState e = projectCache.get(p.getNameKey()); if (e != null && e.controlFor(currentUser).isVisible()) { if (showBranch != null) { ObjectId id = getObjectIdForBranch(p.getNameKey(), showBranch); if (id != null) { stdout.print(id.name() + " "); <START> stdout.print(p.getName()); <END> stdout.println(); } } } } catch (OrmException e) { throw new Failure(1, "fatal: database error", e); } finally { stdout.flush(); } } }</code><technical_language>if -b use, display now? a breakage</technical_language>

Target:
private void display() throws Failure { final PrintWriter stdout = toPrintWriter(out); try { for (final Project p : db.projects().all()) { if (p.getNameKey().equals(wildProject)) { continue; } final ProjectState e = projectCache.get(p.getNameKey()); if (e != null && e.controlFor(currentUser).isVisible()) { if (showBranch != null) { ObjectId id = getObjectIdForBranch(p.getNameKey(), showBranch); if (id != null) { stdout.print(id.name() + " "); stdout.print(p.getName()); stdout.println(); } } else { stdout.print(p.getName()); stdout.println(); } } } } catch (OrmException e) { throw new Failure(1, "fatal: database error", e); } finally { stdout.flush(); } }
Source:
<code>protected int doWork() { <START> if (EXPECT_ALL_READ_GROUPS_TO_MATCH) EXPECT_ALL_GROUPS_TO_MATCH = EXPECT_ALL_READ_GROUPS_TO_MATCH; <END> if (CROSSCHECK_LIBRARIES) { CROSSCHECK_BY = CrosscheckMetric.DataType.LIBRARY; } else if (CROSSCHECK_SAMPLES) { CROSSCHECK_BY = CrosscheckMetric.DataType.SAMPLE; } else { CROSSCHECK_BY = CrosscheckMetric.DataType.READGROUP; MATRIX_OUTPUT = OUTPUT; OUTPUT = new File("/dev/null"); } return super.doWork(); }</code><technical_language>this is java { } body. other options migrated base class original names. original name incorrect? is longer specific read groups</technical_language>

Target:
protected int doWork() { if (EXPECT_ALL_READ_GROUPS_TO_MATCH) { EXPECT_ALL_GROUPS_TO_MATCH = EXPECT_ALL_READ_GROUPS_TO_MATCH; } if (CROSSCHECK_LIBRARIES) { CROSSCHECK_BY = CrosscheckMetric.DataType.LIBRARY; } else if (CROSSCHECK_SAMPLES) { CROSSCHECK_BY = CrosscheckMetric.DataType.SAMPLE; } else { CROSSCHECK_BY = CrosscheckMetric.DataType.READGROUP; MATRIX_OUTPUT = OUTPUT; OUTPUT = new File("/dev/null"); } return super.doWork(); }
Source:
<code>public RunResult runTests(Path path) { ProcessRunner runner = new ProcessRunner(getTestCommand(), path); try { runner.call(); } catch (Exception e) { log.error(CANNOT_RUN_TESTS_MESSAGE, e); } try { return new RTestResultParser(path).parse(); } catch (IOException e) { log.error(CANNOT_PARSE_TEST_RESULTS_MESSAGE, e); } return null; <START> } <END></code><technical_language>if running tests fails is a results file in directory? worried this failing silently showing previous run's results user</technical_language>

Target:
public RunResult runTests(Path path) { ProcessRunner runner = new ProcessRunner(getTestCommand(), path); try { runner.call(); } catch (Exception e) { log.error(CANNOT_RUN_TESTS_MESSAGE, e); return getGenericErrorRunResult(e); } try { return new RTestResultParser(path).parse(); } catch (IOException e) { log.error(CANNOT_PARSE_TEST_RESULTS_MESSAGE, e); return getGenericErrorRunResult(e); } }
Source:
<code>public TmfSimpleTimestamp(final ITmfTimestamp timestamp) { <START> super(timestamp.getValue(), 0, 0); <END> }</code><technical_language>call normalize() ITmfTimestamp parameter a scale != 0 convertible a TmfSimpleTimestamp (where scale == 0). assume original precision is important if caller specifically invokes this constructor</technical_language>

Target:
public TmfSimpleTimestamp(final ITmfTimestamp timestamp) { super(timestamp.normalize(0, ITmfTimestamp.SECOND_SCALE).getValue(), 0, 0); }
Source:
<code>public void readWithWrongPayloadFormat() throws Exception{ KryoMessageConverter kryoMessageConverter = new KryoMessageConverter(null,true); Message message = MessageBuilder.withPayload("foo").setHeader(MessageHeaders.CONTENT_TYPE,KryoMessageConverter.KRYO_MIME_TYPE+";type=java.lang.String").build(); <START> Object result = kryoMessageConverter.fromMessage(message,String.class); <END> }</code><technical_language>unused result variable. remove I guess</technical_language>

Target:
public void readWithWrongPayloadFormat() throws Exception{ KryoMessageConverter kryoMessageConverter = new KryoMessageConverter(null,true); Message message = MessageBuilder.withPayload("foo").setHeader(MessageHeaders.CONTENT_TYPE,KryoMessageConverter.KRYO_MIME_TYPE+";type=java.lang.String").build(); kryoMessageConverter.fromMessage(message,String.class); }
Source:
<code>public void run() { Future<?> future = null; try { <START> attemptCounter.increment(); <END> future = executor.submit(task); threadPoolLevelGauge.set((long) executor.getActiveCount()); future.get(timeoutMillis, TimeUnit.MILLISECONDS); delay.set(timeoutMillis); threadPoolLevelGauge.set((long) executor.getActiveCount()); } catch (TimeoutException e) { logger.warn("task supervisor timed out", e); timeoutCounter.increment(); long currentDelay = delay.get(); long newDelay = Math.min(maxDelay, currentDelay * 2); delay.compareAndSet(currentDelay, newDelay); } catch (RejectedExecutionException e) { if (executor.isShutdown() || scheduler.isShutdown()) { logger.warn("task supervisor shutting down, reject the task", e); } else { logger.warn("task supervisor rejected the task", e); } rejectedCounter.increment(); } catch (Throwable e) { if (executor.isShutdown() || scheduler.isShutdown()) { logger.warn("task supervisor shutting down, can't accept the task"); } else { logger.warn("task supervisor threw an exception", e); } throwableCounter.increment(); } finally { if (future != null) { future.cancel(true); } if (!scheduler.isShutdown()) { scheduler.schedule(this, delay.get(), TimeUnit.MILLISECONDS); } } }</code><technical_language>instead of attempt counter, a completion counter future.get()? state (success|timeout|reject|throwable) is measured is a similar way</technical_language>

Target:
public void run() { Future<?> future = null; try { future = executor.submit(task); threadPoolLevelGauge.set((long) executor.getActiveCount()); future.get(timeoutMillis, TimeUnit.MILLISECONDS); delay.set(timeoutMillis); threadPoolLevelGauge.set((long) executor.getActiveCount()); successCounter.increment(); } catch (TimeoutException e) { logger.warn("task supervisor timed out", e); timeoutCounter.increment(); long currentDelay = delay.get(); long newDelay = Math.min(maxDelay, currentDelay * 2); delay.compareAndSet(currentDelay, newDelay); } catch (RejectedExecutionException e) { if (executor.isShutdown() || scheduler.isShutdown()) { logger.warn("task supervisor shutting down, reject the task", e); } else { logger.warn("task supervisor rejected the task", e); } rejectedCounter.increment(); } catch (Throwable e) { if (executor.isShutdown() || scheduler.isShutdown()) { logger.warn("task supervisor shutting down, can't accept the task"); } else { logger.warn("task supervisor threw an exception", e); } throwableCounter.increment(); } finally { if (future != null) { future.cancel(true); } if (!scheduler.isShutdown()) { scheduler.schedule(this, delay.get(), TimeUnit.MILLISECONDS); } } }
Source:
<code>public String toString() { try { if (diff == null) { log.error("Diff null"); return "--Diff null--"; } String diffString = ""; try { diffString = diff.toString(); } catch (Exception e) { log.error("Error when printing diff result: " + e.getMessage()); e.printStackTrace(); diffString = "wrong diff"; } String resultString = "\n----For Diff:" + diffString + "\n: number instances found: " + instances.size(); for (ChangePatternInstance instance : instances) { resultString += "\n" + instance.toString(); } <START> log.info(resultString += "\n----"); <END> } catch (Exception e) { e.printStackTrace(); } log.info("--Diff ex--"); return "--Diff ex--"; }</code><technical_language>undo this. a toString remains is, remove call tostring instead</technical_language>

Target:
public String toString() { try { if (diff == null) { log.error("Diff null"); return "--Diff null--"; } String diffString = ""; try { diffString = diff.toString(); } catch (Exception e) { log.error("Error when printing diff result: " + e.getMessage()); e.printStackTrace(); diffString = "wrong diff"; } String resultString = "\n----For Diff:" + diffString + "\n: number instances found: " + instances.size(); for (ChangePatternInstance instance : instances) { resultString += "\n" + instance.toString(); } return resultString += "\n----"; } catch (Exception e) { e.printStackTrace(); } return "--Diff ex--"; }
Source:
<code>public Pipeline processPipeline(Pipeline inputPipeline) { Trigger inputTrigger = inputPipeline.getTrigger(); if (inputTrigger == null) { return inputPipeline; <START> } else { <END> Trigger augmentedTrigger = addBuildInfo(inputTrigger); return inputPipeline.withTrigger(augmentedTrigger); } }</code><technical_language>else needed</technical_language>

Target:
public Pipeline processPipeline(Pipeline inputPipeline) { Trigger inputTrigger = inputPipeline.getTrigger(); if (inputTrigger == null) { return inputPipeline; } Trigger augmentedTrigger = addBuildInfo(inputTrigger); return inputPipeline.withTrigger(augmentedTrigger); }
Source:
<code>private static DescribeGroupsResponseData prepareDescribeGroupsResponseData(String groupId, List<String> groupInstances, List<TopicPartition> topicPartitions) { final ByteBuffer memberAssignment = ConsumerProtocol.serializeAssignment(new ConsumerPartitionAssignor.Assignment(topicPartitions)); byte[] memberAssignmentBytes = new byte[memberAssignment.remaining()]; <START> List<DescribedGroupMember> describedGroupMembers = groupInstances.stream().map(groupInstance -> DescribeGroupsResponse.groupMember("0", groupInstance, "clientId0", "clientHost", memberAssignmentBytes, null)).collect(Collectors.toList()); <END> DescribeGroupsResponseData data = new DescribeGroupsResponseData(); data.groups().add(DescribeGroupsResponse.groupMetadata( groupId, Errors.NONE, "", ConsumerProtocol.PROTOCOL_TYPE, "", describedGroupMembers, Collections.emptySet())); return data; }</code><technical_language>nit: set "0" JoinGroupRequest.UNKNOWN_MEMBER_ID if want test out. members member.id is a bit weird</technical_language>

Target:
private static DescribeGroupsResponseData prepareDescribeGroupsResponseData(String groupId, List<String> groupInstances, List<TopicPartition> topicPartitions) { final ByteBuffer memberAssignment = ConsumerProtocol.serializeAssignment(new ConsumerPartitionAssignor.Assignment(topicPartitions)); List<DescribedGroupMember> describedGroupMembers = groupInstances.stream().map(groupInstance -> DescribeGroupsResponse.groupMember(JoinGroupRequest.UNKNOWN_MEMBER_ID, groupInstance, "clientId0", "clientHost", new byte[memberAssignment.remaining()], null)).collect(Collectors.toList()); DescribeGroupsResponseData data = new DescribeGroupsResponseData(); data.groups().add(DescribeGroupsResponse.groupMetadata( groupId, Errors.NONE, "", ConsumerProtocol.PROTOCOL_TYPE, "", describedGroupMembers, Collections.emptySet())); return data; }
Source:
<code><START> public static Version fromString(final String value) throws IllegalArgumentException { <END> if (SIGNATURE_V1.value.equals(value)) { return SIGNATURE_V1; } else if (SIGNATURE_V2.value.equals(value)) { return SIGNATURE_V2; } else { throw new IllegalArgumentException("Invalid signature version"); } }</code><technical_language>I this is a checked exception</technical_language>

Target:
public static Version fromString(final String value) { if (SIGNATURE_V1.value.equals(value)) { return SIGNATURE_V1; } else if (SIGNATURE_V2.value.equals(value)) { return SIGNATURE_V2; } else { throw new IllegalArgumentException("Invalid signature version"); } }
Source:
<code>public void copyToRealm() { Date date = new Date(); Dog dog = new Dog(); dog.setName("Fido"); RealmList<Dog> list = new RealmList<Dog>(); list.add(dog); AllTypes allTypes = new AllTypes(); allTypes.setColumnString("String"); allTypes.setColumnLong(1L); <START> allTypes.setColumnFloat(1f); <END> allTypes.setColumnDouble(1d); allTypes.setColumnBoolean(true); allTypes.setColumnDate(date); allTypes.setColumnBinary(new byte[]{1, 2, 3}); allTypes.setColumnRealmObject(dog); allTypes.setColumnRealmList(list); realm.beginTransaction(); AllTypes realmTypes = realm.copyToRealm(allTypes); realm.commitTransaction(); assertNotSame(allTypes, realmTypes); assertEquals(allTypes.getColumnString(), realmTypes.getColumnString()); assertEquals(allTypes.getColumnLong(), realmTypes.getColumnLong()); assertEquals(allTypes.getColumnFloat(), realmTypes.getColumnFloat(), 0); assertEquals(allTypes.getColumnDouble(), realmTypes.getColumnDouble(), 0); assertEquals(allTypes.isColumnBoolean(), realmTypes.isColumnBoolean()); assertEquals(allTypes.getColumnDate(), realmTypes.getColumnDate()); assertArrayEquals(allTypes.getColumnBinary(), realmTypes.getColumnBinary()); assertEquals(allTypes.getColumnRealmObject().getName(), dog.getName()); assertEquals(list.size(), realmTypes.getColumnRealmList().size()); assertEquals(list.get(0).getName(), realmTypes.getColumnRealmList().get(0).getName()); }</code><technical_language>F</technical_language>

Target:
public void copyToRealm() { Date date = new Date(); Dog dog = new Dog(); dog.setName("Fido"); RealmList<Dog> list = new RealmList<Dog>(); list.add(dog); AllTypes allTypes = new AllTypes(); allTypes.setColumnString("String"); allTypes.setColumnLong(1L); allTypes.setColumnFloat(1F); allTypes.setColumnDouble(1D); allTypes.setColumnBoolean(true); allTypes.setColumnDate(date); allTypes.setColumnBinary(new byte[] {1, 2, 3}); allTypes.setColumnRealmObject(dog); allTypes.setColumnRealmList(list); realm.beginTransaction(); AllTypes realmTypes = realm.copyToRealm(allTypes); realm.commitTransaction(); assertNotSame(allTypes, realmTypes); assertEquals(allTypes.getColumnString(), realmTypes.getColumnString()); assertEquals(allTypes.getColumnLong(), realmTypes.getColumnLong()); assertEquals(allTypes.getColumnFloat(), realmTypes.getColumnFloat(), 0); assertEquals(allTypes.getColumnDouble(), realmTypes.getColumnDouble(), 0); assertEquals(allTypes.isColumnBoolean(), realmTypes.isColumnBoolean()); assertEquals(allTypes.getColumnDate(), realmTypes.getColumnDate()); assertArrayEquals(allTypes.getColumnBinary(), realmTypes.getColumnBinary()); assertEquals(allTypes.getColumnRealmObject().getName(), dog.getName()); assertEquals(list.size(), realmTypes.getColumnRealmList().size()); assertEquals(list.get(0).getName(), realmTypes.getColumnRealmList().get(0).getName()); }
Source:
<code>public Builder withOutputFileset(String fileset){ <START> this.outputFilesets.add(fileset); <END> return this; }</code><technical_language>add safety checks null empty strings, plz</technical_language>

Target:
public Builder withOutputFileset(String fileset){ if (fileset!=null && !fileset.isEmpty()){ this.outputFilesets.add(fileset); } return this; }
Source:
<code>private boolean shouldUpdateOnWriteCommand(WriteCommand command) { <START> return configuration.transaction().transactionMode() == TransactionMode.NON_TRANSACTIONAL && <END> !command.hasFlag(Flag.CACHE_MODE_LOCAL); }</code><technical_language>is put of configuration.transaction().transactionMode() == TransactionMode.NON_TRANSACTIONAL in a field? (and set in a start method)</technical_language>

Target:
private boolean shouldUpdateOnWriteCommand(WriteCommand command) { return nonTransactional && !command.hasFlag(Flag.CACHE_MODE_LOCAL); }
Source:
<code>void setRangeHighlight(boolean highlight) { if (fromTo != null) { if (highlight && rangeHighlightMarker == null) { rangeHighlightMarker = cm.markText( fromTo.getFrom(), fromTo.getTo(), Configuration.create() <START> .set("className", Resources.I.diffTableStyle().rangeHighlight())); <END> } else if (!highlight && rangeHighlightMarker != null) { rangeHighlightMarker.clear(); rangeHighlightMarker = null; } } }</code><technical_language>wrap this line</technical_language>

Target:
void setRangeHighlight(boolean highlight) { if (fromTo != null) { if (highlight && rangeHighlightMarker == null) { rangeHighlightMarker = group.getCm().markText( fromTo.getFrom(), fromTo.getTo(), Configuration.create() .set("className", Resources.I.diffTableStyle().rangeHighlight())); } else if (!highlight && rangeHighlightMarker != null) { rangeHighlightMarker.clear(); rangeHighlightMarker = null; } } }
Source:
<code>public static synchronized List<Integer> getAlleles(final int PLindex, final int ploidy) { if ( PLindex < 0) { throw new IllegalStateException("The PL index " + PLindex + " cannot be negative"); } if (ploidy <= 0) { <START> throw new IllegalStateException("The ploidy must be greater than zero"); <END> } if ( ploidy == 2 ) { final GenotypeLikelihoodsAllelePair pair = getAllelePair(PLindex); return Arrays.asList(pair.alleleIndex1, pair.alleleIndex2); } else { final PLIndexAllelesList plIndexAllelesList = anyploidPloidyToPLIndexAllelesList.computeIfAbsent(ploidy, k -> new PLIndexAllelesList(ploidy)); return plIndexAllelesList.getAlleles(PLindex); } }</code><technical_language>I actual in error message. If triggered want know</technical_language>

Target:
public static synchronized List<Integer> getAlleles(final int PLindex, final int ploidy) { if ( PLindex < 0) { throw new IllegalStateException("The PL index " + PLindex + " cannot be negative"); } if (ploidy <= 0) { throw new IllegalStateException("The ploidy " + ploidy +" must be greater than zero"); } if ( ploidy == 2 ) { final GenotypeLikelihoodsAllelePair pair = getAllelePair(PLindex); return Arrays.asList(pair.alleleIndex1, pair.alleleIndex2); } else { final PLIndexAllelesList plIndexAllelesList = anyploidPloidyToPLIndexAllelesList.computeIfAbsent(ploidy, k -> new PLIndexAllelesList(ploidy)); return plIndexAllelesList.getAlleles(PLindex); } }
Source:
<code>private Deque<NetworkClient.InFlightRequest> requestQueue(String node) { Deque<NetworkClient.InFlightRequest> reqs = requests.get(node); if (reqs == null || reqs.isEmpty()) { throw new IllegalStateException("There are no in-flight requests for node " + node); <START> } <END> return reqs; }</code><technical_language>making unrelated formatting changes</technical_language>

Target:
private Deque<NetworkClient.InFlightRequest> requestQueue(String node) { Deque<NetworkClient.InFlightRequest> reqs = requests.get(node); if (reqs == null || reqs.isEmpty()) throw new IllegalStateException("There are no in-flight requests for node " + node); return reqs; }
Source:
<code>public static boolean isLightEmitting(final Material material) { switch (material) { case GLOWSTONE: case TORCH: case SEA_LANTERN: case BEACON: case REDSTONE_LAMP: case REDSTONE_TORCH: case MAGMA_BLOCK: case LAVA: case JACK_O_LANTERN: case CRYING_OBSIDIAN: case SHROOMLIGHT: case CAMPFIRE: case SOUL_CAMPFIRE: case SOUL_TORCH: <START> case LANTERN: <END> case CONDUIT: case RESPAWN_ANCHOR: case BROWN_MUSHROOM: case BREWING_STAND: case ENDER_CHEST: case END_PORTAL_FRAME: case END_ROD: return true; default: return false; } }</code><technical_language>This list needs include soul lantern</technical_language>

Target:
public static boolean isLightEmitting(final Material material) { switch (material) { case GLOWSTONE: case TORCH: case SEA_LANTERN: case BEACON: case REDSTONE_LAMP: case REDSTONE_TORCH: case MAGMA_BLOCK: case LAVA: case JACK_O_LANTERN: case CRYING_OBSIDIAN: case SHROOMLIGHT: case CAMPFIRE: case SOUL_CAMPFIRE: case SOUL_TORCH: case LANTERN: case SOUL_LANTERN: case CONDUIT: case RESPAWN_ANCHOR: case BROWN_MUSHROOM: case BREWING_STAND: case ENDER_CHEST: case END_PORTAL_FRAME: case END_ROD: return true; default: return false; } }
Source:
<code>public long[] updateGlobalPTSSyncData(String streamName, long baseSystemTime, long basePTS, String type) { long[] newSyncData = {baseSystemTime, basePTS}; try { String entryId = Utils.getEntryIdFromStreamName(streamName); synchronized (this.mapLiveEntryToBaseSystemTime) { if (!this.mapLiveEntryToBaseSystemTime.containsKey(entryId)) { this.mapLiveEntryToBaseSystemTime.put(entryId, newSyncData); logger.warn("PTS_SYNC: (" + streamName + ") [" + type + "] first PTS sync data for entry [" + entryId + "] initializing global PTS sync data to [basePTS:"+ basePTS + ", baseSystemTime" + baseSystemTime +"]"); } else { long[] globalSyncData = this.mapLiveEntryToBaseSystemTime.get(entryId); long clockDiff = baseSystemTime - globalSyncData[GLOBAL_SYSTEM_TIME_INDEX]; long ptsDiff = basePTS - globalSyncData[GLOBAL_BASE_PTS_INDEX]; long ptsMisalignment = clockDiff - ptsDiff; if (Math.abs(ptsMisalignment) > maxAllowedPTSDriftMillisec) { logger.warn("PTS_SYNC: (" + streamName + ") [" + type + "] found PTS jump, PTS misalignment [" + ptsMisalignment + "] milliseconds, replacing global PTS sync data from [basePTS:"+ globalSyncData[GLOBAL_BASE_PTS_INDEX] + ", baseSystemTime" + globalSyncData[GLOBAL_SYSTEM_TIME_INDEX] +"] to [basePTS:" + basePTS + ", baseSystemTime:" + baseSystemTime +"]"); this.mapLiveEntryToBaseSystemTime.put(entryId, newSyncData); } } } } catch (Exception e) { logger.error("PTS_SYNC: (" + streamName + ") fail to sync PTS base timestamp for live entry." + e.toString()); } return newSyncData; }</code><technical_language>removed newSyncData = globalSyncData;</technical_language>

Target:
public long[] updateGlobalPTSSyncData(String streamName, long baseSystemTime, long basePTS, String type) { long[] newSyncData = {baseSystemTime, basePTS}; try { String entryId = Utils.getEntryIdFromStreamName(streamName); synchronized (this.mapLiveEntryToBaseSystemTime) { if (!this.mapLiveEntryToBaseSystemTime.containsKey(entryId)) { this.mapLiveEntryToBaseSystemTime.put(entryId, newSyncData); logger.warn("PTS_SYNC: (" + streamName + ") [" + type + "] first PTS sync data for entry [" + entryId + "] initializing global PTS sync data to [basePTS:"+ basePTS + ", baseSystemTime" + baseSystemTime +"]"); } else { long[] globalSyncData = this.mapLiveEntryToBaseSystemTime.get(entryId); long clockDiff = baseSystemTime - globalSyncData[GLOBAL_SYSTEM_TIME_INDEX]; long ptsDiff = basePTS - globalSyncData[GLOBAL_BASE_PTS_INDEX]; long ptsMisalignment = clockDiff - ptsDiff; if (Math.abs(ptsMisalignment) > maxAllowedPTSDriftMillisec) { logger.warn("PTS_SYNC: (" + streamName + ") [" + type + "] found PTS jump, PTS misalignment [" + ptsMisalignment + "] milliseconds, replacing global PTS sync data from [basePTS:"+ globalSyncData[GLOBAL_BASE_PTS_INDEX] + ", baseSystemTime" + globalSyncData[GLOBAL_SYSTEM_TIME_INDEX] +"] to [basePTS:" + basePTS + ", baseSystemTime:" + baseSystemTime +"]"); this.mapLiveEntryToBaseSystemTime.put(entryId, newSyncData); } else { newSyncData = globalSyncData; } } } } catch (Exception e) { logger.error("PTS_SYNC: (" + streamName + ") fail to sync PTS base timestamp for live entry." + e.toString()); } return newSyncData; }
Source:
<code><START> private void constructCacheMapFromMatrixCollection( <END> @Nonnull final IntegerCopyNumberTransitionMatrixCollection transitionMatrixCollection) { transitionMatrixCollection.assertCompleteness(); for (final String sexGenotype : transitionMatrixCollection.getSexGenotypes()) { for (final String contig : transitionMatrixCollection.getContigs()) { sexGenotypeAndContigToTransitionMatrixCacheMap.put(SexGenotypeContigPairKey.of(sexGenotype, contig), new IntegerCopyNumberTransitionProbabilityCache(transitionMatrixCollection.get(sexGenotype, contig))); } } }</code><technical_language>Also, in cases this I prefer static methods return instances assigned fields. is, this a static method returns a HashMap. This prevents possibility inadvertently call a non-static method more leave field in a bad state</technical_language>

Target:
private static Map<SexGenotypeContigPairKey, IntegerCopyNumberTransitionProbabilityCache> constructCacheMapFromMatrixCollection( @Nonnull final IntegerCopyNumberTransitionMatrixCollection transitionMatrixCollection) { transitionMatrixCollection.assertCompleteness(); final Map<SexGenotypeContigPairKey, IntegerCopyNumberTransitionProbabilityCache> cacheMap = new HashMap<>(); for (final String sexGenotype : transitionMatrixCollection.getSexGenotypes()) { for (final String contig : transitionMatrixCollection.getContigs()) { cacheMap.put(SexGenotypeContigPairKey.of(sexGenotype, contig), new IntegerCopyNumberTransitionProbabilityCache(transitionMatrixCollection.get(sexGenotype, contig))); } } return cacheMap; }
Source:
<code>public void assumeNotNullSingleNullThrowsException() { try { <START> assumeNotNull(null); <END> fail("should throw AssumptionViolatedException"); } catch (AssumptionViolatedException e) { } }</code><technical_language>Please add a cast Object[] here</technical_language>

Target:
public void assumeNotNullSingleNullThrowsException() { try { assumeNotNull((Object[]) null); fail("should throw AssumptionViolatedException"); } catch (AssumptionViolatedException e) { } }
Source:
<code>public void testProjectWithCustomField() throws IOException, JSONException { String json = MyIOUtils.getResourceAsString("redmine_projectWithCustomField.json"); Project project = RedmineJSONParser.parseProject(RedmineJSONParser .getResponseSingleObject(json, "project")); Assert.assertEquals(project.getCustomFields().size(), 2); Assert.assertNotNull(project.getCustomFieldById(1)); String expectedCustomeFieldValue = "Should have a value"; Assert.assertEquals(expectedCustomeFieldValue, project.getCustomFieldById(1).getValue()); Assert.assertEquals("", project.getCustomFieldById(6).getValue()); <START> } <END></code><technical_language>I suggest static import Assert.assertEquals(), done in a separate commit (for class)</technical_language>

Target:
public void testProjectWithCustomField() throws IOException, JSONException { String json = MyIOUtils.getResourceAsString("redmine_projectWithCustomField.json"); Project project = RedmineJSONParser.parseProject(RedmineJSONParser .getResponseSingleObject(json, "project")); Assert.assertEquals(project.getCustomFields().size(), 2); String expectedCustomeFieldValue = "Should have a value"; Assert.assertEquals(expectedCustomeFieldValue, project.getCustomFieldById(1).getValue()); Assert.assertEquals("", project.getCustomFieldById(6).getValue()); }
Source:
<code>public Jep getJEPInstance() { long threadId = Thread.currentThread().getId(); Jep jep = jepInstances.get(threadId); if (jep == null) { jep = this.createJEPInstance(); jepInstances.put(threadId, jep); } try { <START> jep.isValidThread(); <END> } catch (JepException e) { LOGGER.warn("JEP instance no longer usable, creating new instance", e); jep = this.createJEPInstance(); jepInstances.put(threadId, jep); } return jep; }</code><technical_language>I cases python part crash JEP instance. I remember I put this, paranoia</technical_language>

Target:
public Jep getJEPInstance() { long threadId = Thread.currentThread().getId(); Jep jep = jepInstances.get(threadId); if (jep == null) { LOGGER.info("Creating JEP instance for thread " + threadId); jep = this.createJEPInstance(); jepInstances.put(threadId, jep); } try { jep.isValidThread(); } catch (JepException e) { LOGGER.warn("JEP instance no longer usable, creating new instance", e); jep = this.createJEPInstance(); jepInstances.put(threadId, jep); } return jep; }