1 11 package org.eclipse.jdt.internal.core.builder; 12 13 import org.eclipse.core.resources.*; 14 import org.eclipse.core.runtime.*; 15 16 import org.eclipse.jdt.core.compiler.CharOperation; 17 import org.eclipse.jdt.internal.compiler.env.AccessRuleSet; 18 import org.eclipse.jdt.internal.compiler.env.AccessRule; 19 import org.eclipse.jdt.internal.compiler.util.SimpleLookupTable; 20 import org.eclipse.jdt.internal.core.ClasspathAccessRule; 21 import org.eclipse.jdt.internal.core.JavaModelManager; 22 23 import java.io.*; 24 import java.util.*; 25 26 public class State { 27 29 String javaProjectName; 30 ClasspathMultiDirectory[] sourceLocations; 31 ClasspathLocation[] binaryLocations; 32 SimpleLookupTable references; 34 public SimpleLookupTable typeLocators; 36 37 int buildNumber; 38 long lastStructuralBuildTime; 39 SimpleLookupTable structuralBuildTimes; 40 41 private String [] knownPackageNames; 43 private long previousStructuralBuildTime; 44 private StringSet structurallyChangedTypes; 45 public static int MaxStructurallyChangedTypes = 100; 47 public static final byte VERSION = 0x0015; 49 static final byte SOURCE_FOLDER = 1; 50 static final byte BINARY_FOLDER = 2; 51 static final byte EXTERNAL_JAR = 3; 52 static final byte INTERNAL_JAR = 4; 53 54 State() { 55 } 57 58 protected State(JavaBuilder javaBuilder) { 59 this.knownPackageNames = null; 60 this.previousStructuralBuildTime = -1; 61 this.structurallyChangedTypes = null; 62 this.javaProjectName = javaBuilder.currentProject.getName(); 63 this.sourceLocations = javaBuilder.nameEnvironment.sourceLocations; 64 this.binaryLocations = javaBuilder.nameEnvironment.binaryLocations; 65 this.references = new SimpleLookupTable(7); 66 this.typeLocators = new SimpleLookupTable(7); 67 68 this.buildNumber = 0; this.lastStructuralBuildTime = computeStructuralBuildTime(javaBuilder.lastState == null ? 0 : javaBuilder.lastState.lastStructuralBuildTime); 70 this.structuralBuildTimes = new SimpleLookupTable(3); 71 } 72 73 long computeStructuralBuildTime(long previousTime) { 74 long newTime = System.currentTimeMillis(); 75 if (newTime <= previousTime) 76 newTime = previousTime + 1; 77 return newTime; 78 } 79 80 void copyFrom(State lastState) { 81 this.knownPackageNames = null; 82 this.previousStructuralBuildTime = lastState.previousStructuralBuildTime; 83 this.structurallyChangedTypes = lastState.structurallyChangedTypes; 84 this.buildNumber = lastState.buildNumber + 1; 85 this.lastStructuralBuildTime = lastState.lastStructuralBuildTime; 86 this.structuralBuildTimes = lastState.structuralBuildTimes; 87 88 try { 89 this.references = (SimpleLookupTable) lastState.references.clone(); 90 this.typeLocators = (SimpleLookupTable) lastState.typeLocators.clone(); 91 } catch (CloneNotSupportedException e) { 92 this.references = new SimpleLookupTable(lastState.references.elementSize); 93 Object [] keyTable = lastState.references.keyTable; 94 Object [] valueTable = lastState.references.valueTable; 95 for (int i = 0, l = keyTable.length; i < l; i++) 96 if (keyTable[i] != null) 97 this.references.put(keyTable[i], valueTable[i]); 98 99 this.typeLocators = new SimpleLookupTable(lastState.typeLocators.elementSize); 100 keyTable = lastState.typeLocators.keyTable; 101 valueTable = lastState.typeLocators.valueTable; 102 for (int i = 0, l = keyTable.length; i < l; i++) 103 if (keyTable[i] != null) 104 this.typeLocators.put(keyTable[i], valueTable[i]); 105 } 106 } 107 public char[][] getDefinedTypeNamesFor(String typeLocator) { 108 Object c = references.get(typeLocator); 109 if (c instanceof AdditionalTypeCollection) 110 return ((AdditionalTypeCollection) c).definedTypeNames; 111 return null; } 113 114 StringSet getStructurallyChangedTypes(State prereqState) { 115 if (prereqState != null && prereqState.previousStructuralBuildTime > 0) { 116 Object o = structuralBuildTimes.get(prereqState.javaProjectName); 117 long previous = o == null ? 0 : ((Long ) o).longValue(); 118 if (previous == prereqState.previousStructuralBuildTime) 119 return prereqState.structurallyChangedTypes; 120 } 121 return null; 122 } 123 124 boolean isDuplicateLocator(String qualifiedTypeName, String typeLocator) { 125 String existing = (String ) typeLocators.get(qualifiedTypeName); 126 return existing != null && !existing.equals(typeLocator); 127 } 128 129 boolean isKnownPackage(String qualifiedPackageName) { 130 if (knownPackageNames == null) { 131 ArrayList names = new ArrayList(typeLocators.elementSize); 132 Object [] keyTable = typeLocators.keyTable; 133 for (int i = 0, l = keyTable.length; i < l; i++) { 134 if (keyTable[i] != null) { 135 String packageName = (String ) keyTable[i]; int last = packageName.lastIndexOf('/'); 137 packageName = last == -1 ? null : packageName.substring(0, last); 138 while (packageName != null && !names.contains(packageName)) { 139 names.add(packageName); 140 last = packageName.lastIndexOf('/'); 141 packageName = last == -1 ? null : packageName.substring(0, last); 142 } 143 } 144 } 145 knownPackageNames = new String [names.size()]; 146 names.toArray(knownPackageNames); 147 } 148 for (int i = 0, l = knownPackageNames.length; i < l; i++) 149 if (knownPackageNames[i].equals(qualifiedPackageName)) 150 return true; 151 return false; 152 } 153 154 boolean isKnownType(String qualifiedTypeName) { 155 return typeLocators.containsKey(qualifiedTypeName); 156 } 157 158 void record(String typeLocator, char[][][] qualifiedRefs, char[][] simpleRefs, char[] mainTypeName, ArrayList typeNames) { 159 if (typeNames.size() == 1 && CharOperation.equals(mainTypeName, (char[]) typeNames.get(0))) { 160 references.put(typeLocator, new ReferenceCollection(qualifiedRefs, simpleRefs)); 161 } else { 162 char[][] definedTypeNames = new char[typeNames.size()][]; typeNames.toArray(definedTypeNames); 164 references.put(typeLocator, new AdditionalTypeCollection(definedTypeNames, qualifiedRefs, simpleRefs)); 165 } 166 } 167 168 void recordLocatorForType(String qualifiedTypeName, String typeLocator) { 169 this.knownPackageNames = null; 170 int start = typeLocator.indexOf(qualifiedTypeName, 0); 172 if (start > 0) 173 qualifiedTypeName = typeLocator.substring(start, start + qualifiedTypeName.length()); 174 typeLocators.put(qualifiedTypeName, typeLocator); 175 } 176 177 void recordStructuralDependency(IProject prereqProject, State prereqState) { 178 if (prereqState != null) 179 if (prereqState.lastStructuralBuildTime > 0) structuralBuildTimes.put(prereqProject.getName(), new Long (prereqState.lastStructuralBuildTime)); 181 } 182 183 void removeLocator(String typeLocatorToRemove) { 184 this.knownPackageNames = null; 185 references.removeKey(typeLocatorToRemove); 186 typeLocators.removeValue(typeLocatorToRemove); 187 } 188 189 void removePackage(IResourceDelta sourceDelta) { 190 IResource resource = sourceDelta.getResource(); 191 switch(resource.getType()) { 192 case IResource.FOLDER : 193 IResourceDelta[] children = sourceDelta.getAffectedChildren(); 194 for (int i = 0, l = children.length; i < l; i++) 195 removePackage(children[i]); 196 return; 197 case IResource.FILE : 198 IPath typeLocatorPath = resource.getProjectRelativePath(); 199 if (org.eclipse.jdt.internal.core.util.Util.isJavaLikeFileName(typeLocatorPath.lastSegment())) 200 removeLocator(typeLocatorPath.toString()); 201 } 202 } 203 204 void removeQualifiedTypeName(String qualifiedTypeNameToRemove) { 205 this.knownPackageNames = null; 206 typeLocators.removeKey(qualifiedTypeNameToRemove); 207 } 208 209 static State read(IProject project, DataInputStream in) throws IOException { 210 if (JavaBuilder.DEBUG) 211 System.out.println("About to read state " + project.getName()); if (VERSION != in.readByte()) { 213 if (JavaBuilder.DEBUG) 214 System.out.println("Found non-compatible state version... answered null for " + project.getName()); return null; 216 } 217 218 State newState = new State(); 219 newState.javaProjectName = in.readUTF(); 220 if (!project.getName().equals(newState.javaProjectName)) { 221 if (JavaBuilder.DEBUG) 222 System.out.println("Project's name does not match... answered null"); return null; 224 } 225 newState.buildNumber = in.readInt(); 226 newState.lastStructuralBuildTime = in.readLong(); 227 228 int length = in.readInt(); 229 newState.sourceLocations = new ClasspathMultiDirectory[length]; 230 for (int i = 0; i < length; i++) { 231 IContainer sourceFolder = project, outputFolder = project; 232 String folderName; 233 if ((folderName = in.readUTF()).length() > 0) sourceFolder = project.getFolder(folderName); 234 if ((folderName = in.readUTF()).length() > 0) outputFolder = project.getFolder(folderName); 235 ClasspathMultiDirectory md = 236 (ClasspathMultiDirectory) ClasspathLocation.forSourceFolder(sourceFolder, outputFolder, readNames(in), readNames(in)); 237 if (in.readBoolean()) 238 md.hasIndependentOutputFolder = true; 239 newState.sourceLocations[i] = md; 240 } 241 242 length = in.readInt(); 243 newState.binaryLocations = new ClasspathLocation[length]; 244 IWorkspaceRoot root = project.getWorkspace().getRoot(); 245 for (int i = 0; i < length; i++) { 246 switch (in.readByte()) { 247 case SOURCE_FOLDER : 248 newState.binaryLocations[i] = newState.sourceLocations[in.readInt()]; 249 break; 250 case BINARY_FOLDER : 251 IPath path = new Path(in.readUTF()); 252 IContainer outputFolder = path.segmentCount() == 1 253 ? (IContainer) root.getProject(path.toString()) 254 : (IContainer) root.getFolder(path); 255 newState.binaryLocations[i] = ClasspathLocation.forBinaryFolder(outputFolder, in.readBoolean(), readRestriction(in)); 256 break; 257 case EXTERNAL_JAR : 258 newState.binaryLocations[i] = ClasspathLocation.forLibrary(in.readUTF(), in.readLong(), readRestriction(in)); 259 break; 260 case INTERNAL_JAR : 261 newState.binaryLocations[i] = ClasspathLocation.forLibrary(root.getFile(new Path(in.readUTF())), readRestriction(in)); 262 } 263 } 264 265 newState.structuralBuildTimes = new SimpleLookupTable(length = in.readInt()); 266 for (int i = 0; i < length; i++) 267 newState.structuralBuildTimes.put(in.readUTF(), new Long (in.readLong())); 268 269 String [] internedTypeLocators = new String [length = in.readInt()]; 270 for (int i = 0; i < length; i++) 271 internedTypeLocators[i] = in.readUTF(); 272 273 newState.typeLocators = new SimpleLookupTable(length = in.readInt()); 274 for (int i = 0; i < length; i++) 275 newState.recordLocatorForType(in.readUTF(), internedTypeLocators[in.readInt()]); 276 277 char[][] internedSimpleNames = ReferenceCollection.internSimpleNames(readNames(in), false); 278 char[][][] internedQualifiedNames = new char[length = in.readInt()][][]; 279 for (int i = 0; i < length; i++) { 280 int qLength = in.readInt(); 281 char[][] qName = new char[qLength][]; 282 for (int j = 0; j < qLength; j++) 283 qName[j] = internedSimpleNames[in.readInt()]; 284 internedQualifiedNames[i] = qName; 285 } 286 internedQualifiedNames = ReferenceCollection.internQualifiedNames(internedQualifiedNames); 287 288 newState.references = new SimpleLookupTable(length = in.readInt()); 289 for (int i = 0; i < length; i++) { 290 String typeLocator = internedTypeLocators[in.readInt()]; 291 ReferenceCollection collection = null; 292 switch (in.readByte()) { 293 case 1 : 294 char[][] additionalTypeNames = readNames(in); 295 char[][][] qualifiedNames = new char[in.readInt()][][]; 296 for (int j = 0, m = qualifiedNames.length; j < m; j++) 297 qualifiedNames[j] = internedQualifiedNames[in.readInt()]; 298 char[][] simpleNames = new char[in.readInt()][]; 299 for (int j = 0, m = simpleNames.length; j < m; j++) 300 simpleNames[j] = internedSimpleNames[in.readInt()]; 301 collection = new AdditionalTypeCollection(additionalTypeNames, qualifiedNames, simpleNames); 302 break; 303 case 2 : 304 char[][][] qNames = new char[in.readInt()][][]; 305 for (int j = 0, m = qNames.length; j < m; j++) 306 qNames[j] = internedQualifiedNames[in.readInt()]; 307 char[][] sNames = new char[in.readInt()][]; 308 for (int j = 0, m = sNames.length; j < m; j++) 309 sNames[j] = internedSimpleNames[in.readInt()]; 310 collection = new ReferenceCollection(qNames, sNames); 311 } 312 newState.references.put(typeLocator, collection); 313 } 314 if (JavaBuilder.DEBUG) 315 System.out.println("Successfully read state for " + newState.javaProjectName); return newState; 317 } 318 319 private static char[] readName(DataInputStream in) throws IOException { 320 int nLength = in.readInt(); 321 char[] name = new char[nLength]; 322 for (int j = 0; j < nLength; j++) 323 name[j] = in.readChar(); 324 return name; 325 } 326 327 private static char[][] readNames(DataInputStream in) throws IOException { 328 int length = in.readInt(); 329 char[][] names = new char[length][]; 330 for (int i = 0; i < length; i++) 331 names[i] = readName(in); 332 return names; 333 } 334 335 private static AccessRuleSet readRestriction(DataInputStream in) throws IOException { 336 int length = in.readInt(); 337 if (length == 0) return null; AccessRule[] accessRules = new AccessRule[length]; 339 for (int i = 0; i < length; i++) { 340 char[] pattern = readName(in); 341 int problemId = in.readInt(); 342 accessRules[i] = new ClasspathAccessRule(pattern, problemId); 343 } 344 JavaModelManager manager = JavaModelManager.getJavaModelManager(); 345 String [] messageTemplates = new String [AccessRuleSet.MESSAGE_TEMPLATES_LENGTH]; 346 for (int i = 0; i < AccessRuleSet.MESSAGE_TEMPLATES_LENGTH; i++) { 347 messageTemplates[i] = manager.intern(in.readUTF()); 348 } 349 AccessRuleSet accessRuleSet = new AccessRuleSet(accessRules, messageTemplates); 350 return accessRuleSet; 351 } 352 353 void tagAsNoopBuild() { 354 this.buildNumber = -1; } 356 357 boolean wasNoopBuild() { 358 return buildNumber == -1; 359 } 360 361 void tagAsStructurallyChanged() { 362 this.previousStructuralBuildTime = this.lastStructuralBuildTime; 363 this.structurallyChangedTypes = new StringSet(7); 364 this.lastStructuralBuildTime = computeStructuralBuildTime(this.previousStructuralBuildTime); 365 } 366 367 boolean wasStructurallyChanged(IProject prereqProject, State prereqState) { 368 if (prereqState != null) { 369 Object o = structuralBuildTimes.get(prereqProject.getName()); 370 long previous = o == null ? 0 : ((Long ) o).longValue(); 371 if (previous == prereqState.lastStructuralBuildTime) return false; 372 } 373 return true; 374 } 375 376 void wasStructurallyChanged(String typeName) { 377 if (this.structurallyChangedTypes != null) { 378 if (this.structurallyChangedTypes.elementSize > MaxStructurallyChangedTypes) 379 this.structurallyChangedTypes = null; else 381 this.structurallyChangedTypes.add(typeName); 382 } 383 } 384 385 void write(DataOutputStream out) throws IOException { 386 int length; 387 Object [] keyTable; 388 Object [] valueTable; 389 390 396 out.writeByte(VERSION); 397 out.writeUTF(javaProjectName); 398 out.writeInt(buildNumber); 399 out.writeLong(lastStructuralBuildTime); 400 401 406 out.writeInt(length = sourceLocations.length); 407 for (int i = 0; i < length; i++) { 408 ClasspathMultiDirectory md = sourceLocations[i]; 409 out.writeUTF(md.sourceFolder.getProjectRelativePath().toString()); 410 out.writeUTF(md.binaryFolder.getProjectRelativePath().toString()); 411 writeNames(md.inclusionPatterns, out); 412 writeNames(md.exclusionPatterns, out); 413 out.writeBoolean(md.hasIndependentOutputFolder); 414 } 415 416 421 out.writeInt(length = binaryLocations.length); 422 next : for (int i = 0; i < length; i++) { 423 ClasspathLocation c = binaryLocations[i]; 424 if (c instanceof ClasspathMultiDirectory) { 425 out.writeByte(SOURCE_FOLDER); 426 for (int j = 0, m = sourceLocations.length; j < m; j++) { 427 if (sourceLocations[j] == c) { 428 out.writeInt(j); 429 continue next; 430 } 431 } 432 } else if (c instanceof ClasspathDirectory) { 433 out.writeByte(BINARY_FOLDER); 434 ClasspathDirectory cd = (ClasspathDirectory) c; 435 out.writeUTF(cd.binaryFolder.getFullPath().toString()); 436 out.writeBoolean(cd.isOutputFolder); 437 writeRestriction(cd.accessRuleSet, out); 438 } else { 439 ClasspathJar jar = (ClasspathJar) c; 440 if (jar.resource == null) { 441 out.writeByte(EXTERNAL_JAR); 442 out.writeUTF(jar.zipFilename); 443 out.writeLong(jar.lastModified()); 444 } else { 445 out.writeByte(INTERNAL_JAR); 446 out.writeUTF(jar.resource.getFullPath().toString()); 447 } 448 writeRestriction(jar.accessRuleSet, out); 449 } 450 } 451 452 457 out.writeInt(length = structuralBuildTimes.elementSize); 458 if (length > 0) { 459 keyTable = structuralBuildTimes.keyTable; 460 valueTable = structuralBuildTimes.valueTable; 461 for (int i = 0, l = keyTable.length; i < l; i++) { 462 if (keyTable[i] != null) { 463 length--; 464 out.writeUTF((String ) keyTable[i]); 465 out.writeLong(((Long ) valueTable[i]).longValue()); 466 } 467 } 468 if (JavaBuilder.DEBUG && length != 0) 469 System.out.println("structuralBuildNumbers table is inconsistent"); } 471 472 475 out.writeInt(length = references.elementSize); 476 SimpleLookupTable internedTypeLocators = new SimpleLookupTable(length); 477 if (length > 0) { 478 keyTable = references.keyTable; 479 for (int i = 0, l = keyTable.length; i < l; i++) { 480 if (keyTable[i] != null) { 481 length--; 482 String key = (String ) keyTable[i]; 483 out.writeUTF(key); 484 internedTypeLocators.put(key, new Integer (internedTypeLocators.elementSize)); 485 } 486 } 487 if (JavaBuilder.DEBUG && length != 0) 488 System.out.println("references table is inconsistent"); } 490 491 496 out.writeInt(length = typeLocators.elementSize); 497 if (length > 0) { 498 keyTable = typeLocators.keyTable; 499 valueTable = typeLocators.valueTable; 500 for (int i = 0, l = keyTable.length; i < l; i++) { 501 if (keyTable[i] != null) { 502 length--; 503 out.writeUTF((String ) keyTable[i]); 504 Integer index = (Integer ) internedTypeLocators.get(valueTable[i]); 505 out.writeInt(index.intValue()); 506 } 507 } 508 if (JavaBuilder.DEBUG && length != 0) 509 System.out.println("typeLocators table is inconsistent"); } 511 512 516 SimpleLookupTable internedQualifiedNames = new SimpleLookupTable(31); 517 SimpleLookupTable internedSimpleNames = new SimpleLookupTable(31); 518 valueTable = references.valueTable; 519 for (int i = 0, l = valueTable.length; i < l; i++) { 520 if (valueTable[i] != null) { 521 ReferenceCollection collection = (ReferenceCollection) valueTable[i]; 522 char[][][] qNames = collection.qualifiedNameReferences; 523 for (int j = 0, m = qNames.length; j < m; j++) { 524 char[][] qName = qNames[j]; 525 if (!internedQualifiedNames.containsKey(qName)) { internedQualifiedNames.put(qName, new Integer (internedQualifiedNames.elementSize)); 527 for (int k = 0, n = qName.length; k < n; k++) { 528 char[] sName = qName[k]; 529 if (!internedSimpleNames.containsKey(sName)) internedSimpleNames.put(sName, new Integer (internedSimpleNames.elementSize)); 531 } 532 } 533 } 534 char[][] sNames = collection.simpleNameReferences; 535 for (int j = 0, m = sNames.length; j < m; j++) { 536 char[] sName = sNames[j]; 537 if (!internedSimpleNames.containsKey(sName)) internedSimpleNames.put(sName, new Integer (internedSimpleNames.elementSize)); 539 } 540 } 541 } 542 char[][] internedArray = new char[internedSimpleNames.elementSize][]; 543 Object [] simpleNames = internedSimpleNames.keyTable; 544 Object [] positions = internedSimpleNames.valueTable; 545 for (int i = positions.length; --i >= 0; ) { 546 if (positions[i] != null) { 547 int index = ((Integer ) positions[i]).intValue(); 548 internedArray[index] = (char[]) simpleNames[i]; 549 } 550 } 551 writeNames(internedArray, out); 552 char[][][] internedQArray = new char[internedQualifiedNames.elementSize][][]; 554 Object [] qualifiedNames = internedQualifiedNames.keyTable; 555 positions = internedQualifiedNames.valueTable; 556 for (int i = positions.length; --i >= 0; ) { 557 if (positions[i] != null) { 558 int index = ((Integer ) positions[i]).intValue(); 559 internedQArray[index] = (char[][]) qualifiedNames[i]; 560 } 561 } 562 out.writeInt(length = internedQArray.length); 563 for (int i = 0; i < length; i++) { 564 char[][] qName = internedQArray[i]; 565 int qLength = qName.length; 566 out.writeInt(qLength); 567 for (int j = 0; j < qLength; j++) { 568 Integer index = (Integer ) internedSimpleNames.get(qName[j]); 569 out.writeInt(index.intValue()); 570 } 571 } 572 573 578 out.writeInt(length = references.elementSize); 579 if (length > 0) { 580 keyTable = references.keyTable; 581 for (int i = 0, l = keyTable.length; i < l; i++) { 582 if (keyTable[i] != null) { 583 length--; 584 Integer index = (Integer ) internedTypeLocators.get(keyTable[i]); 585 out.writeInt(index.intValue()); 586 ReferenceCollection collection = (ReferenceCollection) valueTable[i]; 587 if (collection instanceof AdditionalTypeCollection) { 588 out.writeByte(1); 589 AdditionalTypeCollection atc = (AdditionalTypeCollection) collection; 590 writeNames(atc.definedTypeNames, out); 591 } else { 592 out.writeByte(2); 593 } 594 char[][][] qNames = collection.qualifiedNameReferences; 595 int qLength = qNames.length; 596 out.writeInt(qLength); 597 for (int j = 0; j < qLength; j++) { 598 index = (Integer ) internedQualifiedNames.get(qNames[j]); 599 out.writeInt(index.intValue()); 600 } 601 char[][] sNames = collection.simpleNameReferences; 602 int sLength = sNames.length; 603 out.writeInt(sLength); 604 for (int j = 0; j < sLength; j++) { 605 index = (Integer ) internedSimpleNames.get(sNames[j]); 606 out.writeInt(index.intValue()); 607 } 608 } 609 } 610 if (JavaBuilder.DEBUG && length != 0) 611 System.out.println("references table is inconsistent"); } 613 } 614 615 private void writeName(char[] name, DataOutputStream out) throws IOException { 616 int nLength = name.length; 617 out.writeInt(nLength); 618 for (int j = 0; j < nLength; j++) 619 out.writeChar(name[j]); 620 } 621 622 private void writeNames(char[][] names, DataOutputStream out) throws IOException { 623 int length = names == null ? 0 : names.length; 624 out.writeInt(length); 625 for (int i = 0; i < length; i++) 626 writeName(names[i], out); 627 } 628 629 private void writeRestriction(AccessRuleSet accessRuleSet, DataOutputStream out) throws IOException { 630 if (accessRuleSet == null) { 631 out.writeInt(0); 632 } else { 633 AccessRule[] accessRules = accessRuleSet.getAccessRules(); 634 int length = accessRules.length; 635 out.writeInt(length); 636 if (length != 0) { 637 for (int i = 0; i < length; i++) { 638 AccessRule accessRule = accessRules[i]; 639 writeName(accessRule.pattern, out); 640 out.writeInt(accessRule.problemId); 641 } 642 for (int i = 0; i < AccessRuleSet.MESSAGE_TEMPLATES_LENGTH; i++) 643 out.writeUTF(accessRuleSet.messageTemplates[i]); 644 } 645 } 646 } 647 648 651 public String toString() { 652 return "State for " + javaProjectName + " (#" + buildNumber + " @ " + new Date(lastStructuralBuildTime) + ")"; } 657 658 724 } 725 | Popular Tags |