auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private Statement createTimeToLive(Table table, boolean alter,int value, String unit, String column, int batchSize, int maxFrequency, String migrationTargetName) { if (!alter) { table.addTTL(value, unit, column, batchSize, maxFrequency, migrationTargetName); } else { if (table.getTTL() != null && !StringUtil.isEmpty(table.getTTL().migrationTarget) && !table.getTTL().migrationTarget.equalsIgnoreCase(migrationTargetName)){ <START> throw unexpectedToken("The migration target can not be altered."); <END> } } Object[] args = new Object[] { table.getName(), value, unit, column, batchSize, maxFrequency, migrationTargetName, Integer.valueOf(SchemaObject.CONSTRAINT), Boolean.valueOf(false), Boolean.valueOf(false) }; return new StatementSchema(null, StatementTypes.ALTER_TTL, args, null, table.getName()); }</code><technical_language>"cannot"</technical_language>

Target:
private Statement createTimeToLive(Table table, boolean alter,int value, String unit, String column, int batchSize, int maxFrequency, String migrationTargetName) { if (!alter) { table.addTTL(value, unit, column, batchSize, maxFrequency, migrationTargetName); } else { if (table.getTTL() != null) { final String oldTarget = table.getTTL().migrationTarget; if (StringUtil.isEmpty(oldTarget) && !StringUtil.isEmpty(migrationTargetName)) { throw unexpectedToken("The migration target cannot be added."); } if (!StringUtil.isEmpty(oldTarget) && !oldTarget.equals(migrationTargetName)) { throw unexpectedToken("The migration target cannot be added."); } } else if (!StringUtil.isEmpty(migrationTargetName)) { throw unexpectedToken("The migration target cannot be added."); } } Object[] args = new Object[] { table.getName(), value, unit, column, batchSize, maxFrequency, migrationTargetName, Integer.valueOf(SchemaObject.CONSTRAINT), Boolean.valueOf(false), Boolean.valueOf(false) }; return new StatementSchema(null, StatementTypes.ALTER_TTL, args, null, table.getName()); }
Source:
<code>public void delete(UserEntityFile userEntityFile) { <START> getEntityManager().remove(userEntityFile); <END> }</code><technical_language>Replace method content with... super.delete(userEntityFile); ...as underlying code delete entity fire event it</technical_language>

Target:
public void delete(UserEntityFile userEntityFile) { super.delete(userEntityFile); }
Source:
<code>public int getErrorCode() { int errorCode; try { <START> errorCode = Integer.parseInt(this.errorCode.toString()); <END> } catch (NumberFormatException e) { errorCode = 0; } return errorCode; }</code><technical_language>I understand converting this string. Do need store error code a string for some reason</technical_language>

Target:
public int getErrorCode() { return this.errorCode; }
Source:
<code>public long pauseMillis() { <START> return 5L; <END> }</code><technical_language>do 50 confident need lower. wary of load increase this fast. If need pause this much, need invest in smarter backoffs instead (continuing if iteration work, pausing for longer)</technical_language>

Target:
public long pauseMillis() { return 50L; }
Source:
<code>public void destroy() { <START> if (taskScheduler != null) { <END> taskScheduler.destroy(); } }</code><technical_language>null check needed taskScheduler final set in constructor</technical_language>

Target:
public void destroy() { taskScheduler.destroy(); }
Source:
<code>public void setSaveOffline(boolean saved) { if (pages.isEmpty()) { <START> emptyListSavePagesState = saved; <END> return; } for (ReadingListPage page : pages) { page.savedOrSaving(saved); ReadingListPageDao.instance().upsert(page); } }</code><technical_language>I this unconditionally set saved. (Conditionals hazardous.) Note: this information is preserved in database lost app restart</technical_language>

Target:
public void setSaveOffline(boolean saved) { emptyListSavePagesState = saved; for (ReadingListPage page : pages) { page.savedOrSaving(saved); } }
Source:
<code>private static int zzUnpackTrans() { int result = new int[4374]; <START> int offset = 0; <END> zzUnpackTrans(ZZ_TRANS_PACKED_0, offset, result); return result; }</code><technical_language>kill offset pass 0</technical_language>

Target:
private static int zzUnpackTrans() { int result = new int[4374]; int offset = 0; offset = zzUnpackTrans(ZZ_TRANS_PACKED_0, offset, result); return result; }
Source:
<code>public boolean addDependency(DynamicPomDependency dep, Path pomPath) { if (dep.getGroupID().isEmpty() || dep.getArtifactID().isEmpty()) { return false; } try { Dependency pomDep = getMavenDependency(dep); pomDep.setType("jar"); org.uberfire.java.nio.file.Path filePath = Paths.get(pomPath.toURI()); Model model = getPOMModel(filePath); Set keys = getKeysFromDeps(model.getDependencies()); if(!keys.contains(getKeyFromDep(dep))) { model.getDependencies().add(pomDep); <START> }else{ <END> return false; } writePOMModelOnFS(filePath, model); } catch (Exception ex) { logger.error(ex.getMessage(), ex); return false; } return true; }</code><technical_language>file formatted properly.</technical_language>

Target:
public boolean addDependency(DynamicPomDependency dep, Path pomPath) { if (dep == null || !isGroupIDValid(dep) || !isArtifactIDValid(dep)) { return false; } try { Dependency pomDep = getMavenDependency(dep); org.uberfire.java.nio.file.Path filePath = Paths.get(pomPath.toURI()); Model model = getPOMModel(filePath); Map<String, String> keys = getKeysFromDeps(model.getDependencies()); String keyDep = getKeyFromDep(dep); if (!keys.containsKey(keyDep)) { model.getDependencies().add(pomDep); } else { String versionKey = keys.get(keyDep); List<Dependency> modelDeps = model.getDependencies(); for (Dependency modelDep : modelDeps) { if (modelDep.getGroupId().equals(dep.getGroupID()) && modelDep.getArtifactId().equals(dep.getArtifactID())) { modelDep.setVersion(versionKey); } } return false; } writePOMModelOnFS(filePath, model); } catch (Exception ex) { logger.error(ex.getMessage(), ex); return false; } return true; }
Source:
<code>protected String[][] formatTableContents() { final String [][] formatArray = new String[this.tapeList.size()][]; int i = 0; for (final Tape tape : this.tapeList) { final String bucketArray = new String[this.columnCount]; bucketArray[0] = nullGuard(tape.getBarCode()); bucketArray[1] = nullGuardToString(tape.getId()); bucketArray[2] = nullGuardToString(tape.getState()); bucketArray[3] = nullGuardToDate(tape.getLastModified(), DATE_FORMAT); bucketArray[4] = nullGuardToString(tape.getAvailableRawCapacity()); bucketArray[5] = nullGuardToString(tape.getBucketId()); bucketArray[6] = nullGuardToString(tape.getAssignedToStorageDomain()); <START> bucketArray[6] = nullGuardToString(tape.getAssignedToStorageDomain()); <END> bucketArray[7] = nullGuardToString(tape.getEjectDate()); bucketArray[8] = nullGuard(tape.getEjectLocation()); bucketArray[9] = nullGuard(tape.getEjectLabel()); formatArray[i++] = bucketArray; } return formatArray; }</code><technical_language>This is a duplicate</technical_language>

Target:
protected String[][] formatTableContents() { final String [][] formatArray = new String[this.tapeList.size()][]; int i = 0; for (final Tape tape : this.tapeList) { final String bucketArray = new String[this.columnCount]; bucketArray[0] = nullGuard(tape.getBarCode()); bucketArray[1] = nullGuardToString(tape.getId()); bucketArray[2] = nullGuardToString(tape.getState()); bucketArray[3] = nullGuardToDate(tape.getLastModified(), DATE_FORMAT); bucketArray[4] = nullGuardToString(tape.getAvailableRawCapacity()); bucketArray[5] = nullGuardToString(tape.getBucketId()); bucketArray[6] = nullGuardToString(tape.getAssignedToStorageDomain()); bucketArray[7] = nullGuardToDate(tape.getEjectDate(), DATE_FORMAT); bucketArray[8] = nullGuard(tape.getEjectLocation()); bucketArray[9] = nullGuard(tape.getEjectLabel()); bucketArray[10] = nullGuardToDate(tape.getEjectPending(), DATE_FORMAT); formatArray[i++] = bucketArray; } return formatArray; }
Source:
<code>private static String learnedConstraintMessage(Constraint lc, ExplodedGraph.Node currentNode) { Tree nodeTree = currentNode.programPoint.syntaxTree(); String name = SyntaxTreeNameFinder.getName(nodeTree); <START> if (nodeTree.is(Tree.Kind.METHOD_INVOCATION)) { <END> return String.format("'%s' returns %s", name, lc.valueAsString()); } if (nodeTree.is(Tree.Kind.NEW_CLASS)) { return String.format("'new %s' returns %s", name, lc.valueAsString()); } return name == null ? lc.valueAsString() : String.format("assume '%s' is %s", name, lc.valueAsString()); }</code><technical_language>discussed this is a bit of premature generalization. This addressed in SONARJAVA-2004 ok for now</technical_language>

Target:
private static String learnedConstraintMessage(Constraint lc, ExplodedGraph.Node currentNode) { Tree nodeTree = currentNode.programPoint.syntaxTree(); String name = SyntaxTreeNameFinder.getName(nodeTree); if (nodeTree.is(Tree.Kind.METHOD_INVOCATION)) { return String.format("'%s' returns %s", name, lc.valueAsString()); } if (nodeTree.is(Tree.Kind.NEW_CLASS)) { return String.format("Constructor call creates '%s'", lc.valueAsString()); } return name == null ? lc.valueAsString() : String.format("Implies '%s' is %s", name, lc.valueAsString()); }
Source:
<code>public String captureScreenShot(int status, String className, String methodName, String screenShotName) throws IOException, InterruptedException { String getDeviceModel = null; System.out.println("Current Running Thread Status" + AppiumDriverManager.getDriver().getSessionId()); File scrFile = AppiumDriverManager.getDriver() .getScreenshotAs(OutputType.FILE); screenShotNameWithTimeStamp = currentDateAndTime(); if (DeviceManager.getMobilePlatform().equals(MobilePlatform.ANDROID)) { getDeviceModel = screenShotNameWithTimeStamp; screenShotAndFrame(status, scrFile, methodName, className, getDeviceModel, <START> "android", screenShotName); <END> } else if (DeviceManager.getMobilePlatform().equals(MobilePlatform.IOS)) { getDeviceModel = screenShotNameWithTimeStamp; screenShotAndFrame(status, scrFile, methodName, className, getDeviceModel, "iOS", screenShotName); } return getDeviceModel; }</code><technical_language>this condition screenShotAndFrame(status, scrFile, methodName, className, currentDateAndTime(),DeviceManager.getMobilePlatform().toString(), screenShotName);</technical_language>

Target:
public String captureScreenShot(int status, String className, String methodName, String screenShotName) throws IOException, InterruptedException { System.out.println("Current Running Thread Status" + AppiumDriverManager.getDriver().getSessionId()); File scrFile = AppiumDriverManager.getDriver() .getScreenshotAs(OutputType.FILE); screenShotNameWithTimeStamp = currentDateAndTime(); screenShotAndFrame(status, scrFile, methodName, className, screenShotNameWithTimeStamp, DeviceManager.getMobilePlatform().toString(), screenShotName); return screenShotNameWithTimeStamp; }
Source:
<code>public Block sort( @OperatorDependency(operator = LESS_THAN, argumentTypes = {"E", "E"}) MethodHandle lessThanFunction, @TypeParameter("E") Type type, @SqlType("array(E)") Block block) { int arrayLength = block.getPositionCount(); if (positions.size() < arrayLength) { positions = Ints.asList(new int[arrayLength]); } for (int i = 0; i < arrayLength; i++) { positions.set(i, i); } Collections.sort(positions.subList(0, arrayLength), new Comparator<Integer>() { @Override public int compare(Integer p1, Integer p2) { boolean nullLeft = block.isNull(p1); boolean nullRight = block.isNull(p2); if (nullLeft && nullRight) { return 0; } if (nullLeft) { return 1; } if (nullRight) { return -1; } try { return type.compareTo(block, p1, block, p2); } catch (PrestoException e) { <START> throw new PrestoException(INVALID_FUNCTION_ARGUMENT, e.getMessage()); <END> } } }); if (pageBuilder.isFull()) { pageBuilder.reset(); } BlockBuilder blockBuilder = pageBuilder.getBlockBuilder(0); for (int i = 0; i < arrayLength; i++) { type.appendTo(block, positions.get(i), blockBuilder); } pageBuilder.declarePositions(arrayLength); return blockBuilder.getRegion(blockBuilder.getPositionCount() - arrayLength, arrayLength); }</code><technical_language>rewrite exception if error code is NOT_SUPPORTED. Also, wrap original exception in new exception, e.g. throw new PrestoException(INVALID_FUNCTION_ARGUMENT, "Array contains elements supported compared", e);</technical_language>

Target:
public Block sort( @OperatorDependency(operator = LESS_THAN, argumentTypes = {"E", "E"}) MethodHandle lessThanFunction, @TypeParameter("E") Type type, @SqlType("array(E)") Block block) { int arrayLength = block.getPositionCount(); if (positions.size() < arrayLength) { positions = Ints.asList(new int[arrayLength]); } for (int i = 0; i < arrayLength; i++) { positions.set(i, i); } Collections.sort(positions.subList(0, arrayLength), new Comparator<Integer>() { @Override public int compare(Integer p1, Integer p2) { boolean nullLeft = block.isNull(p1); boolean nullRight = block.isNull(p2); if (nullLeft && nullRight) { return 0; } if (nullLeft) { return 1; } if (nullRight) { return -1; } try { return type.compareTo(block, p1, block, p2); } catch (PrestoException e) { if (e.getErrorCode() == NOT_SUPPORTED.toErrorCode()) { throw new PrestoException(INVALID_FUNCTION_ARGUMENT, "Array contains elements not supported for comparison", e); } throw e; } } }); if (pageBuilder.isFull()) { pageBuilder.reset(); } BlockBuilder blockBuilder = pageBuilder.getBlockBuilder(0); for (int i = 0; i < arrayLength; i++) { type.appendTo(block, positions.get(i), blockBuilder); } pageBuilder.declarePositions(arrayLength); return blockBuilder.getRegion(blockBuilder.getPositionCount() - arrayLength, arrayLength); }
Source:
<code>public List<String> getComponentList() { <START> return mComponentList; <END> }</code><technical_language>please return copy of list, avoid modifications of class</technical_language>

Target:
public List<String> getComponentList() { return new ArrayList<>( mComponentList ); }
Source:
<code>public Set<UnitType> getCanNotTarget() { if (canNotTarget == null) { if (isSuicideOnAttack && isFirstStrike) { canNotTarget = new HashSet<>( CollectionUtils.getMatches( getData().getUnitTypeList().getAllUnitTypes(), <START> Matches.unitTypeIsSuicideOnAttack().or(Matches.unitTypeIsSuicideOnDefense()))); <END> } else { canNotTarget = new HashSet<>( CollectionUtils.getMatches( getData().getUnitTypeList().getAllUnitTypes(), Matches.unitTypeIsAir())); } } return canNotTarget; }</code><technical_language>nit, matches type varies depending if condition, if/else simplified. code low-level cleanup, is 'isSub' 'isSuicide' properties opposites of another? IE: is if 'isSuicide' is false, 'isSub' is true</technical_language>

Target:
public Set<UnitType> getCanNotTarget() { if (canNotTarget == null) { final Predicate<UnitType> unitTypeMatch = (isSuicideOnAttack && isFirstStrike) ? Matches.unitTypeIsSuicideOnAttack().or(Matches.unitTypeIsSuicideOnDefense()) : Matches.unitTypeIsAir(); canNotTarget = new HashSet<>( CollectionUtils.getMatches( getData().getUnitTypeList().getAllUnitTypes(), unitTypeMatch)); } return canNotTarget; }
Source:
<code>public void registerAttributes(ManagementResourceRegistration registry) { for (AttributeDefinition attr : ATTRIBUTES) { if (registerRuntimeOnly || !attr.getFlags().contains(AttributeAccess.Flag.STORAGE_RUNTIME)) { <START> registry.registerReadWriteAttribute(attr, null, new ReloadRequiredWriteAttributeHandler(ATTRIBUTES)); <END> } } }</code><technical_language>This handler created in loop loop reused</technical_language>

Target:
public void registerAttributes(ManagementResourceRegistration registry) { ReloadRequiredWriteAttributeHandler reloadRequiredWriteAttributeHandler = new ReloadRequiredWriteAttributeHandler(ATTRIBUTES); for (AttributeDefinition attr : ATTRIBUTES) { if (registerRuntimeOnly || !attr.getFlags().contains(AttributeAccess.Flag.STORAGE_RUNTIME)) { registry.registerReadWriteAttribute(attr, null, reloadRequiredWriteAttributeHandler); } } }
Source:
<code>public void recognizeCustomFormLabeledDataWithEmptyModelId(HttpClient httpClient, FormRecognizerServiceVersion serviceVersion) { client = getFormRecognizerAsyncClient(httpClient, serviceVersion); customFormDataRunner(data -> beginTrainingLabeledRunner((trainingFilesUrl, useTrainingLabels) -> { <START> SyncPoller<OperationResult, CustomFormModel> syncPoller = <END> getFormTrainingAsyncClient(httpClient, serviceVersion).beginTraining(trainingFilesUrl, useTrainingLabels).getSyncPoller(); syncPoller.waitForCompletion(); Exception ex = assertThrows(RuntimeException.class, () -> client.beginRecognizeCustomForms(toFluxByteBuffer(data), "", CUSTOM_FORM_FILE_LENGTH, FormContentType.APPLICATION_PDF, true, null).getSyncPoller()); assertEquals(EXPECTED_INVALID_UUID_EXCEPTION_MESSAGE, ex.getMessage()); })); }</code><technical_language>here. need train, if training result</technical_language>

Target:
public void recognizeCustomFormLabeledDataWithEmptyModelId(HttpClient httpClient, FormRecognizerServiceVersion serviceVersion) { client = getFormRecognizerAsyncClient(httpClient, serviceVersion); customFormDataRunner((data, dataLength) -> { Exception ex = assertThrows(RuntimeException.class, () -> client.beginRecognizeCustomForms( new RecognizeCustomFormsOptions(toFluxByteBuffer(data), dataLength, "") .setFormContentType(FormContentType.APPLICATION_PDF).setIncludeTextContent(true) .setPollInterval(durationTestMode)).getSyncPoller()); assertEquals(EXPECTED_INVALID_UUID_EXCEPTION_MESSAGE, ex.getMessage()); }); }
Source:
<code>public void extractsQueryStringIgnoringAParameter() throws Exception { final String IGNORED_PARAM = "foo"; final Map<String, List<String>> queryString = someQueryString(); <START> queryString.remove(IGNORED_PARAM); <END> testWithHttpContext(queryString, httpContext -> assertThat(extractQueryString(httpContext.request(), Collections.singleton( IGNORED_PARAM ))) .isEqualTo( queryString )); }</code><technical_language>If remove parameter for test pass ;)</technical_language>

Target:
public void extractsQueryStringIgnoringAParameter() throws Exception { final String IGNORED_PARAM = "foo"; final Map<String, List<String>> queryString = someQueryString(); testWithHttpContext(queryString, httpContext -> assertThat(extractQueryString(httpContext.request(), Collections.singleton( IGNORED_PARAM ))) .isEqualTo( quxQueryString() )); }
Source:
<code>private boolean containsBeanDefiningAnnotation(Set<DotName> annotations) { <START> for (DotName name : annotations) { <END> if (scopeTypes.contains(name.toString())) { return true; } } return false; }</code><technical_language>more efficient a Set<DotName> scopeTypes do scopeTypes.contains(name) covert DotName String form calling toString()</technical_language>

Target:
private boolean containsBeanDefiningAnnotation(Set<DotName> annotations) { for (DotName name : annotations) { if (beanDefiningAnnotations.contains(name)) { return true; } } return false; }
Source:
<code>public Object createInstance(List<String> paths, String className, Object[] args) throws IllegalArgumentException, InstantiationException, IllegalAccessException, InvocationTargetException{ pathsCache = paths; Class<?> k = null; try{ k = searchPathsForClass(paths, className); } catch (SlimError errorClassNotFound){ try { MethodExecutionResult mER = invokeStaticMethod(className, paths, args); if(mER != null) return mER.getObject(); } catch (Throwable e) { <START> throw new InstantiationException(String.format("Failed to call static method '%s': %s", className, new StringBuilder().append("\nCaused by: ").append(e.getClass().getName()).append(": ").append(e.getMessage()) + new StackTraceEnricher().getStackTraceAsString(e))); <END> } throw errorClassNotFound; } Constructor<?> constructor = getConstructor(k, args); if (constructor == null) { throw new SlimError(String.format("message:<<%s %s>>", SlimServer.NO_CONSTRUCTOR, className)); } return newInstance(args, constructor); }</code><technical_language>Please mix String.format StringBuilder. a StringBuilder create message</technical_language>

Target:
public Object createInstance(List<String> paths, String className, Object[] args) throws IllegalArgumentException, InstantiationException, IllegalAccessException, InvocationTargetException{ pathsCache = paths; Class<?> k = null; try{ k = searchPathsForClass(paths, className); } catch (SlimError errorClassNotFound) { try { MethodExecutionResult mER = invokeStaticMethod(className, paths, args); if (mER != null) { if (mER.hasResult()) { return mER.getObject(); } else { return mER.returnValue(); } } } catch (Throwable e) { throw new InstantiationException(new StringBuilder().append("Failed to call static method '").append(className).append("': ") .append("\nCaused by: ").append(e.getClass().getName()).append(": ") .append(e.getMessage()).append( new StackTraceEnricher().getStackTraceAsString(e)).toString()); } throw errorClassNotFound; } Constructor<?> constructor = getConstructor(k, args); if (constructor == null) { throw new SlimError(String.format("message:<<%s %s>>", SlimServer.NO_CONSTRUCTOR, className)); } return newInstance(args, constructor); }
Source:
<code>public BlobOutput getBlob(BlobId blobId, ClusterMap map, boolean expiredBlobs) throws MessageFormatException, IOException { List<ReplicaId> replicas = blobId.getPartition().getReplicaIds(); BlobOutput blobOutput = null; for (ReplicaId replicaId : replicas) { try { blobOutput = getBlob(blobId, map, replicaId, expiredBlobs); break; } catch (Exception e) { <START> } <END> } return blobOutput; }</code><technical_language>exception messages stack traces</technical_language>

Target:
public BlobOutput getBlob(BlobId blobId, ClusterMap map, boolean expiredBlobs) throws MessageFormatException, IOException { List<ReplicaId> replicas = blobId.getPartition().getReplicaIds(); BlobOutput blobOutput = null; for (ReplicaId replicaId : replicas) { try { blobOutput = getBlob(blobId, map, replicaId, expiredBlobs); break; } catch (Exception e) { System.out.println("Get blob error "); e.printStackTrace(); } } return blobOutput; }
Source:
<code>private StartpointSpecific() { super(); <START> this.specificOffset = null; <END> }</code><technical_language>is this required</technical_language>

Target:
private StartpointSpecific() { this(null); }
Source:
<code>public List<LatencyStat> getLatencyStats(Set<Double> percentiles) { return statBuckets.entrySet().stream() .flatMap(entry -> percentiles.stream().map(percentile -> { TimeValue tv = entry.getValue().getTimeValueAtPercentile(percentile); return new LatencyStat(entry.getKey(), percentile, tv); })) <START> .collect(Collectors.toList()); <END> }</code><technical_language>static import</technical_language>

Target:
public List<LatencyStat> getLatencyStats(Set<Double> percentiles) { return statBuckets.entrySet().stream() .flatMap(entry -> percentiles.stream().map(percentile -> { TimeValue tv = entry.getValue().getTimeValueAtPercentile(percentile); return new LatencyStat(entry.getKey(), percentile, tv); })) .collect(toList()); }
Source:
<code>public static boolean isCType(IProject project) { try { if (project.hasNature(CProjectNature.C_NATURE_ID) && !project.hasNature(CCProjectNature.CC_NATURE_ID)) { return true; } else { return false; } } catch (CoreException e) { MessageDialog.openError(null, "Getting Project type error", <START> "project not found or is closed."); END> return false; } }</code><technical_language>Externalize strings</technical_language>

Target:
public static boolean isCType(IProject project) { try { if (project.hasNature(CProjectNature.C_NATURE_ID) && !project.hasNature(CCProjectNature.CC_NATURE_ID)) { return true; } else { return false; } } catch (CoreException e) { MessageDialogSyncedRunnable.openErrorSyncedRunnable(ProfilingMessages.errorTitle, ProfilingMessages.errorGetProjectType); return false; } }
Source:
<code>public void setUp() throws InterruptedException { outputTopic = createTopic(topicSuffixGenerator.incrementAndGet()); final Properties properties = new Properties(); properties.put(StreamsConfig.CACHE_MAX_BYTES_BUFFERING_CONFIG, 0); properties.put(StreamsConfig.COMMIT_INTERVAL_MS_CONFIG, 100); properties.put(ConsumerConfig.METADATA_MAX_AGE_CONFIG, "1000"); properties.put(ConsumerConfig.AUTO_OFFSET_RESET_CONFIG, "earliest"); <START> streamsConfiguration = StreamsTestUtils.getStreamsConfig("regex-source-integration-test-" + topicSuffixGenerator.get(), <END> CLUSTER.bootstrapServers(), STRING_SERDE_CLASSNAME, STRING_SERDE_CLASSNAME, properties); }</code><technical_language>@Rule public TestName testName = new TestName(); instead suffix</technical_language>

Target:
public void setUp() throws InterruptedException { outputTopic = createTopic(topicSuffixGenerator.incrementAndGet()); final Properties properties = new Properties(); properties.put(StreamsConfig.CACHE_MAX_BYTES_BUFFERING_CONFIG, 0); properties.put(StreamsConfig.COMMIT_INTERVAL_MS_CONFIG, 100); properties.put(ConsumerConfig.METADATA_MAX_AGE_CONFIG, "1000"); properties.put(ConsumerConfig.AUTO_OFFSET_RESET_CONFIG, "earliest"); streamsConfiguration = StreamsTestUtils.getStreamsConfig( IntegrationTestUtils.safeUniqueTestName(RegexSourceIntegrationTest.class, new TestName()), CLUSTER.bootstrapServers(), STRING_SERDE_CLASSNAME, STRING_SERDE_CLASSNAME, properties ); }
Source:
<code>private String encodeBase64(String str) { <START> byte[] stringBytes = new byte[0]; <END> String b64EncodedString = null; try { stringBytes = str.getBytes("UTF-8"); b64EncodedString = new String(Base64.getEncoder().encode(stringBytes), "UTF-8"); } catch (UnsupportedEncodingException e) { } b64EncodedString = b64EncodedString.replace("=", ""); b64EncodedString = b64EncodedString.replace('/', '_'); b64EncodedString = b64EncodedString.replace('+', '-'); return b64EncodedString; }</code><technical_language>declare this variable try block, inline variable. point in allocating array of length zero immediately throwing line 71</technical_language>

Target:
private String encodeBase64(String str) { String b64EncodedString = null; try { byte[] stringBytes = str.getBytes("UTF-8"); b64EncodedString = new String(Base64.getEncoder().encode(stringBytes), "UTF-8"); } catch (UnsupportedEncodingException e) { throw new IllegalArgumentException(e); } b64EncodedString = b64EncodedString.replace("=", ""); b64EncodedString = b64EncodedString.replace('/', '_'); b64EncodedString = b64EncodedString.replace('+', '-'); return b64EncodedString; }
Source:
<code>public static GsonBuilder createGson() { return new GsonBuilder().setLongSerializationPolicy(LongSerializationPolicy.STRING) <START> .disableHtmlEscaping().registerTypeAdapter(LongAdder.class, new TypeAdapter<LongAdder>() { <END> @Override public void write(JsonWriter out, LongAdder value) throws IOException { out.value(value.longValue()); } @Override public LongAdder read(JsonReader in) throws IOException { LongAdder value = new LongAdder(); value.add(in.nextLong()); return value; } }); }</code><technical_language>separate method createGsonWithDisableHtmlEscape() for RpcServer.logResponse() this is places</technical_language>

Target:
public static GsonBuilder createGson() { return new GsonBuilder().setLongSerializationPolicy(LongSerializationPolicy.STRING) .registerTypeAdapter(LongAdder.class, new TypeAdapter<LongAdder>() { @Override public void write(JsonWriter out, LongAdder value) throws IOException { out.value(value.longValue()); } @Override public LongAdder read(JsonReader in) throws IOException { LongAdder value = new LongAdder(); value.add(in.nextLong()); return value; } }); }
Source:
<code>public ImageFormat determineFormat(byte[] headerBytes, int headerSize) { if (headerSize < getHeaderSize()) { return null; } if (ImageFormatCheckerUtils.startsWithPattern(headerBytes, HEADER)) { return SVG_FORMAT; } for (String possibleHeaderTag : POSSIBLE_HEADER_TAGS) { <START> byte[] possibleHeader = ImageFormatCheckerUtils.asciiBytes(possibleHeaderTag); <END> if (ImageFormatCheckerUtils.startsWithPattern(headerBytes, possibleHeader) && ImageFormatCheckerUtils.indexOfPattern(headerBytes, HEADER) > -1) { return SVG_FORMAT; } } return null; }</code><technical_language>this for image is unnecessary work. need String header tag, do: POSSIBLE_HEADER_TAGS = { ImageFormatCheckerUtils.asciiBytes("<?xml")}</technical_language>

Target:
public ImageFormat determineFormat(byte[] headerBytes, int headerSize) { if (headerSize < getHeaderSize()) { return null; } if (ImageFormatCheckerUtils.startsWithPattern(headerBytes, HEADER)) { return SVG_FORMAT; } for (byte[] possibleHeaderTag : POSSIBLE_HEADER_TAGS) { if (ImageFormatCheckerUtils.startsWithPattern(headerBytes, possibleHeaderTag) && ImageFormatCheckerUtils.indexOfPattern(headerBytes, headerBytes.length, HEADER, HEADER.length) > -1) { return SVG_FORMAT; } } return null; }
Source:
<code>public void setStunned(boolean stunned) { if (stunned) { this.stunTick = 40; return; <START> } <END> this.stunTick = 0; }</code><technical_language>If this is implementing a method, please annotate appropriately @Override</technical_language>

Target:
public void setStunned(boolean stunned) { if (stunned) { this.stunTick = Constants.Entity.Ravager.STUNNED_TIME; return; } this.stunTick = 0; }
Source:
<code>public void visitNode(Tree tree) { if (hasSemantic()) { MethodInvocationTree mit = (MethodInvocationTree) tree; Arguments arguments = mit.arguments(); if (SSLCONTEXT_GETINSTANCE_MATCHER.matches(mit)) { ExpressionTree firstArgument = arguments.get(0); if (firstArgument.is(Tree.Kind.STRING_LITERAL) && !STRONG_PROTOCOLS.contains(((LiteralTree) firstArgument).value())) { <START> reportIssue(mit, "Change this code to use a stronger protocol."); <END> } } } }</code><technical_language>I way, I more interesting highlight parameter</technical_language>

Target:
public void visitNode(Tree tree) { if (hasSemantic()) { MethodInvocationTree mit = (MethodInvocationTree) tree; Arguments arguments = mit.arguments(); if (SSLCONTEXT_GETINSTANCE_MATCHER.matches(mit)) { ExpressionTree firstArgument = arguments.get(0); if (firstArgument.is(Tree.Kind.STRING_LITERAL) && !STRONG_PROTOCOLS.contains(trimQuotes(((LiteralTree) firstArgument).value()))) { reportIssue(firstArgument, "Change this code to use a stronger protocol."); } } } }
Source:
<code>void processPendingEmptyTrash(Account account) throws MessagingException { Store remoteStore = account.getRemoteStore(); Folder remoteFolder = remoteStore.getFolder(account.getTrashFolderName()); LocalStore localStore = account.getLocalStore(); LocalFolder localFolder = localStore.getFolder(account.getTrashFolderName()); try { if (remoteFolder.exists()) { remoteFolder.open(Folder.OPEN_MODE_RW); remoteFolder.setFlags(Collections.singleton(Flag.DELETED), true); if (Expunge.EXPUNGE_IMMEDIATELY == account.getExpungePolicy()) { <START> remoteFolder.expunge(localFolder.getAllMessageUids(true)); <END> } synchronizeFolder(account, remoteFolder, true, 0, null); compact(account, null); } } finally { closeFolder(localFolder); closeFolder(remoteFolder); } }</code><technical_language>Same, this expunge() arguments</technical_language>

Target:
void processPendingEmptyTrash(Account account) throws MessagingException { Store remoteStore = account.getRemoteStore(); Folder remoteFolder = remoteStore.getFolder(account.getTrashFolderName()); try { if (remoteFolder.exists()) { remoteFolder.open(Folder.OPEN_MODE_RW); remoteFolder.setFlags(Collections.singleton(Flag.DELETED), true); if (Expunge.EXPUNGE_IMMEDIATELY == account.getExpungePolicy()) { remoteFolder.expunge(); } synchronizeFolder(account, remoteFolder, true, 0, null); compact(account, null); } } finally { closeFolder(remoteFolder); } }
Source:
<code>private void extractRemovedNetworks() { for (VdsNetworkInterface iface : getExistingIfaces().values()) { String networkName = iface.getNetworkName(); if (StringUtils.isNotBlank(networkName) && !attachedNetworksNames.contains(networkName)) { removedNetworks.add(networkName); final List<String> vmNames = getVmInterfaceManager().findActiveVmsUsingNetworks( params.getVdsId(), Collections.singleton(networkName)); if (vmNames.size() == 1) { <START> addViolation(EngineMessage.NETWORK_CANNOT_DETACH_NETWORK_USED_BY_SINGLE_VM, vmNames.get(0)); <END> } else { for (String vmName : vmNames) { addViolation(EngineMessage.NETWORK_CANNOT_DETACH_NETWORK_USED_BY_VMS, vmName); } } } } }</code><technical_language>pass networkName well? Please verify setup networks displayes message correctly</technical_language>

Target:
private void extractRemovedNetworks() { for (VdsNetworkInterface iface : getExistingIfaces().values()) { String networkName = iface.getNetworkName(); if (StringUtils.isNotBlank(networkName) && !attachedNetworksNames.contains(networkName)) { removedNetworks.add(networkName); final List<String> vmNames = getVmInterfaceManager().findActiveVmsUsingNetworks( params.getVdsId(), Collections.singleton(networkName)); for (String vmName : vmNames) { addDetailedViolation( EngineMessage.NETWORK_CANNOT_DETACH_NETWORK_USED_BY_VMS, vmName, Collections.singletonMap("networkNames", networkName)); } } } }
Source:
<code>public final void cleanExpiredUsersSessions() { Long key = new Date().getTime() / 60000; <START> List<String> sessionsList = validToSessionsMap.get(key); <END> if (sessionsList != null) { for (String session : sessionsList) { removeSession(session); } validToSessionsMap.remove(key); } if (intervalsCounter.incrementAndGet() == Config.<Integer> getValue(ConfigValues.UserSessionTimeOutInterval)) { deleteOldGeneration(); intervalsCounter.set(0); } }</code><technical_language>this is great, if clock is out of sync / jumps / process suspended leftovers clean <= x</technical_language>

Target:
public final void cleanExpiredUsersSessions() { Date now = new Date(); Iterator<SessionInfo> iterator = sessionInfoList.iterator(); while (iterator.hasNext()) { ConcurrentMap<String, Object> sessionMap = iterator.next().sessionMap; Date hardLimit = (Date) sessionMap.get(HARD_LIMIT_PARAMETER_NAME); Date softLimit = (Date) sessionMap.get(SOFT_LIMIT_PARAMETER_NAME); if (hardLimit != null) { if (hardLimit.before(now)) { iterator.remove(); } } else if (softLimit != null) { if (softLimit.before(now)) { iterator.remove(); } } } }
Source:
<code>public RealmAwareZkClient buildZkClient( RealmAwareZkClient.RealmAwareZkConnectionConfig connectionConfig, <START> RealmAwareZkClient.RealmAwareZkClientConfig clientConfig) { <END> return null; }</code><technical_language>This a conflict. change is in, need a rebase for this one</technical_language>

Target:
public RealmAwareZkClient buildZkClient( RealmAwareZkClient.RealmAwareZkConnectionConfig connectionConfig, RealmAwareZkClient.RealmAwareZkClientConfig clientConfig) throws IOException, InvalidRoutingDataException { return new SharedZkClient(connectionConfig, clientConfig); }
Source:
<code>public boolean performOk() { <START> Set<IItemDescriptor<Descriptor>> postProcessorDescriptors = Sets.newHashSet(EMFCompareRCPPlugin <END> .getDefault().getPostProcessorDescriptorRegistry().getItemDescriptors()); SetView<IItemDescriptor<Descriptor>> postProcessorToDisable = Sets.difference( postProcessorDescriptors, dataHolder.getData()); setEnginePreferences(EMFComparePreferences.DISABLED_POST_PROCESSOR, postProcessorToDisable); if (TracingConstant.CONFIGURATION_TRACING_ACTIVATED) { StringBuilder traceMessage = new StringBuilder("Post processor preference serialization:\n"); String prefDelimiter = " :\n"; String new_line = "\n"; traceMessage.append(EMFComparePreferences.DISABLED_POST_PROCESSOR).append(prefDelimiter).append( getPreferenceStore().getString(EMFComparePreferences.DISABLED_POST_PROCESSOR)).append( new_line); EMFCompareRCPPlugin.getDefault().log(IStatus.INFO, traceMessage.toString()); } return super.performOk(); }</code><technical_language>Likewise, a LinkedHashSet</technical_language>

Target:
public boolean performOk() { Set<IItemDescriptor<Descriptor>> postProcessorDescriptors = Sets.newLinkedHashSet(EMFCompareRCPPlugin .getDefault().getPostProcessorDescriptorRegistry().getItemDescriptors()); SetView<IItemDescriptor<Descriptor>> postProcessorToDisable = Sets.difference( postProcessorDescriptors, dataHolder.getData()); setEnginePreferences(EMFComparePreferences.DISABLED_POST_PROCESSOR, postProcessorToDisable); if (TracingConstant.CONFIGURATION_TRACING_ACTIVATED) { StringBuilder traceMessage = new StringBuilder("Post processor preference serialization:\n"); String prefDelimiter = " :\n"; String new_line = "\n"; traceMessage.append(EMFComparePreferences.DISABLED_POST_PROCESSOR).append(prefDelimiter).append( getPreferenceStore().getString(EMFComparePreferences.DISABLED_POST_PROCESSOR)).append( new_line); EMFCompareRCPPlugin.getDefault().log(IStatus.INFO, traceMessage.toString()); } return super.performOk(); }
Source:
<code>public static void copyRecursive(Path source, Path target) throws IOException { if (Files.exists(target)) { throw new FileAlreadyExistsException(target.toString()); } if (!Files.exists(target.getParent())) { throw new NoSuchFileException(target.toString()); } <START> if (target.startsWith(source)) { <END> throw new FileSystemException( source.toString(), target.toString(), "cannot copy a path into itself"); } FileSystemProvider sourceProvider = source.getFileSystem().provider(); FileSystemProvider targetProvider = target.getFileSystem().provider(); if (sourceProvider instanceof RecursiveCopy) { try { ((RecursiveCopy) sourceProvider).copyRecursive(source, target); return; } catch (UnsupportedOperationException e) { } } if (targetProvider instanceof RecursiveCopy) { try { ((RecursiveCopy) targetProvider).copyRecursive(source, target); return; } catch (UnsupportedOperationException e) { } } Files.walkFileTree(source, new CopyVisitor(source, target)); }</code><technical_language>Is this check susceptible funny business? if I do source = Paths.get(".") target = source.resolve("foo").toAbsolutePath().normalize() target.startsWith(source) true</technical_language>

Target:
public static void copyRecursive(Path source, Path target) throws IOException { if (Files.exists(target)) { throw new FileAlreadyExistsException(target.toString()); } if (!Files.exists(target.getParent())) { throw new NoSuchFileException(target.toString()); } Path normalizedSource = source.normalize().toAbsolutePath(); Path normalizedTarget = target.normalize().toAbsolutePath(); if (normalizedTarget.startsWith(normalizedSource)) { throw new FileSystemException( normalizedSource.toString(), normalizedTarget.toString(), "cannot copy a path into itself"); } FileSystemProvider sourceProvider = source.getFileSystem().provider(); FileSystemProvider targetProvider = target.getFileSystem().provider(); if (sourceProvider instanceof RecursiveCopy) { try { ((RecursiveCopy) sourceProvider).copyRecursive(source, target); return; } catch (UnsupportedOperationException e) { } } if (targetProvider instanceof RecursiveCopy) { try { ((RecursiveCopy) targetProvider).copyRecursive(source, target); return; } catch (UnsupportedOperationException e) { } } Files.walkFileTree(source, new CopyVisitor(source, target)); }
Source:
<code>public void executeMojo() throws MojoExecutionException, MojoFailureException { final File originalClassesDir = new File(getProject().getBuild() .getDirectory(), "generated-classes/jacoco"); final File classesDir = new File(getProject().getBuild() .getOutputDirectory()); final List<String> fileNames; try { final FileFilter fileFilter = new FileFilter(this.getIncludes(), this.getExcludes()); <START> fileNames = FileUtils.getFileNames(classesDir, <END> fileFilter.getIncludes(), fileFilter.getExcludes(), false); } catch (final IOException e1) { throw new MojoExecutionException( "Unable to get list of files to instrument.", e1); } final Instrumenter instrumenter = new Instrumenter( new OfflineInstrumentationAccessGenerator()); for (final String fileName : fileNames) { if (fileName.endsWith(".class")) { final File source = new File(classesDir, fileName); final File backup = new File(originalClassesDir, fileName); InputStream input = null; OutputStream output = null; try { FileUtils.copyFile(source, backup); input = new FileInputStream(backup); output = new FileOutputStream(source); instrumenter.instrument(input, output); } catch (final IOException e2) { throw new MojoExecutionException( "Unable to instrument file.", e2); } finally { IOUtil.close(input); IOUtil.close(output); } } } }</code><technical_language>@Godin avoid suppress Eclipse compiler warning here? I warning free workspaces ;-) > Type safety: expression of type List needs unchecked conversion conform List<String></technical_language>

Target:
public void executeMojo() throws MojoExecutionException, MojoFailureException { final File originalClassesDir = new File(getProject().getBuild() .getDirectory(), "generated-classes/jacoco"); originalClassesDir.mkdirs(); final File classesDir = new File(getProject().getBuild() .getOutputDirectory()); if (!classesDir.isDirectory()) { getLog().info("skip non existing outputDirectory " + classesDir); return; } final List<String> fileNames; try { fileNames = new FileFilter(this.getIncludes(), this.getExcludes()).getFileNames(classesDir); } catch (final IOException e1) { throw new MojoExecutionException( "Unable to get list of files to instrument.", e1); } final Instrumenter instrumenter = new Instrumenter( new OfflineInstrumentationAccessGenerator()); for (final String fileName : fileNames) { if (fileName.endsWith(".class")) { final File source = new File(classesDir, fileName); final File backup = new File(originalClassesDir, fileName); InputStream input = null; OutputStream output = null; try { FileUtils.copyFile(source, backup); input = new FileInputStream(backup); output = new FileOutputStream(source); instrumenter.instrument(input, output); } catch (final IOException e2) { throw new MojoExecutionException( "Unable to instrument file.", e2); } finally { IOUtil.close(input); IOUtil.close(output); } } } }
Source:
<code>public CompletionStage<Path> getServerReport() { return CompletableFuture.supplyAsync(() -> { Path home = serverHome.toPath(); <START> ProcessBuilder builder = new ProcessBuilder("sh", "-c", home.resolve("bin/report.sh").toString(), home.toString()); <END> try { Process process = builder.start(); BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream())); Path path = Paths.get(reader.readLine()); process.waitFor(1, TimeUnit.MINUTES); return path; } catch (IOException e) { throw new RuntimeException(e); } catch (InterruptedException e) { Thread.currentThread().interrupt(); throw new RuntimeException(e); } }, ForkJoinPool.commonPool()); }</code><technical_language>Is Windows handled? needs return 501 REST endpoint</technical_language>

Target:
public CompletionStage<Path> getServerReport() { OS os = OS.getCurrentOs(); if (os != OS.LINUX) { return CompletableFutures.completedExceptionFuture(log.serverReportUnavailable(os)); } long pid = ProcessInfo.getInstance().getPid(); Path home = serverHome.toPath(); Path root = serverRoot.toPath(); ProcessBuilder builder = new ProcessBuilder(); builder.command("sh", "-c", home.resolve("bin/report.sh").toString(), Long.toString(pid), root.toString()); return blockingManager.supplyBlocking(() -> { try { Process process = builder.start(); BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream())); Path path = Paths.get(reader.readLine()); process.waitFor(1, TimeUnit.MINUTES); return path; } catch (IOException e) { throw new RuntimeException(e); } catch (InterruptedException e) { Thread.currentThread().interrupt(); throw new RuntimeException(e); } }, "report"); }
Source:
<code>public FilterEntry(String eventName, boolean exclude, String transport, String name) { this.eventName = eventName; this.exclude = exclude; if (transport != null){ recipient = new Recipient(transport, name); } else { recipient = null; <START> } <END> }</code><technical_language>I alternate cleaner solution for this. again, please separate parsing data</technical_language>

Target:
public FilterEntry(String eventName, boolean exclude, String transport, String name) { this.eventName = eventName; this.exclude = exclude; this.recipient = new Recipient(transport, name); }
Source:
<code>public static OGCGeometry deserialize(Slice shape) { if (shape == null) { return null; } BasicSliceInput input = shape.getInput(); List<OGCGeometry> geometries = new ArrayList<>(); if (input.available() > 0) { byte code = input.readByte(); while (input.available() > 0) { <START> OGCGeometry geometry = extractGeometry(code, input); <END> geometries.add(geometry); } } if (geometries.isEmpty()) { return new OGCConcreteGeometryCollection(emptyList(), null); } else if (geometries.size() == 1) { return geometries.get(0); } return new OGCConcreteGeometryCollection(geometries, null); }</code><technical_language>extractGeometry converts code GeometryTypeName checks if is GEOMETRY_COLLECTION loop iteration unnecessarily; check this if (input.readByte() != GEOMETRY_COLLECTION.ordinal()) { ByteBuffer buffer = input.slice().toByteBuffer().slice().order(LITTLE_ENDIAN); Geometry esriGeometry = local().execute(0, Unknown, buffer); return createFromEsriGeometry(esriGeometry, null); } else { <the original while loop> }</technical_language>

Target:
public static OGCGeometry deserialize(Slice shape) { if (shape == null) { return null; } BasicSliceInput input = shape.getInput(); List<OGCGeometry> geometries = new ArrayList<>(); if (input.available() > 0) { byte code = input.readByte(); boolean isGeometryCollection = (code == GeometryTypeName.GEOMETRY_COLLECTION.code()); while (input.available() > 0) { geometries.add(readGeometry(isGeometryCollection, input)); } } if (geometries.isEmpty()) { return new OGCConcreteGeometryCollection(emptyList(), null); } else if (geometries.size() == 1) { return geometries.get(0); } return new OGCConcreteGeometryCollection(geometries, null); }
Source:
<code>public void testBug542084_error() { int enumsCount = 4500; StringBuilder lotOfEnums = new StringBuilder(enumsCount * 3); for (int i = 0; i < enumsCount; i++) { lotOfEnums.append("A").append(i).append(", "); } runNegativeTest( new String[] { "X.java", "public class X {\n" + " enum Y {\n" + lotOfEnums.toString() + " }\n" + " public static void main(String[] args) {\n" + " X.Y y = X.Y.A0;\n" + " switch(y){\n" + " case A0:\n" + " System.out.println(\"a\");\n" + " break;\n" + " default:\n" + " System.out.println(\"default\");\n" + " break;\n" + " }\n" + " }\n" + " public void z2(Y y) {\n" + " switch(y){\n" + " case A0:\n" + " System.out.println(\"a\");\n" + " break;\n" + " default:\n" + " System.out.println(\"default\");\n" + " break;\n" + " }\n" + " }\n" + "}" }, "----------\n" + "1. ERROR in X.java (at line 6)\n" + " switch(y){\n" + " case A0:\n" + " System.out.println(\"a\");\n" + " break;\n" + " default:\n" + " System.out.println(\"default\");\n" + " break;\n" + " }\n" + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + "The code of method <START> $SWITCH_TABLE$X$Y() is <END> exceeding the 65535 bytes limit\n" + "----------\n"); }</code><technical_language>do want expose this internal method name</technical_language>

Target:
public void testBug542084_error() { int enumsCount = getEnumsCountForError(); StringBuilder lotOfEnums = new StringBuilder(enumsCount * 3); for (int i = 0; i < enumsCount; i++) { lotOfEnums.append("A").append(i).append(", "); } runNegativeTest( new String[] { "X.java", "public class X {\n" + " enum Y {\n" + lotOfEnums.toString() + " }\n" + " public static void main(String[] args) {\n" + " X.Y y = X.Y.A0;\n" + " switch(y){\n" + " case A0:\n" + " System.out.println(\"a\");\n" + " break;\n" + " default:\n" + " System.out.println(\"default\");\n" + " break;\n" + " }\n" + " }\n" + " public void z2(Y y) {\n" + " switch(y){\n" + " case A0:\n" + " System.out.println(\"a\");\n" + " break;\n" + " default:\n" + " System.out.println(\"default\");\n" + " break;\n" + " }\n" + " }\n" + "}" }, "----------\n" + "1. ERROR in X.java (at line 6)\n" + " switch(y){\n" + " case A0:\n" + " System.out.println(\"a\");\n" + " break;\n" + " default:\n" + " System.out.println(\"default\");\n" + " break;\n" + " }\n" + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + "The code of method $SWITCH_TABLE$X$Y() is exceeding the 65535 bytes limit\n" + "----------\n"); }