auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>static <C extends Condition, CPS extends AbstractConditionParserState<C>> C parseCondition( ObjectParser<CPS, QueryParseContext> condParser, XContentParser parser, QueryParseContext parseContext ) throws IOException { CPS state = condParser.parse(parser, parseContext); String error = <START> state.checkValid(); <END> if (error != null) { throw new ParsingException(parser.getTokenLocation(), error); } return state.condition(); }</code><technical_language>nitpick: throw IllegalArgumentException there. note IAExc catched toplevel parse function (fromXContent) token location added there</technical_language>

Target:
static <C extends Condition, CPS extends AbstractConditionParserState<C>> C parseCondition( ObjectParser<CPS, QueryParseContext> condParser, XContentParser parser, QueryParseContext parseContext ) throws IOException { CPS state = condParser.parse(parser, parseContext); state.checkValid(); return state.condition(); }
Source:
<code>protected void configure() { bind(SitePaths.class); bind(InitFlags.class); bind(Libraries.class); bind(LibraryDownloader.class); factory(Section.Factory.class); step().to(UpgradeFrom2_0_x.class); step().to(InitGitManager.class); if (initDb) { step().to(InitDatabase.class); } step().to(InitIndex.class); step().to(InitAuth.class); step().to(InitLabels.class); step().to(InitSendEmail.class); if (standalone) { step().to(InitContainer.class); } step().to(InitSshd.class); step().to(InitHttpd.class); step().to(InitCache.class); <START> step().to(InitAdminUser.class); <END> step().to(InitPlugins.class); }</code><technical_language>move line 55, this step is related type of Auth</technical_language>

Target:
protected void configure() { bind(SitePaths.class); bind(InitFlags.class); bind(Libraries.class); bind(LibraryDownloader.class); factory(Section.Factory.class); step().to(UpgradeFrom2_0_x.class); step().to(InitGitManager.class); if (initDb) { step().to(InitDatabase.class); } step().to(InitIndex.class); step().to(InitAuth.class); step().to(InitAdminUser.class); step().to(InitLabels.class); step().to(InitSendEmail.class); if (standalone) { step().to(InitContainer.class); } step().to(InitSshd.class); step().to(InitHttpd.class); step().to(InitCache.class); step().to(InitPlugins.class); }
Source:
<code>public static FileOutputStream createFile(final Context context, final String filename) throws IOException { final String filepath = getSDPath(); final File path = new File(filepath); final boolean hasSD = MainActivity.hasSD(); if (hasSD) { path.mkdirs(); final String openString = filepath + filename; MainActivity.info("openString: " + openString); final File file = new File(openString); if (!file.exists()) { if (!file.createNewFile()) { throw new IOException("Could not create file: " + openString); } } return new FileOutputStream(file); } if (Build.VERSION.SDK_INT >= 23) { return context.openFileOutput(filename, Context.MODE_PRIVATE); } else { return context.openFileOutput(filename, Context.MODE_WORLD_READABLE); <START> } <END> }</code><technical_language>do a ternary chose mode a variable for 3 blocks this, pass variable a single openFileOutput, reduce copy paste. i if android developer inspection handles properly though</technical_language>

Target:
public static FileOutputStream createFile(final Context context, final String filename) throws IOException { final String filepath = getSDPath(); final File path = new File(filepath); final boolean hasSD = MainActivity.hasSD(); if (hasSD) { path.mkdirs(); final String openString = filepath + filename; MainActivity.info("openString: " + openString); final File file = new File(openString); if (!file.exists()) { if (!file.createNewFile()) { throw new IOException("Could not create file: " + openString); } } return new FileOutputStream(file); } return context.openFileOutput(filename, Context.MODE_PRIVATE); }
Source:
<code>protected void executeQueryCommand() { clusterId = getParameters().getClusterId(); <START> Guid volumeId = getParameters().getVolumeId(); <END> if (volumeId != null) { volume = getGlusterVolumeDao().getById(volumeId); if (volume == null) { throw new RuntimeException(String.format("Invalid volume id %s", volumeId)); } asyncTask = volume.getAsyncTask(); if(asyncTask == null) { getQueryReturnValue().setReturnValue(null); return; } getQueryReturnValue().setReturnValue(fetchTaskStatusDetails()); } }</code><technical_language>if clusterId is null? (Could called API well)</technical_language>

Target:
protected void executeQueryCommand() { clusterId = getParameters().getClusterId(); if (clusterId == null) { clusterId = volume.getClusterId(); } Guid volumeId = getParameters().getVolumeId(); if (volumeId != null) { volume = getGlusterVolumeDao().getById(volumeId); if (volume == null) { throw new RuntimeException(VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_VOLUME_INVALID.toString()); } asyncTask = volume.getAsyncTask(); if (asyncTask == null) { getQueryReturnValue().setReturnValue(null); return; } getQueryReturnValue().setReturnValue(fetchTaskStatusDetails()); } }
Source:
<code>public String queryGC100(String getDevices, String sourceAddress) throws IOException { List<String> deviceList = new ArrayList<String>(); Socket socket = new Socket(sourceAddress, GC100IRControlPoint.CONNECT_PORT); SocketAddress socketAddress = socket.getRemoteSocketAddress(); if (socket.isConnected()) { <START> logger.info("Connected Successfully to " + socketAddress); <END> } DataOutputStream outToServer = new DataOutputStream(socket.getOutputStream()); BufferedReader inFromServer = new BufferedReader(new InputStreamReader(socket.getInputStream())); byte[] commandInBytes = getDevices.getBytes(); outToServer.write(commandInBytes); int c; StringBuilder response = new StringBuilder(); while ((c = inFromServer.read()) != '\0') { response.append((char) c); if (c == 13) { deviceList.add(response.toString()); response = new StringBuilder(); } if (response.toString().equals(END_LIST_DEVICES)) { break; } } StringBuilder temp = new StringBuilder(); for (String deviceStr : deviceList) { temp.append(deviceStr); } try { socket.close(); } catch (SocketException e) { logger.warn("Socket Exception occurred", e); } return temp.toString(); }</code><technical_language>parameterized logging instead of string concatenation</technical_language>

Target:
public String queryGC100(String getDevices, String sourceAddress) throws IOException { List<String> deviceList = new ArrayList<String>(); Socket socket = new Socket(sourceAddress, GC100IRControlPoint.CONNECT_PORT); SocketAddress socketAddress = socket.getRemoteSocketAddress(); if (socket.isConnected()) { logger.info("Connected Successfully to {}", socketAddress); } DataOutputStream outToServer = new DataOutputStream(socket.getOutputStream()); BufferedReader inFromServer = new BufferedReader(new InputStreamReader(socket.getInputStream())); byte[] commandInBytes = getDevices.getBytes(); outToServer.write(commandInBytes); int c; StringBuilder response = new StringBuilder(); while ((c = inFromServer.read()) != '\0') { response.append((char) c); if (c == 13) { deviceList.add(response.toString()); response = new StringBuilder(); } if (response.toString().equals(END_LIST_DEVICES)) { break; } } StringBuilder temp = new StringBuilder(); for (String deviceStr : deviceList) { temp.append(deviceStr); } try { socket.close(); } catch (SocketException e) { logger.warn("Socket Exception occurred", e); } return temp.toString(); }
Source:
<code>private static void addExtensionLink(LinkMenuBar m, TopMenuItem item) { Anchor atag; if <START> (item.getUrl() != null <END> && isAbsolute(item.getUrl())) { atag = anchor(item.getName(), item.getUrl()); } else { atag = anchor(item.getName(), selfRedirect(item.getUrl())); } atag.setTarget(item.getTarget()); if (item.getId() != null) { atag.getElement().setAttribute("id", item.getId()); } m.add(atag); }</code><technical_language>check item.getUrl() != null is needed</technical_language>

Target:
private static void addExtensionLink(LinkMenuBar m, TopMenuItem item) { Anchor atag = anchor(item.getName(), isAbsolute(item.getUrl()) ? item.getUrl() : selfRedirect(item.getUrl())); atag.setTarget(item.getTarget()); if (item.getId() != null) { atag.getElement().setAttribute("id", item.getId()); } m.add(atag); }
Source:
<code>private static List<Storage> buildMountsList(Context context, <START> Collection<String> mounts) { <END> List<Storage> list = new ArrayList<Storage>(mounts.size()); int externalSdcardsCount = 0; if (mounts.size() > 0) { String firstItem = mounts.iterator().next(); if (!Environment.isExternalStorageRemovable() || Environment.isExternalStorageEmulated()) { list.add(new Storage(context.getString(R.string.prefs_sdcard_internal), firstItem)); } else { externalSdcardsCount = 1; list.add(new Storage(context.getString(R.string.prefs_sdcard_external, externalSdcardsCount), firstItem)); } if (mounts.size() > 1) { Iterator<String> iter = mounts.iterator(); iter.next(); externalSdcardsCount++; while (iter.hasNext()) { String mount = iter.next(); list.add(new Storage(context.getString(R.string.prefs_sdcard_external, externalSdcardsCount++), mount)); } } } Log.d(TAG, "final storage list is: " + list); return list; }</code><technical_language>this anymore, remove string strings files? speaking of which, need a utility this easier, a hassle right :( exists</technical_language>

Target:
private static List<Storage> buildMountsList(Context context, Collection<String> mounts) { List<Storage> list = new ArrayList<>(mounts.size()); int externalSdcardsCount = 0; if (mounts.size() > 0) { String firstItem = mounts.iterator().next(); if (!Environment.isExternalStorageRemovable() || Environment.isExternalStorageEmulated()) { list.add(new Storage(context.getString(R.string.prefs_sdcard_internal), firstItem)); } else { externalSdcardsCount = 1; list.add(new Storage(context.getString(R.string.prefs_sdcard_external, externalSdcardsCount), firstItem)); } if (mounts.size() > 1) { Iterator<String> iter = mounts.iterator(); iter.next(); externalSdcardsCount++; while (iter.hasNext()) { String mount = iter.next(); list.add(new Storage(context.getString(R.string.prefs_sdcard_external, externalSdcardsCount++), mount)); } } } Log.d(TAG, "final storage list is: " + list); return list; }
Source:
<code>public void registerSynchronization(Synchronization synchronization) { if (transactionSynchronizationRegistry == null) { throw JpaLogger.JPA_LOGGER.nullTransactionSynchronizationRegistry(); } <START> transactionSynchronizationRegistry.registerInterposedSynchronization(synchronization); <END> }</code><technical_language>a big deal all, I some point @dmlloyd wanting null checks org.wildfly.common.Assert.checkNotNullParam(). Sin this case be: transactionSynchronizationRegistry.registerInterposedSynchronization(Assert.checkNotNullParam("synchronization", synchronization);</technical_language>

Target:
public void registerSynchronization(Synchronization synchronization) { locateTransactionSynchronizationRegistry(). registerInterposedSynchronization(synchronization); }
Source:
<code>protected void testExecute_withCourseIdAndSectionNameAndSessionName_shouldUpdatePrivilegesInSessionLevel() { InstructorAttributes instructor1OfCourse1 = typicalBundle.instructors.get("instructor1OfCourse1"); String[] submissionParams = new String[] { Const.ParamsNames.INSTRUCTOR_ID, instructor1OfCourse1.getGoogleId(), Const.ParamsNames.COURSE_ID, instructor1OfCourse1.courseId, }; InstructorPrivilegeUpdateRequest reqBody = new InstructorPrivilegeUpdateRequest(); reqBody.setCanSubmitSessionInSections(true); reqBody.setSectionName("Tutorial1"); <START> reqBody.setFeedbackSessionName("Session1"); <END> UpdateInstructorPrivilegeAction action = getAction(reqBody, submissionParams); JsonResult result = getJsonResult(action); assertEquals(HttpStatus.SC_OK, result.getStatusCode()); InstructorPrivilegeData response = (InstructorPrivilegeData) result.getOutput(); assertTrue(response.isCanModifyCourse()); assertTrue(response.isCanModifySession()); assertTrue(response.isCanModifyStudent()); assertTrue(response.isCanModifyInstructor()); assertTrue(response.isCanViewStudentInSections()); assertTrue(response.isCanSubmitSessionInSections()); assertFalse(response.isCanViewSessionInSections()); assertFalse(response.isCanModifySessionCommentsInSections()); }</code><technical_language>(and others below)</technical_language>

Target:
protected void testExecute_withCourseIdAndSectionNameAndSessionName_shouldUpdatePrivilegesInSessionLevel() { InstructorAttributes helper1OfCourse1 = typicalBundle.instructors.get("helperOfCourse1"); assertFalse(helper1OfCourse1.privileges.isAllowedForPrivilege("Tutorial1", "Session1", Const.ParamsNames.INSTRUCTOR_PERMISSION_SUBMIT_SESSION_IN_SECTIONS)); assertFalse(helper1OfCourse1.privileges.isAllowedForPrivilege("Tutorial1", "Session1", Const.ParamsNames.INSTRUCTOR_PERMISSION_VIEW_SESSION_IN_SECTIONS)); assertFalse(helper1OfCourse1.privileges.isAllowedForPrivilege("Tutorial1", "Session1", Const.ParamsNames.INSTRUCTOR_PERMISSION_MODIFY_SESSION_COMMENT_IN_SECTIONS)); String[] submissionParams = new String[] { Const.ParamsNames.INSTRUCTOR_EMAIL, helper1OfCourse1.getEmail(), Const.ParamsNames.COURSE_ID, helper1OfCourse1.courseId, }; InstructorPrivilegeUpdateRequest reqBody = new InstructorPrivilegeUpdateRequest(); reqBody.setCanSubmitSessionInSections(true); reqBody.setCanViewSessionInSections(true); reqBody.setCanModifySessionCommentsInSections(true); reqBody.setSectionName("Tutorial1"); reqBody.setFeedbackSessionName("Session1"); UpdateInstructorPrivilegeAction action = getAction(reqBody, submissionParams); JsonResult result = getJsonResult(action); assertEquals(HttpStatus.SC_OK, result.getStatusCode()); InstructorPrivilegeData response = (InstructorPrivilegeData) result.getOutput(); assertFalse(response.isCanModifyCourse()); assertFalse(response.isCanModifySession()); assertFalse(response.isCanModifyStudent()); assertFalse(response.isCanModifyInstructor()); assertFalse(response.isCanViewStudentInSections()); assertTrue(response.isCanSubmitSessionInSections()); assertTrue(response.isCanViewSessionInSections()); assertTrue(response.isCanModifySessionCommentsInSections()); }
Source:
<code>public IRichBolt getConsumer() { Preconditions.checkArgument(!props.isEmpty(), "Writable MongoDB must contain collection config"); String serField; if (props.contains("ser.field")) { serField = props.getProperty("ser.field"); <START> } else if (props.contains("trident.ser.field")) { <END> serField = props.getProperty("trident.ser.field"); } else { serField = "tridentSerField"; } MongoMapper mapper = new SqlMongoMapper(serField, serializer); return new MongoInsertBolt(url, props.getProperty("collection.name"), mapper); }</code><technical_language>Nit: constants instead of literals</technical_language>

Target:
public IRichBolt getConsumer() { Preconditions.checkArgument(!props.isEmpty(), "Writable MongoDB must contain collection config"); String serField; if (props.contains(VALUE_SERIALIZED_FIELD)) { serField = props.getProperty(VALUE_SERIALIZED_FIELD); } else if (props.contains(TRIDENT_VALUE_SERIALIZED_FIELD)) { serField = props.getProperty(TRIDENT_VALUE_SERIALIZED_FIELD); } else { serField = DEFAULT_VALUE_SERIALIZED_FIELD; } MongoMapper mapper = new SqlMongoMapper(serField, serializer); return new MongoInsertBolt(url, props.getProperty(COLLECTION_NAME), mapper); }
Source:
<code>private static boolean parseOptions(String arg, SelectedOptions options) { final boolean isOption = isOption(arg); if (isOption) { final String[] argParts = arg.substring(2).split("="); final Options option = Options.valueOf(argParts[0].toUpperCase()); <START> option.accept(options, argParts.length > 1 ? argParts[1] : null); <END> } return isOption; }</code><technical_language>fault logic is flawed in = --foo=true a shortcut of -f true breaks this</technical_language>

Target:
private static boolean parseOptions(String arg, SelectedOptions options) { final boolean isOption = isOption(arg); if (isOption) { final String[] argParts = arg.substring(2).split("="); final Options option = Options.valueOf(argParts[0].toUpperCase()); switch (option) { case PATH: options.getPaths().setBasePath(new File(argParts[1])); break; case ENVPATH: options.getPaths().setEnvPath(new File(argParts[1])); break; case SCRIPTPATH: options.getPaths().setScriptPath(new File(argParts[1])); break; case DRIVERPATH: options.getPaths().setDriverPath(new File(argParts[1])); break; case HOOKPATH: options.getPaths().setHookPath(new File(argParts[1])); break; case ENV: options.setEnvironment(argParts[1]); break; case FORCE: options.setForce(true); break; case TRACE: options.setTrace(true); break; case HELP: options.setHelp(true); break; case TEMPLATE: options.setTemplate(argParts[1]); break; case IDPATTERN: options.setIdPattern(argParts[1]); break; case QUIET: options.setQuiet(true); break; } } return isOption; }
Source:
<code>private boolean hasOnlyPseudoConflicts(List<Diff> differences) { <START> for (Diff difference : differences) { if (difference.getConflict().getKind() == ConflictKind.REAL) { return false; } } return true; <END> }</code><technical_language>Instead of for loop, more readable concise: Iterators.all(differences.iterator(), hasConflict(ConflictKind.PSEUDO)); cf org.eclipse.emf.compare.utils.EMFComparePredicates.hasConflict(ConflictKind...)</technical_language>

Target:
private boolean hasOnlyPseudoConflicts(List<Diff> differences) { return Iterators.all(differences.iterator(), EMFComparePredicates.hasConflict(ConflictKind.PSEUDO)); }
Source:
<code>public void shutDown() { <START> closeQuitely(m_outStream); <END> m_outStream = null; if (null != m_readerThread) { m_readerThread.interrupt(); } closeQuitely(m_inReader); m_inReader = null; closeQuitely(m_clientSocket); m_clientSocket = null; }</code><technical_language>Typo: "quietly"</technical_language>

Target:
public void shutDown() { closeQuietly(m_outStream); m_outStream = null; if (null != m_readerThread) { m_readerThread.interrupt(); } closeQuietly(m_inReader); m_inReader = null; closeQuietly(m_clientSocket); m_clientSocket = null; }
Source:
<code>private Watch eventWatch(KubernetesClient client, String podName, String namespace, TaskListener runListener) { try { return client.events().inNamespace(namespace).withField("involvedObject.name", podName).watch(new TaskListenerEventWatcher(podName, runListener)); } catch (KubernetesClientException e) { <START> LOGGER.log(Level.FINE, e, () -> "Cannot watch events on " + namespace + "/" +podName); <END> } return () -> {}; }</code><technical_language>Is is reasonable ask this log line written more readily (less restricted FINE) include a note/link instructions for required level of access needed watch pod events</technical_language>

Target:
private Watch eventWatch(KubernetesClient client, String podName, String namespace, TaskListener runListener) { try { return client.events().inNamespace(namespace).withField("involvedObject.name", podName).watch(new TaskListenerEventWatcher(podName, runListener)); } catch (KubernetesClientException e) { LOGGER.log(Level.INFO, e, () -> "Cannot watch events on " + namespace + "/" +podName); } return () -> {}; }
Source:
<code>public void write(PacketBuffer buffer) { this.getBlocks().write(buffer); this.getItems().write(buffer); <START> this.getFluids().write(buffer); <END> writeForgeTags(buffer); }</code><technical_language>Welcome world of limited packet sizes. This explode explode fast. Do hijack vanilla packet</technical_language>

Target:
public void write(PacketBuffer buffer) { this.getBlocks().write(buffer); this.getItems().write(buffer); this.getFluids().write(buffer); }
Source:
<code><START> public DlmsDevice findDlmsDevice(final DlmsDeviceMessageMetadata messageMetadata) throws FunctionalException, <END> SessionProviderException, InterruptedException { final String deviceIdentification = messageMetadata.getDeviceIdentification(); final DlmsDevice dlmsDevice = this.dlmsDeviceRepository.findByDeviceIdentification(deviceIdentification); if (dlmsDevice == null) { throw new FunctionalException(FunctionalExceptionType.UNKNOWN_DEVICE, COMPONENT_TYPE, new ProtocolAdapterException("Unable to communicate with unknown device: " + deviceIdentification)); } dlmsDevice.setIpAddress(this.getDeviceIpAddress(dlmsDevice, messageMetadata.getIpAddress())); return dlmsDevice; }</code><technical_language>![MAJOR](<LINK_1> Refactor this method throw checked exception instead of: com.alliander.osgp.shared.exceptionhandling.FunctionalException, org.osgp.adapter.protocol.dlms.application.jasper.sessionproviders.exceptions.SessionProviderException [![rule](<LINK_2>](<LINK_0></technical_language>

Target:
public DlmsDevice findDlmsDevice(final DlmsDeviceMessageMetadata messageMetadata) throws FunctionalException, SessionProviderException { final String deviceIdentification = messageMetadata.getDeviceIdentification(); final DlmsDevice dlmsDevice = this.dlmsDeviceRepository.findByDeviceIdentification(deviceIdentification); if (dlmsDevice == null) { throw new FunctionalException(FunctionalExceptionType.UNKNOWN_DEVICE, COMPONENT_TYPE, new ProtocolAdapterException("Unable to communicate with unknown device: " + deviceIdentification)); } dlmsDevice.setIpAddress(this.getDeviceIpAddress(dlmsDevice, messageMetadata.getIpAddress())); return dlmsDevice; }
Source:
<code>private void handlerError(String clientEndpoint, final String ticket, final Exception exception) { excutorService.submit(new Runnable() { @Override public void run() { try { sendError(ticket, exception.getMessage()); <START> } catch (Throwable t) { <END> LOG.error("Unable to send error message.", t); } } }); }</code><technical_language>catch RuntimeException</technical_language>

Target:
private void handlerError(String clientEndpoint, final String ticket, final Exception exception) { executorService.submit(new Runnable() { @Override public void run() { try { sendError(ticket, exception.getMessage()); } catch (RuntimeException t) { LOG.error("Unable to send error message.", t); } } }); }
Source:
<code>public MessageHeader extractHeader(IndexedRecord message) { assert message != null : "Message should not be null"; final Schema messageSchema = message.getSchema(); final Schema firstFieldSchema = messageSchema.getFields().get(EXPECTED_HEADER_POSITION).schema(); if (firstFieldSchema.getType() != Schema.Type.RECORD) { throw new IllegalArgumentException( <START> "Provided message's first field is not a record but " + firstFieldSchema.getType()); <END> } if (!firstFieldSchema.getFullName().equals(messageHeaderSchema.getFullName())) { throw new IllegalArgumentException( "Provided message's first field is not a header but " + firstFieldSchema.getFullName()); } final Object firstFieldValue = message.get(EXPECTED_HEADER_POSITION); if (firstFieldValue instanceof MessageHeader) { return MessageHeader.class.cast(firstFieldValue); } else { return (MessageHeader) SpecificData.get().deepCopy(messageHeaderSchema, firstFieldValue); } }</code><technical_language>declare this String a final static field ? I String is</technical_language>

Target:
public MessageHeader extractHeader(IndexedRecord message) { assert message != null : MESSAGE_SHOULD_NOT_BE_NULL_LABEL; final Schema messageSchema = message.getSchema(); final Schema firstFieldSchema = messageSchema.getFields().get(EXPECTED_HEADER_POSITION).schema(); if (firstFieldSchema.getType() != Schema.Type.RECORD) { throw new IllegalArgumentException(PROVIDED_FIRST_FIELD_RECORD_LABEL + firstFieldSchema.getType()); } if (!firstFieldSchema.getFullName().equals(messageHeaderSchema.getFullName())) { throw new IllegalArgumentException(PROVIDED_FIRST_FIELD_HEADER_LABEL + firstFieldSchema.getFullName()); } final Object firstFieldValue = message.get(EXPECTED_HEADER_POSITION); if (firstFieldValue instanceof MessageHeader) { return MessageHeader.class.cast(firstFieldValue); } else { return (MessageHeader) SpecificData.get().deepCopy(messageHeaderSchema, firstFieldValue); } }
Source:
<code>private void start() { if (isStarted.compareAndSet(false, true)) { executor.execute(() -> { try (BufferedReader br2 = br) { SseEventBuilder builder = new SseEventBuilder(providers); String line = br.readLine(); while (line != null && !subscriptions.isEmpty()) { <START> if (line.startsWith("data: ")) { <END> builder.data(line.substring(6)); } else if (line.startsWith("id: ")) { builder.id(line.substring(4)); } else if (line.startsWith("event: ")) { builder.name(line.substring(7)); } else if (line.startsWith(": ")) { builder.comment(line.substring(2)); } else if ("".equals(line)) { InboundSseEvent event = builder.build(); for (SseSubscription subscription : subscriptions) { subscription.fireEvent(event); } builder = new SseEventBuilder(providers); } line = br.readLine(); } for (SseSubscription subscription : subscriptions) { subscription.fireComplete(); } } catch (IOException ex) { for (SseSubscription subscription : subscriptions) { subscription.fireError(ex); } } }); } }</code><technical_language>This is is a bit tricky. space is : is optional (<LINK_0>, data: data: valid event encodings</technical_language>

Target:
private void start() { if (isStarted.compareAndSet(false, true)) { executor.execute(() -> { try (BufferedReader br2 = br) { SseEventBuilder builder = new SseEventBuilder(providers); String line = br.readLine(); while (line != null && !subscriptions.isEmpty()) { if (line.startsWith("data:")) { builder.data(removeSpace(line.substring(5))); } else if (line.startsWith("id:")) { builder.id(removeSpace(line.substring(3))); } else if (line.startsWith("event:")) { builder.name(removeSpace(line.substring(6))); } else if (line.startsWith(":")) { builder.comment(removeSpace(line.substring(1))); } else if ("".equals(line)) { InboundSseEvent event = builder.build(); for (SseSubscription subscription : subscriptions) { subscription.fireEvent(event); } builder = new SseEventBuilder(providers); } line = br.readLine(); } for (SseSubscription subscription : subscriptions) { subscription.complete(); } } catch (IOException ex) { for (SseSubscription subscription : subscriptions) { subscription.fireError(ex); } } }); } }
Source:
<code><START> public synchronized long getMaxSize() { <END> return maxSize; }</code><technical_language>For Max + Min Size, I synchronized removed setter methods variables volatile instead</technical_language>

Target:
public long getMaxSize() { return maxSize; }
Source:
<code>public void testManualMetadataBasedRule() throws InterruptedException { RetentionRule testRule = createManualMetadataBasedRuleMillis("dc:expired", 1000L); Calendar haldSecond = Calendar.getInstance(); haldSecond.add(Calendar.MILLISECOND, 500); file.setPropertyValue("dc:expired", haldSecond); file = session.saveDocument(file); file = service.attachRule(file, testRule, session); assertTrue(file.isRecord()); assertTrue(session.isUnderRetentionOrLegalHold(file.getRef())); awaitRetentionExpiration(1000L); <START> <END> Record record = file.getAdapter(Record.class); assertFalse(record.isRetainUntilInderterminate()); assertFalse(record.isRetentionExpired()); assertTrue(session.isUnderRetentionOrLegalHold(file.getRef())); awaitRetentionExpiration(1000L); file = session.getDocument(file.getRef()); record = file.getAdapter(Record.class); assertFalse(session.isUnderRetentionOrLegalHold(file.getRef())); assertTrue(record.isRetentionExpired()); }</code><technical_language>awaitRetentionExpiration(1000L); -> awaitRetentionExpiration(1_000);</technical_language>

Target:
public void testManualMetadataBasedRule() throws InterruptedException { RetentionRule testRule = createManualMetadataBasedRuleMillis("dc:expired", 1000); Calendar halfSecond = Calendar.getInstance(); halfSecond.add(Calendar.MILLISECOND, 500); file.setPropertyValue("dc:expired", halfSecond); file = session.saveDocument(file); file = service.attachRule(file, testRule, session); assertTrue(file.isRecord()); assertTrue(session.isUnderRetentionOrLegalHold(file.getRef())); awaitRetentionExpiration(1000); Record record = file.getAdapter(Record.class); assertFalse(record.isRetentionIndeterminate()); assertFalse(record.isRetentionExpired()); assertTrue(session.isUnderRetentionOrLegalHold(file.getRef())); awaitRetentionExpiration(1000); file = session.getDocument(file.getRef()); record = file.getAdapter(Record.class); assertFalse(session.isUnderRetentionOrLegalHold(file.getRef())); assertTrue(record.isRetentionExpired()); }
Source:
<code>public Set<String> toShardIdentifiers(Set<String> routingKeys) { <START> Set<String> shardIds = new LinkedHashSet<>(); <END> for ( String routingKey : routingKeys ) { shardIds.add( toShardIdentifier( routingKey ) ); } return shardIds; }</code><technical_language>This is a doubt. I of time input list is fine. Do need instantiate another object here</technical_language>

Target:
public Set<String> toShardIdentifiers(Set<String> routingKeys) { for ( String routingKey : routingKeys ) { checkShardIdentifier( routingKey ); } return routingKeys; }
Source:
<code>private void applyAsHasher(final Hasher hasher, final IntConsumer action) { verifyHasher(hasher); <START> toSet(hasher).forEach(i -> action.accept(i)); <END> }</code><technical_language>toSet() a filtering consumer. like: java private static class UniqueFilter implements IntConsumer { IntConsumer child; long[] filter; UniqueFilter( IntConsumer child, Shape shape ) { this.child=child; filter = new long[ BloomFilterIndexer.getLongIndex(shape.getNumberOfBits()) ]; } @Override public void accept(int arg0) { long target = filter[BloomFilterIndexer.getLongIndex(arg0) ]; long mask = BloomFilterIndexer.getLongBit(arg0); if ( (target & mask) == 0) { target |= mask; child.accept( arg0 ); } } } java UniqueFilter filter = new UniqueFilter( action, shape ); hasher.getBits(shape).forEachRemaining( filter );</technical_language>

Target:
private void applyAsHasher(final Hasher hasher, final IntConsumer action) { verifyHasher(hasher); IndexFilters.distinctIndexes(hasher, getShape(), action); }
Source:
<code>public void testRequestShouldNotFollowRedirects() throws IOException { final AtomicInteger requestsAttempted = new AtomicInteger(0); HttpRequestExecutor requestExecutor = new HttpRequestExecutor() { @Override <START> public HttpResponse execute(HttpRequest request, HttpClientConnection conn, <END> HttpContext context) throws IOException, HttpException { HttpResponse resp = new BasicHttpResponse(HttpVersion.HTTP_1_1, 302, null); resp.addHeader("location", "<LINK_0>/path"); requestsAttempted.incrementAndGet(); return resp; } }; HttpClient client = HttpClients.custom().setRequestExecutor(requestExecutor).build(); ApacheHttpTransport transport = new ApacheHttpTransport(client); ApacheHttpRequest request = transport.buildRequest("GET", "<LINK_0>"); LowLevelHttpResponse response = request.execute(); assertEquals(1, requestsAttempted.get()); assertEquals(302, response.getStatusCode()); }</code><technical_language>conn --> connection</technical_language>

Target:
public void testRequestShouldNotFollowRedirects() throws IOException { final AtomicInteger requestsAttempted = new AtomicInteger(0); HttpRequestExecutor requestExecutor = new HttpRequestExecutor() { @Override public HttpResponse execute(HttpRequest request, HttpClientConnection connection, HttpContext context) throws IOException, HttpException { HttpResponse response = new BasicHttpResponse(HttpVersion.HTTP_1_1, 302, null); response.addHeader("location", "<LINK_0>/path"); requestsAttempted.incrementAndGet(); return response; } }; HttpClient client = HttpClients.custom().setRequestExecutor(requestExecutor).build(); ApacheHttpTransport transport = new ApacheHttpTransport(client); ApacheHttpRequest request = transport.buildRequest("GET", "<LINK_0>"); LowLevelHttpResponse response = request.execute(); assertEquals(1, requestsAttempted.get()); assertEquals(302, response.getStatusCode()); }
Source:
<code>public void testIsFiltered() { Variant variant = Variant.newBuilder() .setId("Var1") <START> .addFilter("PASS") <END> .setReferenceBases("A") .addAlternateBases("G") .addAlternateBases("C") .addAlternateBases("T") .build(); assertFalse(VariantUtils.IS_FILTERED.apply(variant)); variant = Variant.newBuilder() .setId("Var2") .addFilter(".") .setReferenceBases("A") .addAlternateBases("G") .addAlternateBases("C") .addAlternateBases("T") .build(); assertFalse(VariantUtils.IS_FILTERED.apply(variant)); variant = Variant.newBuilder() .setId("Var3") .addFilter("BAD_SB_SCORE") .setReferenceBases("A") .addAlternateBases("G") .addAlternateBases("C") .addAlternateBases("T") .build(); assertTrue(VariantUtils.IS_FILTERED.apply(variant)); variant = Variant.newBuilder() .setId("Var4") .addFilter("LowQual") .addFilter("!ReallyBadHaplotype_score") .setReferenceBases("A") .addAlternateBases("G") .addAlternateBases("C") .addAlternateBases("T") .build(); assertTrue(VariantUtils.IS_FILTERED.apply(variant)); variant = Variant.newBuilder().setReferenceBases("A").addAlternateBases("G").build(); assertFalse(VariantUtils.IS_FILTERED.apply(variant)); }</code><technical_language>new String constant here</technical_language>

Target:
public void testIsFiltered() { Variant variant = Variant.newBuilder() .setId("Var1") .addFilter(VariantUtils.PASSES_FILTERS) .setReferenceBases("A") .addAlternateBases("G") .addAlternateBases("C") .addAlternateBases("T") .build(); assertFalse(VariantUtils.IS_FILTERED.apply(variant)); variant = Variant.newBuilder() .setId("Var2") .addFilter(VariantUtils.MISSING_VALUE) .setReferenceBases("A") .addAlternateBases("G") .addAlternateBases("C") .addAlternateBases("T") .build(); assertFalse(VariantUtils.IS_FILTERED.apply(variant)); variant = Variant.newBuilder() .setId("Var3") .addFilter("BAD_SB_SCORE") .setReferenceBases("A") .addAlternateBases("G") .addAlternateBases("C") .addAlternateBases("T") .build(); assertTrue(VariantUtils.IS_FILTERED.apply(variant)); variant = Variant.newBuilder() .setId("Var4") .addFilter("LowQual") .addFilter("!ReallyBadHaplotype_score") .setReferenceBases("A") .addAlternateBases("G") .addAlternateBases("C") .addAlternateBases("T") .build(); assertTrue(VariantUtils.IS_FILTERED.apply(variant)); variant = Variant.newBuilder().setReferenceBases("A").addAlternateBases("G").build(); assertFalse(VariantUtils.IS_FILTERED.apply(variant)); }
Source:
<code>public ResilienceStrategyProvider create(ServiceCreationConfiguration<ResilienceStrategyProvider> configuration) { if (configuration != null) { throw new IllegalArgumentException("Expected a null configuration but got " + configuration .getClass() <START> .getSimpleName()); <END> } return new DefaultResilienceStrategyProvider(); }</code><technical_language>getName() precise</technical_language>

Target:
public ResilienceStrategyProvider create(ServiceCreationConfiguration<ResilienceStrategyProvider> configuration) { if (configuration == null) { return new DefaultResilienceStrategyProvider(); } else if (configuration instanceof DefaultResilienceStrategyProviderConfiguration) { return new DefaultResilienceStrategyProvider((DefaultResilienceStrategyProviderConfiguration) configuration); } else { throw new IllegalArgumentException("Expected a configuration of type DefaultResilienceStrategyProviderConfiguration (or none) but got " + configuration .getClass() .getName()); } }
Source:
<code>protected Map<String, TraceTypeHelper> getTraceTypeMap() { Map<String, TraceTypeHelper> traceTypeMap = new TreeMap<>(); for (TraceTypeHelper helper : TmfTraceType.getTraceTypeHelpers()) { <START> String text = helper.getCategoryName() + SEP + helper.getName(); <END> traceTypeMap.put(text, helper); } return traceTypeMap; }</code><technical_language>a utility for that</technical_language>

Target:
protected Map<String, TraceTypeHelper> getTraceTypeMap() { Map<String, TraceTypeHelper> traceTypeMap = new TreeMap<>(); for (TraceTypeHelper helper : TmfTraceType.getTraceTypeHelpers()) { if (!helper.isExperimentType()) { String text = helper.getCategoryName() + SEP + helper.getName(); traceTypeMap.put(text, helper); } } return traceTypeMap; }
Source:
<code>public WebSocketCloseStatus(int statusCode, String reasonText) { if (!isValidStatusCode(statusCode)) { throw new IllegalArgumentException( "WebSocket close status code does NOT comply with RFC-6455: " + statusCode); } <START> if (reasonText == null) { <END> throw new NullPointerException("Reason text cannot be null"); } this.statusCode = statusCode; this.reasonText = reasonText; }</code><technical_language>ObjectUtil.checkNotNull(...)</technical_language>

Target:
public WebSocketCloseStatus(int statusCode, String reasonText) { if (!isValidStatusCode(statusCode)) { throw new IllegalArgumentException( "WebSocket close status code does NOT comply with RFC-6455: " + statusCode); } this.statusCode = statusCode; this.reasonText = checkNotNull(reasonText, "reasonText"); }
Source:
<code>public Set<ITmfEventType> getContainedEventTypes() { TmfEventTypeManager instance = TmfEventTypeManager.getInstance(); <START> return instance.getTypes(CtfTmfEventType.computeContextName(this)); <END> }</code><technical_language>want do a defensive copy here</technical_language>

Target:
public Set<ITmfEventType> getContainedEventTypes() { TmfEventTypeManager instance = TmfEventTypeManager.getInstance(); Set<ITmfEventType> eventTypes = instance.getTypes(CtfTmfEventType.computeContextName(this)); return ImmutableSet.copyOf(eventTypes); }
Source:
<code>public void execute() { String inviterId = getRequestParamValue(ParamsNames.INVITER_ID); Assumption.assertNotNull(inviterId); String courseId = getRequestParamValue(ParamsNames.COURSE_ID); Assumption.assertNotNull(courseId); <START> String inviteReceiverEmail = getRequestParamValue(ParamsNames.INVITE_RECEIVER_EMAIL); <END> Assumption.assertNotNull(inviteReceiverEmail); AccountAttributes inviter = logic.getAccount(inviterId); Assumption.assertNotNull(inviter); CourseAttributes course = logic.getCourse(courseId); Assumption.assertNotNull(course); InstructorAttributes inviteReceiver = logic.getInstructorForEmail(courseId, inviteReceiverEmail); Assumption.assertNotNull(inviteReceiver); EmailWrapper email = new EmailGenerator() .generateInstructorCourseJoinEmail(inviter, inviteReceiver, course); try { emailSender.sendEmail(email); } catch (Exception e) { throw new RuntimeException("Unexpected error while sending email", e); } }</code><technical_language>Similarly here: INSTRUCTOR_EMAIL do enough</technical_language>

Target:
public void execute() { String inviterId = getRequestParamValue(ParamsNames.INVITER_ID); Assumption.assertNotNull(inviterId); String courseId = getRequestParamValue(ParamsNames.COURSE_ID); Assumption.assertNotNull(courseId); String instructorEmail = getRequestParamValue(ParamsNames.INSTRUCTOR_EMAIL); Assumption.assertNotNull(instructorEmail); AccountAttributes inviter = logic.getAccount(inviterId); Assumption.assertNotNull(inviter); CourseAttributes course = logic.getCourse(courseId); Assumption.assertNotNull(course); InstructorAttributes instructor = logic.getInstructorForEmail(courseId, instructorEmail); Assumption.assertNotNull(instructor); EmailWrapper email = new EmailGenerator() .generateInstructorCourseJoinEmail(inviter, instructor, course); try { emailSender.sendEmail(email); } catch (Exception e) { throw new RuntimeException("Unexpected error while sending email", e); } }
Source:
<code>public Set<IndexFieldDTO> getIndexedFields(boolean update) throws Exception { Set<IndexFieldDTO> result = indexFields; if(result == null || update) { synchronized(solrIndexVersionLock) { result = indexFields; if(result == null || update) { result = getIndexFieldDetails(null); Map<String, IndexFieldDTO> resultMap = new HashMap<String, IndexFieldDTO>(); for(IndexFieldDTO field: result) { <START> resultMap.put(field.getName(), field); <END> } indexFields = result; indexFieldMap = resultMap; } } } return result; }</code><technical_language>field.getName() is unique. For purposes of ScatterplotController, field.getName() + field.isStored() is suitable unique</technical_language>

Target:
public Set<IndexFieldDTO> getIndexedFields(boolean update) throws Exception { Set<IndexFieldDTO> result = indexFields; if(result == null || update) { synchronized(solrIndexVersionLock) { result = indexFields; if(result == null || update) { result = indexFields = getIndexFieldDetails(null); Map<String, IndexFieldDTO> resultMap = new HashMap<String, IndexFieldDTO>(); for(IndexFieldDTO field: result) { resultMap.put(field.getName(), field); } indexFieldMap = resultMap; } } } return result; }
Source:
<code><START> public CoLocationConstraintDesc(final AbstractID coLocationGroupId, final int constraintIndex) { <END> this.coLocationGroupId = checkNotNull(coLocationGroupId); this.constraintIndex = constraintIndex; }</code><technical_language>suggestion CoLocationConstraintDesc(final AbstractID coLocationGroupId, final int constraintIndex) {</technical_language>

Target:
CoLocationConstraintDesc(final AbstractID coLocationGroupId, final int constraintIndex) { this.coLocationGroupId = checkNotNull(coLocationGroupId); this.constraintIndex = constraintIndex; }
Source:
<code>public List<File> getContextScreenshots() { List<File> screenshots = currentContextScreenshots.get(); return Collections.unmodifiableList(screenshots == null ? Collections.emptyList() : screenshots); <START> } <END></code><technical_language>I change order: is need call unmodifiableList for emptyList: return screenshots == null ? Collections.emptyList() : Collections.unmodifiableList(screenshots);</technical_language>

Target:
public List<File> getContextScreenshots() { List<File> screenshots = currentContextScreenshots.get(); return screenshots == null ? Collections.emptyList() : Collections.unmodifiableList(screenshots); }
Source:
<code>public HazmatArmorPiece(Category category, SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe, PotionEffect[] effects) { super(category, item, recipeType, recipe, effects, new NamespacedKey(SlimefunPlugin.instance, "hazmat_suit")); <START> types = new ProtectionType[] {ProtectionType.BEES, ProtectionType.RADIATION}; <END> }</code><technical_language>initialise right</technical_language>

Target:
public HazmatArmorPiece(Category category, SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe, PotionEffect[] effects) { super(category, item, recipeType, recipe, effects); types = new ProtectionType[] {ProtectionType.BEES, ProtectionType.RADIATION}; setId = new NamespacedKey(SlimefunPlugin.instance, "hazmat_suit"); }
Source:
<code>private String formatVolClusterName(String volClusterName) { if (volClusterName == null) { return null; } String[] names = volClusterName.split("\\|"); <START> return names.length == 2 ? names[0] + " (" + names[1] + ")" : names[0]; END> }</code><technical_language>I feel this alias name pass cluster volume names messages get a string " Volume data {0} of cluster {1} is replicated this volume " a thought</technical_language>

Target:
private String[] formatVolClusterName(String volClusterName) { if (volClusterName == null) { return null; } String[] names = volClusterName.split("\\|"); return names; }
Source:
<code>private void assertIsDefaultValues(StudentProfileAttributes profileAttributes) { <START> assertEquals("OTHER", profileAttributes.gender.name()); <END> assertEquals("", profileAttributes.googleId); assertEquals("", profileAttributes.shortName); assertEquals("", profileAttributes.email); assertEquals("", profileAttributes.institute); assertEquals("", profileAttributes.nationality); assertEquals("", profileAttributes.moreInfo); assertEquals("", profileAttributes.pictureKey); }</code><technical_language>is .name() necessary? compare enum</technical_language>

Target:
private void assertIsDefaultValues(StudentProfileAttributes profileAttributes) { assertEquals(Gender.OTHER, profileAttributes.gender); assertEquals(VALID_GOOGLE_ID, profileAttributes.googleId); assertEquals("", profileAttributes.shortName); assertEquals("", profileAttributes.email); assertEquals("", profileAttributes.institute); assertEquals("", profileAttributes.nationality); assertEquals("", profileAttributes.moreInfo); assertEquals("", profileAttributes.pictureKey); }
Source:
<code>protected boolean formatStorage(StorageDomain dom, VDS vds) { try { return getVdsBroker() .RunVdsCommand(VDSCommandType.FormatStorageDomain, new FormatStorageDomainVDSCommandParameters(vds.getId(), dom.getId())).getSucceeded(); } catch (VdcBLLException e) { <START> if (e.getVdsError().getCode() != VdcBllErrors.StorageDomainDoesNotExist) { <END> throw e; } log.warnFormat("Storage Domain {0} which was about to be formatted was not exists in VDS id {1}", vds.getId(), dom.getId()); return true; } }</code><technical_language>1. please replace getVdsError().getCode() getErrorCode(). 2. please consider change VdcBllErrors.StorageDomainDoesNotExist.equals.</technical_language>

Target:
protected boolean formatStorage(StorageDomain dom, VDS vds) { try { return getVdsBroker() .RunVdsCommand(VDSCommandType.FormatStorageDomain, new FormatStorageDomainVDSCommandParameters(vds.getId(), dom.getId())).getSucceeded(); } catch (VdcBLLException e) { if (e.getErrorCode() != VdcBllErrors.StorageDomainDoesNotExist) { throw e; } log.warnFormat("Storage Domain {0} which was about to be formatted does not exist in VDS {1}", dom.getName(), vds.getName()); return true; } }
Source:
<code>protected boolean canDoAction() { VdsValidator validator = new VdsValidator(getVds()); <START> return validate(validator.isUp()); <END> }</code><technical_language>Check if supports Disk provisioning feature</technical_language>

Target:
protected boolean canDoAction() { VDSGroup cluster = getDbFacade().getVdsGroupDao().get(getVds().getVdsGroupId()); if (!cluster.supportsGlusterService() || !GlusterFeatureSupported.glusterDiskProvisioning(cluster.getCompatibilityVersion())) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_PROVISIONING_NOT_SUPPORTED_BY_CLUSTER); } VdsValidator validator = new VdsValidator(getVds()); return validate(validator.isUp()); }
Source:
<code>public void close() throws InterruptedException { if (m_blessedThreadIds.contains(Thread.currentThread().getId())) { throw new RuntimeException("Can't invoke backpressureBarrier from within the client callback thread " + " without deadlocking the client library"); } m_isShutdown = true; synchronized (m_backpressureLock) { m_backpressureLock.notifyAll(); } if (m_reconnectStatusListener != null) { m_distributer.removeClientStatusListener(m_reconnectStatusListener); m_reconnectStatusListener.close(); } m_distributer.shutdown(); <START> m_ex.shutdown(); <END> m_ex.awaitTermination(365, TimeUnit.DAYS); ClientFactory.decreaseClientNum(); }</code><technical_language>This executor pushed Distributer</technical_language>

Target:
public void close() throws InterruptedException { if (m_blessedThreadIds.contains(Thread.currentThread().getId())) { throw new RuntimeException("Can't invoke backpressureBarrier from within the client callback thread " + " without deadlocking the client library"); } m_isShutdown = true; synchronized (m_backpressureLock) { m_backpressureLock.notifyAll(); } if (m_reconnectStatusListener != null) { m_distributer.removeClientStatusListener(m_reconnectStatusListener); m_reconnectStatusListener.close(); } if (m_ex != null) { m_ex.shutdown(); m_ex.awaitTermination(1, TimeUnit.SECONDS); } m_distributer.shutdown(); ClientFactory.decreaseClientNum(); }
Source:
<code>protected CompiledPlan compileAdHocCalcitePlan(String sql, boolean inferPartitioning, boolean forcedSP, DeterminismMode detMode) { CompiledPlan cp = null; try { cp = m_aide.compileAdHocPlan(PlannerType.CALCITE, sql, inferPartitioning, forcedSP, detMode); assertNotNull(cp); } catch (Exception ex) { <START> fail(ex.getMessage()); <END> } return cp; }</code><technical_language>exception bubble fail test test throw exception. entire stack trace is captured junit</technical_language>

Target:
protected CompiledPlan compileAdHocCalcitePlan(String sql, boolean inferPartitioning, boolean forcedSP, DeterminismMode detMode) { CompiledPlan cp = m_aide.compileAdHocPlan(PlannerType.CALCITE, sql, inferPartitioning, forcedSP, detMode); assertNotNull(cp); return cp; }
Source:
<code>public void interrupt( @Nonnull Thread thread, @Nullable String template, @Nullable Object... args) { String message = String.format(String.valueOf(template), args); <START> mInterruptMessage.put(thread, message); <END> }</code><technical_language>need interrupt a thread if is interruptible? (to calls Thread.sleep() interrupted)</technical_language>

Target:
public void interrupt( @Nonnull Thread thread, @Nullable String template, @Nullable Object... args) { String message = String.format(String.valueOf(template), args); mInterruptMessage.put(thread, message); if (isInterruptible(thread)) { thread.interrupt(); } }