auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public static CinderDisk volumeToCinderDisk(Volume volume, Guid storageDomainId) { CinderDisk cinderDisk = new CinderDisk(); cinderDisk.setId(Guid.createGuidFromString(volume.getId())); cinderDisk.setImageId(Guid.createGuidFromString(volume.getId())); cinderDisk.setDiskAlias(volume.getName()); cinderDisk.setDescription(volume.getDescription()); cinderDisk.setSizeInGigabytes(volume.getSize()); cinderDisk.setCinderVolumeType(volume.getVolumeType()); cinderDisk.setStorageIds(new ArrayList<>(Arrays.asList(storageDomainId))); cinderDisk.setActive(true); cinderDisk.setImageStatus(ImageStatus.OK); cinderDisk.setvolumeFormat(VolumeFormat.RAW); cinderDisk.setDiskInterface(DiskInterface.VirtIO); try { cinderDisk.setCreationDate(new SimpleDateFormat(DATE_FORMAT).parse(volume.getCreatedAt())); } catch (ParseException e) { cinderDisk.setCreationDate(null); <START> log.error("Invalid disk creation date format", e); <END> } return cinderDisk; }</code><technical_language>Please add volume id of disk</technical_language>

Target:
public static CinderDisk volumeToCinderDisk(Volume volume, Guid storageDomainId) { CinderDisk cinderDisk = new CinderDisk(); cinderDisk.setId(Guid.createGuidFromString(volume.getId())); cinderDisk.setImageId(Guid.createGuidFromString(volume.getId())); cinderDisk.setDiskAlias(volume.getName()); cinderDisk.setDescription(volume.getDescription()); cinderDisk.setSizeInGigabytes(volume.getSize()); cinderDisk.setCinderVolumeType(volume.getVolumeType()); cinderDisk.setStorageIds(new ArrayList<>(Arrays.asList(storageDomainId))); cinderDisk.setActive(true); cinderDisk.setImageStatus(ImageStatus.OK); cinderDisk.setvolumeFormat(VolumeFormat.RAW); cinderDisk.setDiskInterface(DiskInterface.VirtIO); try { cinderDisk.setCreationDate(new SimpleDateFormat(DATE_FORMAT).parse(volume.getCreatedAt())); } catch (ParseException e) { cinderDisk.setCreationDate(null); log.error("Invalid disk creation date format, id: '{}' (info: {})", volume.getId(), e.getMessage()); } return cinderDisk; }
Source:
<code>public static Iterable<Object[]> getParameters() { return Arrays.asList(new Object[][] { { 0, "0" }, { 3, "3" }, { 975, "975" }, { 1000, "1 k" }, { 4000, "4 k" }, { -4000, "-4 k" }, { 4000L, "4 k" }, { 4000.0, "4 k" }, { 12345678, "12.3 M" }, { Integer.MAX_VALUE, "2.1 G" }, { Integer.MIN_VALUE, "-2.1 G" }, { Long.MAX_VALUE, "9223.4 P" }, { 98765432.123456, "98.8 M" }, { -98765432.123456, "-98.8 M" }, { 555555555555L, "555.6 G" }, { 555555555555555L, "555.6 T" }, { 100100000, "100.1 M" }, { 0.1, "100 m" }, { 0.001, "1 m" }, { 0.000001, "1 µ" }, { 0.000000001, "1 n" }, { 0.000000000001, "1 p" }, { -0.04, "-40 m" }, { 0.002, "2 m" }, { 0.0555, "55.5 m" }, { 0.0004928373928, "492.8 µ" }, { 0.000000251, "251 n"}, { 0.000000000043, "43 p"}, { 0.000000045643, "45.6 n"}, <START> { Double.MAX_VALUE, "179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 P" }, <END> { Double.POSITIVE_INFINITY, "∞" }, { Double.MIN_NORMAL, "0" }, { Double.NEGATIVE_INFINITY, "-∞" }, { Double.NaN, "�" }, }); }</code><technical_language>love this one</technical_language>

Target:
public static Iterable<Object[]> getParameters() { return Arrays.asList(new Object[][] { { 0, "0" }, { 3, "3" }, { 975, "975" }, { 1000, "1 k" }, { 4000, "4 k" }, { -4000, "-4 k" }, { 4000L, "4 k" }, { 4000.0, "4 k" }, { 12345678, "12.3 M" }, { Integer.MAX_VALUE, "2.1 G" }, { Integer.MIN_VALUE, "-2.1 G" }, { Long.MAX_VALUE, "9223.4 P" }, { 98765432.123456, "98.8 M" }, { -98765432.123456, "-98.8 M" }, { 555555555555L, "555.6 G" }, { 555555555555555L, "555.6 T" }, { 100100000, "100.1 M" }, { 0.1, "100 m" }, { 0.001, "1 m" }, { 0.000001, "1 µ" }, { 0.000000001, "1 n" }, { 0.000000000001, "1 p" }, { -0.04, "-40 m" }, { 0.002, "2 m" }, { 0.0555, "55.5 m" }, { 0.0004928373928, "492.8 µ" }, { 0.000000251, "251 n"}, { 0.000000000043, "43 p"}, { 0.000000045643, "45.6 n"}, }); }
Source:
<code>void requestMemoryRevokingIfNeeded() { List<MemoryPool> poolsToCheck = memoryPools.stream() .filter(this::memoryRevokingNeeded) .collect(toList()); if (potentiallyOverflowingPools.addAll(poolsToCheck)) { log.debug("Scheduling check for pools: ", poolsToCheck); <START> scheduleRevoking(); <END> } }</code><technical_language>This is executed a thread pool, run this inline</technical_language>

Target:
void requestMemoryRevokingIfNeeded() { if (checkPending.compareAndSet(false, true)) { runMemoryRevoking(); } }
Source:
<code>void moduleInit() throws IngestModuleException { try { currentCase = Case.getCurrentCaseThrows(); fileManager = currentCase.getServices().getFileManager(); absOutputFolderName = RAImageIngestModule.getRAOutputPath(currentCase, moduleName); <START> relOutputFolderName = RAImageIngestModule.getRelModuleOutputPath() + File.separator + moduleName; <END> File dir = new File(absOutputFolderName); if (dir.exists() == false) { dir.mkdirs(); } } catch (NoCurrentCaseException ex) { String msg = "Failed to get current case."; throw new IngestModuleException(msg, ex); } }</code><technical_language>Consider Path class for building Paths</technical_language>

Target:
void moduleInit() throws IngestModuleException { try { currentCase = Case.getCurrentCaseThrows(); fileManager = currentCase.getServices().getFileManager(); absOutputFolderName = RAImageIngestModule.getRAOutputPath(currentCase, moduleName); relOutputFolderName = Paths.get( RAImageIngestModule.getRelModuleOutputPath(), moduleName).normalize().toString(); File dir = new File(absOutputFolderName); if (dir.exists() == false) { dir.mkdirs(); } } catch (NoCurrentCaseException ex) { String msg = "Failed to get current case."; throw new IngestModuleException(msg, ex); } }
Source:
<code><START> public static void saveDefinedFunctions() { <END> for (String name : FunctionDescriptor.defined_functions) { FunctionDescriptor fd = FunctionDescriptor.by_LC_name.get(name); FunctionDescriptor.by_LC_name.remove(name); m_savedFunctionDfns.put(name, fd); } FunctionDescriptor.defined_functions.clear(); }</code><technical_language>This method equivalent deleteOldFunctions</technical_language>

Target:
public static void saveDefinedFunctions() { for (String name : FunctionDescriptor.defined_functions) { FunctionDescriptor fd = FunctionDescriptor.by_LC_name.get(name); assert(fd != null); FunctionDescriptor.by_LC_name.remove(name); m_savedFunctionDfns.put(name, fd); } FunctionDescriptor.defined_functions.clear(); }
Source:
<code>public StreamInputPacketIndexEntry(long dataOffsetBits, long fileSizeBytes) { fContentSizeBits = (fileSizeBytes * Byte.SIZE); fPacketSizeBits = (fileSizeBytes * Byte.SIZE); <START> fOffsetBytes = (dataOffsetBits / Byte.SIZE); <END> fLostEvents = 0; fTarget = ""; fTargetID = 0; fTimestampBegin = Long.MIN_VALUE; fTimestampEnd = Long.MAX_VALUE; }</code><technical_language>name discrepancy (dataOffsetBits fOffsetBytes) is there. Also, is correct divide, here? If yes, need do this in other constructor. If not, remove here</technical_language>

Target:
public StreamInputPacketIndexEntry(long dataOffsetBits, long fileSizeBytes) { fContentSizeBits = (fileSizeBytes * Byte.SIZE); fPacketSizeBits = (fileSizeBytes * Byte.SIZE); fOffsetBits = dataOffsetBits; fLostEvents = 0; fTarget = ""; fTargetID = 0; fTimestampBegin = Long.MIN_VALUE; fTimestampEnd = Long.MAX_VALUE; }
Source:
<code>public Response terminateAll() { return asLeaderWithSupervisorManager( manager -> { <START> Set<String> supervisorIds = manager.getSupervisorIds(); <END> supervisorIds.forEach(manager::stopAndRemoveSupervisor); return Response.ok(ImmutableMap.of( "ids", String.join(",", supervisorIds) )).build(); } ); }</code><technical_language>I this pushed SupervisorManager a terminateAll method</technical_language>

Target:
public Response terminateAll() { return asLeaderWithSupervisorManager( manager -> { manager.stopAndRemoveAllSupervisors(); return Response.ok(ImmutableMap.of("status", "success")).build(); } ); }
Source:
<code>public Mono<HttpResponse> process(HttpPipelineCallContext context, HttpPipelineNextPolicy next) { if ("http".equals(context.getHttpRequest().getUrl().getProtocol())) { <START> return Mono.error(new RuntimeException("token credentials require a URL using the HTTPS protocol scheme")); <END> } context.getHttpRequest().setHeader(API_KEY, this.apiKey.getApiKey()); return next.process(); }</code><technical_language>Is this exception message credentials in AAD use? nice turn a proper sentence file issue for other locations</technical_language>

Target:
public Mono<HttpResponse> process(HttpPipelineCallContext context, HttpPipelineNextPolicy next) { if ("http".equals(context.getHttpRequest().getUrl().getProtocol())) { return Mono.error(new RuntimeException("Search api-key credentials require a URL using the HTTPS protocol " + "scheme.")); } context.getHttpRequest().setHeader(API_KEY, this.apiKey.getApiKey()); return next.process(); }
Source:
<code>public ExpiredObject getExpiredObject(String key) { try { ExpiredObject expiredObject = getExpiredObject(key, null); expiredObject.setType(ExpiredObjectType.fromValue(expiredObject.getTypeString())); <START> if (expiredObject != null) { <END> LOG.debug("Found ExpiredObject id: , ExpiredObject : ", key, expiredObject); return expiredObject; } LOG.error("Failed to fetch ExpiredObject by id: ", key); return null; } catch (Exception e) { if (((e instanceof EntryPersistenceException)) && (e.getMessage().contains("Failed to find entry"))) { LOG.warn("Failed to fetch ExpiredObject by id: {}. ", key, e.getMessage()); return null; } LOG.error("Failed to fetch ExpiredObject by id: ", key, e); } return null; }</code><technical_language>check expiredObject null in line 185 set type, means get NPE if null. 185 line moved down</technical_language>

Target:
public ExpiredObject getExpiredObject(String key) { try { ExpiredObject expiredObject = (ExpiredObject) this.persistenceEntryManager.find(getDnForExpiredObj(key), ExpiredObject.class, null); if (expiredObject != null) { expiredObject.setType(ExpiredObjectType.fromValue(expiredObject.getTypeString())); LOG.debug("Found ExpiredObject id: , ExpiredObject : ", key, expiredObject); return expiredObject; } LOG.error("Failed to fetch ExpiredObject by id: ", key); return null; } catch (Exception e) { if (((e instanceof EntryPersistenceException)) && (e.getMessage().contains("Failed to find entry"))) { LOG.warn("Failed to fetch ExpiredObject by id: {}. ", key, e.getMessage()); return null; } LOG.error("Failed to fetch ExpiredObject by id: ", key, e); } return null; }
Source:
<code>public void testVendorReturnGreaterMinor() { String testString = "1.2.0"; ShadowExtenderVersioningImpl.setTestApiVersion(testString); <START> assertFalse(ExtensionVersion.isExtensionVersionSupported()); <END> assertNull(ExtensionVersion.getRuntimeVersion()); }</code><technical_language>return true for this case? If mistaken, condition match: /////////////////////////// If major version matches, OEM library a greater minor version - extension features exposed CameraX function identically OEM library minor version equal of CameraX library - This needs guaranteed OEM library ///////////////////////////</technical_language>

Target:
public void testVendorReturnGreaterMinor() { String testString = "1.2.0"; ShadowExtenderVersioningImpl.setTestApiVersion(testString); assertTrue(ExtensionVersion.isExtensionVersionSupported()); assertEquals(ExtensionVersion.getRuntimeVersion(), Version.parse(testString)); }
Source:
<code>public void onActivate(ActivateEvent event, EntityRef entity) { BlockItemFactory blockFactory = new BlockItemFactory(entityManager); inventoryManager = new InventoryAuthoritySystem(); BlockComponent blockComponent = entity.getComponent(BlockComponent.class); LASTeam flagTeamComponent = entity.getComponent(LASTeam.class); EntityRef flagTaker = event.getInstigator(); LASTeam playerTeamComponent = flagTaker.getComponent(LASTeam.class); <START> if (flagTeamComponent.team.equals("red") && playerTeamComponent.team.equals("black")) { <END> inventoryManager.giveItem(flagTaker, EntityRef.NULL, blockFactory.newInstance(blockManager.getBlockFamily("LightAndShadowResources:redFlag"))); worldProvider.setBlock(blockComponent.getPosition(), blockManager.getBlock(BlockManager.AIR_ID)); entity.destroy(); } if (flagTeamComponent.team.equals("black") && playerTeamComponent.team.equals("red")) { inventoryManager.giveItem(flagTaker, EntityRef.NULL, blockFactory.newInstance(blockManager.getBlockFamily("LightAndShadowResources:blackFlag"))); worldProvider.setBlock(blockComponent.getPosition(), blockManager.getBlock(BlockManager.AIR_ID)); entity.destroy(); } }</code><technical_language>introduce constants for "red" "black" central in L&S project. easy a typo in there, hard change string on</technical_language>

Target:
public void onActivate(ActivateEvent event, EntityRef entity) { BlockItemFactory blockFactory = new BlockItemFactory(entityManager); inventoryManager = new InventoryAuthoritySystem(); BlockComponent blockComponent = entity.getComponent(BlockComponent.class); LASTeam flagTeamComponent = entity.getComponent(LASTeam.class); EntityRef flagTaker = event.getInstigator(); LASTeam playerTeamComponent = flagTaker.getComponent(LASTeam.class); if (flagTeamComponent.team.equals(flagTeamComponent.RED) && playerTeamComponent.team.equals(playerTeamComponent.BLACK)) { inventoryManager.giveItem(flagTaker, EntityRef.NULL, blockFactory.newInstance(blockManager.getBlockFamily("LightAndShadowResources:redFlag"))); worldProvider.setBlock(blockComponent.getPosition(), blockManager.getBlock(BlockManager.AIR_ID)); entity.destroy(); } if (flagTeamComponent.team.equals(flagTeamComponent.BLACK) && playerTeamComponent.team.equals(playerTeamComponent.RED)) { inventoryManager.giveItem(flagTaker, EntityRef.NULL, blockFactory.newInstance(blockManager.getBlockFamily("LightAndShadowResources:blackFlag"))); worldProvider.setBlock(blockComponent.getPosition(), blockManager.getBlock(BlockManager.AIR_ID)); entity.destroy(); } }
Source:
<code>public void testSelection() throws Throwable { <START> this.testClearFilter(); <END> ListView lv = ((ListActivity) this.activity).getListView(); int index = (int) (Math.random()*(lv.getChildCount()-1)) + 1; final CheckedTextView ctv = (CheckedTextView) lv.getChildAt(index).findViewById(R.id.checkmark); this.runTestOnUiThread(new Runnable() { @Override public void run() { Assert.assertTrue(ctv.performClick()); } }); Assert.assertTrue(this.inst.invokeMenuActionSync(this.activity, R.id.delete_menu, 0)); }</code><technical_language>longer works. attempt this.dbUtil = new DatabaseUtil(this.inst.getTargetContext().getPackageName()); this.activity = this.getActivity(); I get error basically 'Unable open SQLiteDatabase'. I assume worked database stored in system earlier tests recreated reused</technical_language>

Target:
public void testSelection() throws Throwable { ListView lv = ((ListActivity) this.activity).getListView(); int index = (int) (Math.random()*(lv.getChildCount()-1)) + 1; final CheckedTextView ctv = (CheckedTextView) lv.getChildAt(index).findViewById(R.id.checkmark); this.runTestOnUiThread(new Runnable() { @Override public void run() { Assert.assertTrue(ctv.performClick()); } }); Assert.assertTrue(this.inst.invokeMenuActionSync(this.activity, R.id.delete_menu, 0)); }
Source:
<code>public static void deleteBucketTags_test() throws Exception { if (!mintEnv) { System.out.println("Test: deleteBucketTags(DeleteBucketTagsArgs args)"); } long startTime = System.currentTimeMillis(); String bucketName = getRandomName(); try { client.makeBucket(MakeBucketArgs.builder().bucket(bucketName).build()); try { client.deleteBucketTags(DeleteBucketTagsArgs.builder().bucket(bucketName).build()); Map<String, String> map = new HashMap<>(); map.put("Project", "Project One"); map.put("User", "jsmith"); client.setBucketTags(SetBucketTagsArgs.builder().bucket(bucketName).tags(map).build()); client.deleteBucketTags(DeleteBucketTagsArgs.builder().bucket(bucketName).build()); mintSuccessLog("deleteBucketTags(DeleteBucketTagsArgs args)", null, startTime); } finally { client.removeBucket(RemoveBucketArgs.builder().bucket(bucketName).build()); } } catch (Exception e) { ErrorResponse errorResponse = null; if (e instanceof ErrorResponseException) { ErrorResponseException exp = (ErrorResponseException) e; errorResponse = exp.errorResponse(); } if (errorResponse != null && errorResponse.errorCode() == ErrorCode.NOT_IMPLEMENTED) { mintIgnoredLog("deleteBucketTags(DeleteBucketTagsArgs args)", null, startTime); } else { mintFailedLog( <START> "deleteBucketTags(DeleteBucketTagsArgs args)", <END> null, startTime, null, e.toString() + " >>> " + Arrays.toString(e.getStackTrace())); throw e; } } }</code><technical_language>do getBucketTags delete verify tags deleted</technical_language>

Target:
public static void deleteBucketTags_test() throws Exception { String methodName = "deleteBucketTags(DeleteBucketTagsArgs args)"; if (!mintEnv) { System.out.println("Test: " + methodName); } long startTime = System.currentTimeMillis(); String bucketName = getRandomName(); try { client.makeBucket(MakeBucketArgs.builder().bucket(bucketName).build()); try { client.deleteBucketTags(DeleteBucketTagsArgs.builder().bucket(bucketName).build()); Map<String, String> map = new HashMap<>(); map.put("Project", "Project One"); map.put("User", "jsmith"); client.setBucketTags(SetBucketTagsArgs.builder().bucket(bucketName).tags(map).build()); client.deleteBucketTags(DeleteBucketTagsArgs.builder().bucket(bucketName).build()); Tags tags = client.getBucketTags(GetBucketTagsArgs.builder().bucket(bucketName).build()); if (tags.get().size() != 0) { throw new Exception("expected: <empty map>" + ", got: " + tags.get()); } mintSuccessLog(methodName, null, startTime); } finally { client.removeBucket(RemoveBucketArgs.builder().bucket(bucketName).build()); } } catch (Exception e) { handleException(methodName, startTime, e); } }
Source:
<code>public String toString() { return toStringHelper(this) .add("filteringSymbolAlias", filteringSymbolAlias) .add("sourceSymbolAlias", sourceSymbolAlias) .add("outputAlias", outputAlias) <START> .add("distributionType", distributionType.orElse(null)) <END> .toString(); }</code><technical_language>distributionType. is confusing put null here. imply distributionType field is set null, Optional.empty()</technical_language>

Target:
public String toString() { return toStringHelper(this) .add("filteringSymbolAlias", filteringSymbolAlias) .add("sourceSymbolAlias", sourceSymbolAlias) .add("outputAlias", outputAlias) .add("distributionType", distributionType) .toString(); }
Source:
<code>public static void InitDictionaries() { <START> log.info("Start initializing " + CpuFlagsManagerHandler.class.getSimpleName()); <END> _managersDictionary.clear(); for (Version ver : Config.<HashSet<Version>> GetValue(ConfigValues.SupportedClusterLevels)) { _managersDictionary.put(ver, new CpuFlagsManager(ver)); } log.info("Finished initializing " + CpuFlagsManagerHandler.class.getSimpleName()); }</code><technical_language>init directories.. suggest change logging</technical_language>

Target:
public static void InitDictionaries() { log.info("Start initializing dictionaries"); _managersDictionary.clear(); for (Version ver : Config.<HashSet<Version>> GetValue(ConfigValues.SupportedClusterLevels)) { _managersDictionary.put(ver, new CpuFlagsManager(ver)); } log.info("Finished initializing dictionaries" + CpuFlagsManagerHandler.class.getSimpleName()); }
Source:
<code>public void run() { while (alive) { try { PackResponse packResponse = exchangeClient.exchange(); long newPollRate = packResponse != null ? packResponse.getNewPollRate() : 0; if (newPollRate > 0 && pollRate != newPollRate) { log.info("Poll rate changed to ms", pollRate, newPollRate); pollRate = newPollRate; } } catch (IOException e) { log.error("Error in exchange client", e); throw new TechnicalException("IOException", e); } catch (NodeNotFound e) { log.warn("Agent didn't registered on current coordinator! Reset agent registration.", nodeContext.getId()); exchangeClient.getPackExchanger().clean(); AgentStarter.resetAgent(Agent.this); } catch (Throwable e) { alive = false; <START> log.error("Agent got an exception from coordinator", nodeContext.getId()); <END> } log.debug("Pack exchange completed. Poll rate on agent is ms", nodeContext.getId(), pollRate); TimeUtils.sleepMillis(pollRate); } }</code><technical_language>Maybe, need log exception too</technical_language>

Target:
public void run() { while (alive) { try { PackResponse packResponse = exchangeClient.exchange(); long newPollRate = packResponse != null ? packResponse.getNewPollRate() : 0; if (newPollRate > 0 && pollRate != newPollRate) { log.info("Poll rate changed to ms", pollRate, newPollRate); pollRate = newPollRate; } } catch (IOException e) { log.error("Error in exchange client", e); throw new TechnicalException("IOException", e); } catch (NodeNotFound e) { log.warn("Agent didn't registered on current coordinator! Reset agent registration.", nodeContext.getId()); exchangeClient.getPackExchanger().clean(); AgentStarter.resetAgent(Agent.this); } catch (Throwable e) { alive = false; log.error("Agent "+nodeContext.getId()+" got an exception from coordinator", e); } log.debug("Pack exchange completed. Poll rate on agent is ms", nodeContext.getId(), pollRate); TimeUtils.sleepMillis(pollRate); } }
Source:
<code>public static long getSnapshotMemorySizeInBytes(VM vm) { long videoRam = (long)VideoDeviceSettings.totalVideoRAMSizeMb(vm) * 1024 * 1024; <START> return vm.getVmMemSizeMb() + 200 + videoRam; <END> }</code><technical_language>VM's memory size 200MB buffer converted bytes</technical_language>

Target:
public static long getSnapshotMemorySizeInBytes(VM vm) { long videoRam = (long)VideoDeviceSettings.totalVideoRAMSizeMb(vm); return (vm.getVmMemSizeMb() + 200 + videoRam) * 1024 * 1024; }
Source:
<code>public CommandImpl(Command command) { <START> this.name = command.getName(); <END> this.commandLine = command.getCommandLine(); this.type = command.getType(); this.attributes = new HashMap<>(command.getAttributes()); }</code><technical_language>a constructor call here, we</technical_language>

Target:
public CommandImpl(Command command) { this(command.getName(), command.getCommandLine(), command.getType(), unmodifiableMap(command.getAttributes())); }
Source:
<code>private OptionalInt getJoinOperatorsCountForSpill(LocalExecutionPlanContext context, Session session) { OptionalInt driverInstanceCount = context.getDriverInstanceCount(); if (isSpillEnabled(session)) { <START> checkState(driverInstanceCount.isPresent(), "Indeterminate number of LookupJoinOperator-s when using spill to disk. This is a bug."); <END> } return driverInstanceCount; }</code><technical_language>replace LookupJoinOperator-s lookup join operators... dash is strange. need "This is a bug"... tons of checks "foo is null" bug reference. spill disk. change this "A fixed distribution is required for JOIN spilling is enabled" (no period)</technical_language>

Target:
private OptionalInt getJoinOperatorsCountForSpill(LocalExecutionPlanContext context, Session session) { OptionalInt driverInstanceCount = context.getDriverInstanceCount(); if (isSpillEnabled(session)) { checkState(driverInstanceCount.isPresent(), "A fixed distribution is required for JOIN when spilling is enabled"); } return driverInstanceCount; }
Source:
<code>private CommandEntityCleanupManager() { log.info("Start initializing " + getClass().getSimpleName()); Calendar calendar = new GregorianCalendar(); Date mCommandEntityCleanupTime = Config.<DateTime> getValue(ConfigValues.CommandEntityCleanupTime); calendar.setTimeInMillis(mCommandEntityCleanupTime.getTime()); String cronExpression = String.format("%d %d %d * * ?", calendar.get(Calendar.SECOND), calendar.get(Calendar.MINUTE), calendar.get(Calendar.HOUR_OF_DAY)); <START> log.info("Setting command entity cleanup manager to run at: {}" + cronExpression); <END> SchedulerUtilQuartzImpl.getInstance().scheduleACronJob(this, "onTimer", new Class[] {}, new Object[] {}, cronExpression); log.info("Finished initializing {}", getClass().getSimpleName()); }</code><technical_language>,</technical_language>

Target:
private CommandEntityCleanupManager() { log.info("Start initializing " + getClass().getSimpleName()); Calendar calendar = new GregorianCalendar(); Date mCommandEntityCleanupTime = Config.<DateTime> getValue(ConfigValues.CommandEntityCleanupTime); calendar.setTimeInMillis(mCommandEntityCleanupTime.getTime()); String cronExpression = String.format("%d %d %d * * ?", calendar.get(Calendar.SECOND), calendar.get(Calendar.MINUTE), calendar.get(Calendar.HOUR_OF_DAY)); log.info("Setting command entity cleanup manager to run at: {}", cronExpression); SchedulerUtilQuartzImpl.getInstance().scheduleACronJob(this, "onTimer", new Class[] {}, new Object[] {}, cronExpression); log.info("Finished initializing {}", getClass().getSimpleName()); }
Source:
<code>public static boolean isAuthorizationException(Throwable exception) { <START> return exception.getMessage() != null && exception.getMessage().startsWith("401"); <END> }</code><technical_language>good check exception type error message, please try some generic method, creating some exceptions business exception rest exception, check error code dirrectly</technical_language>

Target:
public static boolean isAuthorizationException(Throwable exception) { boolean flag = false; if (exception instanceof ClientException) { ClientException e = (ClientException) exception; if (e.getHttpCode() != null && e.getHttpCode() == 401) { flag = true; } } return flag; }
Source:
<code>protected void updatePortIfAbsent(Integer value) { <START> if (value != null && port == null) { <END> this.port = value; } }</code><technical_language>change if (value != null && > 0 && port == null) {</technical_language>

Target:
protected void updatePortIfAbsent(Integer value) { if (value != null && value > 0 && port == null) { this.port = value; } }
Source:
<code>protected boolean validate() { DiskExistenceValidator diskExistenceValidator = createDiskExistenceValidator(getDiskIds()); if (!validate(diskExistenceValidator.disksNotExist())) { return false; } DiskImagesValidator diskImagesValidator = createDiskImagesValidator(getDisks()); if (!validate(diskImagesValidator.incrementalBackupEnabled())) { return false; } if (!getVm().getStatus().isQualifiedForVmBackup()) { <START> return failValidation(EngineMessage.CANNOT_START_BACKUP_VM_SHOULD_BE_IN_PAUSED_OR_UP_STATUS); <END> } if (!vmBackupDao.getAllForVm(getVmId()).isEmpty()) { return failValidation(EngineMessage.CANNOT_START_BACKUP_ALREADY_IN_PROGRESS); } if (!getVds().isBackupEnabled()) { return failValidation(EngineMessage.CANNOT_START_BACKUP_NOT_SUPPORTED_BY_VDS, String.format("$vdsName %s", getVdsName())); } return true; }</code><technical_language>want change name</technical_language>

Target:
protected boolean validate() { DiskExistenceValidator diskExistenceValidator = createDiskExistenceValidator(getDiskIds()); if (!validate(diskExistenceValidator.disksNotExist())) { return false; } DiskImagesValidator diskImagesValidator = createDiskImagesValidator(getDisks()); if (!validate(diskImagesValidator.incrementalBackupEnabled())) { return false; } if (!getVm().getStatus().isQualifiedForVmBackup()) { return failValidation(EngineMessage.CANNOT_START_BACKUP_VM_SHOULD_BE_IN_UP_STATUS); } if (!vmBackupDao.getAllForVm(getVmId()).isEmpty()) { return failValidation(EngineMessage.CANNOT_START_BACKUP_ALREADY_IN_PROGRESS); } if (!getVds().isBackupEnabled()) { return failValidation(EngineMessage.CANNOT_START_BACKUP_NOT_SUPPORTED_BY_VDS, String.format("$vdsName %s", getVdsName())); } return true; }
Source:
<code>private SqlFieldsQueryEx makeQuery(String schema, String sql, Object[] args, int timeout, boolean autoCommit) { SqlFieldsQueryEx qry = makeQuery(schema, sql); qry.setArgs(args); qry.setAutoCommit(autoCommit); <START> if (timeout >= 0) { <END> qry.setTimeout(timeout, TimeUnit.SECONDS); } return qry; }</code><technical_language>Curly braces redundant code style</technical_language>

Target:
private SqlFieldsQueryEx makeQuery(String schema, String sql, Object[] args, int timeout, boolean autoCommit) { SqlFieldsQueryEx qry = makeQuery(schema, sql); qry.setArgs(args); qry.setAutoCommit(autoCommit); if (timeout >= 0) qry.setTimeout(timeout, TimeUnit.SECONDS); return qry; }
Source:
<code><START> public CompilationUnitTree COMPILATION_UNIT() { <END> return b.<CompilationUnitTree>nonterminal(PHPLexicalGrammar.COMPILATION_UNIT).is( f.compilationUnit(b.optional(SCRIPT()), b.token(PHPLexicalGrammar.EOF)) ); }</code><technical_language>![MAJOR](<LINK_1> Rename this method name match regular expression '^[a-z][a-zA-Z0-9]*$'. [![rule](<LINK_2>](<LINK_0></technical_language>

Target:
public CompilationUnitTree COMPILATION_UNIT() { return b.<CompilationUnitTree>nonterminal(PHPLexicalGrammar.COMPILATION_UNIT).is( f.compilationUnit(b.optional(SCRIPT()), b.optional(b.token(PHPLexicalGrammar.SPACING)), b.token(PHPLexicalGrammar.EOF))); }
Source:
<code>private static String buildEventSparql(String eventType, String beginDate, String endDate) throws ParseException { String searchEndDate = endDate; if (StringUtils.isNotBlank(endDate)) { Calendar eCal = Calendar.getInstance(); eCal.setTime(dateFormat.parse(endDate)); eCal.add(Calendar.DATE, 1); searchEndDate = dateFormat.format(eCal.getTime()); } <START> String sparql = "SELECT ?e WHERE {?e <<LINK_0>> '\"" <END> + eventType + "\"' . ?e <<LINK_1>> ?date . FILTER (?date > '\"" + beginDate + "\"'"; if (StringUtils.isNotBlank(endDate)) { sparql += " && ?date < '\"" + searchEndDate + "\"'"; } sparql += ")}"; return sparql; }</code><technical_language>This is idea, worth making Arks in this other queries constants names refer purpose/role? idea</technical_language>

Target:
private static String buildEventSparql(String eventType, String beginDate, String endDate) throws ParseException { String searchEndDate = endDate; if (StringUtils.isNotBlank(endDate)) { Calendar eCal = Calendar.getInstance(); eCal.setTime(dateFormat.parse(endDate)); eCal.add(Calendar.DATE, 1); searchEndDate = dateFormat.format(eCal.getTime()); } String sparql = "SELECT ?e WHERE {?e <" + DAMSClient.PREDICATE_EVENT_TYPE + "> '\"" + eventType + "\"' . ?e <" + DAMSClient.PREDICATE_EVENT_DATE + "> ?date . FILTER (?date > '\"" + beginDate + "\"'"; if (StringUtils.isNotBlank(endDate)) { sparql += " && ?date < '\"" + searchEndDate + "\"'"; } sparql += ")}"; return sparql; }
Source:
<code>public HazelcastTimerStore(HazelcastCore core) throws Exception { if (!core.isEnabled()) { throw new Exception("Hazelcast MUST be enabled when using the HazelcastTimerStore"); } pkCache = core.getInstance().getMap(EJB_TIMER_CACHE_NAME); containerCache = core.getInstance().getMap(EJB_TIMER_CONTAINER_CACHE_NAME); applicationCache = core.getInstance().getMap(EJB_TIMER_APPLICAION_CACHE_NAME); serverName = core.getInstance().getCluster().getLocalMember().getStringAttribute(HazelcastCore.INSTANCE_ATTRIBUTE); this.ownerIdOfThisServer_ = serverName; this.domainName_ = core.getInstance().getConfig().getGroupConfig().getName(); super.enableRescheduleTimers(); <START> Globals.getDefaultBaseServiceLocator().getService(PayaraCluster.class).addClusterListener(this); <END> }</code><technical_language>cluster injected instead of Globals</technical_language>

Target:
public HazelcastTimerStore(HazelcastCore core) throws Exception { if (!core.isEnabled()) { throw new Exception("Hazelcast MUST be enabled when using the HazelcastTimerStore"); } hazelcast = core.getInstance(); pkCache = hazelcast.getMap(EJB_TIMER_CACHE_NAME); containerCache = hazelcast.getMap(EJB_TIMER_CONTAINER_CACHE_NAME); applicationCache = hazelcast.getMap(EJB_TIMER_APPLICAION_CACHE_NAME); serverName = hazelcast.getCluster().getLocalMember().getStringAttribute(HazelcastCore.INSTANCE_ATTRIBUTE); this.ownerIdOfThisServer_ = serverName; this.domainName_ = core.getInstance().getConfig().getGroupConfig().getName(); super.enableRescheduleTimers(); }
Source:
<code>private void collectMinings(ITypeRoot unit, ITextEditor textEditor, IJavaElement[] elements, List<ICodeMining> minings, ITextViewer viewer, IProgressMonitor monitor) throws JavaModelException { for (IJavaElement element : elements) { if (monitor.isCanceled()) { return; } if (element.getElementType() == IJavaElement.TYPE) { collectMinings(unit, textEditor, ((IType) element).getChildren(), minings, viewer, monitor); } else if (!(element.getElementType() == IJavaElement.METHOD || element.getElementType() == IJavaElement.FIELD)) { continue; } if (showReferences) { try { if ((showReferencesOnTypes && (element.getElementType() == IJavaElement.TYPE)) || (showReferencesOnMethods && (element.getElementType() == IJavaElement.METHOD)) || (showReferencesOnFields && (element.getElementType() == IJavaElement.FIELD)) ) { minings.add(new JavaReferenceCodeMining(element, (JavaEditor) textEditor, viewer.getDocument(), this, showAtLeastOne)); } } catch (BadLocationException e) { } } if (showImplementations) { if (element instanceof IType) { IType type= (IType) element; if (type.isInterface() || type.isClass() || <START> Flags.isAbstract(type.getFlags())) <END> { try { minings.add(new JavaImplementationCodeMining(type, (JavaEditor) textEditor, viewer.getDocument(), this, showAtLeastOne)); } catch (BadLocationException e) { } } } } } }</code><technical_language>Is this required</technical_language>

Target:
private void collectMinings(ITypeRoot unit, ITextEditor textEditor, IJavaElement[] elements, List<ICodeMining> minings, ITextViewer viewer, IProgressMonitor monitor) throws JavaModelException { for (IJavaElement element : elements) { if (monitor.isCanceled()) { return; } if (element.getElementType() == IJavaElement.TYPE) { collectMinings(unit, textEditor, ((IType) element).getChildren(), minings, viewer, monitor); } else if (!(element.getElementType() == IJavaElement.METHOD || element.getElementType() == IJavaElement.FIELD)) { continue; } if (showReferences) { try { if ((showReferencesOnTypes && (element.getElementType() == IJavaElement.TYPE)) || (showReferencesOnMethods && (element.getElementType() == IJavaElement.METHOD)) || (showReferencesOnFields && (element.getElementType() == IJavaElement.FIELD)) ) { minings.add(new JavaReferenceCodeMining(element, (JavaEditor) textEditor, viewer.getDocument(), this, showAtLeastOne)); } } catch (BadLocationException e) { } } if (showImplementations) { boolean addMining= false; if (element instanceof IType) { IType type= (IType) element; if (type.isInterface() || type.isClass()) { addMining= true; } } else if (element instanceof IMethod) { addMining= true; } if (addMining) { try { minings.add(new JavaImplementationCodeMining(element, (JavaEditor) textEditor, viewer.getDocument(), this, showAtLeastOne)); } catch (BadLocationException e) { } } } } }
Source:
<code>public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) { if(!isAdded()) { return; } super.onCreateOptionsMenu(menu, inflater); if (queue != null) { inflater.inflate(R.menu.queue, menu); MenuItem searchItem = menu.findItem(R.id.action_search); final SearchView sv = (SearchView) MenuItemCompat.getActionView(searchItem); MenuItemUtils.adjustTextColor(getActivity(), sv); sv.setQueryHint(getString(R.string.search_hint)); sv.setOnQueryTextListener(new SearchView.OnQueryTextListener() { @Override public boolean onQueryTextSubmit(String s) { sv.clearFocus(); ((MainActivity) getActivity()).loadChildFragment(SearchFragment.newInstance(s)); return true; } @Override public boolean onQueryTextChange(String s) { return false; } }); MenuItemUtils.refreshLockItem(getActivity(), menu); boolean sortedAutomatically = UserPreferences.isQueueSortedAutomatically(); MenuItem lockItem = menu.findItem(R.id.queue_lock); lockItem.setVisible(!sortedAutomatically); MenuItem sortedAutomaticallyItem = menu.findItem(R.id.queue_sort_automatically); sortedAutomaticallyItem.setChecked(sortedAutomatically); MenuItem sortRandomItem = menu.findItem(R.id.queue_sort_random); sortRandomItem.setVisible(!sortedAutomatically); MenuItem sortSmartShuffleItem = menu.findItem(R.id.queue_sort_smart_shuffle); <START> sortSmartShuffleItem.setVisible(!sortedAutomatically); <END> isUpdatingFeeds = MenuItemUtils.updateRefreshMenuItem(menu, R.id.refresh_item, updateRefreshMenuItemChecker); } }</code><technical_language>Smart Shuffle is deterministic, I remember. item stay enabled</technical_language>

Target:
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) { if(!isAdded()) { return; } super.onCreateOptionsMenu(menu, inflater); if (queue != null) { inflater.inflate(R.menu.queue, menu); MenuItem searchItem = menu.findItem(R.id.action_search); final SearchView sv = (SearchView) MenuItemCompat.getActionView(searchItem); MenuItemUtils.adjustTextColor(getActivity(), sv); sv.setQueryHint(getString(R.string.search_hint)); sv.setOnQueryTextListener(new SearchView.OnQueryTextListener() { @Override public boolean onQueryTextSubmit(String s) { sv.clearFocus(); ((MainActivity) getActivity()).loadChildFragment(SearchFragment.newInstance(s)); return true; } @Override public boolean onQueryTextChange(String s) { return false; } }); MenuItemUtils.refreshLockItem(getActivity(), menu); boolean keepSorted = UserPreferences.isQueueKeepSorted(); MenuItem lockItem = menu.findItem(R.id.queue_lock); lockItem.setVisible(!keepSorted); MenuItem sortRandomItem = menu.findItem(R.id.queue_sort_random); sortRandomItem.setVisible(!keepSorted); MenuItem keepSortedItem = menu.findItem(R.id.queue_keep_sorted); keepSortedItem.setChecked(keepSorted); isUpdatingFeeds = MenuItemUtils.updateRefreshMenuItem(menu, R.id.refresh_item, updateRefreshMenuItemChecker); } }
Source:
<code>public static boolean removeRejoinNodeIndicatorForHost(ZooKeeper zk, int hostId) { try { Stat stat = new Stat(); final int rejoiningHost = ByteBuffer.wrap(zk.getData(rejoinNodeBlocker, false, stat)).getInt(); if (hostId == rejoiningHost) { zk.delete(rejoinNodeBlocker, stat.getVersion()); return true; } } catch (KeeperException e) { if (e.code() != KeeperException.Code.NONODE && <START> e.code() != KeeperException.Code.BADVERSION) { <END> return false; } } catch (InterruptedException e) { return false; } return false; }</code><technical_language>is BADVERSION ok? new this</technical_language>

Target:
public static boolean removeRejoinNodeIndicatorForHost(ZooKeeper zk, int hostId) { try { Stat stat = new Stat(); final int rejoiningHost = ByteBuffer.wrap(zk.getData(rejoinNodeBlocker, false, stat)).getInt(); if (hostId == rejoiningHost) { zk.delete(rejoinNodeBlocker, stat.getVersion()); return true; } } catch (KeeperException e) { if (e.code() == KeeperException.Code.NONODE || e.code() == KeeperException.Code.BADVERSION) { return true; } } catch (InterruptedException e) { return false; } return false; }
Source:
<code>protected List<PullRequestReference> fetchPullRequestsRaw() { final List<PullRequestReference> pullRequests = new ArrayList<>(); for(StreamDefinition streamDefinition: super.processorConfig.getStreamDefinition()){ if(streamDefinition.isFound()){ for(StreamComponentDefinition streamComponentDefinition:streamDefinition.getStreamComponents()){ if(streamDefinition.isFound()){ try { final Repository repository = super.processorConfig.getAphrodite().getRepository(streamComponentDefinition.getStreamComponent().getRepositoryURL().toURL()); if(repository != null){ final List<PullRequest> componentPullRequests = super.processorConfig.getAphrodite().getPullRequestsByState(repository, PullRequestState.OPEN); pullRequests.addAll(componentPullRequests.stream().map(p->{ PullRequestReference pullRequestReference = new PullRequestReference(); pullRequestReference.setComponentDefinition(streamComponentDefinition); pullRequestReference.setPullRequest(p); return pullRequestReference; }).collect(Collectors.toList())); } else { <START> super.logger.warning("Did not find repository: "+streamComponentDefinition.getStreamComponent().getRepositoryURL()); <END> } } catch (MalformedURLException e) { super.log(Level.WARNING, "Did not find repo",e); } catch (NotFoundException e) { super.log(Level.WARNING, "Did not find repo",e); } } else { super.log(Level.WARNING, "Component not found, ignoring: "+streamComponentDefinition); } } } } return pullRequests; }</code><technical_language>warning: static field AbstractProcessor.logger accessed in a static</technical_language>

Target:
protected List<PullRequestReference> fetchPullRequestsRaw() { final List<PullRequestReference> pullRequests = new ArrayList<>(); for(StreamDefinition streamDefinition: super.processorConfig.getStreamDefinition()){ if(streamDefinition.isFound()){ for(StreamComponentDefinition streamComponentDefinition:streamDefinition.getStreamComponents()){ if(streamDefinition.isFound()){ try { final Repository repository = super.processorConfig.getAphrodite().getRepository(streamComponentDefinition.getStreamComponent().getRepositoryURL().toURL()); if(repository != null){ final List<PullRequest> componentPullRequests = super.processorConfig.getAphrodite().getPullRequestsByState(repository, PullRequestState.OPEN); pullRequests.addAll(componentPullRequests.stream().map(p->{ return new PullRequestReference(p, streamComponentDefinition); }).collect(Collectors.toList())); } else { super.LOGGER.warning("Did not find repository: "+streamComponentDefinition.getStreamComponent().getRepositoryURL()); } } catch (MalformedURLException e) { super.log(Level.WARNING, "Did not find repo",e); } catch (NotFoundException e) { super.log(Level.WARNING, "Did not find repo",e); } } else { super.log(Level.WARNING, "Component not found, ignoring: "+streamComponentDefinition); } } } } return pullRequests; }
Source:
<code>public List<MatchmakerQueueMapPool> getMatchmakerPools(int matchmakerQueueId) { <START> return Collections.emptyList(); <END> }</code><technical_language>List.of()</technical_language>

Target:
public List<MatchmakerQueueMapPool> getMatchmakerPools(int matchmakerQueueId) { return List.of(); }
Source:
<code>public void parse() { sink.start() ; HandlerSink rslt = new HandlerSink(sink, errorHandler) ; arp.getHandlers().setStatementHandler(rslt) ; arp.getHandlers().setErrorHandler(rslt) ; arp.getHandlers().setNamespaceHandler(rslt) ; ARPOptions arpOptions = arp.getOptions() ; if ( RiotUniformCompatibility ) { for ( int code : additionalErrors ) arpOptions.setErrorMode(code, ARPErrorNumbers.EM_ERROR) ; } if ( JenaRuntime.isRDF11 ) arp.getOptions().setIRIFactory(IRIResolver.iriFactory()); if ( context != null ) { try { @SuppressWarnings("unchecked") Map<String, Object> p = (Map<String, Object>)(context.get(SysRIOT.sysRdfReaderProperties)) ; if ( p != null ) p.forEach((k,v) -> oneProperty(arpOptions, k, v)) ; } catch (Throwable ex) { <START> Log.warn(AdapterRDFWriter.class, "Problem setting properties", ex); <END> } } arp.setOptionsWith(arpOptions) ; try { if ( reader != null ) arp.load(reader, xmlBase) ; else arp.load(input, xmlBase) ; } catch (IOException e) { errorHandler.error(filename + ": " + ParseException.formatMessage(e), -1, -1) ; } catch (SAXParseException e) { } catch (SAXException sax) { errorHandler.error(filename + ": " + ParseException.formatMessage(sax), -1, -1) ; } sink.finish() ; }</code><technical_language>this message more state some/all properties ignored</technical_language>

Target:
public void parse() { sink.start() ; HandlerSink rslt = new HandlerSink(sink, errorHandler) ; arp.getHandlers().setStatementHandler(rslt) ; arp.getHandlers().setErrorHandler(rslt) ; arp.getHandlers().setNamespaceHandler(rslt) ; ARPOptions arpOptions = arp.getOptions() ; if ( RiotUniformCompatibility ) { for ( int code : additionalErrors ) arpOptions.setErrorMode(code, ARPErrorNumbers.EM_ERROR) ; } if ( JenaRuntime.isRDF11 ) arp.getOptions().setIRIFactory(IRIResolver.iriFactory()); if ( context != null ) { Map<String, Object> properties = null; try { @SuppressWarnings("unchecked") Map<String, Object> p = (Map<String, Object>)(context.get(SysRIOT.sysRdfReaderProperties)) ; properties = p; } catch(Throwable ex) { Log.warn(this, "Problem accessing the RDF/XML reader properties: properties ignored", ex); } if ( properties != null ) properties.forEach((k,v) -> oneProperty(arpOptions, k, v)) ; } arp.setOptionsWith(arpOptions) ; try { if ( reader != null ) arp.load(reader, xmlBase) ; else arp.load(input, xmlBase) ; } catch (IOException e) { errorHandler.error(filename + ": " + ParseException.formatMessage(e), -1, -1) ; } catch (SAXParseException e) { } catch (SAXException sax) { errorHandler.error(filename + ": " + ParseException.formatMessage(sax), -1, -1) ; } sink.finish() ; }
Source:
<code>private Token scanIdentifierOrKeyword(int beginToken, char ch) { StringBuilder valueBuilder = new StringBuilder(); valueBuilder.append(ch); boolean containsUnicodeEscape = ch == '\\'; boolean bracedUnicodeEscape = false; <START> int unicodeEscapeLen = (ch == '\\' ? 1 : 0); <END> ch = peekChar(); while (isIdentifierPart(ch) || ch == '\\' || (ch == '{' && unicodeEscapeLen == 2) || (ch == '}' && bracedUnicodeEscape)) { if (ch == '\\') { containsUnicodeEscape = true; } if (ch == '\\' || unicodeEscapeLen > 0) { unicodeEscapeLen ++; } if (ch == '{') { bracedUnicodeEscape = true; } if (ch == '}' || (unicodeEscapeLen >= 6 && !bracedUnicodeEscape)) { bracedUnicodeEscape = false; unicodeEscapeLen = 0; } valueBuilder.append(nextChar()); ch = peekChar(); } String value = valueBuilder.toString(); if (containsUnicodeEscape) { value = processUnicodeEscapes(value); if (value == null) { reportError( getPosition(index), "Invalid escape sequence"); return createToken(TokenType.ERROR, beginToken); } } char start = value.charAt(0); if (!isIdentifierStart(start)) { reportError( getPosition(beginToken), "Character '%c' (U+%04X) is not a valid identifier start char", start, (int) start); return createToken(TokenType.ERROR, beginToken); } if (Keywords.isKeyword(value)) { return new Token(Keywords.getTokenType(value), getTokenRange(beginToken)); } return new IdentifierToken(getTokenRange(beginToken), value.intern()); }</code><technical_language>java int unicodeEscapeLen = containsUnicodeEscape ? 1 : 0;</technical_language>

Target:
private Token scanIdentifierOrKeyword(int beginToken, char ch) { StringBuilder valueBuilder = new StringBuilder(); valueBuilder.append(ch); boolean containsUnicodeEscape = ch == '\\'; boolean bracedUnicodeEscape = false; int unicodeEscapeLen = containsUnicodeEscape ? 1 : 0; ch = peekChar(); while (isIdentifierPart(ch) || ch == '\\' || (ch == '{' && unicodeEscapeLen == 2) || (ch == '}' && bracedUnicodeEscape)) { if (ch == '\\') { containsUnicodeEscape = true; } if (ch == '\\' || unicodeEscapeLen > 0) { unicodeEscapeLen ++; } if (ch == '{') { bracedUnicodeEscape = true; } if (ch == '}' || (unicodeEscapeLen >= 6 && !bracedUnicodeEscape)) { bracedUnicodeEscape = false; unicodeEscapeLen = 0; } valueBuilder.append(nextChar()); ch = peekChar(); } String value = valueBuilder.toString(); if (containsUnicodeEscape) { value = processUnicodeEscapes(value); if (value == null) { reportError( getPosition(index), "Invalid escape sequence"); return createToken(TokenType.ERROR, beginToken); } } char start = value.charAt(0); if (!isIdentifierStart(start)) { reportError( getPosition(beginToken), "Character '%c' (U+%04X) is not a valid identifier start char", start, (int) start); return createToken(TokenType.ERROR, beginToken); } if (Keywords.isKeyword(value)) { return new Token(Keywords.getTokenType(value), getTokenRange(beginToken)); } return new IdentifierToken(getTokenRange(beginToken), value.intern()); }