auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>protected boolean isOperationAllowed(boolean isWrite, long flagBitSet) { if (availabilityMode == AvailabilityMode.AVAILABLE) return true; switch (partitionHandling) { case ALLOW_READ_WRITES: return true; case ALLOW_READS: <START> if (EnumUtil.enumSetOf(flagBitSet, Flag.class).contains(Flag.FORCE_WRITE_LOCK)) <END> throw log.degradedModeForceWriteLockUnavailable(); return !isWrite; default: return false; } }</code><technical_language>EnumUtil.containsAny(flagBitSet, FlagBitSets.FORCE_WRITE_LOCK)</technical_language>

Target:
protected boolean isOperationAllowed(boolean isWrite, long flagBitSet) { if (availabilityMode == AvailabilityMode.AVAILABLE) return true; switch (partitionHandling) { case ALLOW_READ_WRITES: return true; case ALLOW_READS: if (EnumUtil.containsAny(flagBitSet, FlagBitSets.FORCE_WRITE_LOCK)) throw log.degradedModeLockUnavailable(); return !isWrite; default: return false; } }
Source:
<code>public double getTurnSpeed() { try { return motionController.getSafely(); } catch (final InvalidSensorException e) { move.cancel(); cancel(); if (fallbackCommand != null) { <START> fallbackCommand.initialize(); <END> } return 0; } }</code><technical_language>I mentioned above, schedule() initialize()</technical_language>

Target:
public double getTurnSpeed() { try { return motionController.getSafely(); } catch (final InvalidSensorException e) { move.cancel(); cancel(); if (fallbackCommand != null) { fallbackCommand.schedule(); } return 0; } }
Source:
<code>private static SampleTissueProcessingDto asTissueProcessingSampleDto(SampleTissueProcessing from) { SampleTissueProcessingDto dto = null; <START> if (from.getClass() == SampleCVSlideImpl.class) { <END> dto = asCVSlideSampleDto((SampleCVSlide) from); } else if (from.getClass() == SampleLCMTubeImpl.class) { dto = asLCMTubeSampleDto((SampleLCMTube) from); } else { dto = new SampleTissueProcessingDto(); } return dto; }</code><technical_language>getClass comparison is required for Dtos of inheritance works (analyte is a tissue identity for purpose of including parent data), instanceof (and typically for non-dto models), check vs. interfaces for flexibility. e.g. add another implementation of SampleCVSlide this method work for, subclass SampleCVSlideImpl (however unlikely)</technical_language>

Target:
private static SampleTissueProcessingDto asTissueProcessingSampleDto(SampleTissueProcessing from) { SampleTissueProcessingDto dto = null; if (from instanceof SampleCVSlideImpl) { dto = asCVSlideSampleDto((SampleCVSlide) from); } else if (from.getClass() == SampleLCMTubeImpl.class) { dto = asLCMTubeSampleDto((SampleLCMTube) from); } else { dto = new SampleTissueProcessingDto(); } return dto; }
Source:
<code>private CommittableTypeInformation<CommT> extractCommittableTypeInformation(Sink<InputT, CommT, WriterStateT, GlobalCommT> sink) { if (sink.getCommittableSerializer().isPresent()) { final Type committableType = TypeExtractor.getParameterType( Sink.class, sink.getClass(), 1); return new CommittableTypeInformation<>( <START> typeToClass(committableType), () -> sink.getCommittableSerializer().get()); <END> } else { return null; } }</code><technical_language>nit: () -> sink.getCommittableSerializer().get()) in new line</technical_language>

Target:
private CommittableTypeInformation<CommT> extractCommittableTypeInformation(Sink<InputT, CommT, WriterStateT, GlobalCommT> sink) { if (sink.getCommittableSerializer().isPresent()) { final Type committableType = TypeExtractor.getParameterType( Sink.class, sink.getClass(), 1); LOG.debug("Extract committable from sink [{}].", committableType.toString(), sink.getClass().getCanonicalName()); return new CommittableTypeInformation<>( typeToClass(committableType), () -> sink.getCommittableSerializer().get()); } else { return null; } }
Source:
<code><START> public ResponseEntity deleteGroup(@PathVariable(value = "groupName") String groupName) { <END> groupService.deleteGroup(groupName); return ResponseEntity.accepted().build(); }</code><technical_language>A test case in GroupRestControllerTest nice</technical_language>

Target:
public ResponseEntity deleteGroup(@PathVariable(value = "groupName") String groupName) { groupService.deleteGroup(groupName); return ResponseEntity.noContent().build(); }
Source:
<code>private void downloadToFileCleanup(AsynchronousFileChannel channel, String filePath, SignalType signalType) { try { channel.close(); <START> if (!signalType.equals(SignalType.ON_COMPLETE)) { <END> Files.delete(Paths.get(filePath)); } } catch (IOException e) { throw logger.logExceptionAsError(new UncheckedIOException(e)); } }</code><technical_language>This is a safeguard in case operation fails user a potentially corrupted file, correct? If so, want log a message stating operation able successfully complete, cleaning resources</technical_language>

Target:
private void downloadToFileCleanup(AsynchronousFileChannel channel, String filePath, SignalType signalType) { try { channel.close(); if (!signalType.equals(SignalType.ON_COMPLETE)) { Files.delete(Paths.get(filePath)); logger.verbose("Downloading to file failed. Cleaning up resources."); } } catch (IOException e) { throw logger.logExceptionAsError(new UncheckedIOException(e)); } }
Source:
<code>public @ResponseBody Map<String, Object> updatePassword(String oldPassword, String newPassword) { LOG.debug("Requested to update a password."); try { boolean success = this.service.updatePassword(oldPassword, newPassword); if(success) { return ResultSet.success("Password has successfully been updated."); } return ResultSet <START> .error("Password could NOT been updated. Please check if the old password was passed correctly."); <END> } catch (Exception e) { final String message = e.getMessage(); LOG.error("Could not update a password: " + message); return ResultSet.error(message); } }</code><technical_language>.. ~been~ *be* updated</technical_language>

Target:
public @ResponseBody Map<String, Object> updatePassword(String oldPassword, String newPassword) { LOG.debug("Requested to update a password."); try { boolean success = this.service.updatePassword(oldPassword, newPassword); if(success) { return ResultSet.success("Password has successfully been updated."); } return ResultSet .error("Password could NOT be updated. Please check if the old password was passed correctly."); } catch (Exception e) { final String message = e.getMessage(); LOG.error("Could not update a password: " + message); return ResultSet.error(message); } }
Source:
<code>public static XBeePacket parsePacket(String packet) throws XBeeException, PacketParsingException { <START> return parsePacket(HexUtils.hexStringToByteArray(packet.trim().replace(" ", ""))); <END> }</code><technical_language>do throw XBee Exception here</technical_language>

Target:
public static XBeePacket parsePacket(String packet) throws PacketParsingException { if (packet == null) throw new NullPointerException("Packet cannot be null."); return parsePacket(HexUtils.hexStringToByteArray(packet.trim().replace(" ", ""))); }
Source:
<code>public KeycloakUserRemover( @Nullable @Named("che.keycloak.cascade_user_removal_enabled") boolean userRemovalEnabled, @Nullable @Named("che.keycloak.admin_username") String keycloakUser, @Nullable @Named("che.keycloak.admin_password") String keycloakPassword, KeycloakSettings keycloakSettings, HttpJsonRequestFactory requestFactory) { this.keycloakUser = keycloakUser; this.keycloakPassword = keycloakPassword; this.requestFactory = requestFactory; if (userRemovalEnabled) { String serverUrl = keycloakSettings.get().get(AUTH_SERVER_URL_SETTING); if (serverUrl == null) { <START> throw new RuntimeException(AUTH_SERVER_URL_SETTING + " is not configured"); <END> } String realm = keycloakSettings.get().get(REALM_SETTING); if (realm == null) { throw new RuntimeException(REALM_SETTING + " is not configured"); } if (Strings.isNullOrEmpty(keycloakUser) || Strings.isNullOrEmpty(keycloakPassword)) { throw new RuntimeException("Keycloak administrator username or password not set."); } this.keycloakTokenEndpoint = serverUrl + "/realms/master/protocol/openid-connect/token"; this.keycloakRemoveUserUrl = serverUrl + "/admin/realms/" + realm + "/users/"; } }</code><technical_language>I org.eclipse.che.inject.ConfigurationException for cases configuration is invalid</technical_language>

Target:
public KeycloakUserRemover( @Nullable @Named("che.keycloak.cascade_user_removal_enabled") boolean userRemovalEnabled, @Nullable @Named("che.keycloak.admin_username") String keycloakUser, @Nullable @Named("che.keycloak.admin_password") String keycloakPassword, KeycloakSettings keycloakSettings, HttpJsonRequestFactory requestFactory) { this.keycloakUser = keycloakUser; this.keycloakPassword = keycloakPassword; this.requestFactory = requestFactory; if (userRemovalEnabled) { String serverUrl = keycloakSettings.get().get(AUTH_SERVER_URL_SETTING); if (serverUrl == null) { throw new ConfigurationException(AUTH_SERVER_URL_SETTING + " is not configured"); } String realm = keycloakSettings.get().get(REALM_SETTING); if (realm == null) { throw new ConfigurationException(REALM_SETTING + " is not configured"); } if (Strings.isNullOrEmpty(keycloakUser) || Strings.isNullOrEmpty(keycloakPassword)) { throw new ConfigurationException("Keycloak administrator username or password not set."); } this.keycloakTokenEndpoint = serverUrl + "/realms/master/protocol/openid-connect/token"; this.keycloakRemoveUserUrl = serverUrl + "/admin/realms/" + realm + "/users/"; } }
Source:
<code>protected Set<Value.Immutable<?>> api$getVanillaValues() { final Set<Value.Immutable<?>> vanillaValues = super.api$getVanillaValues(); <START> if (this.shadow$getBeamTarget() != null) { <END> this.beamTarget().map(Value::asImmutable).ifPresent(vanillaValues::add); } vanillaValues.add(this.showBottom().asImmutable()); return vanillaValues; }</code><technical_language>this</technical_language>

Target:
protected Set<Value.Immutable<?>> api$getVanillaValues() { final Set<Value.Immutable<?>> values = super.api$getVanillaValues(); this.explosionRadius().map(Value::asImmutable).ifPresent(values::add); values.add(this.showBottom().asImmutable()); this.beamTarget().map(Value::asImmutable).ifPresent(values::add); return values; }
Source:
<code>public SessionResultsBundle(FeedbackSessionAttributes feedbackSession, Map<String, FeedbackQuestionAttributes> questionsMap, List<FeedbackResponseAttributes> responses, Map<String, boolean[]> responseVisibilityTable, Map<String, List<FeedbackResponseCommentAttributes>> responseCommentsMap, Map<Long, boolean[]> commentVisibilityTable, CourseRoster roster) { this.feedbackSession = feedbackSession; this.questionsMap = questionsMap; this.responseCommentsMap = responseCommentsMap; this.responseVisibilityTable = responseVisibilityTable; this.commentVisibilityTable = commentVisibilityTable; this.roster = roster; questionResponseMap = new LinkedHashMap<>(); List<FeedbackQuestionAttributes> questions = new ArrayList<>(questionsMap.values()); for (FeedbackQuestionAttributes question : questions) { <START> questionResponseMap.put(question.getId(), new ArrayList<>()); <END> } for (FeedbackResponseAttributes response : responses) { FeedbackQuestionAttributes question = questionsMap.get(response.getFeedbackQuestionId()); List<FeedbackResponseAttributes> responsesForQuestion = questionResponseMap.get(question.getId()); responsesForQuestion.add(response); } }</code><technical_language>consistent of this. here</technical_language>

Target:
public SessionResultsBundle(FeedbackSessionAttributes feedbackSession, Map<String, FeedbackQuestionAttributes> questionsMap, List<FeedbackResponseAttributes> responses, Map<String, boolean[]> responseVisibilityTable, Map<String, List<FeedbackResponseCommentAttributes>> responseCommentsMap, Map<Long, boolean[]> commentVisibilityTable, CourseRoster roster) { this.feedbackSession = feedbackSession; this.questionsMap = questionsMap; this.responseCommentsMap = responseCommentsMap; this.responseVisibilityTable = responseVisibilityTable; this.commentVisibilityTable = commentVisibilityTable; this.roster = roster; buildQuestionToResponseMap(responses); }
Source:
<code>protected void executeVmCommand() { addCustomValue("InterfaceType", (VmInterfaceType.forValue(getInterface().getType()).getDescription()).toString()); boolean succeeded = false; boolean macAddedToPool = false; try { if (isVnicProfileChanged(oldIface, getInterface())) { Network newNetwork = NetworkHelper.getNetworkByVnicProfileId(getInterface().getVnicProfileId()); Network oldNetwork = NetworkHelper.getNetworkByVnicProfileId(oldIface.getVnicProfileId()); if (ObjectUtils.notEqual(oldNetwork, newNetwork)) { new ExternalNetworkManager(oldIface).deallocateIfExternal(); } } if (macShouldBeChanged) { macAddedToPool = addMacToPool(getMacAddress()); } if (mustChangeAddress(oldIface.getType(), getInterface().getType())) { <START> VmDeviceUtils.clearNicAddress(getInterface().getVmId(), getInterface().getId()); <END> } getInterface().setSpeed(VmInterfaceType.forValue(getInterface().getType()).getSpeed()); TransactionSupport.executeInNewTransaction(new TransactionMethod<Void>() { @Override public Void runInTransaction() { getCompensationContext().snapshotEntity(oldIface); getVmNicDao().update(getInterface()); getCompensationContext().stateChanged(); return null; } }); succeeded = updateHost(); } finally { setSucceeded(succeeded); if (macAddedToPool) { if (succeeded) { MacPoolManager.getInstance().freeMac(oldIface.getMacAddress()); } else { MacPoolManager.getInstance().freeMac(getMacAddress()); } } } }</code><technical_language>this method needed, replaced a call to: getVmDeviceDao().clearDeviceAddress(getInterface().getId());</technical_language>

Target:
protected void executeVmCommand() { addCustomValue("InterfaceType", (VmInterfaceType.forValue(getInterface().getType()).getDescription()).toString()); boolean succeeded = false; boolean macAddedToPool = false; try { if (isVnicProfileChanged(oldIface, getInterface())) { Network newNetwork = NetworkHelper.getNetworkByVnicProfileId(getInterface().getVnicProfileId()); Network oldNetwork = NetworkHelper.getNetworkByVnicProfileId(oldIface.getVnicProfileId()); if (ObjectUtils.notEqual(oldNetwork, newNetwork)) { new ExternalNetworkManager(oldIface).deallocateIfExternal(); } } if (macShouldBeChanged) { macAddedToPool = addMacToPool(getMacAddress()); } if (mustChangeAddress(oldIface.getType(), getInterface().getType())) { getVmDeviceDao().clearDeviceAddress(getInterface().getId()); } getInterface().setSpeed(VmInterfaceType.forValue(getInterface().getType()).getSpeed()); TransactionSupport.executeInNewTransaction(new TransactionMethod<Void>() { @Override public Void runInTransaction() { getCompensationContext().snapshotEntity(oldIface); getVmNicDao().update(getInterface()); getCompensationContext().stateChanged(); return null; } }); succeeded = updateHost(); } finally { setSucceeded(succeeded); if (macAddedToPool) { if (succeeded) { MacPoolManager.getInstance().freeMac(oldIface.getMacAddress()); } else { MacPoolManager.getInstance().freeMac(getMacAddress()); } } } }
Source:
<code>static ReceiveCommand parseCommand(String line) { <START> final ObjectId oldId = ObjectId.fromString(line.substring(0, 40)); <END> final ObjectId newId = ObjectId.fromString(line.substring(41, 81)); String name = line.substring(82); final ReceiveCommand cmd = new ReceiveCommand(oldId, newId, name); return cmd; }</code><technical_language>final necessary in new code; i call this new code</technical_language>

Target:
static ReceiveCommand parseCommand(String line) { ObjectId oldId = ObjectId.fromString(line.substring(0, 40)); ObjectId newId = ObjectId.fromString(line.substring(41, 81)); String name = line.substring(82); return new ReceiveCommand(oldId, newId, name); }
Source:
<code>protected void postShutdownHook() { if (_enablePartitionAssignment) { boolean isInterrupted = false; for (int numAttempts = 0; numAttempts < 3; ++numAttempts) { try { <START> LOG.info("Releasing the lock on datastreamTask: {}, isInterrupted: {}", _datastreamTask, isInterrupted); <END> _datastreamTask.release(); return; } catch (ZkInterruptedException e) { LOG.warn("Releasing the task lock failed for datastreamTask: {}, retrying", _datastreamTask); if (Thread.currentThread().isInterrupted()) { isInterrupted = Thread.interrupted(); } } finally { if (isInterrupted) { Thread.currentThread().interrupt(); } } } } }</code><technical_language>nit: Please print attempt number well</technical_language>

Target:
protected void postShutdownHook() { if (_enablePartitionAssignment) { boolean resetInterrupted = false; try { for (int numAttempts = 1; numAttempts <= 3; ++numAttempts) { try { LOG.info("Releasing the lock on datastreamTask: {}, was thread interrupted: {}, attempt: {}", _datastreamTask, resetInterrupted, numAttempts); _datastreamTask.release(); break; } catch (ZkInterruptedException e) { LOG.warn("Releasing the task lock failed for datastreamTask: {}, retrying", _datastreamTask); if (Thread.currentThread().isInterrupted()) { resetInterrupted = Thread.interrupted(); } } } } finally { if (resetInterrupted) { Thread.currentThread().interrupt(); } } } }
Source:
<code>public FindResultViewImpl( PartStackUIResources resources, FindResultNodeFactory findResultNodeFactory, CoreLocalizationConstant localizationConstant) { super(resources); setTitle(localizationConstant.actionFullTextSearch()); this.findResultNodeFactory = findResultNodeFactory; NodeStorage nodeStorage = new NodeStorage(); NodeLoader loader = new NodeLoader(Collections.<NodeInterceptor>emptySet()); tree = new Tree(nodeStorage, loader); <START> tree.ensureDebugId("resultSearchTree"); <END> ensureDebugId("findInfoPanel"); tree.getSelectionModel() .addSelectionChangedHandler( new SelectionChangedEvent.SelectionChangedHandler() { @Override public void onSelectionChanged(SelectionChangedEvent event) { delegate.onSelectionChanged(event.getSelection()); } }); setContentWidget(tree); tree.setAutoSelect(true); }</code><technical_language>IMHO explain proposal of setup debug id prevent occasional removal in future, follow: > do remove debug id; needed for selenium tests</technical_language>

Target:
public FindResultViewImpl( PartStackUIResources resources, FindResultNodeFactory findResultNodeFactory, CoreLocalizationConstant localizationConstant) { super(resources); setTitle(localizationConstant.actionFullTextSearch()); this.findResultNodeFactory = findResultNodeFactory; NodeStorage nodeStorage = new NodeStorage(); NodeLoader loader = new NodeLoader(Collections.<NodeInterceptor>emptySet()); tree = new Tree(nodeStorage, loader); tree.ensureDebugId("result-search-tree"); ensureDebugId("find-info-panel"); tree.getSelectionModel() .addSelectionChangedHandler( new SelectionChangedEvent.SelectionChangedHandler() { @Override public void onSelectionChanged(SelectionChangedEvent event) { delegate.onSelectionChanged(event.getSelection()); } }); setContentWidget(tree); tree.setAutoSelect(true); }
Source:
<code>public GitHubPRPullRequest(GHPullRequest pr) throws IOException { userLogin = pr.getUser().getLogin(); number = pr.getNumber(); prUpdatedAt = pr.getUpdatedAt(); <START> issueUpdatedAt = pr.getUpdatedAt(); <END> headSha = pr.getHead().getSha(); headRef = pr.getHead().getRef(); title = pr.getTitle(); baseRef = pr.getBase().getRef(); htmlUrl = pr.getHtmlUrl(); try { Date maxDate = new Date(0); List<GHIssueComment> comments = execute(() -> pr.getComments()); for (GHIssueComment comment : comments) { if (comment.getCreatedAt().compareTo(maxDate) > 0) { maxDate = comment.getCreatedAt(); } } lastCommentCreatedAt = maxDate.getTime() == 0 ? null : new Date(maxDate.getTime()); } catch (IOException e) { LOGGER.error("Can't get comments for PR: {}", pr.getNumber(), e); lastCommentCreatedAt = null; } try { userEmail = execute(() -> pr.getUser().getEmail()); } catch (Exception e) { LOGGER.error("Can't get GitHub user email.", e); userEmail = ""; } GHRepository remoteRepo = pr.getRepository(); try { updateLabels(execute(() -> remoteRepo.getIssue(number).getLabels())); } catch (IOException e) { LOGGER.error("Can't retrieve label list: {}", e); inBadState = true; } try { mergeable = execute(() -> pr.getMergeable()); } catch (IOException e) { LOGGER.error("Can't get mergeable status.", e); mergeable = false; } sourceRepoOwner = remoteRepo.getOwnerName(); state = pr.getState().toString(); body = pr.getBody(); }</code><technical_language><LINK_1> change of wrong deprecation. github-api is bad maintained, kohsuke randomly do changes</technical_language>

Target:
public GitHubPRPullRequest(GHPullRequest pr) throws IOException { userLogin = pr.getUser().getLogin(); number = pr.getNumber(); prUpdatedAt = pr.getUpdatedAt(); issueUpdatedAt = pr.getIssueUpdatedAt(); headSha = pr.getHead().getSha(); headRef = pr.getHead().getRef(); title = pr.getTitle(); baseRef = pr.getBase().getRef(); htmlUrl = pr.getHtmlUrl(); try { Date maxDate = new Date(0); List<GHIssueComment> comments = execute(() -> pr.getComments()); for (GHIssueComment comment : comments) { if (comment.getCreatedAt().compareTo(maxDate) > 0) { maxDate = comment.getCreatedAt(); } } lastCommentCreatedAt = maxDate.getTime() == 0 ? null : new Date(maxDate.getTime()); } catch (IOException e) { LOGGER.error("Can't get comments for PR: {}", pr.getNumber(), e); lastCommentCreatedAt = null; } try { userEmail = execute(() -> pr.getUser().getEmail()); } catch (Exception e) { LOGGER.error("Can't get GitHub user email.", e); userEmail = ""; } GHRepository remoteRepo = pr.getRepository(); try { updateLabels(execute(() -> remoteRepo.getIssue(number).getLabels())); } catch (IOException e) { LOGGER.error("Can't retrieve label list: {}", e); inBadState = true; } try { mergeable = execute(() -> pr.getMergeable()); } catch (IOException e) { LOGGER.error("Can't get mergeable status.", e); mergeable = false; } sourceRepoOwner = remoteRepo.getOwnerName(); state = pr.getState().toString(); body = pr.getBody(); }
Source:
<code><START> public FyberRewardedVideoRenderer(MediationRewardedAdConfiguration adConfiguration, <END> MediationAdLoadCallback<MediationRewardedAd, MediationRewardedAdCallback> adLoadCallback) { mAdConfiguration = adConfiguration; mAdLoadCallback = adLoadCallback; }</code><technical_language>Set package-private. render()</technical_language>

Target:
FyberRewardedVideoRenderer(MediationRewardedAdConfiguration adConfiguration, MediationAdLoadCallback<MediationRewardedAd, MediationRewardedAdCallback> adLoadCallback) { mAdConfiguration = adConfiguration; mAdLoadCallback = adLoadCallback; }
Source:
<code>private Tuple2<ProtectedMailboxStorageEntry, DecryptedMessageWithPubKey> decryptProtectedMailboxStorageEntry( ProtectedMailboxStorageEntry protectedMailboxStorageEntry) { try { DecryptedMessageWithPubKey decryptedMessageWithPubKey = encryptionService.decryptAndVerify(protectedMailboxStorageEntry .getMailboxStoragePayload() <START> .getPrefixedSealedAndSignedMessage() <END> .getSealedAndSigned()); checkArgument(decryptedMessageWithPubKey.getNetworkEnvelope() instanceof MailboxMessage); return new Tuple2<>(protectedMailboxStorageEntry, decryptedMessageWithPubKey); } catch (CryptoException ignore) { } catch (ProtobufferException e) { log.error(e.toString()); e.getStackTrace(); } return null; }</code><technical_language>Is plan prefixed messages a random prefix messages attributable? a bit of overhead for easier transition. get rid of prefix later</technical_language>

Target:
private MailboxItem decryptProtectedMailboxStorageEntry(ProtectedMailboxStorageEntry protectedMailboxStorageEntry) { try { DecryptedMessageWithPubKey decryptedMessageWithPubKey = encryptionService.decryptAndVerify(protectedMailboxStorageEntry .getMailboxStoragePayload() .getPrefixedSealedAndSignedMessage() .getSealedAndSigned()); checkArgument(decryptedMessageWithPubKey.getNetworkEnvelope() instanceof MailboxMessage); return new MailboxItem(protectedMailboxStorageEntry, decryptedMessageWithPubKey); } catch (CryptoException ignore) { } catch (ProtobufferException e) { log.error(e.toString()); e.getStackTrace(); } return null; }
Source:
<code>public boolean enterATCommandMode() throws InvalidOperatingModeException, XBeeException { if (operatingMode != OperatingMode.AT) throw new InvalidOperatingModeException("Invalid mode. Command mode can only be accesses while in AT mode."); byte[] readData = new byte[256]; try { connectionInterface.writeData(new byte[]{COMMAND_MODE_CHAR}); connectionInterface.writeData(new byte[]{COMMAND_MODE_CHAR}); connectionInterface.writeData(new byte[]{COMMAND_MODE_CHAR}); <START> Thread.sleep(1500); <END> int readBytes = connectionInterface.readData(readData); if (readBytes < 3) throw new XBeeException(XBeeException.CONNECTION_TIMEOUT); for (int i = 0; i < 3; i++) { if (readData[i] != COMMAND_MODE_OK.getBytes()[i]) return false; } return true; } catch (IOException e) { } catch (InterruptedException e) { } return false; }</code><technical_language>Move this time a constant</technical_language>

Target:
public boolean enterATCommandMode() throws InvalidOperatingModeException, XBeeException { if (operatingMode != OperatingMode.AT) throw new InvalidOperatingModeException("Invalid mode. Command mode can only be accesses while in AT mode."); byte[] readData = new byte[256]; try { connectionInterface.writeData(COMMAND_MODE_CHAR.getBytes()); connectionInterface.writeData(COMMAND_MODE_CHAR.getBytes()); connectionInterface.writeData(COMMAND_MODE_CHAR.getBytes()); Thread.sleep(TIMEOUT_ENTER_COMMAND_MODE); int readBytes = connectionInterface.readData(readData); if (readBytes < COMMAND_MODE_OK.length()) throw new XBeeException(XBeeException.CONNECTION_TIMEOUT); String readString = new String(readData, 0, readBytes); if (!readString.contains(COMMAND_MODE_OK)) return false; return true; } catch (IOException e) { } catch (InterruptedException e) { } return false; }
Source:
<code>public void setUp() throws Exception { testUser = "testUser" + System.currentTimeMillis(); testEmail = testUser + "@gmail.com"; String testPassword = "pwspws"; listenerMock = Mockito.mock(TaskListener.class); authenticator = new ServerAuthenticator(testUser, testPassword, token, CatrobatWebClient.INSTANCE.getClient(), BASE_URL_TEST_HTTPS, listenerMock <START> ); <END> sharedPreferences = PreferenceManager.getDefaultSharedPreferences(InstrumentationRegistry.getTargetContext()); }</code><technical_language>is this line</technical_language>

Target:
public void setUp() throws Exception { testUser = "testUser" + System.currentTimeMillis(); testEmail = testUser + "@gmail.com"; String testPassword = "pwspws"; listenerMock = Mockito.mock(TaskListener.class); sharedPreferences = PreferenceManager.getDefaultSharedPreferences(InstrumentationRegistry.getTargetContext()); authenticator = new ServerAuthenticator(testUser, testPassword, token, CatrobatWebClient.INSTANCE.getClient(), BASE_URL_TEST_HTTPS, sharedPreferences.edit(), listenerMock); }
Source:
<code>public List<PoolUpdate> updatePoolsFromStack(Consumer consumer, List<Pool> pools, boolean deleteIfNoStackedEnts) { Map<String, List<Entitlement>> entitlementMap = new HashMap<String, List<Entitlement>>(); Set<String> sourceStackIds = new HashSet<String>(); List<PoolUpdate> result = new ArrayList<PoolUpdate>(); for (Pool pool : pools) { sourceStackIds.add(pool.getSourceStackId()); } List<Entitlement> stackedEnts = this.entCurator.findByStackIds(consumer, sourceStackIds); for (Entitlement entitlement : stackedEnts) { if (!entitlementMap.containsKey(entitlement.getPool().getStackId())) { entitlementMap.put(entitlement.getPool().getStackId(), new ArrayList<Entitlement>()); } <START> entitlementMap.get(entitlement.getPool().getStackId()).add(entitlement); <END> } List<Pool> poolsToDelete = new ArrayList<Pool>(); for (Pool pool : pools) { List<Entitlement> entitlements = entitlementMap.get(pool.getSourceStackId()); if (CollectionUtils.isNotEmpty(entitlements)) { result.add(this.updatePoolFromStackedEntitlements(pool, entitlements, new HashSet<Product>())); } else if (deleteIfNoStackedEnts) { poolsToDelete.add(pool); } } if (!poolsToDelete.isEmpty()) { this.poolManager.deletePools(poolsToDelete); } return result; }</code><technical_language>Another mapped list block optimized</technical_language>

Target:
public List<PoolUpdate> updatePoolsFromStack(Consumer consumer, List<Pool> pools, boolean deleteIfNoStackedEnts) { Map<String, List<Entitlement>> entitlementMap = new HashMap<String, List<Entitlement>>(); Set<String> sourceStackIds = new HashSet<String>(); List<PoolUpdate> result = new ArrayList<PoolUpdate>(); for (Pool pool : pools) { sourceStackIds.add(pool.getSourceStackId()); } List<Entitlement> stackedEnts = this.entCurator.findByStackIds(consumer, sourceStackIds); for (Entitlement entitlement : stackedEnts) { List<Entitlement> ents = entitlementMap.get(entitlement.getPool().getStackId()); if (ents == null) { ents = new ArrayList<Entitlement>(); entitlementMap.put(entitlement.getPool().getStackId(), ents); } ents.add(entitlement); } List<Pool> poolsToDelete = new ArrayList<Pool>(); for (Pool pool : pools) { List<Entitlement> entitlements = entitlementMap.get(pool.getSourceStackId()); if (CollectionUtils.isNotEmpty(entitlements)) { result.add(this.updatePoolFromStackedEntitlements(pool, entitlements, new HashSet<Product>())); } else if (deleteIfNoStackedEnts) { poolsToDelete.add(pool); } } if (!poolsToDelete.isEmpty()) { this.poolManager.deletePools(poolsToDelete); } return result; }
Source:
<code>public boolean isMatch(String ref) { if (ref == null) return false; if (isWildcard) <START> return ref.startsWith(refName.substring(0, refName.length() - 1)); <END> return refName.equals(ref); }</code><technical_language>stripWildcard(refName)</technical_language>

Target:
public boolean isMatch(String ref) { if (ref == null) return false; if (isWildcard) return ref.startsWith(stripWildcard(refName)); return refName.equals(ref); }
Source:
<code>public boolean isBare() { boolean bareSet = getConfig().getString( ConfigConstants.CONFIG_CORE_SECTION, null, ConfigConstants.CONFIG_KEY_BARE) != null; if (bareSet) return getConfig().getBoolean(ConfigConstants.CONFIG_CORE_SECTION, ConfigConstants.CONFIG_KEY_BARE, false); if (gitDirExplicit && workDir == null) return true; if (getDirectory().getName().equals(Constants.DOT_GIT)) return false; <START> return true; <END> }</code><technical_language>of logic in constructor, I if simplify this method to: public boolean isBare() { return workDir == null; }</technical_language>

Target:
public boolean isBare() { return workDir == null; }
Source:
<code>protected String getProjectLocation() { IProject project = getProject(); if (null != project) { return <START> project.getLocation().toOSString(); <END> } return null; }</code><technical_language>need OSString</technical_language>

Target:
protected String getProjectLocation() { IProject project = getProject(); if (null != project) { return project.getLocation().toString(); } return null; }
Source:
<code>public List<Rules> getEnabledRules() throws ArgumentParserException { <START> List<Rules> enabledRules = new LinkedList<>(Arrays.asList(Rules.values())); <END> List<String> enabledRuleNames = enabledRules.stream().map(Rules::getName).collect(Collectors.toList()); if (this.cmd.getOptionValues(ONLY_OPT) != null) { List<String> onlySpecificRules = new LinkedList<>(Arrays.asList(this.cmd.getOptionValues(ONLY_OPT))); checkValidRules(enabledRuleNames, onlySpecificRules); return enabledRules.stream().filter(onlySpecificRules::contains).collect(Collectors.toList()); } else if (this.cmd.getOptionValues(EXCLUDE_OPT) != null) { List<String> excludedRules = new LinkedList<>(Arrays.asList(this.cmd.getOptionValues(EXCLUDE_OPT))); checkValidRules(enabledRuleNames, excludedRules); return enabledRules.stream() .filter(rule -> !excludedRules.contains(rule.getName())).collect(Collectors.toList()); } return enabledRules; }</code><technical_language>I a Set for enabledRules excludedRules more sense (instead of a List). retainAll/removeAll update list of rules</technical_language>

Target:
public Set<Rules> getEnabledRules() throws ArgumentParserException { Set<Rules> enabledRules = new HashSet<>(Arrays.asList(Rules.values())); Set<String> enabledRuleNames = enabledRules.stream().map(Rules::getName).collect(Collectors.toSet()); if (this.cmd.hasOption(ONLY_OPT)) { Set<String> onlySpecificRules = new HashSet<>(Arrays.asList(this.cmd.getOptionValues(ONLY_OPT))); checkValidRules(enabledRuleNames, onlySpecificRules); return enabledRules.stream() .filter(rule -> onlySpecificRules.contains(rule.getName())).collect(Collectors.toSet()); } else if (this.cmd.hasOption(EXCEPT_OPT)) { Set<String> excludedRules = new HashSet<>(Arrays.asList(this.cmd.getOptionValues(EXCEPT_OPT))); checkValidRules(enabledRuleNames, excludedRules); return enabledRules.stream() .filter(rule -> !excludedRules.contains(rule.getName())).collect(Collectors.toSet()); } return enabledRules; }
Source:
<code>private void createIndexArea(Composite parent, FormToolkit toolkit, int span) { stagedDiffSection = createSection(parent, toolkit, span); String sectionTitle = MessageFormat.format( UIText.StashEditorPage_StagedChanges, Integer.valueOf(0)); stagedDiffSection.setText(sectionTitle); Composite unstagedChangesArea = createSectionClient( stagedDiffSection, toolkit); stagedDiffViewer = new CommitFileDiffViewer(unstagedChangesArea, getSite(), SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.FULL_SELECTION | toolkit.getBorderStyle()); Control control = stagedDiffViewer.getControl(); <START> if (control != null) { <END> control.setData(FormToolkit.KEY_DRAW_BORDER, FormToolkit.TREE_BORDER); GridDataFactory.fillDefaults().grab(true, true).applyTo(control); addToFocusTracking(control); } stagedDiffViewer.setContentProvider(ArrayContentProvider .getInstance()); stagedDiffViewer.setTreeWalk(getCommit().getRepository(), null); updateSectionClient(stagedDiffSection, unstagedChangesArea, toolkit); }</code><technical_language>unnecessary null check</technical_language>

Target:
private void createIndexArea(Composite parent, FormToolkit toolkit, int span) { stagedDiffSection = createSection(parent, toolkit, span); String sectionTitle = MessageFormat.format( UIText.StashEditorPage_StagedChanges, Integer.valueOf(0)); stagedDiffSection.setText(sectionTitle); Composite unstagedChangesArea = createSectionClient( stagedDiffSection, toolkit); stagedDiffViewer = new CommitFileDiffViewer(unstagedChangesArea, getSite(), SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.FULL_SELECTION | toolkit.getBorderStyle()); Control control = stagedDiffViewer.getControl(); control.setData(FormToolkit.KEY_DRAW_BORDER, FormToolkit.TREE_BORDER); GridDataFactory.fillDefaults().grab(true, true).applyTo(control); addToFocusTracking(control); stagedDiffViewer.setContentProvider(ArrayContentProvider .getInstance()); stagedDiffViewer.setTreeWalk(getCommit().getRepository(), null); updateSectionClient(stagedDiffSection, unstagedChangesArea, toolkit); }
Source:
<code>public void testFetchAuditEntriesForAllDataSources() throws Exception { List<Rule> rules = Arrays.<Rule>asList( new IntervalLoadRule( new Interval("2015-01-01/2015-02-01"), ImmutableMap.<String, Integer>of( DruidServer.DEFAULT_TIER, DruidServer.DEFAULT_NUM_REPLICANTS ) ) ); AuditInfo auditInfo = new AuditInfo("test_author", "test_comment", "127.0.0.1"); ruleManager.overrideRule( "test_dataSource", rules, auditInfo ); ruleManager.overrideRule( "test_dataSource2", rules, auditInfo ); ruleManager.poll(); Assert.assertEquals(rules, ruleManager.getRules("test_dataSource")); Assert.assertEquals(rules, ruleManager.getRules("test_dataSource2")); List<AuditEntry> auditEntries = auditManager.fetchAuditHistory("rules", null); Assert.assertEquals(2, auditEntries.size()); for (AuditEntry entry : auditEntries) { <START> Assert.assertEquals(mapper.writeValueAsString(rules), entry.getPayload()); <END> Assert.assertEquals(auditInfo, entry.getAuditInfo()); } }</code><technical_language>is check object equality instead of string equality using... Assert.assertEquals(rules, mapper.readValue(entry.getPayload(), typeref..List);</technical_language>

Target:
public void testFetchAuditEntriesForAllDataSources() throws Exception { List<Rule> rules = Arrays.<Rule>asList( new IntervalLoadRule( new Interval("2015-01-01/2015-02-01"), ImmutableMap.<String, Integer>of( DruidServer.DEFAULT_TIER, DruidServer.DEFAULT_NUM_REPLICANTS ) ) ); AuditInfo auditInfo = new AuditInfo("test_author", "test_comment", "127.0.0.1"); ruleManager.overrideRule( "test_dataSource", rules, auditInfo ); ruleManager.overrideRule( "test_dataSource2", rules, auditInfo ); ruleManager.poll(); Assert.assertEquals(rules, ruleManager.getRules("test_dataSource")); Assert.assertEquals(rules, ruleManager.getRules("test_dataSource2")); List<AuditEntry> auditEntries = auditManager.fetchAuditHistory("rules", null); Assert.assertEquals(2, auditEntries.size()); for (AuditEntry entry : auditEntries) { Assert.assertEquals( rules, mapper.readValue( entry.getPayload(), new TypeReference<List<Rule>>() { } ) ); Assert.assertEquals(auditInfo, entry.getAuditInfo()); } }
Source:
<code>public void removeDeviceModelFirmware(@Identification final String organisationIdentification, @Valid final int firmwareIdentification) throws FunctionalException { final Organisation organisation = this.domainHelperService.findOrganisation(organisationIdentification); this.domainHelperService.isAllowed(organisation, PlatformFunction.REMOVE_DEVICE_MODEL_FIRMWARE); final DeviceModelFirmware removedDeviceModelFirmware = this.deviceModelFirmwareRepository.findById(Long.valueOf(firmwareIdentification)); if (removedDeviceModelFirmware == null) { LOGGER.info("DeviceModelFirmware not found."); throw new FunctionalException(FunctionalExceptionType.UNKNOWN_DEVICEMODEL_FIRMWARE, ComponentType.WS_CORE, new UnknownEntityException(DeviceModelFirmware.class, String.valueOf(firmwareIdentification))); <START> } else { <END> this.deviceModelFirmwareRepository.delete(removedDeviceModelFirmware); } }</code><technical_language>else statement is needed exception is thrown if</technical_language>

Target:
public void removeDeviceModelFirmware(@Identification final String organisationIdentification, @Valid final int firmwareIdentification) throws FunctionalException { final Organisation organisation = this.domainHelperService.findOrganisation(organisationIdentification); this.domainHelperService.isAllowed(organisation, PlatformFunction.REMOVE_DEVICE_MODEL_FIRMWARE); final DeviceModelFirmware removedDeviceModelFirmware = this.deviceModelFirmwareRepository.findById(Long.valueOf(firmwareIdentification)); if (removedDeviceModelFirmware == null) { LOGGER.info("DeviceModelFirmware not found."); throw new FunctionalException(FunctionalExceptionType.UNKNOWN_DEVICEMODEL_FIRMWARE, ComponentType.WS_CORE, new UnknownEntityException(DeviceModelFirmware.class, String.valueOf(firmwareIdentification))); } this.deviceModelFirmwareRepository.delete(removedDeviceModelFirmware); }
Source:
<code>private boolean needsInforming() { final Integer repeat = settings.KEEP_INFORMING.get(); if (repeat == null || repeat == 0) return false; final long now = System.currentTimeMillis(); if (lastAnnouncement + repeat * 60 * 1000L < now) { <START> lastAnnouncement = now; <END> return true; } return false; }</code><technical_language>I measure lastAnnouncement command periodically. right place I method 'getNewCommandPlayerToPlay'</technical_language>

Target:
private boolean needsInforming() { final Integer repeat = settings.KEEP_INFORMING.get(); if (repeat == null || repeat == 0) return false; final long notBefore = lastAnnouncement + repeat * 60 * 1000L; return System.currentTimeMillis() > notBefore; }
Source:
<code>public void doPeriodicWork(int today) { if (activeUserCache.claimActiveWorker(workerId, WORKER_TTL_MS)) { try { Optional<Long> id = activeUserCache.getId(); int date = activeUserCache.getDate(); <START> if (today > date) { <END> date = today; id = Optional.of(ActiveUserCache.INITIAL_ID); activeUserCache.setId(id); activeUserCache.setDate(date); activeUserCache.resetTallies(PLATFORMS, INTERVALS); logger.info(date + " started"); } if (id.isPresent()) { id = processChunk(date, id.get(), CHUNK_SIZE); activeUserCache.setId(id); if (!id.isPresent()) { registerMetrics(); logger.info(date + " completed"); } } lastDate = date; lastId = id; } finally { activeUserCache.releaseActiveWorker(workerId); } } }</code><technical_language>this tallies blown time work spans GMT date boundary? kind of assuming scan more 24 hours</technical_language>

Target:
public boolean doPeriodicWork(int today) { if (activeUserCache.claimActiveWorker(workerId, WORKER_TTL_MS)) { try { long startTimeMs = System.currentTimeMillis(); Optional<String> number = activeUserCache.getLastNumberVisited(); int date = activeUserCache.getDateToReport(INITIAL_DATE); if (today > date) { logger.info(date + " started"); date = today; number = Optional.of(INITIAL_NUMBER); activeUserCache.setLastNumberVisited(number); activeUserCache.setDateToReport(date); activeUserCache.resetTallies(PLATFORMS, INTERVALS); } if (!number.isPresent()) return false; number = processChunk(date, number.get(), CHUNK_SIZE); activeUserCache.setLastNumberVisited(number); if (!number.isPresent()) { logger.info(date + " completed"); registerMetrics(); return false; } long endTimeMs = System.currentTimeMillis(); long sleepInterval = getDelayWithJitter() - (endTimeMs - startTimeMs); if (sleepInterval > 0) sleepWhileRunning(sleepInterval); } finally { activeUserCache.releaseActiveWorker(workerId); } } return true; }
Source:
<code>protected void recordCapabilitiesAndRequirements(OperationContext context, ModelNode operation, Resource resource) throws OperationFailedException { super.recordCapabilitiesAndRequirements(context, operation, resource); ModelNode defaultTracer = DEFAULT_TRACER.resolveModelAttribute(context, resource.getModel()); <START> if (defaultTracer.isDefined()) { <END> context.deregisterCapability(RuntimeCapability.Builder.of(DEFAULT_TRACER_CAPABILITY.getDynamicName(defaultTracer.asString()), false).build().getName()); } }</code><technical_language>I want call super implementation, handling capability registration conditionally</technical_language>

Target:
protected void recordCapabilitiesAndRequirements(OperationContext context, ModelNode operation, Resource resource) throws OperationFailedException { super.recordCapabilitiesAndRequirements(context, operation, resource); ModelNode defaultTracer = DEFAULT_TRACER.resolveModelAttribute(context, resource.getModel()); if (defaultTracer.isDefined()) { context.deregisterCapability(DEFAULT_TRACER_CAPABILITY_NAME); } }
Source:
<code>public boolean forceRun() { <START> return true; <END> }</code><technical_language>I ask catalog if filter_key exists publishing_bundle proceed</technical_language>

Target:
public boolean forceRun() { try { return !new DotDatabaseMetaData().getColumnNames(DbConnectionFactory.getConnection(), "publishing_bundle").contains("filter_key"); } catch (SQLException e) { Logger.error(this, e.getMessage(),e); return false; } }
Source:
<code>void move(byte[] encodedRegionName, ServerName destServerName) throws IOException; void assign(byte[] regionName) throws IOException; void unassign(byte[] regionName) throws IOException; @Deprecated <START> void unassign(byte[] regionName, boolean force) throws IOException; <END> void offline(byte[] regionName) throws IOException; boolean balancerSwitch(boolean onOrOff, boolean synchronous) throws IOException; boolean balance() throws IOException; boolean balance(boolean force) throws IOException; boolean isBalancerEnabled() throws IOException; CacheEvictionStats clearBlockCache(final TableName tableName) throws IOException; boolean normalize() throws IOException; boolean isNormalizerEnabled() throws IOException; boolean normalizerSwitch(boolean on) throws IOException; boolean catalogJanitorSwitch(boolean onOrOff) throws IOException; int runCatalogJanitor() throws IOException; boolean isCatalogJanitorEnabled() throws IOException; boolean cleanerChoreSwitch(boolean onOrOff) throws IOException; boolean runCleanerChore() throws IOException; boolean isCleanerChoreEnabled() throws IOException; @Deprecated default Future<Void> mergeRegionsAsync(byte[] nameOfRegionA, byte[] nameOfRegionB, boolean forcible) throws IOException { byte[][] nameofRegionsToMerge = new byte[2][]; nameofRegionsToMerge[0] = nameOfRegionA; nameofRegionsToMerge[1] = nameOfRegionB; return mergeRegionsAsync(nameofRegionsToMerge, forcible); }</code><technical_language>a default method call unassign(b[]) implementations skip including same</technical_language>

Target:
void move(byte[] encodedRegionName, ServerName destServerName) throws IOException; void assign(byte[] regionName) throws IOException; void unassign(byte[] regionName) throws IOException; @Deprecated default void unassign(byte[] regionName, boolean force) throws IOException { unassign(regionName); }
Source:
<code>public String toString() { <START> return String.format("PackExt[%s]", getExtension()); END> }</code><technical_language>Include bit in toString(), e.g. 1<<getPosition()</technical_language>

Target:
public String toString() { return String.format("PackExt[%s, bit=0x%s]", getExtension(), Integer.toHexString(1 << getPosition())); }
Source:
<code>public void restart() throws IOException, InterruptedException { Jenkins jenkins = Jenkins.getInstance(); if (jenkins != null) { <START> jenkins.cleanUp(); <END> } File me = getHudsonWar(); File home = me.getParentFile(); ByteArrayOutputStream baos = new ByteArrayOutputStream(); StreamTaskListener task = new StreamTaskListener(baos); task.getLogger().println("Restarting a service"); String exe = System.getenv("WINSW_EXECUTABLE"); File executable; if (exe!=null) executable = new File(exe); else executable = new File(home, "hudson.exe"); if (!executable.exists()) executable = new File(home, "jenkins.exe"); int r = new LocalLauncher(task).launch().cmds(executable, "restart!") .stdout(task).pwd(home).join(); if(r!=0) throw new IOException(baos.toString()); }</code><technical_language>try/catch in case this throws for some reason? I continue restart in case</technical_language>

Target:
public void restart() throws IOException, InterruptedException { Jenkins jenkins = Jenkins.getInstance(); try { if (jenkins != null) { jenkins.cleanUp(); } } catch (Exception e) { LOGGER.log(Level.SEVERE, "Failed to clean up. Restart will continue.", e); } File me = getHudsonWar(); File home = me.getParentFile(); ByteArrayOutputStream baos = new ByteArrayOutputStream(); StreamTaskListener task = new StreamTaskListener(baos); task.getLogger().println("Restarting a service"); String exe = System.getenv("WINSW_EXECUTABLE"); File executable; if (exe!=null) executable = new File(exe); else executable = new File(home, "hudson.exe"); if (!executable.exists()) executable = new File(home, "jenkins.exe"); int r = new LocalLauncher(task).launch().cmds(executable, "restart!") .stdout(task).pwd(home).join(); if(r!=0) throw new IOException(baos.toString()); }
Source:
<code>public Path generateArtifact(URI uri, int size) throws IOException { <START> this.in(Paths.get(uri)); <END> return(this.buildPublishJson()); }</code><technical_language>@yugander-krishan-singh provide public NpmPackageGenerator(Path basedir) constructor instead of this.in(Paths.get(uri)) here</technical_language>

Target:
public Path generateArtifact(URI uri, int size) throws IOException { buildPublishJson(); return getPackagePath(); }
Source:
<code>public String toString() { <START> return new StringBuilder() <END> .append("Injectable type: Invoker") .append(", accessor: ").append(methodLocation.name) .append(", method name: ").append(methodName) .append(", invokes method: ").append(mName).toString(); }</code><technical_language>String.format instead: String.format("Injectable type: Invoker, accessor: %s, method name: %s, invokes method: %s", methodLocation.name, methodName, mName); more readable</technical_language>

Target:
public String toString() { return String.format("Injectable type: Invoker, accessor: %s, method name: %s, invokes method: %s", methodLocation.name, methodName, mName); }